:root {
  /* 🆕 2026-11-04 船长：二级栏与自动化工作台左栏**同宽**（共用这一个变量，不再各写一套） */
  /* 🆕 2026-11-13 船长：「二级菜单变窄一半」——原 clamp(206px,16vw,268px) 直接减半。
     下限 104px 足够放「图标 15 + 间距 8 + 四字 52 + 内边距 20」= 95px；文字加 nowrap 不换行。 */
  --rail-w: clamp(104px, 8vw, 134px);
  --bg: #f4f6fa; --panel: #ffffff; --border: #e3e8f0;
  --text: #1f2d3d; --muted: #7a8699;
  /* 🆕 2026-10-05 船长：「品牌色用小鲨鱼三个字的蓝色」＋「全站主色都换」
     ⇒ --primary 由青绿 #1a7f6e 换成品牌蓝 #00A0E8（色值直接从 logo 里「小鲨鱼」三字采样）。
     配套一起换的：--primary-soft（浅绿底 → 浅蓝底）、登录页渐变、图表调色板首色、
     以及散落在 modules/*.js 里的字面量（已全量替换，见 2026-10-05 日志）。
     🔴 唯一**刻意没换**的是分院配色里的「同安路」——它原来是品牌青绿，盲换会和
        「梦乐城 #2f7fd1」撞成两个蓝 ⇒ 改成独立绿 #2aa36a（collect.js / dashboard.js 两处）。 */
  --brand: #00A0E8; --primary: #00A0E8; --primary-soft: #e2f3fd;
  --danger: #d9534f; --warn: #e6a23c; --ok: #52a352;
  --radius: 12px; --shadow: 0 2px 10px rgba(31,45,61,.06);
  /* 顶部横栏（照「牙医管家」：白色横条 + logo 在左上角）与侧栏（侧栏色收成变量，将来要换一处就够） */
  --appbar-h: 48px;
  /* 🆕 2026-10-08 船长：左侧栏由「深绿底 + 浅绿字」改「浅灰底 + 黑字」；当前项＝蓝色主色块 + 白字。 */
  /* 🆕 2026-10-08 船长：左侧栏改「蓝底 + 白字」，当前项＝**白色卡片 + 黑字**；图标改线性 SVG。 */
  --side-bg: #0C7FC2; --side-fg: #ffffff; --side-muted: rgba(255,255,255,.72); --side-accent: #ffffff;
  /* 🆕 2026-11-11 船长：内置中文字体（阿里巴巴普惠体 3.0，GB18030-2022 全字符）。
     顺序＝**装了系统的就用本地的（零下载）**，没装才回落到内置的 `AliPH`，
     生僻字（Regular 缺的）再落 `AliPH-L3`（6 万汉字）。
     换个字体只需改这一行；「设置 → 诊所设置 → 界面字体」会覆写它（js 加内联 style）。 */
  --ui-font: "Alibaba PuHuiTi 3.0", "阿里巴巴普惠体 3.0", "AliPH", "AliPH-L3",
             -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--ui-font); background: var(--bg); color: var(--text); font-size: 14px; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }

/* 登录 */
.login-wrap { height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary) 0%, #4ab6f0 100%); }
.login-box { background: #fff; padding: 36px; border-radius: 16px; width: 360px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
/* 🆕 2026-10-05：登录页顶部换成 logo 图（原来是「🦈 BabyShark军营」纯文字）。
   🔴 src 由 app.js 按 /api/brand 覆盖 ⇒ 换过 logo 就显示换过的那个。 */
.login-box .login-brand { margin-bottom: 8px; height: 46px; display: flex; align-items: center; justify-content: center; }
.login-box .login-brand img { max-height: 46px; max-width: 96%; display: block; }
.login-box .sub { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 13px; }
.login-box .field { margin-bottom: 14px; }
.login-box button.btn-primary { width: 100%; padding: 11px; font-size: 15px; margin-top: 6px; }

/* 布局 */
/* 🆕 2026-10-05 船长照「牙医管家」定（**反转 2026-10-03「顶栏整行撤掉」**）：
   最上面一条白色横栏放 logo，横栏下面才是「侧栏 + 内容」两栏。
   🔴 `.layout` 由「一行 flex」改成「一列 flex」，原来的侧栏/内容两栏下沉到 .layout-body ——
      任何新增的直接子元素都要按这个层级放，否则会变成横栏的同级挤在一行。 */
.layout { display: flex; flex-direction: column; height: 100vh; }
.layout-body { flex: 1 1 auto; display: flex; min-height: 0; }
.appbar { flex: none; height: var(--appbar-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  /* 🆕 2026-10-08 船长：整条横栏下方加阴影、凸显「顶栏 / 内容」层级。
     🔴 position+z-index 不能省 —— 否则阴影会被下方不定位的 .layout-body 盖住，等于没加。 */
  position: relative; z-index: 30; box-shadow: 0 2px 8px rgba(31, 45, 61, .08); }
.appbar-brand { display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.appbar-brand img { height: 32px; width: auto; max-width: 260px; display: block; }
/* 🆕 2026-10-06 三段式顶栏：左 logo / 中 搜索（居中）/ 右 操作（齿轮在最右）。
   🆕 2026-10-10 船长照参考图定：「搜索框**动态居中**，右侧新建预约简化成符号、附着搜索框右侧」——
   ① **居中口径改了**：原来搜索框是在「logo 与右侧按钮之间」那段**剩余空间**里居中
      ⇒ 实测 1660 宽下搜索框中心 689、顶栏中心 830 —— **偏左 141px**（左侧 logo 156px，右侧按钮＋账号块 426px）。
      现在相对**整条顶栏**绝对居中（`left:50%` + `translateX(-50%)`），窗口拉宽拉窄自动跟随。
      🔴 定位祖先是 `.appbar`（它本来就 `position:relative`），**不是** `.appbar-tools`。
      🔴 ≤1023px 会与左侧 logo / 右侧齿轮打架（算过：宽 984px 是安全下限）⇒ 那一档在文件下方媒体查询里恢复成静态老布局。
   ② 「＋新建预约」从文字按钮（122px）改成 **42×42 图标按钮，紧贴输入框右端成一整体**（见 `.apt-newone`）。 */
.appbar-tools { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.appbar-tools .appbar-search { position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; min-width: 0; }
/* 🆕 2026-10-08 船长：「搜索框缩小 50%」520→260px；「用主色蓝强化」＝蓝色描边。 */
/* 🔴 `order: 0` 不能省：≤820px 那段媒体查询里有一条老的 `.apt-ps{ order: 3 }`
   （当年给"预约页内搜索框整行落到第二行"用的），它会**串到顶栏这里** ——
   把「＋」挤到输入框**左边**去（实测 390px：按钮 125~167、输入框 167~284，顺序反了）。 */
.appbar-tools .appbar-search .apt-ps { flex: 0 0 260px; width: 260px; max-width: 30vw; order: 0; }
/* 🔴 输入框**右侧圆角改直角** —— 让右端那个「＋」按钮把口封住；
   否则输入框自带的右圆角会在拼接处露出一道白弧（看着像没对齐）。 */
.appbar-tools .apt-ps-in { border: 2px solid var(--primary); border-radius: 10px 0 0 10px; }
.appbar-tools .apt-ps-in::placeholder { color: #9aa6b6; }
.appbar-tools .appbar-actions { flex: none; display: flex; align-items: center; gap: 8px; }
/* 🆕「＋」＝附着在搜索框右端的图标按钮（与输入框同高 42px；左直角、右圆角；-2px 吃掉输入框那 2px 蓝边＝无缝）。
   🔴 图标用 `App.icon('plus')` 线条图（与旁边齿轮同一套），不是全角「＋」字符（字体渲染不一致）；
   🔴 它紧贴输入框，光一个「＋」有歧义（搜索下拉里还藏着「＋ 新建」）⇒ `title`/`aria-label` 必须留。 */
.apt-newone { flex: none; width: 42px; height: var(--apt-top-h, 42px); margin-left: -2px; padding: 0;
  border: 0; border-radius: 0 10px 10px 0; background: var(--primary); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: filter .15s; }
.apt-newone:hover { filter: brightness(.93); }
.apt-newone:active { transform: translateY(1px); }
.apt-newone:focus-visible { outline: 2px solid #1d6fa5; outline-offset: 2px; }
.apt-newone .nico { width: 20px; height: 20px; }
/* ≤1023px：绝对居中会与 logo / 齿轮打架 ⇒ 恢复「在剩余空间里居中」的老行为（窄窗口不会重叠） */
@media (max-width: 1023px) {
  .appbar-tools .appbar-search { position: static; transform: none; flex: 1 1 auto; justify-content: center; }
}
/* ≤760px（手机档，与 `.sidebar{display:none}` 那批同档）：顶栏本来就塞不下 ——
   logo 142 + 搜索框 117 + 齿轮 38 ＋ 账号块 65 已超过 390（**搜索框与齿轮实测重叠 11px**）。
   🔵 2026-10-11：手机顶栏整条搜索框（含这个「＋」）已随「分院提到 logo 右侧」一并撤掉
      （见下方手机端那段的 `.appbar .appbar-search{display:none}`）⇒ 这条现在是**双保险**，
      留着是为了「哪天有人把搜索框在窄屏放回来」时，「＋」不会又压到齿轮上。 **别删。**
   手机上要新建预约：走底部标签栏进「预约」页，页内有入口。 */
@media (max-width: 760px) {
  .apt-newone { display: none; }
}

/* 🆕 2026-10-11 船长：「分院切换，移动至 logo 右侧」——
   「当前分院」从右上角那块搬到这里，成为**全站唯一一个分院入口**（桌面到手机都在）。
   样式＝船长从六版草图里挑的 **D「无容器」**：平时只有「房子图标 + 分院名 + ▾」，
   鼠标移上去才浮出一层浅蓝底（别加边框/底色 —— A/B/C 三版他都否了）。
   🔴 内容由 app.js 的 `renderClinicSwitch()` 生成（含 `<select id="clinicSelect">`）；空壳在 index.html。
   🔴 全局有 `input/select{width:100%}` ⇒ 里面那个 select **必须显式给宽度**（下面 .clsk-sel 已给），
      否则它会把整条顶栏撑爆、把左边挤出去（这个坑已在 qw-bar / 旧 .clinic-switch / 旧 .me-clinic 上各踩过一次）。 */
.appbar-clinic { flex: none; display: inline-flex; align-items: center; gap: 6px; position: relative;
  height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  transition: background .15s, border-color .15s; }
.appbar-clinic:hover { background: #f2f7fe; border-color: #e3eefb; }
.appbar-clinic .clsk-ic { display: inline-flex; color: #2E86D9; }
.appbar-clinic .clsk-ic .nico { width: 16px; height: 16px; }
/* 原生 select 的**内在宽度＝选项里最宽的那条**（管理员会多一条「全部分院（汇总）」⇒ ~100px）
   ⇒ 必须给 max-width 兜底，否则窄屏会把它顶到别的控件上。 */
.appbar-clinic .clsk-sel { width: auto; max-width: 200px; min-width: 0; border: 0; background: transparent;
  padding: 0; font-size: 13px; color: #243044; cursor: pointer; appearance: none; -webkit-appearance: none; }
.appbar-clinic .clsk-car { font-style: normal; font-size: 10px; color: #b9c4d2; }

/* 🆕 2026-10-10 船长照参考图定：顶栏右上角「当前分院 ＋ 账号」曾**融合成一个控件**（左头像/上分院/下账号）。
   🔵 2026-10-11：院长把「当前分院」搬到 logo 右侧 ⇒ 这块只剩**一行**（头像 ＋ 姓名·角色·昵称 ▾），
      横向从 ~247px 收到 ~150px。原来那两条 `.me-col{width:178px}`／`.me-clinic` 规则随之下线。 */
.appbar-user { flex: none; display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 13px 0 8px; margin-left: 6px; cursor: pointer;
  border: 1px solid #dbe7f5; border-radius: 12px; background: #f7fbff;
  transition: background .15s, border-color .15s; }
.appbar-user:hover { background: #eef5ff; border-color: #c3daf5; }
/* 🔴 `.me-col` 现在**只有一行**（账号信息）⇒ 宽度按内容撑（原来是固定 178px 用来让上下两行等宽对齐，
   上排搬走后那个固定宽只剩副作用：撑出一段空白）。 */
.appbar-user .me-col { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.appbar-user .me-info { display: flex; align-items: center; gap: 4px; min-width: 0; padding-left: 0; }
/* 🆕 2026-10-24：头像已从账号块去掉，原来给头像留的 8px 内边距一并去掉，文字不偏右 */
.appbar-user .me-name { font-size: 12.5px; font-weight: 600; color: #243044; flex: 0 0 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-user .me-dot { font-style: normal; color: #c8d2de; font-size: 11px; flex: none; }
.appbar-user .me-sub { font-size: 11.5px; color: #8d99a8; flex: 0 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-user .caret { font-style: normal; font-size: 10px; color: #b9c4d2; margin-left: 1px; flex: none; }
.appbar-user .caret-m { display: none; }          /* 窄屏专用，桌面不显示（桌面版 ▾ 在下排行末） */
/* 「远程」小徽标（非院内网络访问时的提示；顶栏与菜单头共用同一个类） */
.me-remote { flex: none; font-size: 10px; color: #b06a00; background: #fff5e0;
  border: 1px solid #ffe0a3; border-radius: 5px; padding: 0 4px; }
/* 圆形头像：有图片用图片；没图片显示「昵称前两字」（由 app.js 的 avatarHtml 决定） */
.avt { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 600; flex: none; overflow: hidden; user-select: none; }
.avt img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 账号下拉菜单（贴在头像下方；点外面或再点头像关闭） */
.user-menu { position: fixed; z-index: 3000; min-width: 212px; background: #fff; border-radius: 10px;
  box-shadow: 0 6px 24px rgba(16,30,54,.16); border: 1px solid var(--border); padding: 6px; }
.user-menu .um-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.user-menu .um-head b { display: block; font-size: 13.5px; color: #2b3644; }
.user-menu .um-head em { display: block; font-style: normal; font-size: 11.5px; color: #95a1b0; margin-top: 1px; }
/* 🗑 2026-10-11 删：`.user-menu .um-clinic*`（点开菜单里的「当前分院」那一行）。
   顶栏 logo 右侧现在**桌面到手机**一直有分院切换（船长选的「只留一处」）⇒ 菜单里不再重复摆一份。
   app.js 的 App.userMenu() 里对应那段 HTML 也已删；`.um-clinic-lb` 一并下线。 */
.user-menu a { display: block; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: #33404f; cursor: pointer; }
.user-menu a:hover { background: #f4f8fc; }
.user-menu a.danger { color: #c0392b; }
.user-menu a.danger:hover { background: #fdf1ef; }

/* 🔵 2026-10-09 船长：「黄色二级菜单修改为竖版放在绿色位置」⇒ 系统设置那排**横排页签**
   连同它的样式（#setTabsWrap / .pt-grp / .pt-grp-t）一起删除，页签改由左侧二级竖栏 .subrail 承载。
   ⚠️ `.page-tabs` 本身**保留** —— 人事管理的页内小页签（tabHr：员工档案 / 权限矩阵）还在用它。 */
/* 预约页贴边撑满：#main 自身不滚动、去内边距，看板填满剩余高度、只内部滚 */
#main.apt-mode { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
#main.apt-mode .apt-page { height: 100%; margin-top: 0; display: flex; flex-direction: column; }
#main.apt-mode #aptHint { flex: none; }
#main.apt-mode #aptBody { flex: 1 1 auto; min-height: 0; overflow: auto; }
#main.apt-mode .apt-layout { height: 100%; }
/* 🔴 `align-self: stretch` **不能省**（2026-10-06 实测真踩）：
   .apt-layout 基础样式是 `display:flex; align-items:flex-start`（见文件下方 .apt-layout 那条），
   flex-start 会让 .apt-main **不被拉伸**、高度改由内容撑（40 格 × 行高 = 1700+px）⇒
   .cal-scroll 拿到的高度就是"内容高"，aptFitCols 读它算行高又把内容撑回原样 —— **自我循环、自适应彻底失效**
   （实测：15 分钟档 .cal-scroll 高 1767px，视口仅 900）。加 align-self:stretch 后立刻收敛到 791px 铺满。
   只给 .apt-main 加、不动 .apt-layout 的 align-items：左侧小日历(.apt-left)要维持自然高度。 */
#main.apt-mode .apt-main { flex: 1; align-self: stretch; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#main.apt-mode .cal-scroll { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
/* 侧栏按业务分成「概览 / 接诊 / 患者 / 经营 / 系统」几块（船长 2026-09-22 定），宽度 200 → 156，
   2026-10-05 再收到 140（船长：「蓝框修改宽度缩窄一些」）。
   🗑 侧栏顶部原来那块「小鲨鱼 / 儿童齿科」文字品牌区**已删** —— 品牌迁到顶部横栏的 logo 图。 */
.sidebar { width: 100px; background: var(--side-bg); color: var(--side-fg); display: flex; flex-direction: column; flex-shrink: 0; }
/* 🔵 2026-10-10：原来这里有一组 `.appbar .clinic-switch`（顶栏里独立的「当前分院」下拉）。
   当天晚些时候船长照参考图把它与账号区**融成一块**（下拉由 `.appbar-user .me-clinic` 承载）。
   🔵 2026-10-11：船长又把它从账号块里**搬到 logo 右侧** ⇒ 现在的家是 `.appbar-clinic`
   （见文件上方那段）。下拉**永远只有一处**（`<select id="clinicSelect">` 全仓只有一个）——
   别再单独放一个 .clinic-switch / .me-clinic 到顶栏里，否则会出现两个分院下拉。 */
/* 🔴 2026-10-21 船长（三次调整）：
   ① 「字体保持现在的大小」→ 文字**保持 13px 不变**
   ② 「图标变大」→ 图标 17px → **24px**，描边 1.7 → 2（放大后不显细）
   ③ 「图图标在上，文字在下」→ **竖排**：图标居中在上、文字居中在下
   ④ 「占满整个左侧工作台区域」→ 菜单项竖排铺满
   ⑤ 「图标大一些，工作台可以变窄一些」（2026-10-21 17:18）→ 侧栏 140→**100px**、图标 24→**30px**
   ⚠️ 文字 13px 始终不变；宽度核算：最宽文字行「患者管理›」实测 60px，
      菜单项内可用 100−10(nav内边距)−4(项内边距)=86px ⇒ 余量 26px，不会出省略号。 */
.sidebar nav { flex: 1; padding: 6px 5px 10px; overflow-y: auto; }
.sidebar nav a { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 2px; border-radius: 7px; position: relative;
  color: var(--side-fg); text-decoration: none; margin-bottom: 2px; font-size: 13px; min-height: 60px; }
/* 文字 + 二级箭头同一行（竖排布局下箭头跟在文字后面） */
.sidebar nav a .txrow { display: inline-flex; align-items: center; justify-content: center;
  max-width: 100%; gap: 2px; }
.sidebar nav a .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center; line-height: 1.2; }
.sidebar nav a .nico { width: 30px; height: 30px; flex: none;   /* 17→24→30px（船长两次要求图标变大） */
  stroke-width: 2; }   /* 描边同步加粗（原来 1.7 配 17px 刚好，放大后会显得太细） */
.nav-grp + .nav-grp { margin-top: 10px; }
/* 🆕 2026-10-08 船长：**不再显示分组小标题**（概览/接诊/患者/库房…）——
   renderNav 已不再往 DOM 里放 `.nav-gt`，这里再兜一道（万一别处又渲染出来）。 */
.nav-gt { display: none; }
/* 🆕 2026-10-08 船长：蓝底上「当前项」＝**白色卡片 + 黑字**；hover 走一层半透明白。 */
.sidebar nav a:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.sidebar nav a.active, .sidebar nav a.active:hover { background: #fff; color: var(--text); font-weight: 600; }
/* 🆕 2026-10-05：侧栏收到 140px 后底部三行会折得更碎（「同安路」被拆成「同安 / 安路」那种），
   所以字号收到 11.5px、左右内边距收到 10px，并把两个链接设成不可断行 —— 实测三行各自一行放得下。
   🔴 这里改的是**侧栏底部**，别顺手去改全局 .foot 或 main 的 padding。 */
.sidebar .foot { padding: 12px 10px; font-size: 11.5px; line-height: 1.55; color: var(--side-muted); border-top: 1px solid rgba(255,255,255,.18); }
.sidebar .foot b { color: #fff; display: block; margin-bottom: 5px; font-size: 12px; }
.sidebar .foot a { display: inline-block; white-space: nowrap; }
.sidebar .foot a + a { margin-left: 9px; }
/* 🔴 机构名（梦乐城 · 怡海路 · 同安路）必须独立成行 + `keep-all`：
   否则被 140px 挤到"同安 / 路"这种**把一个分院名从中间劈开**的断法，
   而且后半截会和「修改密码 退出登录」挤在同一行看着像一句话。
   `word-break: keep-all` ＝ 中日韩文字不在字间断行（只在空格/·处断），正好治这个。 */
.sidebar .foot #footClinic { display: block; word-break: keep-all; margin-bottom: 3px; }.sidebar .foot b { color: #fff; display: block; margin-bottom: 6px; }
.sidebar .foot a { color: rgba(255,255,255,.92); cursor: pointer; }
/* 左侧导航：管理员可按住菜单项上下拖动排序（桌面端侧栏；手机端侧栏本就不显示） */
.sidebar nav a.dragging { opacity: .4; }
.sidebar nav a.drop-before { box-shadow: inset 0 2px 0 0 #fff; }
.sidebar nav a.drop-after { box-shadow: inset 0 -2px 0 0 #fff; }
/* 🆕 2026-10-07：大板块（分组）也可拖：标题作手柄；落点高亮整块 */
.sidebar nav .nav-gt.nav-gt-drag { cursor: grab; }
.sidebar nav .nav-gt.nav-gt-drag:active { cursor: grabbing; }
.sidebar nav .nav-grp.dragging { opacity: .4; }
.sidebar nav .nav-grp.drop-before { box-shadow: inset 0 2px 0 0 #fff; }
.sidebar nav .nav-grp.drop-after { box-shadow: inset 0 -2px 0 0 #fff; }
.sidebar .nav-sorthint { font-size: 11px; line-height: 1.5; color: rgba(255,255,255,.62); padding: 8px 14px 2px; }
.main { flex: 1; overflow-y: auto; padding: 22px 26px; }

/* 组件 */
.btn { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 8px 14px; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border: 1px solid var(--primary); color: #fff; }
.btn-primary:hover { opacity: .9; color: #fff; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 20px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat .value.money { color: var(--primary); }

table.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.tbl th { color: var(--muted); font-weight: 600; background: #f8fafc; }
.tbl tbody tr:hover { background: #f4fbf9; }
.tbl th:first-child, .tbl td:first-child { border-radius: 8px 0 0 8px; }
.tbl th:last-child, .tbl td:last-child { border-radius: 0 8px 8px 0; }
.table-card { padding: 8px; overflow-x: auto; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag.待诊 { background: #e8f1ff; color: #2f6fd8; }
.tag.已完成 { background: #e5f4e5; color: var(--ok); }
.tag.已取消 { background: #f0f0f0; color: #999; }
.tag.爽约 { background: #fdeaea; color: var(--danger); }
/* 语义化标签（与预约状态名解耦）：价目表/导入记录这类非预约场景用它，
   否则预约状态一改名，这些标签配色就跟着错乱 */
.tag.tag-on { background: #e5f4e5; color: var(--ok); }
.tag.tag-off { background: #f0f0f0; color: #999; }
.tag.tag-info { background: #e8f1ff; color: #2f6fd8; }
/* 🆕 2026-10-05 病历「草稿」标记（自动保存过、还没点「保存病历」完成）—— 用琥珀色警示，别和"旧版"灰混淆 */
.tag.tag-warn { background: var(--warn, #e6a23c); color: #fff; }
.tag.已收费 { background: #e5f4e5; color: var(--ok); }
.tag.欠费 { background: #fdeaea; color: var(--danger); }
.tag.admin { background: #efe3ff; color: #7b3fd8; }
.tag.doctor { background: var(--primary-soft); color: var(--primary); }
.tag.reception { background: #fff4e2; color: var(--warn); }

/* 患者详情抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(20,30,40,.35); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; width: min(860px, 96vw); height: 100vh; background: var(--bg); z-index: 51; box-shadow: -8px 0 30px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.drawer .d-head { background: #fff; padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.drawer .d-head h3 { font-size: 17px; }
.drawer .d-tabs { background: #fff; padding: 0 22px; display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.drawer .d-tabs a { padding: 11px 16px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; }
.drawer .d-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.drawer .d-body { flex: 1; overflow-y: auto; padding: 18px 22px; }

/* ================= 患者详情页（整页版 · 参照 E看牙 · 船长 2026-09-21 定）=================
   结构：左侧患者列表窄栏 ｜ 右侧【顶部信息条 → 功能页签 → 页签内容 → 底部操作栏】
   高度由 JS 实算（App.renderPatientPage 里的 fit），这里给兜底高度以免首帧塌陷。
   注意：本段只有桌面端规则，不加任何 ≤760px 媒体查询（手机端暂停中）。 */
.pd-wrap { display: flex; height: 640px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
/* 左侧患者列表窄栏 */
/* 258 → 190：给右侧详情让宽度（船长 2026-09-22 定） */
/* 🆕 2026-11-13 船长：「患者列表变宽、显示更多标签」——190 → 240px。
   二级栏减半让出来的横向空间给到这里：左栏一行能放下头像＋姓名＋会员卡＋过敏＋手工标签。 */
.pd-rail { width: 240px; flex: 0 0 240px; min-width: 0; border-right: 1px solid var(--border); background: #fbfcfe; display: flex; flex-direction: column; }
.pd-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.pd-back { border: 1px solid var(--border); background: #fff; border-radius: 6px; font-size: 12px; padding: 3px 8px; color: var(--muted); }
.pd-back:hover { border-color: var(--primary); color: var(--primary); }
.pd-mback { display: none; }   /* 只在手机端出现（≤760px 段里打开） */
.pd-rail-search { display: flex; gap: 6px; padding: 9px 10px; }
.pd-rail-search input { padding: 5px 9px; font-size: 13px; }
.pd-rail-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.pd-rail-tabs a { padding: 7px 11px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.pd-rail-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.pd-rail-list { flex: 1; overflow-y: auto; padding: 6px; }
.pd-rail-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 26px 0; }
.pd-pcard { padding: 7px 9px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; margin-bottom: 3px; }
.pd-pcard:hover { background: #f1f7f6; }
.pd-pcard.on { background: var(--primary-soft); border-color: #a9ded6; }
/* 🆕 305 总库（船长 2026-10-26）：远端搜索结果，点一下才把整包拉到本地 */
.pd-remote-h { margin: 8px 0 4px; padding: 4px 2px; font-size: 11px; color: #6b7a90;
  border-top: 1px dashed #d7dee8; }
.pd-remote-h.err { color: var(--danger); border-top-color: #f0c2c2; }
.pd-pcard.pd-remote { background: #f7fbfa; border-color: #dbeae7; }
.pd-pcard.pd-remote:hover { background: #eef7f5; }
.pd-pcard.pd-remote .pd-pc-doc { background: #e6f2ef; color: #2b7a6a; }
.pd-pcard.pd-remote.busy { opacity: .55; pointer-events: none; }
.pd-pc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pd-pc-top b { font-size: 13.5px; }
.pd-pc-doc { font-size: 11.5px; color: #d98e00; max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-pc-tags { display: flex; flex-wrap: wrap; gap: 3px; margin: 3px 0 1px; }
.pd-pc-tag { font-size: 10.5px; padding: 1px 5px; border-radius: 4px; background: #eef1f5; color: #6b7787; }
.pd-pc-line { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pd-rail-new { margin: 8px 10px 10px; }
/* 右侧详情 */
.pd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pd-head { display: flex; gap: 14px; padding: 13px 18px 9px; border-bottom: 1px solid var(--border); }
/* 🆕 2026-11-02 去圆框 + 放大：底色由灰改白（灰底会把头像框出来），圆角收到 8px 只做裁边 */
.pd-avatar { width: 66px; height: 66px; flex: 0 0 66px; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #b7c1cd; overflow: hidden; }
/* 真实照片：cover 填满（人脸照裁一点边没关系）
   插画头像：contain 保持完整（图片本身已把人物撑满，cover 会切掉下巴/耳朵） */
.pd-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pd-avatar img.pat-av-img { object-fit: contain; }
/* 头像现在兼作「上传 / 更换照片」入口（左列撤掉后搬过来） */
.pd-avatar.can-up { cursor: pointer; }
.pd-avatar.can-up:hover { box-shadow: 0 0 0 2px var(--primary-soft); }
.pd-head-counts { display: flex; gap: 10px; margin-top: 7px; font-size: 12px; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }
.pd-head-counts b { color: var(--text); font-weight: 600; }
.pd-head-mid { flex: 1; min-width: 0; }
.pd-name { display: flex; align-items: baseline; gap: 8px; font-size: 17px; font-weight: 700; flex-wrap: wrap; }
.pd-name .age { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.pd-head-kv { display: flex; flex-wrap: wrap; gap: 5px 24px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.pd-head-kv b { color: var(--text); font-weight: 600; }
.pd-head-kv .pen { font-style: normal; color: #a8bccf; margin-left: 3px; cursor: pointer; }
.pd-head-kv .pen:hover { color: var(--primary); }
/* 手机号：点一下 = 手机端拨号 / 桌面端复制或电话盒子（口径见 core/phone.js） */
.pd-head-kv .pd-phone { cursor: pointer; border-bottom: 1px dashed #b9cfe0; }
.pd-head-kv .pd-phone:hover { color: var(--primary); border-bottom-color: var(--primary); }
/* 号码后面的大号电话标识（船长 2026-09-25 定）：
   本地号只给图标；异地号图标前带「+0」并用暖色区分 —— 提示座机拨要加的前缀 */
.pd-head-kv .pd-call { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 7px; margin-left: 6px; vertical-align: middle; border: 1px solid #cfe0ee; border-radius: 9px; background: #f2f8fd; color: #2f7fae; cursor: pointer; }
.pd-head-kv .pd-call:hover { background: #e4f1fb; border-color: #8fbcd9; }
.pd-head-kv .pd-call svg { width: 22px; height: 22px; display: block; }
.pd-head-kv .pd-call svg path { fill: currentColor; }
.pd-head-kv .pd-call-zero { font-size: 12px; font-weight: 600; letter-spacing: -0.3px; }
.pd-head-kv .pd-call.is-remote { border-color: #f0cf9a; background: #fff8ec; color: #a9701a; }
.pd-head-kv .pd-call.is-remote:hover { background: #fdf0da; border-color: #e0b46a; }
/* 本机拨号方式设置面板 */
.pd-dl { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.pd-dl-opt { font-size: 13px; }
.pd-dl > input { width: 100%; }
.pd-dl code { background: #f1f5f9; padding: 0 3px; border-radius: 3px; }
.pd-head-ops { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pd-stars { color: #f0b429; letter-spacing: 2px; font-size: 13px; }
.pd-op-row { display: flex; gap: 7px; }
.pd-op { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: #7a8699; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.pd-op:hover { border-color: var(--primary); color: var(--primary); }
.pd-tabs { position: relative; display: flex; gap: 2px; padding: 0 46px 0 10px; border-bottom: 1px solid var(--border); overflow-x: auto; align-items: center; }
.pd-tabs a { padding: 9px 11px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.pd-tabs a:hover { color: var(--primary); }
.pd-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
/* ⚙ 2026-11-18 船长：「页面所有设置统一为一个尺寸，一个图标」——
   一律齿轮 ⚙、一律 28×28、字形 16px（与正文行高一致）。此前各处 24/26/30 混着来、
   还有 ⚙️（带变体选择符）渲染成彩色 emoji 与纯 ⚙ 大小不一致。
   新增设置入口就用这个类，不要再写一套尺寸。 */
.set-ico { width: 28px; height: 28px; flex: none; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s; }
.set-ico:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
/* 患者页签右侧那颗齿轮：仍贴右、垂直居中 */
.pd-tabs > .set-ico { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
/* 库房分类行：齿轮靠右 */
.wh-cats .set-ico { margin-left: auto; }
.pd-body { flex: 1; overflow-y: auto; padding: 14px 18px 18px; }
.pd-foot { border-top: 1px solid var(--border); background: #fbfcfe; padding: 9px 18px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
/* 🆕 2026-11-18：打印 / 查看日志在**左下角**，修改信息靠右 */
.pd-foot-l, .pd-foot-r { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pd-foot-l:empty { display: none; }
.pd-foot-r:empty { display: none; }
/* 「患者信息」页：左栏（照片 + 患者价值） + 右栏（各信息分组） */
.pd-cols { display: flex; gap: 26px; align-items: flex-start; }
/* 原本这里还有一列 .pd-col-l（患者价值）224px，已按船长 2026-09-22 的决定整列撤掉，右列独占整宽 */
.pd-col-r { flex: 1; min-width: 0; }
.pd-photo { text-align: center; }
.pd-photo-box { height: 148px; border-radius: 10px; background: #f2f5f8; border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; font-size: 30px; color: #c3ccd7; overflow: hidden; }
.pd-photo-box img { width: 100%; height: 100%; object-fit: cover; }
.pd-photo .btn { margin: 6px 4px 0; }
.pd-sect { margin-bottom: 18px; }
.pd-sect > h4 { display: flex; align-items: center; gap: 7px; font-size: 13.5px; padding-bottom: 7px; margin-bottom: 10px; border-bottom: 1px solid #f0f3f7; }
.pd-sect > h4 .ico { width: 3px; height: 13px; border-radius: 2px; background: var(--primary); }
.pd-sect > h4 em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.pd-sect > h4 .pen { margin-left: auto; font-style: normal; font-weight: 400; color: #a8bccf; cursor: pointer; }
/* 🆕 2026-11-18：板块标题右上角的动作按钮（如「患者信息字段配置」） */
.pd-sect > h4 .pd-sec-act { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.pd-sect > h4 .pd-sec-act .btn { height: 26px; padding: 0 10px; font-size: 12px; }
/* 动作按钮已经吃掉 auto 空间 ⇒ 后面的 ✎ 紧跟着排，别再顶一次 */
.pd-sect > h4 .pd-sec-act ~ .pen { margin-left: 6px; }
.pd-sect > h4 .pen:hover { color: var(--primary); }
/* 每个字段是「标签+值」整体，避免隐藏字段时把后面的标签/值错位 */
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; font-size: 13px; }
.pd-grid2 { display: grid; grid-template-columns: 1fr; gap: 9px; font-size: 13px; }
.pd-f { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.pd-f.full { grid-column: 1 / -1; }
.pd-f .k { color: var(--muted); font-size: 12.5px; }
.pd-f .v { color: var(--text); word-break: break-word; }
.pd-f .v.na { color: #c3ccd7; }
.pd-f .v.danger { color: var(--danger); }
.pd-inline { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 13px; }
.pd-il { color: var(--text); }
.pd-il .k { color: var(--muted); font-size: 12.5px; }
.pd-il .na { color: #c3ccd7; }
.pd-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.pd-counts b { color: var(--primary); }
.pd-rel-empty { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c3ccd7; }
.pd-rel-empty .pen { font-style: normal; color: #a8bccf; cursor: pointer; }
.pd-todo { text-align: center; padding: 60px 0; color: var(--muted); }
.pd-todo-ic { font-size: 44px; }
.pd-todo h3 { font-size: 16px; color: var(--text); margin: 10px 0 6px; }
.pd-todo p { font-size: 13px; }
.pd-tabstate { font-size: 12px; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }

/* 牙位图 */
.tooth-chart { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.chart-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; }

/* 影像 */
.img-mfilter { display: none; }   /* 只在手机端出现（≤760px 段里打开） */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
/* 2026-09-25：网格格子改为 .img-cell（外层容器），.img-item 只留给「一次检查」的分组卡 */
.img-item { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.img-item img { width: 100%; height: 110px; object-fit: cover; cursor: pointer; display: block; background: #f0f2f5; }
.img-item .meta { padding: 8px 10px; font-size: 12px; }
.img-item .meta .cat { font-weight: 600; }
.img-item .meta .del { float: right; color: var(--danger); cursor: pointer; }
/* 🆕 2026-10-29 拍摄日期要显眼，上传信息与文件大小退一层；大小再用小一号字体（船长要求） */
.img-item .meta .time.shot, .img-cell .meta .time.shot { color: #3c4a58; font-weight: 600; margin-top: 3px; }
.img-item .meta .time .img-size, .img-cell .meta .time .img-size { font-size: 10.5px; color: #8b98a6; }
.img-item .meta .time.up, .img-cell .meta .time.up { font-size: 11px; line-height: 1.45; }
.img-cell { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
/* 🆕 2026-10-28 船长：取消格子上的「删除」，改成左上角勾选 + 底部批量删除 */
.img-cell { position: relative; }
/* 🔴 放右上角：左上角被「口扫 / CT」角标占着（实测两者完全重叠 513,450 vs 515,452） */
.img-pick { position: absolute; top: 6px; right: 6px; z-index: 4; width: 22px; height: 22px; border-radius: 6px;
  background: rgba(255,255,255,.94); border: 1px solid #cfd8e2; box-shadow: 0 1px 3px rgba(15,30,45,.12);
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.img-pick input { flex: none; width: 14px; height: 14px; margin: 0; padding: 0; cursor: pointer; accent-color: #1D9E75; }
.img-cell.picked { border-color: #1D9E75; box-shadow: 0 0 0 2px rgba(29,158,117,.35); }
.img-cell.picked .img-pick { background: #1D9E75; border-color: #1D9E75; }
/* 底部浮动操作条（有勾选才出现） */
/* 靠右下角：居中会压住患者详情抽屉底部那排「修改信息/打印/扫一扫」 */
#imgBatchBar { position: fixed; right: 26px; bottom: 22px; z-index: 920;
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px;
  background: #22303c; color: #fff; box-shadow: 0 8px 26px rgba(15,30,45,.28); font-size: 13px; }
#imgBatchBar .ib-n { margin-right: 4px; }
#imgBatchBar .ib-n b { font-size: 15px; color: #7fe0bb; }
#imgBatchBar .ib-sub { color: #b9c6d2; font-size: 11.5px; margin-left: 2px; }
#imgBatchBar .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); color: #fff; }
#imgBatchBar .btn:hover { background: rgba(255,255,255,.2); }
#imgBatchBar .btn-danger { background: #B4443B; border-color: #B4443B; color: #fff; }
#imgBatchBar .btn-danger:hover { background: #9d3a32; }
@media (max-width: 760px) {
  #imgBatchBar { left: 10px; right: 10px; bottom: 12px; justify-content: space-between; gap: 6px; padding: 8px 10px; }
  #imgBatchBar .btn { padding: 5px 8px; font-size: 12px; }
  #imgBatchBar .ib-sub { display: none; }
}
.img-cell > img { width: 100%; height: 110px; object-fit: cover; cursor: pointer; display: block; background: #f0f2f5; }
/* 🆕 2026-10-28 卡通预览图（CT/口扫/曲面断层/头颅侧位）：整张画进去，不裁边 */
.img-cell > img.is-art { object-fit: cover; background: #0c141c; }
/* 片子类（CT/曲面断层/头颅侧位）：暗底、整张显示不裁边 */
.img-cell > img.is-film { object-fit: contain; background: #0c141c; }
.grp-img.is-film { object-fit: contain; }
.img-item.is-group .grp-thumb.has-img { background: #0c141c; }
/* 口扫是浅底彩色图：整张显示 + 浅底，避免 cover 把画面裁成中间一块 */
.img-item.is-group .grp-thumb.has-img.art-scan { background: #eef3f8; }
.img-item.is-group .grp-thumb.has-img.art-scan .grp-img { object-fit: contain; }

.img-cell .meta { padding: 8px 10px; font-size: 12px; }
.img-cell .meta .cat { font-weight: 600; }
.img-cell .meta .del { float: right; color: var(--danger); cursor: pointer; }
.img-cell .meta .time { color: var(--muted); margin-top: 3px; }
.img-cell .meta .pat { margin-top: 3px; font-size: 12px; }
.img-cell > .img-item { border: 0; border-radius: 0; }   /* 分组卡自带外框，别套两层 */
.img-broken { height: 110px; display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; background: #f0f2f5; color: var(--muted); font-size: 12px; }
.img-broken small { font-size: 10.5px; opacity: .8; }
/* 🆕 2026-10-29 「示意图」角标：不是这张片子的真图，必须一眼能看出来 */
.img-art-tag { position: absolute; left: 6px; top: 6px; z-index: 3; padding: 1px 6px; border-radius: 8px; font-size: 10px; letter-spacing: .3px; color: #dbe6f0; background: rgba(12,20,28,.74); border: 1px solid rgba(255,255,255,.18); pointer-events: none; }
/* 🆕 2026-10-20 头颅侧位片：格子上的「头影测量 / 已测量」角标 + 「看原图」入口
   （主点击已改走测量视图，这两个是补充信息与退路，不抢主点击） */
.ceph-badge { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 9px; font-size: 10px; font-weight: 500; cursor: default; background: rgba(0,160,232,.1); color: var(--primary); border: 1px solid rgba(0,160,232,.3); vertical-align: 1px; }
.ceph-badge.done { background: rgba(82,163,82,.12); color: #3d7a3d; border-color: rgba(82,163,82,.35); }
.ceph-raw { display: inline-block; margin-left: 5px; font-size: 11px; color: var(--muted); text-decoration: underline; cursor: pointer; vertical-align: 1px; }
.ceph-raw:hover { color: var(--primary); }
/* 按「就诊日期」分组折叠：默认只展开最新一组 */
.img-group { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; background: var(--panel, #fff); }
.img-group > summary { cursor: pointer; padding: 9px 12px; display: flex; align-items: center; gap: 8px; font-size: 13px; user-select: none; list-style: none; }
.img-group > summary::-webkit-details-marker { display: none; }
.img-group > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.img-group[open] > summary::before { transform: rotate(90deg); }
.img-group > summary:hover { background: #f7f9fb; border-radius: 10px; }
.img-group .ig-date { font-weight: 700; font-variant-numeric: tabular-nums; }
.img-group .ig-n { background: #eef3f8; color: var(--muted); border-radius: 20px; padding: 1px 9px; font-size: 12px; }
.img-group .ig-cats { color: var(--muted); font-size: 12px; margin-left: auto; }
.img-group > .img-grid { padding: 0 12px 12px; }
.img-more { padding: 0 12px 12px; text-align: center; }
/* 一次检查（CBCT 数百层 / 口扫多文件）在列表里折叠成一个条目，点开才看 */
.img-item.is-group .grp-thumb { height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; background: linear-gradient(150deg, #2b3440, #46515f); color: #eaf2fb; }
.img-item.is-group .grp-thumb .grp-cat { font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.img-item.is-group .grp-thumb .grp-n { font-size: 12px; opacity: .85; }
/* 🆕 2026-10-28 口扫卡片缩略图（船长）：有图时整块换成真预览，文字缩成角标压在图上 */
.img-item.is-group .grp-thumb { position: relative; overflow: hidden; }
.img-item.is-group .grp-thumb.has-img { display: block; padding: 0; background: #e8eef4; }
.img-item.is-group .grp-thumb .grp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.img-item.is-group .grp-thumb.has-img .grp-cat { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0; padding: 1px 8px; border-radius: 999px; background: rgba(17,24,32,.55); color: #fff; }
.img-item.is-group .grp-thumb.has-img .grp-n { position: absolute; right: 8px; bottom: 7px; font-size: 11px; opacity: 1; padding: 1px 8px; border-radius: 999px; background: rgba(17,24,32,.5); color: #fff; }
.img-item.is-group .grp-act { margin-top: 6px; }
.img-item.is-group .grp-act .btn { width: 100%; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 99; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ══ 病历书写：三栏（船长 2026-09-26）══════════════════════════════
   左栏＝今日拍摄照片（上）＋ 病历模板（下）；右栏＝正常书写区。
   为什么做成超宽弹窗而不是新页面：病历是从「患者详情 → 病历」进来的，
   改成独立页会丢掉患者上下文（还得再选一次患者）。 */
.modal.modal-record { width: min(1560px, 97vw); max-height: 94vh; padding: 18px 20px; }
.rec-3col { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.rec-left { display: flex; flex-direction: column; gap: 12px; }
.rec-box { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.rec-box-h { display: flex; align-items: center; gap: 7px; padding: 8px 11px; background: #f7f9fc;
  border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.rec-box-h .n { font-weight: 400; color: var(--muted); font-size: 12px; }
.rec-box-b { padding: 9px 11px; }
/* 照片网格：三列小图，点一下进查看器 */
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 330px; overflow: auto; }
.ph-grid img { width: 100%; height: 74px; object-fit: cover; border-radius: 6px; cursor: zoom-in;
  border: 1px solid var(--border); display: block; }
.ph-grid img:hover { border-color: var(--brand); }
/* 模板列表：点一下即套用（比原来"再弹一次窗"少一步） */
.tpl-list { max-height: 300px; overflow: auto; }
.tpl-item { padding: 8px 4px; border-bottom: 1px solid #eef1f5; cursor: pointer; }
.tpl-item:hover { background: #f7fbff; }
.tpl-item:last-child { border-bottom: 0; }
/* 图片查看器：缩放 / 旋转 / 平移 / 翻页
   🔴 2026-09-26 船长：**只占左半屏**，右半屏要能继续写病历 ——
      所以不能再用 `inset:0` 的全屏遮罩（那会把右侧书写区一起盖住、点不动）。
      现在：左半屏一块深色面板 + 底部工具条；右半屏完全不碰。 */
/* 🆕 2026-10-04 船长定：「点击图片后显示居中」⇒ 查看器改成**整屏**。
   原来只占左半屏（right 留给病历弹窗），看着就是"图片跑到左边去了、没居中"。 */
.pv-mask { position: fixed; inset: 0;
  background: rgba(8,12,18,.94); z-index: 120;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
/* 🆕 2026-10-28 查看器左侧日期栏（船长：点照片后左侧列出有影像的日期，点开下拉当天照片） */
.pv-body { flex: 1; width: 100%; min-height: 0; display: flex; gap: 10px; padding: 10px 10px 0; }
.pv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pv-dates { width: 152px; flex: 0 0 152px; background: rgba(255,255,255,.045); border-radius: 10px; padding: 8px 0; overflow-y: auto; }
.pv-dt-hd { padding: 2px 12px 8px; font-size: 11px; color: #8ea0b6; }
.pv-dt-all { padding: 7px 12px; font-size: 12px; color: #cfe0f5; cursor: pointer; display: flex; justify-content: space-between; }
.pv-dt-all:hover { background: rgba(255,255,255,.07); }
.pv-dt { padding: 7px 12px; font-size: 12px; color: #a8bdd4; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.pv-dt:hover { background: rgba(255,255,255,.07); }
.pv-dt.open { color: #e8f1fb; background: rgba(55,138,221,.16); }
.pv-dt b, .pv-dt-all b { color: #7d8fa6; font-weight: 600; }
.pv-dr { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 16px; cursor: pointer; }
.pv-dr:hover { background: rgba(255,255,255,.07); }
.pv-dr img { width: 26px; height: 26px; object-fit: cover; border-radius: 3px; flex: none; }
.pv-dr-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #b9cbe0; }
/* 选中的那一行＝白底（船长 2026-10-28 定：更改白色底色） */
.pv-dr.on { background: #fff; }
.pv-dr.on .pv-dr-t { color: #1a2433; font-weight: 600; }
.pv-dr-p { width: 13px; height: 13px; flex: none; border-radius: 50%; border: 1px solid #55708c; cursor: pointer; }
.pv-dr-p.picked { background: #378ADD; border-color: #378ADD; }
.pv-stage { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: grab; padding: 10px; }
.pv-stage:active { cursor: grabbing; }
/* 图片按**整屏**取景（2026-10-04 查看器改整屏后回到 92vw） */
.pv-stage img { max-width: 92%; max-height: 78vh; user-select: none; -webkit-user-drag: none;
  transform-origin: center center; }
.pv-bar { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center;
  padding: 9px 12px; margin: 0 10px 16px; background: rgba(255,255,255,.10);
  border-radius: 12px; color: #fff; font-size: 13px; max-width: calc(100% - 20px); }
.pv-row { display: flex; gap: 7px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pv-bar button { background: rgba(255,255,255,.16); border: 0; color: #fff; padding: 6px 11px;
  border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.pv-bar button:hover { background: rgba(255,255,255,.30); }
.pv-bar button:disabled { opacity: .55; cursor: default; }
/* 「水平/垂直翻转」是开关 ⇒ 开着时必须看得出来（否则用户不知道现在是不是镜像状态） */
.pv-bar button.on { background: var(--primary, #2f6fd8); box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.pv-bar .pv-pct { min-width: 52px; text-align: center; }
.pv-bar .pv-idx { min-width: 64px; text-align: center; opacity: .85; }
.pv-bar .pv-tip { opacity: .62; font-size: 11.5px; }
/* 亮度 / 对比度滑杆（船长 2026-10-04 定：滑杆 + 百分比，拖动实时预览） */
.pv-bar .pv-sl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #fff;
  background: rgba(255,255,255,.08); border-radius: 8px; padding: 3px 9px; white-space: nowrap; }
.pv-bar .pv-sl input[type=range] { width: 88px; accent-color: #4a9df0; cursor: pointer; }
.pv-bar .pv-sl b { min-width: 40px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
/* 「保存」：有还没记下来的改动时变黄 —— 否则医生关掉了也不知道白调了 */
.pv-bar .pv-save.dirty { background: #d99114; }
.pv-bar .pv-save.dirty:hover { background: #e8a325; }
/* 「退出对比」键（对比模式下才出现） */
.pv-bar .pv-cmp { background: #1d6e5e; }
.pv-bar .pv-cmp:hover { background: #23866f; }

/* ── 多图对比（船长 2026-10-04：底部缩略图勾选，最多 12 张＝横向 4 × 竖向 3）── */
.pv-label { color: #fff; padding: 6px 12px 0; }
/* 底部缩略图条：点图切换 / 点右上小圈加入对比 */
.pv-strip { display: flex; gap: 6px; padding: 8px 10px; margin: 0 10px 8px;
  max-width: calc(100% - 20px); overflow-x: auto; background: rgba(255,255,255,.06); border-radius: 10px; }
.pv-th { position: relative; flex: 0 0 auto; width: 66px; height: 46px; border-radius: 6px;
  overflow: hidden; cursor: pointer; border: 2px solid transparent; background: #1b232c; }
.pv-th img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .7; }
.pv-th.on img { opacity: 1; }
.pv-th.on { border-color: #fff; }
.pv-th.picked { border-color: #5ec8f5; }
.pv-th.picked img { opacity: 1; }
.pv-th-p { position: absolute; right: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 1.5px solid #fff; cursor: pointer; }
.pv-th.picked .pv-th-p { background: #5ec8f5; border-color: #5ec8f5; }
.pv-th-p::after { content: ''; position: absolute; left: 3.5px; top: 5px; width: 5px; height: 2.5px;
  border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff; transform: rotate(-45deg); opacity: 0; }
.pv-th.picked .pv-th-p::after { opacity: 1; }
/* 对比网格：等分可用高度，每格等大（12 张时自然排成 4 × 3） */
.pv-grid { flex: 1; width: 100%; display: grid; gap: 8px; padding: 10px; overflow: auto;
  grid-auto-rows: minmax(0, 1fr); }
.pv-cell { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: #10161d; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; }
.pv-cell img { max-width: 100%; max-height: 100%; object-fit: contain;
  user-select: none; -webkit-user-drag: none; transform-origin: center center; }
/* 被点中的格加青边 —— 不然"正在调哪一张"看不出来，很容易改错 */
.pv-cell.on { border-color: #5ec8f5; }
.pv-cell-i { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 8px; }
/* 网格里「已调整」角标（调过显示的图，一眼能认出来；原图其实没动） */
.edit-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px;
  background: #eef4ff; color: #2f6fd8; font-size: 11px; font-weight: 500; vertical-align: 1px; }

/* 🗑 2026-10-04：查看器已改成**整屏**（船长定），原来那套「让病历弹窗退到右半屏」的
   `body.pv-open …` 规则**删掉** —— 大图整屏盖住一切，让位已经没有意义；
   留着只会误导人以为"查看器还只占半屏"。 */

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #143d36; color: #fff; padding: 10px 22px; border-radius: 24px; z-index: 200; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.modal-mask { position: fixed; inset: 0; background: rgba(20,30,40,.4); z-index: 80; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 14px; width: min(680px, 94vw); max-height: 90vh; overflow-y: auto; padding: 24px; }
/* 窄弹窗：一句话确认框、单个输入框这类 —— 任何分辨率下都锁 520（2026-11-03） */
.modal.modal-confirm, .modal.modal-narrow { width: min(520px, 94vw); }
.modal h3 { margin-bottom: 16px; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
/* 🆕 2026-11-18 预约日志：「关闭」左边那个「显示完整信息」选项（默认不勾＝时间/修改人按天、按人折叠） */
.apl-full { display: inline-flex; align-items: center; gap: 6px; flex: none; align-self: center;
  font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
/* 🔴 必须显式给宽高：全局 `input { width: 100% }` 会把勾选框撑成一整行 */
.apl-full input { width: 14px; height: 14px; flex: none; margin: 0; accent-color: var(--primary); cursor: pointer; }
.apl-full:hover { color: var(--text); }

/* ---------- 内窥镜拍照（船长 2026-10-02：面板放大、预览为主体、已拍双排、文字信息在上） ---------- */
.modal.modal-capture { width: min(1100px, 96vw); max-height: 94vh; padding: 16px 20px;
  display: flex; flex-direction: column; }
.modal.modal-capture h3 { margin-bottom: 10px; }
.endo-top { flex: none; }
.endo-devrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 10px; }
.endo-devrow select { flex: 1 1 220px; min-width: 170px; }
.endo-devrow #ec_tip { margin: 0; flex: 1 1 100%; }
/* 大预览区 —— 原来船长圈的那个「红框」 */
.endo-stage { position: relative; flex: 1 1 52vh; min-height: 300px; background: #0b0b0b;
  border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.endo-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.endo-stage-ph { position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  color: #8a8a8a; font-size: 13px; text-align: center; padding: 20px; }
.endo-stage.empty video { display: none; }
.endo-stage.empty .endo-stage-ph { display: flex; }
/* 已拍照片：双排（grid-auto-flow:column + 两个固定行 ⇒ 正好两排，横向滚动） */
.endo-shots-wrap { flex: none; margin-top: 10px; }
.endo-shots { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 74px);
  gap: 6px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
.endo-shots:empty { display: none; }
.endo-shot { position: relative; width: 132px; }
.endo-shot img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block;
  border: 1px solid var(--border); }
/* 序号角标 —— 🔴 双排是「按列」排的（第1张在上、第2张在它下面、第3张在右边），
   不标号容易读错顺序，所以每张都带上它是第几张。 */
.endo-shot .n { position: absolute; left: 3px; bottom: 3px; background: rgba(0,0,0,.62);
  color: #fff; font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 4px; }
.endo-shot button { position: absolute; top: -5px; right: -5px; width: 19px; height: 19px;
  border-radius: 50%; border: none; background: #c33; color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; padding: 0; }
.endo-shots-empty { color: var(--muted); font-size: 12px; padding: 10px 0; }
.modal.modal-capture .m-foot { margin-top: 12px; flex: none; }
.kv { display: grid; grid-template-columns: 90px 1fr 90px 1fr; gap: 8px 10px; font-size: 13px; }
.kv .k { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- 口腔筛查 ---------- */
.scr-card { padding: 14px; margin-bottom: 12px; }
.scr-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.scr-title { font-size: 14px; }
.scr-ops { display: flex; gap: 6px; }
.scr-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; font-size: 13px; color: var(--muted); }
.scr-meta b { color: var(--text); font-weight: 600; }
.scr-line { font-size: 13px; margin-top: 4px; }
.scr-list { display: flex; flex-direction: column; }
.tooth-toggle { display: flex; gap: 6px; margin-bottom: 8px; }
.tooth-palette { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tooth-pal { border: 1px solid #ddd; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; background: #fff; }
.tooth-pal.on { outline: 2px solid var(--primary); }
.tooth-archs { display: flex; flex-direction: column; gap: 8px; }
.tooth-arch { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; padding: 8px; background: #fafbfc; border: 1px solid var(--border); border-radius: 8px; }
.tooth { width: 34px; height: 34px; border: 1px solid #ddd; border-radius: 6px; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .05s; }
.tooth:active { transform: scale(.92); }
.tooth-missing { text-decoration: line-through; }

/* ---------- 患者列表（对齐牙医管家） ---------- */
.pat-card { padding: 14px 16px; }
.pat-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.pat-tabs { display: flex; gap: 22px; }
.pat-tabs a { padding: 4px 2px 10px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.pat-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.pat-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 6px; }
.pat-sel { width: auto; min-width: 92px; height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; background: #fff; font-size: 13px; }
.pat-search { height: 34px; width: 220px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; font-size: 13px; }
.pf-lb { font-size: 13px; color: var(--muted); }
.pf-toggle { display: none; }   /* 只在手机端出现（≤760px 段里再打开） */
.pat-actions { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
/* 桌面端：高级查询/查询/重置 整组靠右，右缘与「+ 新建档案」对齐（船长 9/21 定）；≤820px 手机端不变 */
@media (min-width: 821px) { .pat-actions { justify-content: flex-end; } }
.pat-adv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: #f7faf9; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.pat-adv label { color: var(--muted); }
.pat-adv input { width: auto; min-width: 120px; height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; font-size: 13px; }
/* ---------- 患者表格：排序提示 + 显示信息设置（船长 2026-09-21） ---------- */
.pat-sortbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 2px 2px 8px; font-size: 12px; color: var(--muted); }
.pat-sortbar b { color: var(--text); font-weight: 600; }
.pat-sortbar .sb-def { margin-left: 6px; padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; }
.pat-sortbar .lnk { color: var(--primary); cursor: pointer; }
.pat-sortbar .sb-hint { margin-left: auto; }
.pat-tbl th.pat-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.pat-tbl th.pat-th-sort:hover { color: var(--primary); background: #f2faf7; }
.pat-tbl th.is-nodata, .pat-tbl td.is-nodata { color: #a8b0ae; }
.sort-mark { display: inline-block; margin-left: 3px; font-size: 10px; color: #c9d0ce; }
.sort-mark.on { color: var(--primary); font-weight: 700; }
.pat-th-ops, .pat-th-set { white-space: nowrap; }
.pat-th-set { width: 34px; text-align: right !important; }
.pat-tbl .ta-left { text-align: left; }
.pat-tbl .ta-center { text-align: center; }
.pat-tbl .ta-right { text-align: right; }
.pay-neg { color: var(--warn); }
/* 显示信息设置弹窗 */
.vset-tip { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 2px 0 10px; }
.vset-wrap { border: 1px solid var(--border); border-radius: 8px; max-height: 52vh; overflow: auto; }
/* 🆕 2026-10-09「筛选患者」弹窗（照 E看牙）：分组 + 自适应多列网格 */
.pfd { max-height: 62vh; overflow: auto; padding-right: 4px; }
.pfd-g { margin-bottom: 14px; }
.pfd-gt { font-size: 13px; font-weight: 600; color: var(--text); border-left: 3px solid var(--primary); padding-left: 8px; margin-bottom: 10px; }
.pfd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 18px; }
.pfd-grid .field { margin: 0; }
.pfd-grid .field label { font-size: 12px; }
.pfd-tip { font-size: 11.5px; color: var(--muted); line-height: 1.7; border-top: 1px dashed var(--border); padding-top: 10px; }

/* ══════════════════════════════════════════════════════════════════════════
   患者高级搜索（2026-11-09 船长：全模块 + 自由嵌套条件组）
   · 左侧竖栏是「且 / 或」，组可以套组；条件卡里再放属性筛选与统计指标
   ══════════════════════════════════════════════════════════════════════════ */
.modal.modal-patadv { width: min(1080px, 96vw); max-height: 92vh; padding: 18px 20px; }
/* ══ 🆕 2026-11-09 高级筛选改成 E看牙 式右侧抽屉（船长：界面用 E看牙 的，功能保留我们的）══ */
.modal-mask.drawer-mask { align-items: stretch; justify-content: flex-end; padding: 0; }
.modal.modal-drawer { width: 940px; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0;
  border-radius: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden;
  animation: padvDrawerIn .18s ease-out; }
.modal.modal-drawer .padv-head { margin: 0; padding: 14px 20px 10px; border-bottom: 1px solid #eef1f5; align-items: center; }
.modal.modal-drawer .padv-head h3 { font-size: 15px; }
.modal.modal-drawer .padv-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid #f4f7fa; }
.padv-scheme-del { font-size: 11.5px; color: #c0392b; cursor: pointer; }
.padv-scheme-lk { font-size: 11.5px; color: #2f6fed; cursor: pointer; }
.padv-scheme-lk:hover { text-decoration: underline; }
/* 批量处理弹窗（2026-11-09 D 组） */
.pbat-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.pbat-it { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.pbat-it:hover { border-color: #9cc7f5; background: #f7fbff; }
.pbat-it b { display: block; font-size: 13px; color: #1f2d3d; margin-bottom: 2px; }
.pbat-it span { font-size: 11.5px; color: var(--muted); }
.pbat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pbat-row span { flex: none; font-size: 12px; color: var(--muted); }
.modal.modal-drawer .padv-bar select { width: 240px; max-width: 60%; }
.padv-cond > .padv-filter > a[data-act="add-filter"] { color: #8b98a8; font-size: 11px; }
.padv-cond > .padv-filter > a[data-act="add-filter"]:hover { color: #2f6fed; }
.modal.modal-drawer .padv-scroll { flex: 1; max-height: none; padding: 12px 20px; }
.modal.modal-drawer .padv-foot { margin: 0; padding: 12px 20px; border-top: 1px solid #eef1f5; }
.padv-save { margin: 4px 0 8px; }
.padv-save input { width: 100%; }
.padv-tip-s { font-size: 11.5px; color: #8b98a8; line-height: 1.7; }
@keyframes padvDrawerIn { from { transform: translateX(36px); opacity: .5; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal.modal-drawer { animation: none; } }
@media (max-width: 980px) {
  .modal.modal-drawer { width: 100vw; }
  .modal.modal-drawer .padv-head, .modal.modal-drawer .padv-bar,
  .modal.modal-drawer .padv-scroll, .modal.modal-drawer .padv-foot { padding-left: 14px; padding-right: 14px; }
}
.padv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.padv-head h3 { margin: 0; }
.padv-hint { font-size: 11px; color: var(--muted); }
.padv-scroll { max-height: 58vh; overflow: auto; padding-right: 4px; }
.padv-group { display: flex; border: 1px solid #e3ebf5; border-radius: 8px; background: #f7fafd; margin-bottom: 8px; }
.padv-group .padv-group { background: #f1f6fc; border-color: #d9e6f2; margin: 4px 0 8px; }
.padv-rail { flex: none; width: 38px; padding: 8px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; border-right: 1px solid #e8eef6; }
.padv-op { width: 24px; height: 24px; border-radius: 5px; border: 1px solid #d9e1ea; background: #fff; color: #6b7887; font-size: 11px; cursor: pointer; }
.padv-op.on { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.padv-gbody { flex: 1; min-width: 0; padding: 8px; }
.padv-cond { background: #fff; border: 1px solid #e3e9f1; border-radius: 6px; padding: 8px; margin-bottom: 8px; }
.padv-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.padv-row + .padv-row, .padv-row + .padv-filter { margin-top: 6px; }
.padv-row select, .padv-row input, .padv-filter select, .padv-filter input {
  height: 28px; font-size: 12px; border: 1px solid #d9e1ea; border-radius: 5px;
  padding: 0 6px; background: #fff; flex: none; }
.padv-s-sub { width: 132px; }
.padv-s-mode { width: 84px; }
.padv-s-field { width: 132px; }
.padv-s-op { width: 120px; }
/* 🆕 2026-11-09 三段式后：统计条件的比较符窄一点；「且满足」的额外行缩进 */
.padv-s-cmp { width: 92px; }
.padv-cond > .padv-filter { margin-top: 6px; padding-left: 4px; }
.padv-i-val { width: 150px; }
.padv-i-num { width: 90px; }
.padv-lb { font-size: 11px; color: #8b98a8; }
.padv-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.padv-filter .padv-lb { width: 56px; flex: none; }
.padv-add { display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 2px 2px; }
.padv-add a, .padv-del, .padv-x { font-size: 11.5px; color: #2f6fed; cursor: pointer; user-select: none; }
.padv-x { margin-left: auto; color: #a0aab6; font-size: 15px; line-height: 1; padding: 0 4px; }
.padv-del { color: #c0392b; }
.padv-empty { font-size: 11.5px; color: #a0aab6; padding: 6px 2px; }
.padv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid #eef1f5; margin-top: 12px; padding-top: 12px; }
.padv-count { font-size: 12px; color: #1f2d3d; }
.padv-count b { color: #2f6fed; font-size: 15px; }
/* 0 命中时给「去掉哪条能有人」（2026-11-09 B2） */
.padv-tip { display: inline-block; margin-left: 10px; padding: 1px 8px; border-radius: 5px;
  background: #fff4e8; border: 1px solid #f6d3ae; color: #b96a16; font-size: 11.5px; }
.padv-tip b { color: #b96a16; font-size: 12px; }
/* 引用了已失效字段的条件（2026-11-09 C3）：显性标红，别静默换字段 */
.padv-cond.is-bad { background: #fdf3f2; border: 1px solid #f5c6c0; border-radius: 8px; padding: 6px; }
.padv-cond.is-bad .padv-s-field { border-color: #e0a39a; color: #c0392b; }
.padv-acts { display: flex; gap: 8px; }
/* 🆕 2026-11-09 相对时间范围：一个是「过去 [起] 天 — [止] 天」整体，别被 .padv-filter .padv-lb 的 56px 撑开 */
.padv-rel { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.padv-rel .padv-lb { width: auto; flex: none; }
.padv-i-day { width: 64px; }
.padv-dash { color: #a0aab6; font-size: 12px; }
.padv-badge { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 8px;
  background: #e8f3ff; color: #185fa5; font-size: 10.5px; line-height: 16px; }
@media (max-width: 760px) {
  .padv-rail { width: 30px; }
  .padv-s-sub, .padv-s-field { width: 112px; }
  .padv-i-val { width: 120px; }
}
/* ══ 🆕 2026-10-10 优惠卡券卡面（船长给的「分享券」图样式；三处共用，见 core/ui.js 的 tcCard）══
   顶部色带 + 居中大面值 + 副标题 + 规则行 + 胶囊按钮；颜色由行内 `--tc` 决定
   （会员卡天蓝 / 代金券亮绿 / 折扣券亮橙 / 抵用券亮紫 / 赠送会员亮粉） */
.tc-card { border-radius: 13px; overflow: hidden; background: #fff; border: 1px solid var(--border);
  display: flex; flex-direction: column; min-width: 0; }
.tc-card.dim { opacity: .55; filter: grayscale(1); }
/* 🆕 2026-10-23：不能用的券要**变灰**（原来只降透明度，颜色还在，看不出"这券用不了"） */
/* 色带＝类型图标 + **券名**（🆕 10-10：券名从卡身挪上来，"代金券"这类类型名改由图标+颜色表达）+ 状态 */
.tc-top { background: var(--tc); color: #fff; padding: 6px 10px; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; }
.tc-ico { width: 14px; height: 14px; flex: none; opacity: .95; }
.tc-tn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-top em { font-style: normal; font-size: 10.5px; font-weight: 400; opacity: .92; flex: none; }
.tc-bd { padding: 11px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; flex: 1; }
.tc-nm { font-size: 11.5px; color: var(--muted); }
.tc-face { font-size: 31px; font-weight: 700; color: var(--tc); line-height: 1; letter-spacing: -0.5px; }
.tc-face small { font-size: 16px; font-weight: 600; letter-spacing: 0; }
.tc-sub { font-size: 11.5px; color: #4a5568; line-height: 1.35; }
.tc-lines { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.tc-btn { margin-top: 3px; background: var(--tc); color: #fff; border: 0; border-radius: 999px;
  padding: 5px 20px; font-size: 11.5px; cursor: pointer; }
.tc-btn:hover { filter: brightness(.94); }
.tc-btn:disabled { background: #c8ced6; cursor: default; }
/* 🆕 2026-10-10 船长：「卡券剩余日期放在下方内容栏里」
   ＝贴在卡片最底、占满整宽的一条：左「剩 N 天」（最要紧那句）／右「至 到期日」。
   按紧急度整条变色（≤30 天橙、≤15 天红）—— 快过期的券扫一眼就能抓到。
   为什么不做在卡身里：混着券号排会交错，140px 窄卡上还会被折成两行。 */
.tc-due { display: flex; align-items: baseline; justify-content: space-between; gap: 2px 6px;
  flex-wrap: wrap; margin-top: auto; padding: 5px 7px; font-size: 10.5px; font-weight: 600;
  background: #f2f4f7; color: #6b7684; border-top: 1px solid rgba(0, 0, 0, .05); }
/* 🔴 两段都必须 nowrap：140px 的窄卡（优惠卡券墙）里「剩 1080 天」会被拆成「剩 / 1080 / 天」三行。
   配 flex-wrap ⇒ 放不下时整段换行，绝不拆字。 */
.tc-due span, .tc-due em { white-space: nowrap; }
.tc-due em { font-style: normal; font-weight: 400; opacity: .85; }
.tc-due-warn { background: #fdf3e0; color: #a86b12; }
.tc-due-hot { background: #fdecec; color: #c0392b; }
/* 开单弹窗里的「可用卡券」用同一套卡面，只是卡更窄（沿用原有的 .tt-cp-grid 网格） */
.tt-cp-grid .tc-bd { padding: 10px 9px 9px; }
.tt-cp-grid .tc-face { font-size: 25px; }
.tt-cp-grid .tc-btn { padding: 5px 14px; font-size: 11.5px; margin-top: 2px; }
/* 「优惠卡券」页：左卡券区（可收起）+ 右原有列表 */
/* 会员卡券三态页签（2026-11-13 船长）：主界面只显示未到期未使用的彩色卡券 */
.mc-state-tabs, .mp-state-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.mc-state-tabs { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; }
.mc-state-tabs a, .mp-state-tabs a { padding: 5px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.mc-state-tabs a.on, .mp-state-tabs a.on { background: var(--primary); color: #fff; border-color: transparent; font-weight: 600; }
.mc-state-tabs a i, .mp-state-tabs a i { font-style: normal; font-size: 11px; margin-left: 5px; opacity: .85; }
.mc-state-hint { margin-left: auto; font-size: 11.5px; color: var(--muted); }
@media (max-width: 760px) { .mc-state-hint { display: none; } }
.mc-split { display: flex; gap: 14px; align-items: flex-start; }

/* ═══ 会员卡券 · 三级卡片（2026-11-13 船长重排：大类卡片 → 卡种卡片 → 患者列表） ═══ */
.mc3-lv2 { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.mc3-k2 { flex: 0 0 auto; min-width: 132px; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.mc3-k2:hover { border-color: #bcd8ea; }
.mc3-k2.on { border-color: var(--kc, var(--primary)); background: var(--primary-soft); box-shadow: 0 2px 8px rgba(0, 160, 232, .10); }
.mc3-k2 b { display: block; font-size: 13px; color: var(--text); font-weight: 600; }
.mc3-k2 em { font-style: normal; font-size: 19px; font-weight: 700; color: var(--kc, var(--primary)); line-height: 1.2; }
.mc3-k2 small { color: var(--muted); font-size: 11.5px; }

.mc3-split { display: flex; gap: 12px; align-items: flex-start; }
.mc3-lv3 { flex: 0 0 268px; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mc3-lv3h { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--muted); }
.mc3-lv3b { max-height: 560px; overflow: auto; padding: 8px; }
.mc3-k3 { display: flex; align-items: center; gap: 10px; padding: 9px 11px; margin-bottom: 7px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s; }
.mc3-k3:hover { border-color: #bcd8ea; background: #fafdff; }
.mc3-k3.on { border-color: var(--kc, var(--primary)); background: var(--primary-soft); }
.mc3-dot { width: 8px; height: 34px; border-radius: 6px; flex: none; background: var(--kc, #ffb454); }
.mc3-nm { flex: 1; min-width: 0; }
.mc3-nm b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc3-nm small { display: block; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc3-cnt { flex: none; text-align: right; }
.mc3-cnt b { display: block; font-size: 15px; color: var(--primary); line-height: 1.2; }
.mc3-cnt small { font-size: 11px; color: var(--muted); }

.mc3-pane { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mc3-paneh { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.mc3-paneh b { font-size: 13.5px; }
.mc3-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #fff3e2; color: #b45309;
  border: 1px solid #f3d9a6; }
.mc3-hint { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.mc3-paneb { max-height: 560px; overflow: auto; }
.mc3-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mc3-tbl th, .mc3-tbl td { padding: 8px 10px; border-bottom: 1px solid #f0f4f8; text-align: left; white-space: nowrap; }
.mc3-tbl th { background: #f8fafc; color: var(--muted); font-weight: 500; font-size: 11.5px;
  position: sticky; top: 0; z-index: 1; }
.mc3-tbl tbody tr { cursor: pointer; }
.mc3-tbl tbody tr:hover { background: #fafdff; }
.mc3-st { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #e8f7ee; color: #15803d; }
.mc3-st.used { background: #eef2f7; color: #5b6b7c; }
.mc3-st.exp { background: #fdecec; color: #b91c1c; }
.mc3-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 12.5px; }
/* 卡种卡片上的「修改」：平时隐藏，hover / 选中时出现（不抢人数那块的视觉） */
.mc3-edit { flex: none; width: 22px; height: 22px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; color: var(--muted); font-size: 12px; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, border-color .15s; }
.mc3-k3:hover .mc3-edit, .mc3-k3.on .mc3-edit { opacity: 1; }
.mc3-edit:hover { color: var(--primary); border-color: var(--primary); }

/* 新建 / 修改券种弹窗 */
.mc3f { display: flex; flex-direction: column; gap: 10px; }
.mc3f-row { display: flex; align-items: center; gap: 10px; }
.mc3f-row > label { flex: none; width: 84px; font-size: 12.5px; color: var(--muted); }
.mc3f-row input, .mc3f-row select { padding: 5px 9px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; }
.mc3f-seg { display: flex; gap: 6px; }
.mc3f-seg button { padding: 5px 14px; border: 1px solid var(--border); border-radius: 7px; background: #fff;
  font-size: 12.5px; cursor: pointer; color: #5b6b7c; }
.mc3f-seg button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.mc3f-pick { display: flex; gap: 6px; }
.mc3f-pick input { flex: 1; min-width: 0; }
.mc3f-hits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; max-height: 120px; overflow: auto; }
.mc3f-hit { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 3px 10px;
  font-size: 12px; cursor: pointer; color: #3d4b5c; }
.mc3f-hit:hover { border-color: var(--primary); color: var(--primary); }
.mc3f-hit em { font-style: normal; color: var(--muted); margin-left: 4px; }
.mc3f-sel { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mc3f-chip { display: inline-flex; align-items: center; gap: 4px; background: #eef6fc; color: #14618f;
  border: 1px solid #cfe6f5; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.mc3f-chip em { font-style: normal; color: #6b8ba0; }
.mc3f-chip a { cursor: pointer; color: #8aa4b6; font-weight: 700; }
.mc3f-tip { font-size: 11.5px; color: #b45309; background: #fff8ed; border: 1px solid #f5dfbd;
  border-radius: 8px; padding: 7px 10px; }
/* 三页签版：页签条 / 阶梯档位 / 复选框行 */
.modal.modal-mc3f { width: min(880px, 96vw); }
.mc3f-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.mc3f-tabs button { border: 0; background: transparent; padding: 7px 14px; font-size: 13px; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mc3f-tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.mc3f-step { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12.5px; }
.mc3f-step input { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; }
.mc3f-del { width: 24px; height: 24px; border: 1px solid var(--border); background: #fff; border-radius: 6px;
  color: #b91c1c; cursor: pointer; line-height: 1; }
.mc3f-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.mc3f textarea { padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px;
  font-family: inherit; resize: vertical; }
.mc3f-row > label { width: 96px; }
/* 🆕 2026-11-13 单页版（船长：一页显示全部信息，不再切页签）
   三段分区竖排：基本信息 / 权益设置 / 使用限制；宽度 980 让「券名 + 类型」一行放下。
   颜色由容器上的 --kc 驱动（代金券蓝 / 折扣券橙 / 项目抵用券绿），标题色条、选中态、保存键同源。 */
.modal.modal-mc3f { width: min(980px, 97vw); }
.mc3f-1p { gap: 10px; max-height: 72vh; overflow-y: auto; padding-right: 4px; }
.mc3f-sect { border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow: hidden; }
.mc3f-sect > h4 { margin: 0; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: #33475b;
  background: #f7f9fc; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 7px; }
.mc3f-sect > h4::before { content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: var(--kc, #2E86D9); flex: none; }
.mc3f-body { padding: 10px 12px; }
.mc3f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 18px; }
.mc3f-f { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc3f-f > label { flex: none; width: 84px; font-size: 12.5px; color: var(--muted); }
.mc3f-f input:not([type=checkbox]), .mc3f-f select, .mc3f-f textarea {
  flex: 1; min-width: 0; padding: 5px 9px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; }
.mc3f-f textarea { width: 100%; font-family: inherit; resize: vertical; }
.mc3f-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #3d4b5c; }
.mc3f-hint { font-size: 11.5px; color: #94a3b8; line-height: 1.35; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 复选框文字不许折行：「仅会 / 员可领」那种断句比省略更难读 */
.mc3f-chk { white-space: nowrap; flex: none; }
/* 结算口径说明（弹窗里只读，改在卡券页顶部） */
.mc3f-note { font-size: 11.5px; color: #5a6b7c; background: #f6f9fd; border: 1px dashed #d8e4f0;
  border-radius: 7px; padding: 6px 9px; line-height: 1.5; }
/* 会员卡 × 券 结算口径条（全院一套，仅管理员/店长可改） */
.mc3-rule { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px;
  background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.mc3-rule-k { font-size: 12.5px; font-weight: 600; color: #33475b; flex: none; }
.mc3-rule-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.mc3-rule-opts button { border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 3px 12px; font-size: 12.5px; color: #3d4b5c; cursor: pointer; }
.mc3-rule-opts button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.mc3-rule-opts button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.mc3-rule-opts button:disabled { opacity: .55; cursor: default; }
.mc3-rule-d { font-size: 11.5px; color: #6b7684; }
.mc3-rule-lock { font-size: 11px; color: #b45309; background: #fff8ed; border: 1px solid #f5dfbd;
  border-radius: 999px; padding: 1px 8px; }
.mc3f-tag { font-size: 11.5px; color: #fff; border-radius: 999px; padding: 1px 9px; margin-left: 6px;
  vertical-align: 1px; font-weight: 500; }
/* 类型按钮 / 抵扣方式按钮：选中色跟分类走（#fType）或系统主色（#fCashMode） */
#fType button.on { border-color: var(--kc, var(--primary)); color: #fff; background: var(--kc, var(--primary)); font-weight: 600; }
.mc3f-seg button { font-size: 12.5px; }
@media (max-width: 820px) {
  .mc3f-grid { grid-template-columns: 1fr; }
  .mc3f-f > label { width: 76px; }
  .mc3f-1p { max-height: 66vh; }
}
@media (max-width: 820px) {
  .mc3-split { flex-direction: column; }
  .mc3-lv3 { flex: none; width: 100%; }
  .mc3-lv3b { max-height: 260px; }
  .mc3-hint { display: none; }
}
.mc-cards { flex: none; width: 292px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px;
  max-height: 72vh; overflow: auto; padding-right: 4px; }
.mc-cards.hide { display: none; }
.mc-main { flex: 1; min-width: 0; }
.mc-cards .tc-face { font-size: 25px; }
.mc-cards .tc-bd { padding: 10px 9px 9px; }
.mc-cards .tc-btn { padding: 5px 14px; font-size: 11.5px; }
/* 卡券墙的卡只有 140px ⇒ 底栏「剩 N 天 / 至 日期」两段最容易挤成两行，这里再收一点内边距 */
.mc-cards .tc-due { padding: 5px 6px; gap: 2px 4px; }
.mc-toggle { margin-right: 8px; }
.vset-head, .vset-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 50px 104px 76px; align-items: center; gap: 6px; padding: 7px 14px 7px 10px; font-size: 13px; }
/* 🆕 2026-10-09 照 E看牙「自定义列设置」补：显示方式（全部/自定义）+ 固定字段 / 非固定字段分区 + 序号 */
.vset-mode { font-size: 13px; margin: 2px 0 10px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vset-mode label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
/* 🔴 全局 input 是 width:100% ⇒「显示方式」里的 radio 会被撑成整行、把「自定义」三个字挤成竖排
   （2026-10-10 在「今日工作」的看板设置里实测到）—— 单选框必须显式钉死尺寸。 */
.vset-mode input[type="radio"] { flex: none; width: 14px; height: 14px; accent-color: var(--primary); }
.vset-sec { font-size: 13px; font-weight: 600; margin: 12px 0 6px; display: flex; align-items: center; gap: 8px; }
.vset-sec em { font-style: normal; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.vset-fix { border: 1px dashed var(--border); border-radius: 8px; padding: 7px 12px; font-size: 13px; color: var(--muted); background: #fafbfb; }
.vset-allctl { margin-left: auto; font-weight: 400; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.vset-no { color: var(--muted); font-size: 12px; text-align: right; }
.vset-head { background: #f5f7f6; color: var(--muted); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.vset-row { border-top: 1px solid var(--border); background: #fff; }
.vset-row.is-nodata-lite { background: #fafbfb; color: var(--muted); }
.vset-row.dragging { opacity: .45; }
.vset-row.over { box-shadow: inset 0 2px 0 var(--primary); }
.vset-name { cursor: grab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vset-name em { font-style: normal; font-size: 11px; color: #a9b0ae; border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; margin-left: 6px; }
.vset-chk { text-align: center; }
.vset-chk input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
/* 🆕 2026-10-14「患者信息字段配置」专用：那一版每行只输出 4 个格子，而 .vset-row 的 5 列是给
   「显示信息设置」留了 34px 的拖拽柄列 ⇒ 字段名被挤进 34px，实测全被截成「病…」「患…」「出…」。
   这里显式改成 4 列（特异性更高，不受文件里谁先谁后影响）。 */
.vset-head.pd-fld, .vset-row.pd-fld { grid-template-columns: minmax(0, 1fr) 50px 104px 76px; }
/* 「昵称」那一行：名称右边直接跟一个输入框（改的是当前患者的昵称，随保存写回） */
.vset-name.has-in { display: flex; align-items: center; gap: 8px; overflow: visible; white-space: nowrap; cursor: default; }
/* 🔴 全局有 input{width:100%} ⇒ 这里必须显式写回 auto，否则输入框会把整格撑爆 */
.vset-name.has-in input { flex: 1; width: auto; min-width: 120px; max-width: 240px; padding: 3px 8px; font-size: 12.5px; }
.vset-row.is-nick { background: #f6fafd; }
/* 🆕 2026-10-10 患者昵称（来自 E看牙 姓名里原来的括号内容）：比名字小一号、颜色浅，跟在名字后面。
   长昵称在渲染时已截断（patNick），鼠标停上去看全文。 */
.pat-nick { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: #95a1b0; }
/* 🆕 2026-10-14 站内提示弹窗（提成归属被改时弹给「第一个人」） */
.nt-list { max-height: 46vh; overflow: auto; margin: 4px 0 2px; }
.nt-item { padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; line-height: 1.6; }
.nt-item:first-child { border-top: 0; }
.pd-name .pat-nick { font-size: 12.5px; margin-left: 8px; }
/* 🆕 2026-10-10「今日工作」的看板设置照参考图改成**网格卡片**（每行 4 张：☑ + 名称 + 右上角序号）。
   与患者管理那版（行列表）并存、互不影响：行列表用 .vset-row，网格用 .vg-item。 */
.vset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 2px 0 4px; }
.vg-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; }
.vg-item:hover { border-color: #cfe0ff; }
.vg-item.on { border-color: #cfe0ff; background: #f7fbff; }
.vg-item.dragging { opacity: .45; }
.vg-item.over { box-shadow: inset 0 2px 0 var(--primary); }
/* 🔴 全局 input 是 width:100% ⇒ 网格里的复选框必须显式钉死尺寸，否则会把文字挤成竖排（这条踩过多次） */
.vg-item input { flex: none; width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.vg-t { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vg-no { position: absolute; top: 3px; right: 7px; font-style: normal; font-size: 10.5px; color: #b8c2cd; }
.vset-aln, .vset-ord { display: flex; gap: 4px; }
.vset-aln .aln { width: 32px; height: 26px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--text); }
.vset-aln .aln.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.vset-ord .mv { width: 28px; height: 26px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; color: var(--text); }
.vset-ord .mv:disabled { opacity: .35; cursor: default; }
/* 🆕 2026-10-15「功能选项卡显示」整块重排版（船长截图：页签名全被截成「患…」「会…」「就…」）
   🔴 根因：`.vset-row` 那 5 列是给「显示信息设置」留的 —— **首列 34px 是序号/拖拽柄列，第二列才是名称**；
      而「功能选项卡显示」每行只输出 4 个格子（名称/显示/状态/顺序）⇒ 名称被塞进 34px 那一列。
   ⇒ 这里按 4 列重排，且用 .modal-tabset 限定作用域，绝不动「显示信息设置」那一版（它仍是 5 列）。
   🔴 作用域靠 `.modal-tabset` 前缀（特异性更高），不受「同权重后写的赢」影响。 */
.modal.modal-tabset { width: min(900px, 96vw); }
/* 🆕 2026-11-13：多一列「可见岗位」（在状态与顺序之间）⇒ 这里改成 5 列 */
.modal-tabset .vset-head, .modal-tabset .vset-row { grid-template-columns: minmax(0, 1fr) 56px 84px 150px 84px; }
/* 「可见岗位」那一格：一颗胶囊按钮，点开是 8 个岗位的勾选集 */
.vset-roles { min-width: 0; text-align: center; }
.rolechip { max-width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 2px 10px; font-size: 12px; color: #4a5568; cursor: pointer; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.rolechip:hover { border-color: var(--primary); color: var(--primary); }
.rolechip.on { border-color: #b9d3f5; background: #eef5ff; color: #1657b3; }
/* 岗位弹层：挂 body + position:fixed（弹窗可能带 transform，fixed 会被带偏 ⇒ 只能挂最外层） */
.rolepop { position: fixed; z-index: 10050; width: 210px; background: #fff; border: 1px solid #dde4ee;
  border-radius: 10px; box-shadow: 0 10px 28px rgba(16,32,48,.18); padding: 9px 10px 8px; }
.rolepop-h { font-size: 12px; color: var(--muted); padding: 0 2px 6px; }
.rolepop-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.rolepop-i { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text);
  padding: 3px 4px; border-radius: 6px; cursor: pointer; }
.rolepop-i:hover { background: #f5f8fc; }
/* 🔴 全局 input{width:100%} ⇒ 这些 checkbox 必须显式定宽，否则会把整格撑满 */
.rolepop-i input[type=checkbox] { flex: none; width: 14px; height: 14px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.rolepop-f { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 6px; border-top: 1px solid #eef1f6; }
.rolepop-f .muted { font-size: 11px; }
.rolepop-f .btn { height: 24px; padding: 0 9px; font-size: 12px; }
.modal-tabset .vset-wrap { max-height: 58vh; }
/* 名称列恢复正常字号（原来挤在 34px 里，字号再正常也没用）；em 徽标「待开发」保持原样 */
.modal-tabset .vset-name { font-size: 13.5px; }
.modal-tabset .vset-row:hover { background: #f8fbfa; }
/* 🆕 2026-11-13 管理员专用：允许其他岗位自己调页签（全局开关） */
.vset-allow { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; padding: 8px 10px;
  border: 1px solid #e3e8ef; border-radius: 8px; background: #f7f9fc; font-size: 12.5px; color: #414b5a; }
/* 🔴 全局有 input{width:100%}（见 .vset-row 那条教训）⇒ 这个 checkbox 必须显式定宽，否则撑满整行 */
.vset-allow input[type=checkbox] { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.modal-tabset .vset-row.is-nodata-lite:hover { background: #f3f6f5; }
/* 状态：裸文字 → 淡色胶囊，一眼能扫（可用=绿、待开发=琥珀、无权限=灰） */
.modal-tabset .pd-tabstate { display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; line-height: 1.7; white-space: nowrap; background: #eef5f0; color: #3d7f60; }
.modal-tabset .pd-tabstate.is-soon { background: #f6f1e6; color: #94814a; }
.modal-tabset .pd-tabstate.is-noperm { background: #f1f2f2; color: #8b9498; }
@media (max-width: 640px) {
  .modal-tabset .vset-head, .modal-tabset .vset-row { grid-template-columns: minmax(0, 1fr) 46px 78px 72px; }
  .modal-tabset .vset-name { font-size: 13px; }
}
.pat-body { display: flex; gap: 14px; align-items: flex-start; }
/* 🆕 2026-10-28 患者列表头像（男蓝/女粉/性别未填绿；四档年龄换脸） */
.pat-av { display: inline-flex; vertical-align: -9px; margin-right: 8px; }
.pat-av svg { display: block; border-radius: 50%; }
/* 头像图不再圆裁：图片本身是「人物撑满的方形」，再套圆就变成圆中圆 */
.pat-av img { display: block; border-radius: 0; }
.pat-name b { vertical-align: middle; }
.pat-cats { width: 132px; flex: 0 0 132px; display: flex; flex-direction: column; gap: 2px; }
.pat-cats .cat { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.pat-cats .cat:hover { background: var(--primary-soft); }
.pat-cats .cat.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pat-cats .cat b { font-weight: 600; color: var(--muted); }
.pat-cats .cat.active b { color: var(--primary); }
.pat-cats .cat.muted { color: #b7bfc7; cursor: not-allowed; }
.pat-cats .cat.muted:hover { background: transparent; }
.pat-table-wrap { flex: 1; min-width: 0; overflow-x: auto; }
.pat-tbl { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 13px; }
.pat-tbl th { text-align: left; color: var(--muted); font-weight: 500; padding: 9px 8px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.pat-tbl td { padding: 10px 8px; border-bottom: 1px solid #f0f3f5; }
.pat-tbl tbody tr:hover { background: #f8fbfa; }
.pat-name { cursor: pointer; }
.pat-name b { color: var(--primary); }
.pat-name:hover b { text-decoration: underline; }
.pat-tags .tag { margin-right: 4px; }
.pat-ops { white-space: nowrap; }
.pat-ops a { color: var(--primary); cursor: pointer; margin-right: 10px; font-size: 13px; }
.pat-ops a:hover { text-decoration: underline; }
.pat-count { color: var(--muted); font-size: 12px; padding: 10px 2px; }
.pat-menu { position: fixed; z-index: 300; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.16); padding: 6px; min-width: 120px; }
.pat-menu a { display: block; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.pat-menu a:hover { background: var(--primary-soft); }
.pat-menu a.danger { color: var(--danger); }

/* 手机端才出现的顶栏退出入口 —— 🗑 2026-10-03 顶栏撤销后已无用（手机端「退出登录」在底部
   标签栏的「更多」弹窗里，`#tbOut`） */

/* ↓↓↓ 手机端（≤760px）适配统一放在文件末尾的「手机端适配」段落，
   避免被后面模块补充样式里的同名基础规则覆盖 ↓↓↓ */
@media (max-width: 760px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .sidebar { width: 64px; }
  /* 只隐藏文字，保留图标（原来 font-size:0 会把 emoji 一起藏掉） */
  /* 🔴 2026-10-21 竖排后：文字和二级箭头包在 .txrow 里 ⇒ 要隐藏**整个 .txrow**，
     只藏 .tx 会留下一根孤零零的箭头。 */
  .sidebar nav a .txrow { display: none; }
  .sidebar nav a .tx { display: none; }
  .sidebar nav a { font-size: 0; }
  .sidebar nav a .ico { font-size: 19px; }
  /* 🗑 2026-10-05：这两条原来是把侧栏顶部文字品牌区在窄屏缩成一个 🦈 emoji；
     品牌已迁到顶部横栏的 logo 图（.appbar-brand img），所以整段作废。
     另注：这一段（≤760px 的 64px 图标栏）在更靠后的「手机端适配」段里**已被 .sidebar{display:none} 取代**，
     属于历史遗留，留着只为改动可比对。 */
  .sidebar nav a { text-align: center; padding: 12px 6px; }
  .sidebar .foot { display: none; }
  .form-grid, .kv { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ============ 模块化前端补充样式（阶段1）============ */
/* 🗑 2026-10-03：`.topbar` / `.topbar-right` / `.tb-brand` 三条已删 —— 顶栏整行撤销，
   分院下拉移进左侧栏（🔵 2026-10-10 船长又把它搬去**顶栏右上角**、并与账号区融成一块，
   见 `.appbar-user .me-clinic`），账号信息回左侧栏底部。 */
/* 🆕 2026-10-09 船长：「点击一级菜单增加右侧滑出动画，右侧增加阴影增强滑出的卡片立体感」。
   实测基准（CDP 量过，别照 CSS 字面值猜）：.sidebar x=0 w=140；.content-col x=140 w=1360、
   原先 position:static 且无阴影。left:36ms/40px 是船长定的（适中档）。
   🔴 两条阴影的分工：外阴影（-12px）**压在左邻的侧栏上**，营造"卡片浮在侧栏之上"；
      内阴影（inset）落在 #main 的 26px 左内边距里，是主要可见的那道边缘暗带，
      **不会盖到卡片本体**（卡片从 26px 才开始）。
   🔴 z-index:5 —— 必须低于顶栏（.appbar z-index:30）与二级浮层（z-index:60），高于侧栏。 */
/* ===== 🆕 2026-10-09 船长：二级菜单＝左侧竖排栏（全站统一）=====
   位置：一级菜单(140px) 右侧、内容区左侧；滑出时把内容区**往右推开**（三栏并排，不遮住表格）。
   🔴 宽度动画做在**外层**（0 → 158px），内层 `.subrail-in` 固定 158px ——
      动画直接做在内层会让里面每个字都跟着挤，滑出过程像"文字揉成一团再摊开"。
   🔴 阴影往**右**投（`8px 0 24px`）：左侧是深蓝侧栏，投影过去根本看不见；
      右侧才是浅色内容区，只有投这边才看得出"浮起一张卡片"。
   🔴 z-index:6 高于 .content-col(5)、低于顶栏(.appbar 30)；不设它阴影会被内容区盖掉。 */
/* 🔵 2026-10-09 船长：「只保留一个**快速的**弹出+推动动画」⇒ 时长定为 160ms。
   🔵 2026-10-09 船长：「开始动画的时候，主界面有点闪，修复一下」——
   根因（CDP 逐帧实测，不是猜）：原来把 `width` 做成 0→158px 的过渡，而 renderSubRail 排在
   fn(main) **之后** ⇒ 新页面内容先按**旧宽度(1360)**渲染了一帧，随后 160ms 内被逐帧挤窄
   （实测内容高度 3297 → 3319，中途发生换行跳变）⇒ 看着就是"内容先闪一下宽版、再被挤"。
   ⇒ 改法：**宽度不再过渡**（瞬时到位 ⇒ 内容一出生就是最终宽度，零重排、零闪帧），
      动画全部交给 `clip-path`（纯绘制裁剪，**不触发任何布局**）：
        · 展开：宽度当场 158px，clip-path 从「右侧裁掉 100%」→「不裁」⇒ 二级栏从左侧**揭开**，
                视觉上仍是"从一级菜单右侧滑出"（阴影跟着一起揭开，更自然）。
        · 收起：先反向裁掉（.closing），动画播完再摘 .on 让宽度归零 —— 见 app.js 的 railClose()。
      「无二级菜单时瞬收」天然满足：宽度本来就无过渡。
   🔴 别再把 width 写回过渡 —— 那会让内容区逐帧重排，「闪」立刻复发（船长报的就是这个）。 */
.subrail { flex: none; width: 0; overflow: hidden; background: var(--panel);
  position: relative; z-index: 6; clip-path: inset(0 100% 0 0);
  transition: clip-path .16s ease-out; }
.subrail.on { width: var(--rail-w); box-shadow: 8px 0 24px rgba(16, 32, 56, .10); clip-path: inset(0 0 0 0); }
/* 收起方向：把竖栏裁回去（等动画播完，app.js 的 railClose() 才摘 .on、宽度归零） */
.subrail.on.closing { clip-path: inset(0 100% 0 0); transition: clip-path .16s ease-in; }
/* ── 二级栏收纳（船长 2026-11-04：「增加一个向左收纳的按键，放在中间或顶部」）─────────
   🔴 为什么是「宽度 14px 的细条」而不是 width:0 + 浮层按钮：
      .subrail 是一级菜单与内容区之间的 flex 子项，留 14px 就把把手放在原位，
      不会盖住左侧一级菜单（fixed 到 left:0 会压在一级菜单上面）。
   🔴 与旧版「悬停缩窄成图标栏」不同：这是**手动点击**才收，且不收成图标栏。
   ⚠️ 只在有二级菜单（.on）时收成 14px；没有二级的页面保持 0，不白占一条缝。 */
.subrail.on.folded { width: 14px !important; clip-path: none !important; box-shadow: none !important; }
.subrail.on.folded .subrail-in { display: none; }
.rail-edge { display: none; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 14px; height: 66px; padding: 0; border: 1px solid var(--border); border-left: 0;
  border-radius: 0 8px 8px 0; background: var(--panel); color: #8b97a6; font-size: 12px; line-height: 1;
  cursor: pointer; align-items: center; justify-content: center; }
.rail-edge:hover { background: #eef4fb; color: var(--primary); border-color: var(--primary-soft); }
.subrail.on.folded .rail-edge { display: flex; }
/* 栏内「收起」按钮：放在二级栏顶部，右对齐一小颗 */
.subrail-hd { display: flex; justify-content: flex-end; padding: 0 2px 4px; }
.subrail-fold { border: 1px solid transparent; background: transparent; color: #9aa6b4; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 2px 5px; border-radius: 6px; }
.subrail-fold:hover { background: #f2f7fc; color: var(--primary); border-color: var(--border); }

.subrail-in { width: var(--rail-w); height: 100%; overflow-y: auto; padding: 10px 8px 18px; }
/* 分组小标题（系统设置用：常用配置 / 运维与接入） */
.subrail-g { font-size: 11px; color: #95a1b0; padding: 11px 9px 5px; }
.subrail a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px;
  font-size: 13px; color: #3d4b5c; cursor: pointer; white-space: nowrap; }
.subrail a:hover { background: #f2f7fc; color: var(--primary); }
.subrail a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
/* 🆕 2026-10-09 船长：「二级菜单的图标更新」⇒ 二级项前的线性图标（与一级 `.nico` 同一套画法）。
   🔴 尺寸固定 + `flex: none`：`.subrail a` 是 flex 行，不给 none 的话图标会被文字挤变形。 */
.sub-ico { width: 15px; height: 15px; flex: none; opacity: .7; }
.subrail a:hover .sub-ico { opacity: .95; }
.subrail a.active .sub-ico { opacity: 1; }
/* 管理员在竖栏里拖动二级项排序时的落点提示（原来这套标记在浮层里，随浮层一起搬过来） */
.subrail a.dragging { opacity: .4; }
.subrail a.drop-before { box-shadow: inset 0 2px 0 0 var(--primary); }
.subrail a.drop-after { box-shadow: inset 0 -2px 0 0 var(--primary); }

.content-col { flex: 1; display: flex; flex-direction: column; min-width: 0;
  position: relative; z-index: 5; background: var(--bg);
  box-shadow: -12px 0 28px rgba(16, 32, 56, .10), inset 12px 0 18px -12px rgba(16, 32, 56, .10); }
/* 🔵 2026-10-09 船长：「点击一级菜单，只保留一个快速的弹出+推动动画，现在好像看起来多了一个动画」
   ⇒ 原 `.content-col.pg-in`（内容区自己再滑 40px + 淡入）**已删除**：
      它和二级栏的宽度过渡（把内容区往右推开）叠在一起播，看着就是"多了一个动画"。
      现在整页只留**一个**动作：二级栏弹出 ⇒ 内容区被推开。
   ⚠️ 别再按旧日志把 .pg-in / @keyframes pgSlideIn 加回来。阴影（上面那条 box-shadow）保留。 */

/* 系统偏好「减弱动态效果」时不动 —— 无障碍，且不影响阴影 */
@media (prefers-reduced-motion: reduce) {
  .subrail { transition: none; }
}
/* 🔵 2026-10-10：`.badge-remote` 已随顶栏融合块改名为 `.me-remote`（见文件上方那条）——
   全仓已无代码引用它（`outputs/` 里那几个渲染样例自带内联样式，与本文件无关）⇒ 删掉，免得留成"改名只改了一半"的残留。 */
.badge-local { background: var(--primary-soft); color: var(--primary); padding: 2px 9px; border-radius: 20px; font-size: 12px; }

.link { color: var(--primary); cursor: pointer; }
.link:hover { text-decoration: underline; }
.sub-muted { color: var(--muted); font-size: 12px; }
.muted-line { color: var(--muted); font-size: 12px; line-height: 1.7; }
.card-h3 { font-size: 15px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
/* 🆕 2026-11-18：财务页「支付方式 / 分院收入 / 笔数趋势」三连卡在窄屏会被压到 179px
   （标题竖排、饼图图例压住饼本身，实测 820px）。加宽档在前、窄档在后，逐级折行。 */
@media (max-width: 1180px) { .rp-g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .rp-g3 { grid-template-columns: 1fr; } }
.grid2 .card, .grid3 .card { margin-bottom: 0; }

/* 页面级页签 */
.page-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.page-tabs a { padding: 9px 16px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; }
.page-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
/* 🆕 2026-10-05：系统设置 →「诊所设置」里的 logo 上传区 */
.brd-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.brd-prev { flex: none; min-width: 240px; max-width: 320px; padding: 12px; border: 1px dashed var(--border);
  border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; }
.brd-prev img { max-width: 100%; max-height: 64px; display: block; }
.brd-ops { flex: 1 1 320px; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.brd-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* 角色标签补充 */
.tag.manager { background: #e8f1ff; color: #2f6fd8; }
.tag.operation { background: #f0e9ff; color: #7b3fd8; }
.tag.finance { background: #e6f6ef; color: #1a9b6c; }
.tag.nurse { background: #fdeff6; color: #d8478f; }

/* 表单补充 */
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { width: auto; }
.check-list { font-size: 13px; line-height: 2.1; }
.check-list .ok { color: var(--ok); }
.check-list .todo { color: var(--muted); }

/* 患者选择器 */
.pick-hits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pick-chip { background: var(--primary-soft); color: var(--primary); border-radius: 20px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.pick-chip:hover { background: var(--primary); color: #fff; }
.pick-none { color: var(--muted); font-size: 12px; }
/* 🆕 2026-11-03：「无匹配患者」旁边的建档入口（只有传了 onCreate 的页面才出现） */
.pick-new { display: inline-flex; align-items: center; font-size: 12px; line-height: 1.7;
  padding: 1px 10px; border-radius: 20px; border: 1px dashed var(--primary);
  background: var(--primary-soft); color: var(--primary); cursor: pointer; white-space: nowrap; }
.pick-new:hover { background: var(--primary); border-style: solid; color: #fff; }

/* 牙位 chips */
.tooth-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tooth-chip { display: inline-block; background: #fdecec; color: var(--danger); border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 600; }

/* 牙位图补充 */
.chart-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-head .set-switch { display: flex; gap: 6px; }
.chart-head .chart-sel { margin-left: auto; color: var(--muted); font-size: 12px; }
.chart-quad-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 0 10px; }
/* ===== 🆕 2026-10-10 病历书写界面照 E看牙 参考图重排（船长定）=====
   ① 顶部两行：类型（初诊/复诊）+ 病历模板；医生/分院/就诊/复诊；
   ② 字段区＝「左固定标签列 + 右内容区」—— 参考图里标签在左、内容在右；
   ③ 五个带牙位的栏：内容区最左嵌一个**牙位小十字**（点它弹选牙卡片，见 .twp）；
   ④ 行右端两个小图标：▤ 本栏套用模板、＋ 展开本栏常用片段（默认收起，版面才干净）；
   ⑤ 「相关影像」＝一个 ⊕（关联当日照片），「标签」＝搜索输入 + 常用标签。
   🔴 字段的 id 仍是 `rf_<key>`（自动保存 / 提交 / 打印全靠它取值），只换了外壳结构。 */
.rf-hint { font-size: 11.5px; color: #a9b2bf; }
.rf-snips .btn { font-size: 11.5px; padding: 2px 8px; color: #8b95a3; border-style: dashed; background: #fbfcfe; }
.rf-snips .btn:hover { color: var(--primary); border-color: var(--primary); background: #fff; }

.rf-top { border: 1px solid var(--border); border-radius: 10px; background: #fbfcfe; padding: 2px 10px; margin-top: 8px; }
.rf-tl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.rf-tl + .rf-tl { border-top: 1px dashed #e8edf3; }
/* 字段名（船长 2026-10-11 定）：**左对齐 · 不加粗 · 13.5px · 必选星号在文字右边**；
   🔴 字段列**加宽到 152px**（不是压字号去塞）——「既往史与药物过敏史」9 个字 + 星号刚好一行，
      左右各留一点位置（左 4px 贴着表单内边距、右 10px 与内容区隔开）。
   ⚠️ 宽度只给 `.rf-body` 的字段列；顶部那行（类型/医生/就诊）是**横排**的，宽度得由内容决定。 */
.rf-lb { flex: none; text-align: left; font-size: 13.5px; color: var(--muted); line-height: 1.35;
  padding-left: 4px; padding-right: 10px; }
.rf-lb.on { color: var(--text); }
.rf-lb > i { font-style: normal; color: var(--danger); margin-left: 4px; }
.rf-body .rf-lb { width: 152px; }
/* 窄屏（≤760px）：152px 的标签列会吃掉半个屏幕 ⇒ 收窄，**字号不降**，长字段名折两行即可 */
@media (max-width: 760px) { .rf-body .rf-lb { width: 104px; } }
.rf-ro { font-size: 12.5px; color: var(--text); }
.rf-in { width: 172px; padding: 4px 8px; font-size: 12.5px; }

.rf-body { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.rf-body > .rf-row:last-child { border-bottom: 0; }
.rf-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 12px 7px 10px; border-bottom: 1px solid #f0f3f7; }
.rf-row > .rf-lb { padding-top: 7px; }
.rf-fd { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: flex-start; }
.rf-fd > textarea, .rf-fd > input { flex: 1; min-width: 0; }
/* 🔵 2026-10-11 船长：「文字内容较多，框线自适应高度」—— 高度由 JS（autoGrow）按内容撑，
   这里只管**不出现内部滚动条 / 不要拖拽把手**（两者与自动长高会打架）。
   最小高度在打开表单时按各栏 rows 的自然高度存进 `min-height`，所以空白栏的观感不变。 */
.rf-fd > textarea { resize: none; overflow: hidden; }
/* 🆕 2026-10-12 船长：「书写病历的辅助提醒文字在点击文字输入框后显示，不要一直显示在框下」——
   各栏那串「该写什么」的提示（主诉「部位＋症状＋时间，不得写诊断名词」、既往史「无亦须写「否认」…」、
   医嘱「术后交代与用药注意」等）原先靠 `placeholder` 常驻在框里，一打开表单满屏灰字
   ⇒ 现在改成**点进这一栏（聚焦）才出现**，不点就完全干净。
   🔴 用 `opacity` 不用 `color`：聚焦后浮出来的仍是浏览器原本那套灰字颜色，一个色值都不改。
   🔴 纯 CSS `:focus`，不动 JS —— 提示内容仍在 `F()` 的 ph 参数里，一处没动。
   🔴 只作用于 `.rf-fd` 里的输入（＝各栏正文）；顶部那排（类型/医生/就诊/复诊）在 `.rf-tl` 里，不受影响。
   ⚠️ 别改成 `display:none` 那类写法：placeholder 只能改样式，改不了"存不存在"。 */
.rf-fd > input::placeholder, .rf-fd > textarea::placeholder { opacity: 0; }
.rf-fd > input:focus::placeholder, .rf-fd > textarea:focus::placeholder { opacity: 1; }
/* 🔵 2026-10-11 船长：「可套用模板的单条文字，增加清空符号，点击清空单条文字」
   —— 每栏行右端一个 ✕＝**只清空这一栏**（`.off`＝这栏本来就没内容，点它没意义） */
.rf-ic.rf-clr { font-size: 12px; }
.rf-ic.rf-clr:hover { border-color: var(--danger); color: var(--danger); }
.rf-ic.rf-clr.off { opacity: .35; }
.rf-act { flex: none; display: flex; gap: 4px; padding-top: 3px; }
.rf-ic { width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 7px; background: #fff;
  color: var(--muted); font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.rf-ic:hover { border-color: var(--primary); color: var(--primary); }
.rf-ic.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
/* 牙位小十字（点它弹选牙卡片）：没选牙位＝一个空十字，选了就把号写在十字的上/下排 */
.rf-tw { flex: none; padding: 3px 6px; border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; }
.rf-tw:hover { border-color: var(--primary); }
.rf-tw.on { border-color: var(--primary); background: var(--primary-soft); }
/* ══ 多段书写区（2026-10-17 船长：「加号应当是新建一个书写区域」）══
   · 带牙位的五栏：每段 = 牙位十字 ｜ 书写框 ｜ 删除；组末「＋ 新增一段」
   · `.rf-fd.rf-segs` 把原来的**横排**改成**竖排**（其它单段栏不受影响）
   🔴 `.rf-fd > textarea` 那条只作用于**直接子元素**，段框是孙辈 ⇒ 这里必须自己写全套 */
.rf-fd.rf-segs { flex-direction: column; align-items: stretch; gap: 6px; }
.rf-seg { display: flex; align-items: flex-start; gap: 8px; }
.rf-seg > .rf-tw { flex: none; margin-top: 2px; }
.rf-seg > .rf-segta {
  flex: 1; min-width: 0; resize: none; overflow: hidden;
  border: 1px solid var(--border); border-radius: 9px; padding: 5px 9px;
  font: inherit; line-height: 1.5; background: #fff; color: inherit;
}
.rf-seg > .rf-segta:focus { outline: none; border-color: var(--primary); }
/* 🆕 2026-10-18 船长：「框内文字变浅，变小」
   多段框原先**漏**了单段框那条规范（`.rf-fd > textarea::placeholder{opacity:0}`）⇒ 一打开一片灰字。
   现在与单段一致：**平时不显示、聚焦才出现**；出现时也比正文更浅更小。 */
.rf-seg > .rf-segta::placeholder { opacity: 0; color: #b9c3d0; font-size: 12.5px; }
.rf-seg > .rf-segta:focus::placeholder { opacity: 1; }
.rf-seg > .rf-segdel { flex: none; margin-top: 1px; }
/* 🆕 2026-10-18 船长：「删除后面增加一个清空小扫帚」 */
.rf-seg > .rf-segclr { flex: none; margin-top: 1px; }
.rf-seg > .rf-segclr svg { width: 15px; height: 15px; }
.rf-segadd { display: flex; align-items: center; gap: 8px; padding-top: 1px; }
.rf-segadd > .btn { height: 26px; padding: 0 10px; font-size: 12.5px; }
.rf-row-multi > .rf-lb { padding-top: 8px; }
@media (max-width: 760px) {
  .rf-seg { gap: 6px; }
  .rf-seg > .rf-segdel { width: 24px; height: 24px; }
}
/* 🔵 2026-10-10 牙号改成**连着排一行**后（见文件下方「牙位十字线」那段），
   这里只需把整体压小一号；`.tcr-side` 那两个覆盖**已随旧结构删除**。
   🔵 2026-10-11 十字线改成「四象限网格」后，表单里这个只有 30px 高（每格 15px）⇒
      与横线的间距收到 3px，否则 11px 的字号 + 4px 间距会顶出格子。 */
.rf-tw .tcr { height: 30px; min-width: 108px; font-size: 11px; }
.rf-tw .tcr-ul, .rf-tw .tcr-ur { padding-bottom: 3px; }
.rf-tw .tcr-dl, .rf-tw .tcr-dr { padding-top: 3px; }
.rf-img { flex: none; width: 40px; height: 40px; border: 1px dashed #cfd8e3; border-radius: 10px; background: #fff;
  font-size: 18px; color: var(--primary); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rf-img:hover { border-color: var(--primary); background: var(--primary-soft); }
.rf-imgnote { font-size: 12px; color: var(--muted); padding-top: 11px; }
.rf-snip { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 8px 112px; }
.rf-snip.hidden { display: none; }
.rf-taglist { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 12px 2px 112px; }
.rf-taglist.hidden { display: none; }
.rf-taglist .btn { font-size: 11.5px; padding: 2px 9px; }

/* ══ 单条病历模板选择器（2026-10-28）══════════════════════════════════
   从病历录入弹窗里的「▤」打开：候选只列**这一栏**的句子，点一条插到光标处。
   🔴 类名统一用 rsn- 前缀，别用 rf-snip（那是「常用片段」的容器，重名会串样式）。 */
.rsn-top { padding: 0 2px 9px; }
.rsn-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rsn-chip { font-size: 12px; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; color: var(--muted); cursor: pointer; line-height: 1.5; }
.rsn-chip:hover { border-color: var(--brand); color: var(--brand); }
.rsn-chip.on { background: var(--primary-soft); border-color: var(--brand); color: #0b6ea8; }
.rsn-list { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.rsn-item { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; background: #fff; cursor: pointer; }
.rsn-item:hover { border-color: var(--brand); background: #fbfdff; }
.rsn-h { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: wrap; }
.rsn-t { font-size: 12.5px; font-weight: 600; color: var(--text); }
.rsn-tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--primary-soft); color: #0b6ea8; }
.rsn-src { font-size: 11px; color: #9aa6b5; }
.rsn-b { font-size: 11.5px; padding: 2px 9px; border: 1px solid var(--border); border-radius: 4px;
  background: #fff; color: var(--muted); cursor: pointer; }
.rsn-b:hover { border-color: var(--brand); color: var(--brand); }
.rsn-b.danger { color: var(--danger); border-color: #f0c8c6; }
.rsn-c { font-size: 12.5px; line-height: 1.65; color: #37475a; white-space: pre-wrap; word-break: break-word; }
.rsn-empty { padding: 22px 10px; text-align: center; color: #9aa6b5; font-size: 12.5px; line-height: 1.8; }
.rsn-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border); }
.rsn-edit { width: 100%; font-size: 12.5px; line-height: 1.6; resize: vertical; }
.rsn-ebar { display: flex; gap: 6px; margin-top: 6px; }

/* ══ 选牙卡片（点牙位小十字弹出）—— 船长：「照参考图，但略小、紧密」══
   参考图是 792×346；这里 596px 宽、格子 24px（参考图 38px），快捷按钮收成一行换行。 */
.modal-record .rec-right { position: relative; }
.twp { position: absolute; z-index: 200; width: 980px; background: #fff; border: 1px solid #dde5ee;
  border-radius: 12px; box-shadow: 0 12px 34px rgba(16, 32, 56, .16); padding: 8px 10px 9px; }
.twp-hd { display: flex; align-items: flex-start; gap: 5px; padding-bottom: 7px; border-bottom: 1px solid #eef2f7; }
.twp-qrows { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.twp-qrow { display: flex; gap: 4px; flex-wrap: wrap; }
.twp-qrow2 { padding-left: 38px; }
.twp-shl { font-size: 12px; color: var(--primary); margin-top: 2px; font-weight: 600; letter-spacing: .5px; }
.twp-q { font-size: 11.5px; padding: 3px 9px; border: 1px solid #dfe6ef; border-radius: 7px; background: #fff; color: #5a6675; }
.twp-q:hover { border-color: var(--primary); color: var(--primary); }
.twp-q.clr { color: var(--muted); }
.twp-x { border: 0; background: transparent; font-size: 15px; color: var(--muted); cursor: pointer; padding: 0 4px; line-height: 1; }
.twp-bd { display: flex; gap: 12px; align-items: flex-start; padding-top: 9px; }
.twp-ch { flex: none; }
.twp-tc { display: flex; align-items: center; gap: 3px; }
.twp-c { width: 30px; height: 28px; border: 1px solid #dfe6ef; border-radius: 5px; background: #fff; font-size: 14px;
  color: #7b8794; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.twp-c:hover { border-color: var(--primary); color: var(--primary); }
.twp-c.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.twp-c.off { opacity: .3; cursor: not-allowed; }
.twp-gap { width: 12px; flex: none; }
.twp-axis { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.twp-axis > i { flex: 1; height: 1px; background: #cfd8e3; }
.twp-axis > b { width: 1px; height: 14px; background: #cfd8e3; }
.twp-axis > span { font-size: 11px; color: #a8b3c0; }
.twp-side { flex: none; width: 150px; border: 1px solid #eef2f7; border-radius: 9px; overflow: hidden; }
.twp-sh { background: #f5f7fa; padding: 6px 8px; font-size: 11.5px; color: #7b8794; text-align: center; }
.twp-sg { padding: 7px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.twp-s { min-height: 30px; border: 1px solid #dfe6ef; border-radius: 5px; background: #fff; color: #5a6675;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; }
.twp-s b { font-weight: 500; font-size: 12px; line-height: 1.1; }
.twp-s em { font-style: normal; font-size: 9px; line-height: 1.1; color: #97a3b0; }
.twp-s:hover { border-color: var(--primary); color: var(--primary); }
.twp-s.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.twp-s.on em { color: #dbeaf7; }
.twp-ft { display: flex; align-items: center; gap: 7px; padding-top: 8px; margin-top: 8px; border-top: 1px solid #eef2f7;
  font-size: 11.5px; color: var(--muted); }
.twp-sup { height: 25px; padding: 0 10px; border: 1px solid #dfe6ef; border-radius: 5px; background: #fff; font-size: 11.5px; color: #5a6675; }
.twp-sup:hover { border-color: var(--primary); color: var(--primary); }
.twp-sup.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.twp-tog { width: 34px; height: 18px; border-radius: 99px; background: #d6dde6; position: relative; cursor: pointer; border: 0; flex: none; }
.twp-tog.on { background: var(--primary); }
.twp-tog > i { position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.twp-tog.on > i { left: 18px; }

/* 🆕 2026-10-08 页内线性图标（App.icon → <svg class="nico">）在各处的尺寸与对齐 */
.btn > .nico { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.apt-gear { display: inline-flex; align-items: center; justify-content: center; }
.apt-gear > .nico { width: 20px; height: 20px; }
.ap-bar > .nico { width: 16px; height: 16px; flex: none; }
.rec-box-h > .nico { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.rf-ic > .nico { width: 14px; height: 14px; flex: none; }

/* 病历卡片 */
.rec-card { padding: 14px 16px; }
.rec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rec-line { display: flex; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.rec-line .k { color: var(--muted); flex: 0 0 56px; }
/* 🔵 2026-10-10（两次改动叠加，现状以本段为准）：官方数据包（xlsx）导入的那张病历卡片
   **已整体改用 `.eks-*` 三段式**（见文件下方「病历卡片 · 照 E看牙 重排」那段）。
   所以下面这批只服务**旧版式**的类已全部作废并删除：
     · `.rec-item`（一条「牙位 + 内容」）
     · `.rec-tw-t`（那条内容前面的**淡色牙位**——E看牙 没有这东西，牙位只由行首十字线表达）
     · `.rec-tw-g` / `.rec-tw-c`（左右分栏的牙位块）
     · `.rec-nil`（缺项显示「——」）
     · `.rec-card.ek-official .rec-v` / `.rec-card.ek-official .rec-line`
   🔴 `.rec-line`（**不带** `ek-official` 前缀）**仍在用** —— 旧病历卡片 `legacyRecCard` / `ekanRecCard`
      靠它排版，别顺手删掉。 */
/* 🆕 2026-10-10 病历页照 E看牙 重排（船长定）：[左侧时间轴] [病历卡片] [右侧元信息栏] */
.rec-row { display: flex; align-items: stretch; margin-bottom: 10px; }
.rec-axis { flex: 0 0 92px; padding: 12px 12px 0 2px; text-align: right; }
.rec-axis b { display: block; font-size: 12.5px; font-weight: 500; color: #5a6675; }
.rec-axis span { display: block; font-size: 12px; color: #95a1b0; margin-top: 2px; }
.rec-row > .rec-card { flex: 1; min-width: 0; margin: 0; }
.rec-aside { flex: 0 0 148px; padding: 12px 4px 0 12px; border-left: 1px solid #eef1f5;
  font-size: 11.5px; color: #4a5568; }
.rec-as-l { line-height: 1.95; }
.rec-as-l > span { color: #8a95a3; }
.rec-as-t { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.rec-as-t i { font-style: normal; border: 1px solid var(--border); border-radius: 5px; padding: 0 7px; font-size: 11px; }
/* 卡片头＝摘要行（浅蓝底，照参考图） */
.rec-card.ek-official { padding: 0; overflow: hidden; }
.rec-sum { display: flex; align-items: center; gap: 14px; background: #eaf4fd; padding: 7px 12px;
  font-size: 12.5px; color: #4a5568; }
.rec-sum-k { color: var(--primary); flex: none; }
.rec-sum-i { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-sum-a { color: var(--primary); cursor: pointer; flex: none; white-space: nowrap; }
.rec-sum .btn { flex: none; white-space: nowrap; }
.rec-card.fold .rec-body { display: none; }
.rec-body { padding: 10px 14px 12px; }

/* ══ 病历卡片 · 照 E看牙 重排（船长 2026-10-10）· 开始 ══
   🔴 前缀 `eks-` 是这一段专用的 —— 起名前查过：style.css 里 0 处同名。
      ⚠️ 别用 `ek-body`（那是 payments.js 收费单卡片的），也别借用 `ek-*` 其它已有名字。
   ⚠️ 作用域分两层：**照片块（.eks-ph/.eks-grid…）是三张卡片共用的**（官方包 / 抓取包 / 自建），
      所以它们**不加** `.ek-official` 前缀；只有"三列对齐"（.eks-seg）才是官方卡片专用。 */
.eks-ph { padding: 10px 0 2px; }
.eks-ph > .eks-k { color: var(--muted); margin-bottom: 6px; }
.eks-ph > .eks-tw { display: none; }
.eks-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.eks-cell { min-width: 0; }
.eks-grid img { width: 100%; height: 74px; object-fit: cover; display: block;
  border-radius: 6px; border: 1px solid #eef1f6; background: #f7f9fb; cursor: zoom-in; }
.eks-noimg { height: 74px; border-radius: 6px; border: 1px solid #eef1f6; background: #f7f9fb;
  display: flex; align-items: center; justify-content: center; color: #b6bfca; font-size: 11px; }
/* 🆕 2026-11-10 关联影像的图是 E看牙 的带 token URL，过期就 403 ⇒ 图片隐藏、格子标「链接失效」，
   不至于留一个破图。 */
.eks-cell.bad img { display: none; }
.eks-cell.bad::before { content: '链接失效'; display: flex; align-items: center; justify-content: center;
  height: 74px; border-radius: 6px; border: 1px dashed #e3e9f0; background: #fafbfd;
  color: #b6bfca; font-size: 11px; }
.eks-d { font-size: 11px; color: var(--muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eks-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.eks-auto { font-size: 11.5px; color: var(--muted); }
.eks-none { color: var(--muted); font-size: 12.5px; padding: 2px 0; }

/* E看牙 官方卡片：三段式（标签列 84px ｜ 牙位列 92px ｜ 内容 1fr）
   🆕 2026-10-10 船长对照 E看牙 原始 JSON 定：**一个字段里的每一段各占一行**，
   行首配**这一段的**牙位十字线（见 records.js 的 ekanParts/seg）。所以：
   · 同一字段的**续行**加 `.cont` ⇒ 不画下分隔线（否则一条两段的记录会被横线从中间切开）
   · 横线只画在**该字段最后一行**的下方 ⇒ 字段之间才看得出一条分界 */
.rec-card.ek-official .eks-seg {
  display: grid; grid-template-columns: 84px 92px minmax(0, 1fr);
  align-items: center; column-gap: 8px; padding: 9px 0;
  border-bottom: 1px solid #f2f5f9;
}
.rec-card.ek-official .eks-seg.cont { border-bottom: 0; padding-bottom: 2px; }
.rec-card.ek-official .eks-seg:last-child { border-bottom: 0; }
.rec-card.ek-official .eks-k { text-align: right; color: var(--muted); }
.rec-card.ek-official .eks-tw { text-align: center; }
/* 正文按原样保留换行（E看牙 的字段里本来就有换行） */
.rec-card.ek-official .eks-v { min-width: 0; white-space: pre-wrap; }
/* 🆕 2026-10-16 与抓取包**统一**：多段字段改成「整组一个标签列」，标签相对**整组**垂直居中
   （船长：「口腔检查，诊断，治疗计划，这一数列标题应该是自适应上下居中」）。
   组内 `.eks-seg` 只剩两列（牙位 92px ｜ 正文 1fr）—— 84px＋gap 8px＋92px 与原三列总对齐一致。
   ⚠️ 两边（.ek-fetch / .ek-official）是各自独立的类，改一处**必须**改另一处。 */
.rec-card.ek-official .eks-grp { display: grid; grid-template-columns: 84px minmax(0, 1fr); column-gap: 8px; }
.rec-card.ek-official .eks-gk {
  grid-column: 1; grid-row: 1 / -1; align-self: center;
  text-align: right; color: var(--muted);
}
.rec-card.ek-official .eks-rows { grid-column: 2; grid-row: 1 / -1; min-width: 0; }
.rec-card.ek-official .eks-rows .eks-seg { grid-template-columns: 92px minmax(0, 1fr); }
/* 🆕 2026-11-10 与 ek-fetch 同一要求：无牙位的行不占 92px，正文从牙位左缘起 */
.rec-card.ek-official .eks-seg.notw { grid-template-columns: 84px minmax(0, 1fr); }
.rec-card.ek-official .eks-rows .eks-seg.notw { grid-template-columns: minmax(0, 1fr); }
.rec-card.ek-official .eks-ph.notw { grid-template-columns: 84px minmax(0, 1fr); }
.rec-card.ek-official .eks-ph {
  display: grid; grid-template-columns: 84px 92px minmax(0, 1fr);
  align-items: flex-start; column-gap: 8px; padding: 12px 0;
  border-bottom: 1px solid #f2f5f9;
}
.rec-card.ek-official .eks-ph > .eks-k { text-align: right; margin-bottom: 0; }
.rec-card.ek-official .eks-ph > .eks-tw { display: block; }
.rec-card.ek-official .eks-src { margin-top: 6px; }
.rec-card.ek-official .eks-src summary { cursor: pointer; color: var(--primary); font-size: 12.5px; }
.rec-card.ek-official .eks-src pre { max-height: 300px; overflow: auto; background: #0f1720; color: #d6e4f0;
  padding: 10px; border-radius: 8px; font-size: 11.5px; white-space: pre-wrap; }
/* 手机端：三列压窄、照片改 3 列（6 列在窄屏每张只剩 30px，看不清） */
@media (max-width: 760px) {
  .eks-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rec-card.ek-official .eks-seg,
  .rec-card.ek-official .eks-ph { grid-template-columns: 64px 64px minmax(0, 1fr); column-gap: 6px; }
  /* 「整组」结构窄屏也要收窄（见上方 .ek-official .eks-grp） */
  .rec-card.ek-official .eks-grp { grid-template-columns: 64px minmax(0, 1fr); column-gap: 6px; }
  .rec-card.ek-official .eks-rows .eks-seg { grid-template-columns: 64px minmax(0, 1fr); }
  /* 2026-11-10 无牙位行（`.notw`）窄屏也要收窄，否则上面这条 0-4-0 会把桌面规则盖掉 */
  .rec-card.ek-official .eks-seg.notw,
  .rec-card.ek-official .eks-ph.notw { grid-template-columns: 64px minmax(0, 1fr); column-gap: 6px; }
  .rec-card.ek-official .eks-rows .eks-seg.notw { grid-template-columns: minmax(0, 1fr); }
}
/* ══ 病历卡片 · 照 E看牙 重排 · 结束 ══ */
/* 自适应牙位小十字（船长 2026-10-10）：横线按牙数伸缩、牙号按象限落四角 */
/* 🔵 2026-10-10 病历里的牙位小十字改用全系统统一的 .tcr（见「牙位十字线」那段），
   原先那套 .ek-tw-*（把 FDI 两位号按象限贴四角）会互相压字，已整体删除。 */
/* 病历详情弹窗：左字段 / 右元信息栏（照 E看牙 病历页，船长 2026-10-10） */
.modal.modal-rec { width: min(960px, 96vw); max-height: 92vh; padding: 20px 22px; }
.rv-wrap { display: flex; gap: 18px; align-items: flex-start; }
.rv-main { flex: 1; min-width: 0; }
.rec-ctx { background: var(--primary-soft); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 6px; }
/* 🆕 2026-10-05 病历自动保存的状态胶囊（船长：「显示草稿状态，点击保存才显示已完成」） */
.rec-status { display: inline-block; margin-left: 10px; padding: 1px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 500; vertical-align: middle; }
.rec-status:empty { display: none; }
.rec-status.draft { background: #fff4e2; color: #8a5a10; }
.rec-status.done { background: #e5f4e5; color: var(--ok); }
.rec-status.err { background: #fdeaea; color: var(--danger); }
/* 草稿提示条：打开一份"自动保存过但没点保存"的病历时给的选择 */
.rec-draftbar { background: #fff8e8; border: 1px solid #f0dfb8; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 13px; line-height: 1.7; color: #8a5a10; }
.rec-draftbar-act { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.warn-line { background: #fdeaea; color: var(--danger); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-top: 8px; }
.warn-chip { background: #fdeaea; color: var(--danger); border-radius: 20px; padding: 2px 10px; font-size: 12px; margin-left: 6px; }
.confirm-detail { font-size: 13px; line-height: 1.9; color: var(--text); background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.assign-log { margin-top: 14px; }.assign-log pre { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 12px; margin-top: 6px; white-space: pre-wrap; font-family: inherit; }

/* 影像 */
.img-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { background: #f2f5f8; color: var(--muted); border-radius: 20px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.cat-chip.active, .cat-chip:hover { background: var(--primary); color: #fff; }
.img-item .meta .pat { margin-top: 3px; font-size: 12px; }

/* 统计 chips */
.chips-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mini-chip { background: #f2f5f8; border-radius: 8px; padding: 4px 10px; font-size: 12px; }
.mini-chip.warn { background: #fdeaea; color: var(--danger); }

/* 柱状条 */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 6px; }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar { width: 100%; background: linear-gradient(180deg, #4ab6f0, var(--primary)); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar-val { font-size: 12px; color: var(--primary); margin-top: 6px; font-weight: 600; }
.bar-label { font-size: 11px; color: var(--muted); }

/* 功能开关台 */
.flag-group { border-top: 1px solid var(--border); padding: 12px 0 4px; }
.flag-group:first-of-type { border-top: none; }
.flag-group-name { font-weight: 700; margin-bottom: 8px; }
.flag-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.flag-row:last-child { border-bottom: none; }
.flag-name { flex: 1; min-width: 200px; }
.flag-row.flag-sub { padding-left: 22px; background: #fbfcfd; }
.flag-row.flag-sub .flag-name { color: var(--muted); padding-left: 10px; border-left: 2px solid var(--border); }
.flag-row.flag-sub .flag-mode select { width: 110px; }
.flag-mode { display: flex; align-items: center; gap: 10px; }
.flag-mode select { width: 150px; }

/* ============ 预约图形化时间轴（阶段2）============ */
.apt-views { display: flex; gap: 4px; border: 1px solid var(--border); border-radius: 8px; padding: 3px; background: #fff; }
.apt-views .btn { border: none; }
/* 🆕 2026-10-03（船长照图定）：视图切换从顶部工具栏**下移到这一行**，紧挨图例与操作提示。
   `‹ ›` 也留在这一行 —— 周/月视图只有它俩能前后翻页（左侧月历的箭头翻的是月份）。 */
/* ⚠️ 2026-10-04：`.apt-viewbar` 已撤（视图切换挪进标题行，见上方的 .apt-gear 段）。
   看板的高度不再靠这里的固定值 —— `aptFitBoard()` 每次渲染后实测并写成 inline max-height。 */
.apt-hint { background: #143d36; color: #fff; border-radius: 8px; padding: 8px 14px; font-size: 13px; margin-bottom: 12px; }

/* 统计条 */
.apt-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.apt-stat { border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; min-width: 88px; cursor: pointer; background: #fff; }
.apt-stat .n { font-size: 20px; font-weight: 700; }
.apt-stat .l { font-size: 12px; color: var(--muted); }
.apt-stat-sum { cursor: default; background: #f8fafc; }

/* 状态配色（时间轴块 / 统计卡 / 标签共用）
   🆕 2026-11-03 船长给了一套参考配色：底色 / 边框 / 文字三色分开（这三行就是出厂值，
      与 appointments.js 的 APT_ST_DEF 必须一一对应；改一处就得改另一处） */
.st-unconfirmed { background: #f5f7fa; border-color: #d5dce5; color: #64748b; border-style: dashed; }
.st-wait { background: #e8f0fe; border-color: #7ea6f1; color: #2563eb; }
.st-confirmed { background: #e6f7ee; border-color: #7fd3a8; color: #15803d; }
.st-arrive { background: #fff3e0; border-color: #f0b870; color: #b45309; }
.st-treat { background: #f3eafe; border-color: #b98bea; color: #7c3aed; }
.st-done { background: #e8f7e9; border-color: #86ce8c; color: #2f7d32; }
.st-expired { background: #fdeee3; border-color: #f0a47a; color: #c2410c; }
.st-noshow { background: #fff0f0; border-color: #f5a3a3; color: #dc2626; }
.st-cancel { background: #eef1f5; border-color: #c3cbd6; color: #4b5563; }
.apt-stat.st-wait { border-width: 1px; }
.tag.已到店 { background: #fff4e2; color: var(--warn); }
.tag.诊疗中 { background: #efe3ff; color: #7b3fd8; }

/* 图例 */
.apt-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.apt-legend .lg { font-size: 12px; padding: 2px 10px; border-radius: 20px; border: 1px solid var(--border); }
.apt-legend .lg-off { background: repeating-linear-gradient(45deg, #f4f6fa, #f4f6fa 4px, #e9edf3 4px, #e9edf3 8px); }
.apt-legend .lg-leave { background: #f0f0f0; color: #6b7480; }
.apt-legend .lg-meet { background: #f2f5f8; color: var(--muted); }
/* 🗑 2026-10-03：`.lg-conf`（医生时间冲突）/ `.lg-room`（诊室撞车）两项已从图例行拿掉，
   样式一并删除（不跟普通排班图例混在一起）。冲突判据仍在预约块上：`.conflict` / `.roomconf`
   描边 + ⚠ + 块上「冲突」标 + hover 文字；含义说明挪进了齿轮（界面设置 → 标记含义）。 */

/* 主体布局 */
.apt-layout { display: flex; gap: 14px; align-items: flex-start; }
.apt-main { flex: 1; min-width: 0; }
.apt-side { width: 240px; flex: 0 0 240px; }
.apt-docpick { margin-bottom: 10px; }

/* 日历容器 */
/* 竖向不滚动：行高由 JS 按容器高度实算（aptFitCols 读 .cal-scroll 自身 clientHeight），
   全天格子正好铺满。.cal-scroll 默认 flex:1 撑满父列（预约页 .apt-main 已是 flex 列），
   🔴 2026-10-06 船长：去掉 66vh 硬兜底、不再依赖 JS 写 inline max-height —— 默认就自适应满高。 */
.cal-scroll { flex: 1 1 auto; min-height: 0; overflow-x: auto; overflow-y: hidden; max-height: none;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.cal-inner { display: flex; flex-direction: column; }
.cal-heads { display: flex; position: sticky; top: 0; z-index: 7; background: #f8fafc; border-bottom: 1px solid var(--border); }
/* 🔴 2026-11-18：齿轮统一成 28×28 后，56px 的首列放不下（28 + 3 + 「时间」22 = 53 > 44 可用宽）
   ⇒ 首列加宽到 66px，否则齿轮会把「时间」压出去。 */
.cal-corner { width: 66px; flex: 0 0 66px; font-size: 12px; color: var(--muted); padding: 8px 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 2px; }
/* 🆕 2026-10-05 船长（照截图）：① 「时间」二字**右移、与下面刻度（09:00）对齐**；② 左侧加齿轮。
   对齐原理：刻度 .cal-tick 是 `right:6px`，这个格子右 padding 也是 6px
   ⇒ 只要「时间」**右对齐**，两者右边缘天然齐平（**别拿 padding 试数值**：以后动刻度偏移就会错位）。
   字号取 11px＝与刻度同号，右边缘对齐后看着才是一条线。
   🔴 可用宽度只有 56-6-6=44px：齿轮 16 + 间隙 3 + 「时间」22 = 41px，刚好塞下；
      再往格子里加东西（图标/更长的字）必须先加宽 .cal-gutter 与 APT_GUTTER，否则会挤到换行。 */
.cal-corner .cal-ct { flex: 0 0 auto; white-space: nowrap; font-size: 11px; }
/* 齿轮：极简小按钮 —— 静默（不抢眼），hover 才上主色。它的分量远低于右边的医生列头。 */
/* 日历左上角那颗齿轮：尺寸/配色统一走 .set-ico（2026-11-18），这里只保留不参与收缩 */
.cal-cgear { flex: 0 0 auto; }
/* 列最小宽：默认 84px；医生多（≤12）且屏宽不够时由 JS 下调 --cal-col-min，尽量同屏不横滚 */
.cal-colhead { flex: 1 1 0; min-width: var(--cal-col-min, 84px); border-left: 1px solid var(--border); padding: 6px 6px; }
/* 昵称跟在名字后面（船长 9/21 定）；列窄到放不下时整段折到名字下一行 */
.cal-colhead .ch-name { font-weight: 600; font-size: 13px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; row-gap: 0; }
.cal-colhead .ch-real { flex: 0 0 auto; max-width: 100%; }
.cal-colhead .ch-nick { flex: 0 0 auto; max-width: 100%; font-weight: 400; font-size: 10px; color: var(--muted); }
.cal-colhead .ch-title { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 5px; }
.cal-colhead .ch-sub { margin-top: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cal-colhead .ch-shift { font-size: 11px; color: var(--muted); }
.cal-colhead .ch-badge { font-style: normal; font-size: 11px; border-radius: 20px; padding: 1px 7px; }
.cal-colhead .ch-warn { background: #fff4e2; color: var(--warn); }
.cal-colhead .ch-leave { background: #f0f0f0; color: #6b7480; }
.cal-colhead .ch-load { font-size: 11px; color: var(--primary); margin-top: 2px; }
/* 医生列多、屏宽不够时：改用整数宽固定列（JS 设 --cal-col-w），保证 ≤12 列同屏、不冒横向滚动条 */
.cal-scroll.cal-fit .cal-colhead, .cal-scroll.cal-fit .cal-colbody { flex: 0 0 var(--cal-col-w, 84px); min-width: 0; }
.cal-scroll.cal-fit .cal-colhead .ch-load, .cal-scroll.cal-fit .cal-colhead .ch-shift { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-scroll.cal-fit .cal-colhead { padding-left: 4px; padding-right: 4px; }
.cal-scroll.cal-fit .cal-colhead .ch-title { display: none; }
.cal-scroll.cal-fit .cal-colhead .ch-name { text-overflow: ellipsis; }
.cal-body { display: flex; }
.cal-gutter { width: 56px; flex: 0 0 56px; position: relative; }
.cal-tick { position: absolute; right: 6px; font-size: 11px; color: var(--muted); transform: translateY(-6px); }
/* 🆕 2026-10-05 船长：「优化 9:00 和 18:00 的时间显示」——
   刻度统一用 translateY(-6px) 在刻度线上"垂直居中"，于是**第一条**上半截被容器顶边裁掉、
   **最后一条**下半截探出容器底边，两头都只露半截（正好就是船长点的那两个时间）。
   ⇒ 首条改**顶对齐**、末条改**底对齐**，中间那些照旧居中。
   特异性 0,2,0 压过上面那条 0,1,0 ⇒ 不看文件顺序。 */
.cal-tick.tick-first { transform: none; }
.cal-tick.tick-last { transform: translateY(-100%); }
.cal-nowtime { position: absolute; right: 6px; font-size: 11px; color: var(--danger); font-weight: 600; transform: translateY(-6px); }
.cal-colbody { flex: 1 1 0; min-width: var(--cal-col-min, 84px); position: relative; border-left: 1px solid var(--border); }
.cal-slot { height: var(--cal-slot-h, 44px); border-bottom: 1px dashed var(--border); }
.cal-slot.off { background: repeating-linear-gradient(45deg, #f4f6fa, #f4f6fa 5px, #e9edf3 5px, #e9edf3 10px); }
.cal-slot.hover { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.cal-colbody.is-leave { background: #f7f8fa; }
.cal-leave-note { position: absolute; top: 40%; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.cal-meet { position: absolute; left: 3px; right: 3px; background: #f2f5f8; border: 1px dashed #c3ccd8; border-radius: 8px; font-size: 11px; color: var(--muted); display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px; }
.cal-nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 5; }
.cal-nowline::before { content: ''; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* 预约块 */
/* 🆕 2026-10-05 船长照参考图定（预约卡内容重排）：
   左侧竖条＝**状态色**（不是项目色了，见下面 .has-ic 那条的说明）；
   第 1 行患者姓名加粗放大 ↓ 之后依次是「项目 → 时间段（浅灰）→ 病历号（最下）」。
   🔴 左边框从 3px 加到 5px 才像参考图里那条"竖条"；`border-left-width` 会吃掉 5px 宽度，
      卡片是 left/right:3px 绝对定位的，宽度够用（并排分道时才会紧，见 .narrow）。 */
.cal-appt { position: absolute; left: 3px; right: 3px; border: 1px solid; border-left-width: 5px; border-radius: 8px; padding: 3px 6px; font-size: 12px; overflow: hidden; cursor: grab; line-height: 1.35; }
.cal-appt:hover { filter: brightness(.97); }
.cal-appt.dragging { opacity: .45; }
.cal-appt .a1 { font-weight: 600; display: flex; align-items: center; gap: 3px; min-width: 0; }
/* 姓名：加粗 + 放大（原来是跟时间/病历号挤在一行里的 12px） */
.cal-appt .a-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; }   /* 2026-11-13：左键点名字＝进患者主信息页（右键才是预约卡片） */
.cal-appt .a-name:hover { text-decoration: underline; }
/* 项目 / 时间段：都在"下方"，都走灰字；项目比时间略深一点点，保持能一眼分出主次 */
.cal-appt .a2 { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt .a3 { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
/* 病历号：最下那一行，比时间深（参考图里它就是最深的一行） */
.cal-appt.conflict { outline: 2px solid var(--danger); outline-offset: -2px; }
/* 2026-11-03 船长：左边那条是**状态色块**，必须是完整的一条（圆角），不能跟着变虚线。
   原来 border-style:dashed 把 5px 的左边框也切成了一段一段。 */
.cal-appt.offshift { border-style: dashed; border-left-style: solid; }
/* 同一医生同时段多位患者 → 横向并排共同占用（--lane 从 0 起，--lanes 为同道总数） */
.cal-appt.coop {
  right: auto;
  width: calc((100% - 6px) / var(--lanes) - 3px);
  left: calc(3px + (100% - 6px) / var(--lanes) * var(--lane));
  border-left-width: 2px;
  padding: 3px 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
}
/* 共同占用是「允许且预期」的状态，不是错误 → 用琥珀色而非危险红 */
.cal-appt.conflict.coop { outline-color: var(--warn); }
.cal-appt.coop .a-flag { background: var(--warn); }
/* 三道以上时块很窄，徽标会压住患者姓名 → 只保留描边，信息看悬停提示 */
.cal-appt.narrow .a-flag { display: none; }
.cal-appt .a-flag { position: absolute; top: 2px; right: 4px; background: var(--danger); color: #fff; border-radius: 20px; font-size: 10px; padding: 0 6px; }
/* 预约块底部「改占用时长」把手（鼠标/触屏通用） */
.cal-appt .a-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; touch-action: none; }
.cal-appt .a-resize::after { content: ''; display: block; width: 26px; height: 3px; margin: 2px auto 0; border-radius: 3px; background: rgba(0,0,0,.22); opacity: 0; transition: opacity .15s; }
.cal-appt:hover .a-resize::after { opacity: 1; }
/* 拖拽落点预览块 */
.cal-dropline { position: absolute; left: 3px; right: 3px; border: 2px dashed var(--primary); border-radius: 8px; background: rgba(26,127,110,.12); color: var(--primary); font-size: 11px; font-weight: 600; padding: 1px 5px; pointer-events: none; z-index: 6; }

/* 🆕 2026-10-08 船长：右侧预约卡弹出时 → 整块 .apt-page 压缩让位，卡片不再压住最右一列医生
   （只压看板的话，上方日期条那排状态按钮会被切掉一半；.apt-dbar 本来 flex-wrap，变窄会自动换行）。
   🔴 2026-11-11：rc-open 的「让位 / 左栏隐藏 / 布局切单列」三条规则**统一放在文件末尾的抽屉覆盖区**，
      这里只留说明 —— 两处重复会出现「改了一处、另一处旧值后写赢」的静默错。 */

/* 「选时段」预约块：虚线蓝框 —— 块身上下拖＝改时间、底边把手＝改占用时长；
   医生当日不在岗 ⇒ 转灰，但**仍可正常放置**（船长定：只做提醒，不拦）。 */
.cal-selblock { position: absolute; left: 3px; right: 3px; z-index: 8; border: 2px dashed var(--primary);
  border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 11.5px; font-weight: 600;
  padding: 1px 5px 5px; overflow: hidden; cursor: move; user-select: none; touch-action: none; }
.cal-selblock.off { border-color: #9aa5b1; background: #eef1f5; color: #5a6675; }
.cal-selblock.dragging { box-shadow: 0 3px 12px rgba(15, 30, 50, .22); }
.cal-selblock .sb-t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 底边把手：**看得见 4px、抓得住 10px**。
   🔴 别用 `::after` 往外扩命中区 —— 块是 `overflow:hidden`，扩出去的部分会被裁掉，
      表现是「看得见把手、就是抓不住」（本轮踩过）。正确做法＝把手本体就加高，
      可见的那条横线用 `::before` 画在它中间。 */
.cal-selblock .sb-h { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize; }
.cal-selblock .sb-h::before { content: ''; position: absolute; left: 6px; right: 6px; bottom: 3px; height: 4px;
  border-radius: 3px; background: currentColor; opacity: .4; }
.cal-selblock .sb-h:hover::before { opacity: .8; }
/* 诊室撞车：与医生冲突区分开（虚线橙边 + 橙色角标） */
.cal-appt.roomconf { outline: 2px dashed var(--warn); outline-offset: -2px; }
.cal-appt .a-flag.rm { background: var(--warn); color: #fff; top: 15px; }

/* 待安排池 */
.apt-pend { position: sticky; top: 12px; }
.apt-pend-list { max-height: 52vh; overflow-y: auto; margin-top: 10px; }
.pend-item { border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; cursor: grab; background: #fff; }
.pend-item:hover { border-color: var(--primary); }
.pend-item .pi-n { font-size: 13px; font-weight: 600; }
.pend-item .pi-n span { color: var(--muted); font-weight: 400; font-size: 11px; }
.pend-item .pi-s { font-size: 11px; color: var(--muted); margin-top: 2px; }
/* ⚠️ 2026-10-04 清点：这条 `.apt-chips` 在 public/ 里同样**找不到使用方**（死样式）。
   留着不动，但别再拿这个名字给新元素用 —— 新日期条的状态按钮条叫 `apd-chips`（文件靠后）。 */
.apt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.apt-stray { padding: 12px 16px; }

/* 周视图（minmax(0,1fr)：防止 nowrap 的预约块把列撑破导致右侧溢出） */
.wk-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wk-col { min-width: 0; }
.wk-col { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; min-height: 160px; }
.wk-col.today { border-color: var(--primary); }
.wk-head { background: #f8fafc; padding: 7px 9px; font-size: 12px; border-bottom: 1px solid var(--border); }
.wk-head em { float: right; font-style: normal; color: var(--primary); font-weight: 600; }
.wk-body { padding: 7px; min-height: 120px; display: flex; flex-direction: column; gap: 5px; }
.wk-body.hover { background: var(--primary-soft); }
.wk-chip { border: 1px solid; border-left-width: 3px; border-radius: 7px; padding: 4px 7px; font-size: 12px; cursor: grab; }
.wk-chip b { display: inline-block; margin-right: 4px; }
.wk-chip span { display: block; font-size: 11px; opacity: .8; }
.wk-chip.dragging { opacity: .45; }

/* 月视图 */
.mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mo-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.mo-cell { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; min-height: 96px; padding: 5px 6px; cursor: pointer; }
.mo-cell.out { opacity: .45; }
.mo-cell.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.mo-cell.hover { background: var(--primary-soft); }
/* 日期行用 flex 而非 float：float 会溢出到下面的预约块上，
   把 .mo-chip（overflow:hidden 形成 BFC）挤成窄条，手机端尤其明显 */
.mo-dnum { display: flex; align-items: center; justify-content: space-between; gap: 2px; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.mo-dnum em { flex: 0 0 auto; font-style: normal; background: var(--primary-soft); color: var(--primary); border-radius: 20px; padding: 0 5px; font-size: 11px; }
.mo-chip { border: 1px solid; border-left-width: 3px; border-radius: 5px; padding: 1px 5px; font-size: 11px; margin-bottom: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: grab; }
.mo-chip.dragging { opacity: .45; }
.mo-more { font-size: 11px; color: var(--muted); }

/* 详情弹窗按钮组 */
.apt-detail-acts { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }

/* 排班维护：旧「按星期循环模板」样式已随该面板一并移除（2026-09-21） */

/* 顾客来源选项（旧扁平版样式，保留兼容） */
.src-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; min-height: 46px; }
.src-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 4px 6px 4px 12px; font-size: 13px; }
.src-chip b { cursor: pointer; color: var(--danger); font-weight: 700; width: 18px; height: 18px; line-height: 16px; text-align: center; border-radius: 50%; }
.src-chip b:hover { background: #fdeaea; }

/* 顾客来源三级树（系统设置 → 顾客来源） */
.src-tree { border: 1px solid var(--border); border-radius: 8px; background: #fbfcfd; padding: 8px 10px; max-height: 48vh; overflow: auto; }
.src-node { margin: 3px 0; }
.src-row { display: flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 7px; background: #fff; border: 1px solid var(--border); }
.src-node.lv1 > .src-row { background: #f4faf8; border-color: #d5e9e4; }
.src-node.lv1 > .src-row .src-name { font-weight: 600; }
.src-kids { margin-left: 16px; padding-left: 10px; border-left: 2px dashed var(--border); }
.src-caret { color: var(--muted); width: 12px; flex: 0 0 12px; font-size: 11px; }
.src-name { flex: 0 0 auto; font-size: 13px; }
.src-lv { flex: 0 0 auto; font-size: 11px; color: var(--muted); background: #f0f3f7; border-radius: 20px; padding: 0 7px; }
.src-acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
/* 已隐藏的来源：虚线灰底 + 名称划线 + 「已隐藏」徽标 */
.src-node.is-hidden > .src-row { opacity: .6; background: #f7f8fa; border-style: dashed; }
.src-node.is-hidden > .src-row .src-name { text-decoration: line-through; }
.src-off { font-size: 11px; color: #8a5a10; background: #fff4e2; border: 1px solid #f0dcc0; border-radius: 20px; padding: 0 7px; }

/* 建档表单：来源三级级联 */
.src-cascade { display: flex; gap: 8px; flex-wrap: wrap; }
.src-cascade select { flex: 1 1 180px; min-width: 0; }

/* 价格表 */
.pl-catbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pl-catchip { background: #f2f5f8; color: var(--muted); border-radius: 20px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.pl-catchip b { color: var(--primary); font-weight: 600; }
.pl-catchip.on, .pl-catchip:hover { background: var(--primary); color: #fff; }
.pl-catchip.on b, .pl-catchip:hover b { color: #fff; }
.pl-price { font-weight: 600; color: var(--primary); }
/* 台账「项目」列上的价目表关联标记：小徽标 + 悬停详情 */
.pl-mark { display: inline-block; background: #eef4ff; color: #3b6fd4; border: 1px solid #d6e3fb; border-radius: 20px; padding: 0 7px; font-size: 11px; cursor: help; white-space: nowrap; }
.pl-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 14px; }
.pl-sumitem { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; text-align: center; }
.pl-sumitem .n { font-size: 17px; font-weight: 700; }
.pl-sumitem .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pl-sumitem.pl-ok { background: #e5f4e5; border-color: var(--ok); }
.pl-sumitem.pl-warn { background: #fff4e2; border-color: var(--warn); }
.pl-difflist { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; margin-top: 10px; }
.pl-up { color: var(--danger); }
.pl-down { color: var(--ok); }

/* 处置：大类条 + 分类条（两级分类，2026-09-21） */
.pl-groupbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px;
  padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.pl-gb-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.pl-groupchip { background: #eef3f8; color: #34506b; border-radius: 6px; padding: 5px 12px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.pl-groupchip b { color: var(--primary); font-weight: 700; margin-left: 2px; }
.pl-groupchip:hover { border-color: var(--primary); }
.pl-groupchip.on { background: var(--primary); color: #fff; }
.pl-groupchip.on b { color: #fff; }
.pl-catbar { margin-top: 10px; }
.pl-draghint { font-size: 12px; color: var(--muted); margin-left: auto; font-style: italic; }

/* 拖动改归属 */
.pl-row[draggable="true"] { cursor: grab; }
.pl-row.dragging { opacity: .4; background: var(--primary-soft); }
.pl-catchip.can-drop { outline: 1px dashed var(--primary); outline-offset: 2px; }
.pl-catchip.drop-on { background: var(--ok) !important; color: #fff !important; transform: scale(1.06); }
.pl-catchip.drop-on b { color: #fff !important; }
body.pl-dragging .pl-catchip { cursor: copy; }
.pl-grp { color: var(--muted); font-size: 12.5px; }

/* 组合处置 */
.pl-wide { width: min(880px, 88vw); }
.pl-cmb-block { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.pl-cmb-head { margin-bottom: 8px; }
.pl-hits { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pl-cmb-tbl { border: 1px solid var(--border); border-radius: 8px; }
.pl-cmb-tbl input.pl-qty { width: 70px; padding: 3px 6px; text-align: center; }

@media (max-width: 820px) {
  .apt-layout { flex-direction: column; }
  .apt-side { width: 100%; flex: 1 1 auto; }
  .apt-pend { position: static; }
  .wk-grid { grid-template-columns: 1fr; }
  .mo-cell { min-height: 68px; }
  .cal-colhead, .cal-colbody { flex: 1 1 168px; min-width: 150px; }
  .cal-scroll { --cal-col-min: 168px; overflow-y: auto; }   /* 手机端维持原样：仍可竖向滚动（桌面端才锁不滚） */
  .sch-card { overflow-x: auto; }
}


/* 手机端底部标签栏（桌面端不显示；规则放在本文件最末尾的移动端段落里生效） */
.tabbar { display: none; }
.tb-more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin: 6px 0; }
.tb-more-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; font-size: 12px; }
.tb-more-btn i { font-size: 20px; font-style: normal; line-height: 1; }
.tb-more-btn > svg { width: 22px; height: 22px; flex: none; }
.tb-more-btn span { white-space: nowrap; }

/* ================= 手机端适配（≤760px）=================
   注意：必须放在文件最后 —— 前面「模块化前端补充样式」里有 .mo-chip / .mo-grid
   等基础规则，媒体查询不提升优先级，靠后定义才能生效。
   实测发现的问题：① 侧栏 font-size:0 把导航 emoji 也隐藏了 ② 账号信息竖排撑破布局
   ③ 手机端侧栏脚部被隐藏 → 退出登录无处可点 ④ 表格列被压成一字一行
   ⑤ 月/周视图 nowrap 的预约块把栅格列撑破、页面横向溢出 */
@media (max-width: 760px) {
  /* ① 顶栏规则整段已删（2026-10-03 顶栏撤销、分院下拉移进左侧栏）。
     ⚠️ 已知边界：本文件**最末尾**还有一段更靠后的 ≤760px 规则会把整个侧栏 `display:none`、
        改用底部标签栏 ⇒ 在那个宽度下**分院下拉不可达**（底部「更多」里有退出登录，不受影响）。
        真机不受影响：index.html 把窄屏视口钉成 1280px，手机上走的仍是桌面布局。
        要不要给移动端单独安置一个分院下拉，等船长定。 */
  .main { padding: 14px 12px; }

  /* ② 表格：横向滚动，避免列被压成一字一行 */
  .table-card { -webkit-overflow-scrolling: touch; }
  .table-card table.tbl { min-width: 620px; }
  .tbl th, .tbl td { white-space: nowrap; }
  .tbl td .sub-muted { white-space: normal; }

  /* ③ 月视图格子太窄：预约块只留时间（患者名点进去看），并压缩字号内边距防截断 */
  .mo-chip .mo-who { display: none; }
  .mo-grid { gap: 4px; }
  .mo-cell { padding: 4px 3px; }
  .mo-dnum { font-size: 11px; }
  .mo-chip { font-size: 9px; padding: 0 2px; margin-bottom: 1px; }

  /* ④ 预约页手机端：医生切换条吸顶；聚焦的医生列自适应撑满可用宽度 */
  .apt-docpick { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 6px 0; }
  .cal-colhead, .cal-colbody { flex: 1 1 150px; min-width: 150px; }
  .cal-scroll { --cal-col-min: 150px; }

  /* ⑤ 患者抽屉全屏 */
  .drawer { width: 100vw; }
  .drawer .d-head, .drawer .d-tabs, .drawer .d-body { padding-left: 14px; padding-right: 14px; }

  /* ⑥ 弹窗贴近全屏，长表单更好填 */
  .modal { width: 96vw; max-height: 92vh; padding: 16px; }
  .modal h3 { font-size: 16px; }

  /* ⑦ 底部标签栏：隐藏左侧图标栏，改用底部 5 个标签（工作台/患者/预约/排班/更多）
     🔵 2026-10-10：侧栏一藏会让「当前分院」下拉跟着消失 —— 船长当天已把它搬到顶栏，手机因此能切分院。
     🔵 2026-10-11 船长：「分院切换移动至 logo 右侧」＋「手机也要显示在顶栏」⇒ 本档三件事：
        ① 账号块窄屏仍只留「头像 ＋ ▾」（姓名/角色收进点开的菜单，桌面也一样）；
        ② 顶栏那个分院控件按下面的尺寸收一号（房子图标 + 院名 + ▾），**照旧一行放得下**；
        ③ 🔴 **手机顶栏撤掉患者搜索框**（下面 `.appbar-search{display:none}`）——
           这是本档换来的空间，不是顺手删：390px 实测顶栏「logo + 搜索框 + 齿轮 + 头像」本来就
           **互相压着**（搜索框 147~264、齿轮 253~291 重叠 11px）。撤掉后顶栏第一次不打架；
           手机上搜患者走「患者管理」页（底部标签栏第 2 个）页内的搜索框。
     🔴 窄屏 logo 改成「只露鲨鱼头」（下面 object-fit 那条）——不是换图，是把同一张横版 logo
        裁出左边那块：`cover` 会按高度 32px 等比缩放，`object-position:left` 再裁到 40px 宽。
        这样**自定义 logo 也跟着变**（不用另存一张方图，服务端也没多一个字段）。 */
  .sidebar { display: none; }
  .appbar-user { padding: 0 9px 0 5px; gap: 6px; border-radius: 10px; }
  .appbar-user .me-col { display: none; }
  .appbar-user .caret-m { display: inline; }
  /* ③ 手机顶栏撤掉患者搜索框（本档的空间就是从这里来的，见上面注释） */
  .appbar .appbar-search { display: none; }
  /* ② 分院控件收一号：390px 实测「方标 40 + 控件 153 + 齿轮 38 + 头像 65 + 间隙」= 346 ≤ 362 */
  .appbar-clinic { height: 32px; padding: 0 7px; gap: 5px; }
  .appbar-clinic .clsk-ic .nico { width: 15px; height: 15px; }
  .appbar-clinic .clsk-sel { font-size: 12.5px; max-width: 132px; }
  /* ① 窄屏 logo：只露左边那块鲨鱼头（40×32，横版原图 142×32 的左边 28% 正好是鲨鱼头） */
  .appbar-brand img { width: 40px; height: 32px; max-width: 40px;
    object-fit: cover; object-position: left center; }
  /* 🆕 2026-10-09：侧栏一藏，二级的左侧竖栏也跟着藏（没有一级菜单，孤零零一条二级栏没意义）；
     二级入口改回**内容区顶部的卡片页签**（.subtabs 默认 display:none，这里放出来）。 */
  .subrail { display: none; }
  .subtabs:not(.hidden) { display: flex; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -2px 12px rgba(31,45,61,.07);
    padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 8px 2px 7px; color: var(--muted); text-decoration: none; cursor: pointer; font-size: 11px; }
  .tabbar a .ico { font-size: 19px; line-height: 1; font-style: normal; }
  /* 🆕 2026-11-03 底部 Tab 换成线性 SVG（原 emoji 靠 font-size 撑大小，SVG 不吃这套） */
  .tabbar a > svg { width: 22px; height: 22px; flex: none; }
  .tabbar a.active > svg { transform: translateY(-1px); }
  .tabbar a .tx { white-space: nowrap; }
  .tabbar a.active { color: var(--primary); font-weight: 600; }
  .tabbar a.active .ico { transform: translateY(-1px); }
  /* 内容区给底部标签栏留出空间 */
  .main { padding-bottom: 78px; }
}

/* ≤340px（iPhone SE 一代那类最窄屏）：顶栏再缩一档 ——
   320px 实测「分院控件 + 齿轮」会压 24px（控件 68..215、齿轮 191..229）⇒ 三处一起收：
   ① logo 只留 32 宽（鲨鱼头再裁窄一点，仍是同一张图的左边那块）；② 分院下拉限宽 84；
   ③ 顶栏内边距与间隙各收一点。收完 320px 实测：36(logo 右) … 213 < 齿轮左 222 ✓ 不再压。
   🔴 必须排在上面那个 ≤760px 块的**后面**：两处置的都是 `.appbar-brand img` 的宽度，
      同权重时**后写的赢**，放前面会被 ≤760 那条盖掉（这个坑今天已经在别处踩过一次）。 */
@media (max-width: 340px) {
  .appbar { gap: 10px; padding: 0 10px; }
  .appbar-brand img { width: 32px; max-width: 32px; }
  .appbar-clinic { padding: 0 6px; gap: 4px; }
  .appbar-clinic .clsk-sel { max-width: 84px; }
  .appbar-user { padding: 0 7px 0 4px; }
}

/* ===== 预约详情卡：按界面切两态（船长 2026-10-08 定）=====
   ① 预约挂号页（看板上点某条预约）⇒ **屏幕居中的大卡片 + 半透明遮罩**（2026-09-21 原样，别动）；
   ② 患者信息界面（点「预约记录」某一行）⇒ **右侧 360px 抽屉**（= 下带 `.right` 的那组，全部以
      `.apt-drawer-wrap.right` 前缀作用域隔离，基础规则一行不改）。
   切换由 JS 决定：`App.apptDetail()` 里判「患者详情页在屏」（`#patientDrawer`）则挂 `.right`。
   版式：顶部色条 / 左「患者信息」窄栏 / 右「预约详情·预约记录」/ 下方三个入口 / 底部操作条。 */
.apt-drawer-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.apt-drawer-mask { position: absolute; inset: 0; background: rgba(31, 45, 61, .38); }
.apt-modal {
  position: relative; width: min(940px, calc(100vw - 32px)); height: min(640px, calc(100vh - 32px));
  background: var(--panel); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 26px 70px rgba(15, 30, 50, .3);
  animation: apIn .18s ease-out;
}
@keyframes apIn { from { transform: translateY(14px) scale(.985); opacity: .5; } to { transform: none; opacity: 1; } }

/* —— 变体：患者信息界面用的「右侧抽屉」（360px、浮层覆盖、左中保持可见）—— */
.apt-drawer-wrap.right { display: block; }
.apt-drawer-wrap.right .apt-drawer-mask { background: transparent; }   /* 遮罩只负责「点卡片外收起」，不压暗患者页 */
/* 🔴 表单卡（rtform）**整层让鼠标穿过去** —— 否则真鼠标点不到看板、拖不动预约块、
   也点不了左侧日期与「今日/三日/一周/四周…」快捷跳转。
   两层都要放行：外层 `.apt-drawer-wrap` 本身就是 `fixed; inset:0` 铺满全屏，
   只放行遮罩不够（实测：elementFromPoint 全返回外层容器）；卡片本体再单独收回 `auto`。
   ⚠️ 只能给 rtform 放行：详情卡（`.apt-drawer-wrap` 与患者页那版 `.right`）的遮罩挂着
      `onclick=closeAptDrawer` 的「点外面关闭」，放行会让它永远关不掉。
   ✅ 表单卡本来就没有「点外面关闭」（只能 ✕ / 取消 / 保存），所以放行零副作用。 */
.apt-drawer-wrap.rtform, .apt-drawer-wrap.rtform .apt-drawer-mask { pointer-events: none; }
.apt-drawer-wrap.rtform .apt-modal { pointer-events: auto; }
.apt-drawer-wrap.right .apt-modal {
  position: absolute; top: 0; right: 0; bottom: 0; left: auto;
  width: 360px; max-width: calc(100vw - 20px); height: 100%; border-radius: 0;
  border-left: 1px solid var(--border); box-shadow: -16px 0 44px rgba(15, 30, 50, .18);
  animation: apInRight .2s ease-out;
}
@keyframes apInRight { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
/* 360px 里排不下两栏 ⇒ 单列纵向堆叠、整块 body 一起滚（左右两栏各自不再滚） */
.apt-drawer-wrap.right .ap-body { display: block; overflow-y: auto; }
.apt-drawer-wrap.right .ap-left { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
.apt-drawer-wrap.right .ap-right { padding: 12px 16px 0; overflow: visible; }
.apt-drawer-wrap.right .ap-foot { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
.apt-drawer-wrap.right .ap-others { flex-wrap: wrap; }
/* 入口格：360px 下三格放不下「图标+标题+副标题」⇒ 等分格、居中、隐藏副标题。
   🆕 2026-11-17：「处置」「收费」合并后是 3 格，但欠费时多出「收欠费」第 4 格
   ⇒ 改成 **2 列**（3 格时是 2+1、4 格时正好 2+2，比 3+1 顺眼）。 */
.apt-drawer-wrap.right .ap-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 0 12px; }
.apt-drawer-wrap.right .ap-bar { justify-content: center; padding: 10px 8px; }
.apt-drawer-wrap.right .ap-bar > em { display: none; }

/* 右侧卡片里的「新建/编辑预约」表单（「再次预约」走这里，三栏版式；2026-10-08） */
.apt-drawer-wrap.right .rtcard-h { flex: none; display: flex; align-items: center; gap: 8px;
  padding: 12px 44px 12px 16px; border-bottom: 1px solid var(--border); position: relative; }
.apt-drawer-wrap.right .rtcard-t { font-size: 15px; color: var(--text); }
.apt-drawer-wrap.right .rtcard-b { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; }
.apt-drawer-wrap.right .rtcard-f { flex: none; display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 16px; border-top: 1px solid var(--border); background: var(--panel); }
/* 360px 里两列表单排不下 ⇒ 强制单列（.form-grid 基础是固定两列） */
.apt-drawer-wrap.right .rtcard-b .form-grid { grid-template-columns: 1fr; }

/* 患者信息页「预约记录」：整行可点 → 打开预约卡（右侧抽屉） */
.tbl tr.pt-appt-row { cursor: pointer; }
.tbl tr.pt-appt-row:hover { background: var(--primary-soft); }
.ap-topbar { height: 7px; flex: none; background: linear-gradient(90deg, #f59a3c, #ffc775); }
.ap-head { padding: 13px 20px 11px; border-bottom: 1px solid var(--border); position: relative; flex: none; }
/* 顶部条（船长 2026-10-03）：原「患者名 + 状态 + 时间医生」整条取消，改「会员卡券简约显示」。
   右边留 46px 给绝对定位的 ✕，免得压住内容。 */
.ap-head-mem { padding: 10px 46px 10px 20px; display: flex; align-items: center; }
.ap-mem { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; text-align: left;
  border: 1px solid #e3e9f2; border-radius: 10px; background: #fff; padding: 8px 12px;
  cursor: pointer; font-size: 12.5px; color: var(--muted); }
.ap-mem:hover { border-color: var(--primary); background: var(--primary-soft); }
.ap-mem.off { cursor: default; background: #fafbfd; }
.ap-mem.off:hover { border-color: #e3e9f2; background: #fafbfd; }
.ap-mem-badge { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--primary); background: #e8f4fd; border-radius: 20px; padding: 1px 9px; flex: none; }
.ap-mem-badge.off { color: #6b7480; background: #eef1f5; }
.ap-mem > b, .ap-mem span > b { color: var(--text); font-weight: 600; }
.ap-mem-tier { font-size: 13px; }
.ap-mem-no { font-size: 11.5px; color: #aab3c0; }
.ap-mem-go { font-style: normal; margin-left: auto; color: var(--primary); font-size: 12px; cursor: pointer; }
.ap-x { position: absolute; top: 12px; right: 16px; border: 0; background: none; font-size: 16px; color: var(--muted); cursor: pointer; }
.ap-body { flex: 1; display: grid; grid-template-columns: minmax(190px, 280px) 1fr; gap: 0; overflow: hidden; }
/* —— 左栏：患者信息（图标行 + 欠费已收，与 E看牙 一致）—— */
.ap-left { padding: 16px 18px; border-right: 1px solid var(--border); background: #fafbfd; overflow: auto; }
/* —— 名字卡片（船长 2026-10-03：整块可点 ⇒ 患者完整信息页）—— */
.ap-namecard {
  display: block; width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; padding: 10px 12px 9px; margin-bottom: 10px; cursor: pointer; position: relative;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.ap-namecard:hover { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 2px 8px rgba(47, 111, 216, .12); }
.ap-namecard.static { cursor: default; }
.ap-namecard.static:hover { border-color: var(--border); background: #fff; box-shadow: none; }
.ap-nc-name { display: block; font-size: 19px; font-weight: 600; line-height: 1.25; }
.ap-nc-mrn { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.ap-nc-go { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--primary); }
.ap-namecard.static .ap-nc-go { display: none; }
/* —— 备注信息（船长 2026-10-03：可填写）—— */
.ap-note { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #eef1f5; }
.ap-note-h { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.ap-note-h > em { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--muted); }
/* 🔵 2026-10-03 船长定：高度**随文字内容自动变长**（原来固定 4 行、长备注要拖着看）。
   高度由 JS（aptAutoGrow）按 scrollHeight 撑开 ⇒ 这里必须关掉手动拖拽把手 + 关掉内滚动条，
   否则把手给出的"假高度"会在下次输入时被打回，看着像坏掉。min-height 保留 ⇒ 短备注仍是 4 行高。 */
.ap-note > textarea {
  display: block; width: 100%; box-sizing: border-box; resize: none; min-height: 76px; font: inherit; font-size: 12.5px;
  line-height: 1.6; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
  overflow: hidden;
}
.ap-note > textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.ap-note > textarea[readonly] { background: #f4f6fa; color: var(--muted); }
.ap-note-f { display: flex; justify-content: flex-end; margin-top: 6px; }
.ap-lrow { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; color: var(--text); }
.ap-lrow > i { font-style: normal; width: 18px; text-align: center; color: var(--muted); }
.ap-lrow.ap-lrow-vt { padding: 2px 0 6px; }
.ap-lrow .ap-self { font-style: normal; font-size: 11px; color: var(--muted); background: #eef1f5; border-radius: 4px; padding: 0 4px; }
.ap-lrow.ap-src > span { color: var(--muted); }
/* 🆕 2026-11-13 船长：详情卡左栏改成会员卡；过敏原/既往史有内容就红字红框 */
.ap-lmeta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: #7a8494; margin: 6px 0 8px; }
.ap-mcard { margin: 2px 0 9px; }
/* ══════════════════════════════════════════════════════════════════════════
   🆕 2026-11-16 船长：「@预约卡界面 映射 @使用会员卡片代码」
   预约卡左栏换成会员卡券页那张卡（App.mcCardHtml → .mp-card + UI.mcFace）。
   左栏只有 154–244px 宽 ⇒ 整卡缩一档、明细的「诊费折扣/剩余券」从两格改成两行。
   🔴 .mp-card 的一套规则已从 patients.js 的 MP_CSS 挪进本文件（全局唯一真源）——
      原来它只在「会员卡券」页签被点开时才注入，没点过时预约卡里的卡面是裸的。
   ══════════════════════════════════════════════════════════════════════════ */
.mp-card { position: relative; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(16, 30, 54, .1); background: #fff; }
/* 🔵 2026-10-09 船长：「已到期 / 已使用变灰，加盖红色印章」（判据见 App.mcState）——
   🔴 卡头那条渐变是**行内 style** 写的 ⇒ 覆盖它必须用 !important，否则灰底加不上、只灰了下半截（看着像渲染坏了）。 */
.mp-card.off { box-shadow: none; border: 1px solid #e4e8ee; }
.mp-card.off .top { background: #a9b2bd !important; }
.mp-card.off .bd { background: #f7f8fa; color: #a2abb6; }
.mp-card.off .bd b { color: #96a0ab; }
.mp-card .stamp { position: absolute; right: 12px; top: 30px; transform: rotate(-16deg);
  border: 2px solid #d94a4a; color: #d94a4a; border-radius: 6px; padding: 3px 10px;
  font-size: 13px; font-weight: 700; letter-spacing: 2px; background: rgba(255, 255, 255, .8); pointer-events: none; }
.mp-card .top { padding: 13px 16px; color: #fff; }
/* 🆕 2026-11-16 船长：患者端会员卡与「会员总览 / 展示窗口」共用一个卡面（UI.mcFace → .mc2-card）
   ⇒ 这里只把圆角改成只圆上边，接下面的 .bd；老 .top 结构保留但不再渲染。 */
.mp-card .mc2-card { border-radius: 12px 12px 0 0; padding: 14px 16px 16px; }
/* 失效卡（过期/注销/用完）整块去色，仍看得清字；红色印章压在最上层 */
.mp-card.off .mc2-card { filter: grayscale(.9) brightness(1.02); opacity: .86; }
.mp-card .top .nm { font-size: 15px; font-weight: 600; }
.mp-card .top .no { font-size: 11.5px; opacity: .9; letter-spacing: .6px; margin-top: 2px; }
.mp-card .top .pr { font-size: 20px; font-weight: 700; margin-top: 4px; }
.mp-card .bd { padding: 10px 16px 13px; font-size: 12.5px; color: #5a6675; }
.mp-card .bd .r { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed #f0f3f8; }
.mp-card .bd .r:last-child { border: 0; }
.mp-card .bd b { color: #33404f; }
/* 🔵 2026-10-09 船长：「卡面瘦身」——原来 4 行（卡期/折扣/剩余券/状态），
   把「诊费折扣」与「剩余券」并成一行两格 ⇒ 降到 3 行，卡面少占一行高（多张卡时省得更多）。 */
.mp-card .bd .r2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 3px 0; border-bottom: 1px dashed #f0f3f8; }
.mp-card .bd .r2 > div { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
.mp-card .bd .r2 > div > span { white-space: nowrap; color: #8d99a8; }
.mp-card .bd .r2 b { margin-left: auto; white-space: nowrap; }

/* —— 预约卡左栏窄版（154–244px）—— */
.ap-mcard .mp-card { border-radius: 11px; }
.ap-mcard .mp-card .mc2-card { padding: 10px 11px 11px; }
.ap-mcard .mp-card .mc2-card-h { margin-bottom: 6px; gap: 6px; }
.ap-mcard .mp-card .mc2-abbr { height: 22px; line-height: 22px; font-size: 10.5px; width: calc(3em + 10px); padding: 0 5px; }
.ap-mcard .mp-card .mc2-card-nm { font-size: 11.5px; }
.ap-mcard .mp-card .mc2-card-pr { font-size: 18px; }
.ap-mcard .mp-card .mc2-card-ds { font-size: 10.5px; }
.ap-mcard .mp-card .mc2-num { width: 26%; max-width: 56px; opacity: .5; }
.ap-mcard .mp-card .bd { padding: 8px 11px 10px; font-size: 11.5px; }
/* 两格并排放不下一行（「诊费折扣 7.5 折」+「剩余券 0 张」）⇒ 窄屏改上下两行 */
.ap-mcard .mp-card .bd .r2 { grid-template-columns: 1fr; gap: 0; }
.ap-mcard .mp-card .bd .r2 > div { padding: 3px 0; border-bottom: 1px dashed #f0f3f8; }
.ap-mcard .mp-card .bd .r2 > div:last-child { border-bottom: 0; }
.ap-mcard .mp-card .stamp { right: 8px; top: 20px; font-size: 11.5px; padding: 2px 8px; letter-spacing: 1px; }
/* 卡面下那个按钮（卡内内容 / 开卡）占满一行，窄栏里点得准 */
.ap-mcard .mp-card .bd .btn { width: 100%; }
/* 没有会员卡时的空状态 */
.ap-mcempty { border: 1px dashed #d7dfe9; border-radius: 11px; background: #fbfcfe;
  padding: 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ap-mcempty b { font-size: 12.5px; color: #5a6675; font-weight: 600; }
.ap-mcempty span { font-size: 11.5px; color: #98a2b3; line-height: 1.5; }
.ap-mcempty .btn { margin-top: 2px; }
.ap-risk { display: flex; gap: 8px; align-items: flex-start; border: 1px solid #e3e8f0; background: #f7f9fc;
  border-radius: 8px; padding: 6px 9px; font-size: 12.5px; color: #4a5566; margin-top: 6px; line-height: 1.45; }
.ap-risk b { flex: none; color: #8a93a3; font-weight: 700; white-space: nowrap; }
.ap-risk span { min-width: 0; word-break: break-word; }
.ap-risk.warn { background: #fdeced; border-color: #e5484d; color: #b42318; }
.ap-risk.warn b { color: #b42318; }
/* 状态步进器：每步用它自己的状态色（与日志/看板同一套 APPT_STCLS） */
.ap-steps { display: flex; margin: 10px 0 6px; }
.ap-step { flex: 1; position: relative; text-align: center; min-width: 0; }
.ap-step i { display: block; width: 11px; height: 11px; border-radius: 50%; background: #dfe4ec; margin: 0 auto 5px; position: relative; z-index: 1; }
.ap-step b { display: block; font-size: 11.5px; font-weight: 500; color: #8a93a3; white-space: nowrap; }
.ap-step em { display: block; font-style: normal; font-size: 10.5px; color: #a7b0bf; white-space: nowrap;
  letter-spacing: -.2px; }   /* 2026-11-13：改成完整日期时间后压一点字距，5 步并排也放得下 */
.ap-step:not(:last-child)::after { content: ""; position: absolute; left: 50%; right: -50%; top: 5px; height: 2px; background: #e6eaf1; }
.ap-step.done i { background: var(--c); box-shadow: 0 0 0 1px var(--c); }
.ap-step.done b { color: var(--c); }
.ap-step.done:not(:last-child)::after { background: var(--c); opacity: .55; }
.ap-step.now i { background: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 0 4px color-mix(in srgb, var(--c) 16%, #fff); }
.ap-step.now b { color: var(--c); font-weight: 700; }
.ap-step.now em { color: var(--c); opacity: .85; }
.ap-stepnote { font-size: 11.5px; color: #b42318; margin: 2px 0 4px; }
.ap-wait { font-style: normal; color: #b45309; font-size: 11.5px; margin-left: 6px; }
/* —— 信息行（船长 2026-10-03 重排）——
   原来 `justify-content: space-between` ⇒ 标签贴左、值贴右，在宽栏里**一行字被拉到屏幕两头**，
   读一条要横跨整屏。改成：**标签定宽、值紧跟其后左对齐**（读一行只动一次眼）。
   并让信息区在宽栏自动排**两列**、窄栏自动回一列（`auto-fit`，不写死断点）。
   `.full` 给「时间 / 项目 / 时间节点 / 备注」这类长值 ⇒ 横跨两列，避免挤成两三行。 */
.ap-kv {
  display: grid; grid-template-columns: 4.8em minmax(0, 1fr); align-items: baseline; gap: 0 10px;
  padding: 7px 0; font-size: 13px; border-bottom: 1px dashed #eef1f5;
}
.ap-kv > span { color: var(--muted); white-space: nowrap; }
/* tabular-nums：让时间/电话这类数字等宽对齐，一列里数位不会左右跳 */
.ap-kv > b { font-weight: 500; min-width: 0; word-break: break-all; font-variant-numeric: tabular-nums; }
.ap-kv.full { grid-column: 1 / -1; }
.ap-kv .warn { color: var(--danger); font-style: normal; }
/* 信息区容器（当日预约 / 历史预约展开）：够宽就两列，放不下自己回一列 */
.ap-sect > .ap-pane, .ap-hdet {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  column-gap: 30px; align-content: start;
}
.ap-alert { margin-top: 10px; padding: 6px 8px; border-radius: 8px; background: #fdecea; color: var(--danger); font-size: 12px; }
/* —— 右栏（船长 2026-10-03 重排）：当日预约置顶 → 历史预约（默认收起） → 三个卡片 —— */
/* 整栏可滚；三个卡片用 sticky 钉在底部，滚到哪都在手边 */
.ap-right { padding: 12px 20px 0; overflow-y: auto; display: block; }
.ap-sect { flex: none; }
.ap-sect-h { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.ap-sect-h > b { font-size: 14px; }
.ap-sect-h > span { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-logbtn { border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 4px 10px; font-size: 12px; color: var(--muted); cursor: pointer; flex: none; }
.ap-logbtn:hover { color: var(--primary); border-color: var(--primary); }
.ap-pane { overflow: visible; }
/* 历史预约：默认收成一行；点开才展开详情（"自动缩放往下排列"） */
.ap-hishead { display: flex; align-items: center; gap: 8px; margin: 14px 0 2px; }
.ap-hishead > b { font-size: 13px; }
.ap-hishead > em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.ap-hist { border-top: 1px dashed #eef1f5; }
.ap-hitem { border-bottom: 1px dashed #eef1f5; }
.ap-hitem.open { background: #fafbfd; }
.ap-hrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 6px; font-size: 12.5px; cursor: pointer; border-radius: 8px; }
.ap-hrow:hover { background: var(--primary-soft); }
.ap-hrow > b { flex: none; font-weight: 500; }
.ap-hrow > .ap-hdoc { flex: none; color: var(--muted); }
.ap-hrow > .ap-hitem-t { flex: 1; min-width: 0; color: var(--muted); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-hcaret { flex: none; font-style: normal; color: var(--muted); font-size: 11px; }
.ap-hdet { padding: 2px 10px 8px 14px; }
/* 三个卡片：处置 / 病例 / 影像 —— 点击跳转到患者对应页面（不再就地展开） */
/* sticky 钉在右栏底部：右侧内容再多，三个入口始终在手边 */
/* 🆕 2026-11-17：底部吸附区 = 备注一行 + 入口按钮（按钮原来自己 sticky，备注排在它后面会被盖住） */
.ap-bottom { position: sticky; bottom: 0; z-index: 2; margin-top: 12px; padding-top: 7px;
  border-top: 1px solid var(--border); background: var(--panel);
  box-shadow: 0 -8px 14px -10px rgba(16, 30, 54, .18); }
.ap-bars { display: flex; gap: 10px; padding: 8px 0 12px; }
.ap-bar { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 13px; color: var(--text); cursor: pointer; }
.ap-bar > i { font-style: normal; font-size: 16px; flex: none; }
.ap-bar > b { font-weight: 500; flex: none; }
.ap-bar > em { font-style: normal; color: var(--muted); font-size: 11.5px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-bar:hover { border-color: var(--primary); background: var(--primary-soft); }
.ap-bar:hover > em { color: var(--primary); }
/* 🆕 2026-11-17 船长：右下角那一格是「钱」—— 欠费时红，不欠费时这一格不出现 */
.ap-bar-money { color: #b42318; border-color: #f0c9c4; background: #fff8f7; }
.ap-bar-money > b { font-weight: 600; }
.ap-bar-money > em { color: #d9736a; }
.ap-bar-money:hover { border-color: #b42318; background: #fdeeec; }
.ap-bar-money:hover > em { color: #b42318; }
/* 🆕 2026-11-17 船长：「不起眼的地方显示备注信息」—— 一行灰字（最多两行后省略），点右侧「编辑」改 */
.ap-noteline { display: flex; align-items: flex-start; gap: 8px; padding: 2px 2px 0; font-size: 11.5px; line-height: 1.55; }
.ap-noteline > b { flex: none; font-weight: 500; color: #b0b9c4; }
.ap-noteline > span { flex: 1; min-width: 0; color: #6b7887;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-noteline.empty > span { color: #c2cbd6; }
.ap-noteline > em { flex: none; font-style: normal; color: var(--primary); cursor: pointer; opacity: .75; }
.ap-noteline > em:hover { opacity: 1; text-decoration: underline; }
/* 🆕 2026-11-17：顶部那条「会员 / 非会员」摘要已撤（会员卡整张画在左栏），这里只留关闭按钮的位置 */
.ap-head-slim { padding: 6px 46px 2px 20px; height: 30px; border-bottom: 0; }
.ap-head-slim .ap-x { top: 8px; right: 14px; }
/* 右侧 360px 抽屉里的入口格走 grid 两列，见上方 .apt-drawer-wrap.right .ap-bars */
/* 日志（谁改过这条预约） */
/* 🆕 2026-10-10 船长：预约操作日志照 E看牙 改成**五列表格**（操作时间/操作人/操作类型/操作患者/变更记录）
   变更记录＝橙色字段标签 + 旧值（灰）+ 绿箭头 + 新值（深）；表头用主题蓝（照参考图）。
   🔴 字段标签由**动作**推出来（detail 里只有「从/到」没字段名），见 appointments.js 的 APL_FIELD。 */
.modal.modal-aplog { width: min(1080px, 96vw); max-height: 92vh; padding: 20px 22px; }
.apl-meta { font-size: 12px; color: var(--muted); margin: -8px 0 10px; }
/* 🆕 2026-11-07 预约日志定稿版（时间轴）：见 日志改版-预约-20261026.png */
.apl-top { display: flex; gap: 10px; background: #f5f8fc; border: 1px solid #e3ebf5;
  border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.apl-cell { flex: 1; min-width: 0; }
.apl-ck { font-size: 11.5px; color: #8b98a8; margin-bottom: 3px; }
.apl-cv { font-size: 13px; color: #2c3e50; font-weight: 500; word-break: break-all; }
.apl-tl { display: flex; flex-direction: column-reverse; max-height: 54vh; overflow: auto; padding-left: 4px; }
.apl-it { position: relative; padding: 0 0 18px 22px; }
.apl-it::before { content: ''; position: absolute; left: 2px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: #c7d2dd; box-shadow: 0 0 0 4px rgba(199, 210, 221, .22); }
.apl-it::after { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: #e8edf3; }
.apl-it:last-child::after { display: none; }
.apl-it.is-new::before { background: #7c5cd6; box-shadow: 0 0 0 4px rgba(124, 92, 214, .16); }
.apl-it.is-move::before { background: #e08e2a; box-shadow: 0 0 0 4px rgba(224, 142, 42, .16); }
.apl-it.is-status::before { background: #2f6fd0; box-shadow: 0 0 0 4px rgba(47, 111, 208, .16); }
.apl-hd { font-size: 13px; color: #2c3e50; line-height: 1.6; }
.apl-hd b { font-weight: 600; color: #1f2d3d; }
.apl-k { display: inline-block; font-size: 12px; color: #8b98a8; margin-right: 6px; font-weight: 400; }
.apl-sub { font-size: 11.5px; color: #8b98a8; line-height: 1.6; }
.apl-foot { font-size: 11px; color: #a0aab6; margin-top: 6px; }
/* 🆕 2026-11-07 诊疗记录：左预约 / 右当天处置+收费 */
.trt-wrap { display: grid; grid-template-columns: 286px 1fr; min-height: 420px; }
.trt-lt { border-right: 1px solid #eef1f5; max-height: 60vh; overflow: auto; background: #fbfcfe; }
.trt-lh { position: sticky; top: 0; z-index: 1; background: #fbfcfe; padding: 10px 14px;
  font-size: 12px; color: #6b7887; border-bottom: 1px solid #eef1f5; }
.trt-li { padding: 10px 14px 12px; border-bottom: 1px solid #f2f5f8; cursor: pointer; position: relative; }
.trt-li:hover { background: #f4f9fe; }
.trt-li.is-on { background: #eaf4fd; box-shadow: inset 3px 0 0 #185FA5; }
.trt-l1 { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: #2c3e50; }
.trt-d { font-weight: 600; }
.trt-st { font-size: 11px; color: #8b98a8; background: #f1f4f8; border-radius: 4px; padding: 1px 6px; }
.trt-l2 { font-size: 12px; color: #6b7887; margin-top: 3px; }
.trt-note { font-size: 11.5px; color: #b5761a; background: #fff8ee; border-radius: 4px;
  padding: 3px 6px; margin-top: 4px; line-height: 1.5; }
.trt-logbtn { margin-top: 6px; font-size: 11px; padding: 3px 9px; border-radius: 5px;
  border: 1px solid rgba(24, 95, 165, .3); background: #fff; color: #185FA5; cursor: pointer; }
.trt-logbtn:hover { background: #eaf4fd; }
.trt-right { max-height: 60vh; overflow: auto; padding: 14px 18px; }
.trt-day { font-size: 15px; font-weight: 600; color: #1f2d3d; margin-bottom: 8px; }
.trt-l3 { font-size: 11px; color: #9aa7b6; margin-top: 4px; }
.trt-rh { font-size: 14px; font-weight: 600; color: #2c3e50; display: flex; align-items: center; gap: 8px; }
.trt-st2 { font-size: 11px; font-weight: 400; color: #8b98a8; background: #f1f4f8; border-radius: 4px; padding: 1px 6px; }
.trt-rnote { font-size: 12px; color: #b5761a; background: #fff8ee; border-radius: 5px; padding: 5px 8px; margin: 8px 0 0; }
.trt-sec { font-size: 12px; color: #6b7887; margin: 16px 0 6px; padding-bottom: 5px; border-bottom: 1px solid #eef1f5; }
.trt-cnt { font-size: 11px; color: #9aa7b6; margin-left: 6px; font-weight: 400; }
.trt-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #f2f5f8; }
.trt-tooth { min-width: 56px; flex: none; }
.trt-tag { display: inline-block; background: #eef4fc; color: #185FA5; border-radius: 6px; padding: 2px 7px; font-size: 11.5px; }
.trt-body { flex: 1; min-width: 0; }
.trt-txt { font-size: 12.5px; color: #2c3e50; line-height: 1.65; white-space: pre-wrap; }
.trt-meta { font-size: 11.5px; color: #8b98a8; margin-top: 3px; }
.trt-empty { font-size: 12px; color: #b0b8c4; padding: 10px 0 6px; }
.apl-wrap { max-height: 62vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.apl-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.apl-tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--primary); color: #fff;
  font-weight: 500; text-align: left; padding: 9px 10px; font-size: 12px; white-space: nowrap; }
.apl-tbl td { padding: 8px 10px; border-top: 1px solid #eef1f5; vertical-align: top; }
.apl-tbl tbody tr:nth-child(even) { background: #fafbfd; }
.apl-tbl tbody tr:hover { background: #f1f9fe; }
.apl-t { color: #6b7684; white-space: nowrap; }
.apl-p { color: #5a6675; }
.apl-a { display: inline-block; border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px; font-size: 11.5px; color: #5a6675; white-space: nowrap; }
.apl-chg > div + div { margin-top: 3px; }
.apl-k { display: inline-block; background: #fdf1e0; color: #8a5a10; border-radius: 4px;
  padding: 1px 6px; font-size: 11px; margin-right: 6px; white-space: nowrap; }
.apl-o { color: #929dab; }
.apl-n { color: #1f2a37; font-weight: 500; }
.apl-nul { color: #b6bec8; }
.apl-ar { display: inline-block; width: 0; height: 0; border-left: 5px solid #2FBF71;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent; margin: 0 7px; vertical-align: 1px; }
.apl-empty { padding: 26px 10px; text-align: center; color: var(--muted); }
.apl-empty span { display: block; font-size: 11.5px; margin-top: 4px; }
.ap-foot { border-top: 1px solid var(--border); padding: 12px 20px; display: flex; align-items: center; gap: 10px; flex: none; }
.ap-adv { position: relative; display: flex; gap: 0; }
.ap-main { border-radius: 8px 0 0 8px; min-width: 118px; }
.ap-caret { border-radius: 0 8px 8px 0; border-left: 1px solid rgba(255, 255, 255, .35); padding: 8px 10px; }
.ap-flow { position: absolute; bottom: calc(100% + 6px); left: 0; width: 220px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 6px 20px rgba(31, 45, 61, .14); padding: 6px; z-index: 5; }
.ap-fitem { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.ap-fitem:hover { background: var(--primary-soft); }
.ap-fitem.off { color: #b6bcc6; cursor: not-allowed; }
.ap-fitem.off:hover { background: none; }
.ap-fitem.back { color: var(--warn); }
.ap-fsplit { height: 1px; background: var(--border); margin: 5px 6px; }
.ap-others { margin-left: auto; display: flex; gap: 8px; }
.vt-badge { display: inline-block; padding: 0 6px; border-radius: 20px; font-size: 11px; line-height: 18px; background: #e8f1ff; color: #2f6fd8; }
.vt-badge.re { background: var(--primary-soft); color: var(--primary); }
.vt-badge.sm { font-size: 10px; line-height: 15px; padding: 0 4px; margin-left: 3px; }
.st-tag { font-size: 11px; }
.a-warn { color: var(--warn); margin-right: 3px; font-weight: 700; }
.warn { color: var(--warn); font-style: normal; }

/* ===== 左侧状态筛选栏（2026-09-20 改版）===== */
.apt-layout { display: grid; grid-template-columns: 152px minmax(0, 1fr) 260px; gap: 12px; align-items: start; }
.apt-filters { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; }
/* 🗑 2026-10-03：`.apt-filt*` 整组已删 —— 「左侧状态筛选栏」的卡片**早在 2026-09-21 就不渲染了**
   （船长定「删掉状态筛选列表，只留当日小计」），只留下 JS 里那段空转的绑定。现在两边都清干净，
   状态筛选只在齿轮（界面设置 → 状态筛选）那一处改。 */
.apt-fsum { margin-top: 8px; padding: 8px 9px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); }
.apt-fsum div { display: flex; justify-content: space-between; padding: 2px 0; }
.apt-fsum b { color: var(--text); font-weight: 500; }
/* 左栏改版（船长 2026-09-21 定）：删掉状态筛选列表，只留「当日合计 / 占用时长」小计 +「待安排」
   —— 状态筛选仍可用顶部工具栏的「全部状态」下拉，左栏省出的高度全给待安排列表 */
.apt-filters-slim .apt-fsum { margin-top: 0; padding: 2px 9px 6px; border-top: 0; }
.apt-filters-slim .apt-pendbox { margin-top: 4px; }
.apt-filters-slim .apt-pendbox .apt-pend-list { max-height: 46vh; }

/* ===== 日期条：农历 / 节气 / 节假日 / 快捷跳转（2026-09-20 新增）===== */
/* ⚠️ 2026-10-04 清点：这一组（.apt-datebar / .db-jump / .db-strip / .db-nav / .db-days / .db-day /
   .db-w / .db-d / .db-f / .db-j / .db-now / .db-tag）**在 public/ 里已找不到任何使用方** ——
   大概是早先「预约表单日期面板」迭代时留下的死样式。
   🔴 千万别以为它是空的就直接拿来用：船长 2026-10-04 的预约页新日期条一开始也叫
   `.apt-datebar` / `.db-nav`，**撞上这一组的 `width:26px; height:46px` 之类**，
   把新日期条硬顶成 56px 高（新日期条因此整体改名 `apt-dbar` / `apd-*`）。
   要删这一组之前，请先确认上面这句「无使用方」的结论。 */
.apt-datebar {
  display: flex; align-items: stretch; gap: 10px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 10px;
}
.db-jump { display: flex; flex-direction: column; gap: 4px; justify-content: center; flex: none; }
.db-jump .db-j { padding: 3px 9px; font-size: 12px; }
.db-strip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.db-nav { flex: none; border: 1px solid var(--border); background: #fff; border-radius: 8px; width: 26px; height: 46px;
  color: var(--muted); font-size: 15px; cursor: pointer; }
.db-nav:hover { background: #f4f6fa; }
.db-days { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.db-day {
  position: relative; flex: none; width: 56px; padding: 5px 2px 6px; border-radius: 9px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid transparent; background: #fff;
}
.db-day:hover { border-color: var(--primary); }
.db-w { font-size: 11px; color: var(--muted); }
.db-d { font-size: 16px; font-weight: 600; line-height: 20px; }
.db-f { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.db-day.weekend { background: #fafbfd; }
.db-day.weekend .db-d { color: #2f6fd8; }
.db-day.today .db-d { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.db-day.off { background: #fff3f2; }
.db-day.off .db-f { color: var(--danger); font-weight: 500; }
.db-day.work { background: #f5f7fa; }
.db-day.term .db-f { color: var(--primary); font-weight: 500; }
.db-day.on { background: var(--primary); border-color: var(--primary); }
.db-day.on .db-w, .db-day.on .db-f { color: rgba(255, 255, 255, .85); }
.db-day.on .db-d { color: #fff; }
.db-tag { position: absolute; top: 2px; right: 3px; font-style: normal; font-size: 9px; line-height: 13px;
  padding: 0 3px; border-radius: 4px; }
.t-off { background: var(--danger); color: #fff; }
.t-work { background: #d8dee8; color: #55607a; }
.t-week { background: #eef1f6; color: #8b93a5; }
.db-now { flex: none; display: flex; flex-direction: column; justify-content: center; font-size: 12px;
  color: var(--muted); padding-left: 10px; border-left: 1px dashed var(--border); }
.db-now b { font-size: 13px; color: var(--text); font-weight: 600; }

/* ===== 系统参数：节假日卡片 ===== */
.hol-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.hol-switch { display: flex; align-items: center; gap: 8px; flex: none; padding-top: 2px; cursor: pointer; }
.hol-switch input { width: 16px; height: 16px; }
.hol-row .muted-line { flex: 1; }
.hol-off-row .field { margin-bottom: 6px; }

/* ===== 月历面板（2026-09-20 晚，参照牙医管家参考图；替代原横向日期条）=====
   2026-09-21 调整：左栏收窄（300→236），「待安排」并入左栏状态区，取消右侧独立栏，
   省出的宽度全部给医生列区，实现「8 位医生同屏自适应」。 */
/* 🆕 2026-11-13 船长：「位置向右移动」——日历栏原来紧贴内容区左缘（实测 left=100 就是 #main 起点，
   与一级导航之间一点空隙都没有）。给 grid 容器加左内边距，整块右移 14px；
   两列宽度不变，时间轴跟着右移，列间距保持 12px。 */
.apt-layout { grid-template-columns: 236px minmax(0, 1fr); padding-left: 14px; }
.apt-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.apt-cal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 12px; }
.mc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.mc-nav { flex: none; width: 24px; height: 24px; border: 1px solid var(--border); background: #fff; border-radius: 7px;
  color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; }
.mc-nav:hover { background: #f4f6fa; }
/* 🆕 2026-10-05 船长：「日期 + 天秤（座）」要**完整显示** ⇒ 去掉省略号截断（原来 overflow:hidden +
   text-overflow:ellipsis 会把「（天秤座）」吃掉）；保留 nowrap 防折行。
   标题现在只剩「2026年10月5日（天秤座）」（农历已挪进 title 属性），长度可控、不会撑破。 */
.mc-title { font-size: 11.5px; color: var(--text); font-weight: 500; white-space: nowrap; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mc-w { text-align: center; font-size: 12px; color: var(--muted); padding: 3px 0 5px; }
.mc-cell { position: relative; text-align: center; padding: 4px 0 5px; border-radius: 9px; cursor: pointer; min-width: 0; }
.mc-cell:hover { background: #f4f6fa; }
.mc-cell b { display: block; font-size: 15px; font-weight: 600; line-height: 19px; color: var(--text); }
.mc-cell span { display: block; font-size: 10px; line-height: 13px; color: #9aa1ad; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-cell.mc-weekend b { color: #e5484d; }
.mc-cell.mc-dim { opacity: .45; }
/* 2026-09-22 船长定：取消「休/班」角标，全部改用颜色 + 边框表达 ↓ */
.mc-cell .c-hol { color: #e5484d; font-weight: 600; }         /* 法定放假：级别最高，红字加粗 */
.mc-cell .c-term { color: #d9822b; font-weight: 500; }        /* 二十四节气：橘黄 */
.mc-cell .c-fest { color: var(--primary); }                          /* 其余节日（农历节/公历节）：绿色 */
.mc-cell.mc-off b { color: #e5484d; }                         /* 法定休息日：日期红字 */
.mc-cell.mc-work b { color: #3b7dd8; }                        /* 补班（调休上班）：日期蓝字 */
/* 2026-09-22 船长定：今日＝浅绿数字（撤掉红框）；点中某天＝同款浅绿实心圆圈；
   点中的正好是今天时，浅绿块与浅绿数字重叠看不清 → 数字改白 */
.mc-cell.mc-today b { color: #52c41a; font-weight: 600; }
.mc-cell.mc-sel b { background: #52c41a; border-radius: 50%; width: 24px; height: 24px; line-height: 24px; margin: 0 auto; }
.mc-cell.mc-today.mc-sel b { color: #fff !important; }
/* 🆕 2026-11-13 船长：「优化排版显示」——
   原来是 flex 6 等分，216px 里每个只有 33px，而「三个月」12px×3 要 36px
   ⇒ 六个按钮**全部竖排换行**（连「今日」都变成两行，实测 h=42px）。
   改成 3 列 × 2 行网格：每格约 68px，一行放得下；文字加 nowrap 防再换行。 */
.mc-jumps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.mc-jumps .mc-j { padding: 5px 2px; font-size: 12px; border: 1px solid var(--border); background: #fff;
  white-space: nowrap; }
.mc-jumps .mc-j:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 预约表单的「日期」选择器（自研面板，替代原生 <input type="date">，船长 2026-09-24 定）=====
   为什么换掉原生：原生面板是浏览器画的，**塞不进自定义按钮** —— 而三日/一周/四周/三个月/六个月
   这几个快捷预约键必须就在面板里（原生面板那个位置只有「清除 / 今天」）。
   面板本体复用上面的 .apt-cal / .mc-* 样式（农历、节气、节假日配色、今天绿圈全部一致），
   这里只加「输入框 + 弹层」这两层壳。
   ⚠️ 刻意**不写窄屏媒体查询**（手机端暂停中）：宽度用视口算式，天生不会溢出。 */
.dt-pick { position: relative; }
.dt-in { cursor: pointer; background: #fff; }
.dt-pop { position: fixed; z-index: 90; width: 320px; max-width: calc(100vw - 16px);
  box-shadow: 0 12px 32px rgba(20, 30, 50, .18); border-radius: var(--radius); }

/* ===== 左栏紧凑化 + 「待安排」迁入左栏（2026-09-21 船长要求）=====
   左栏 300→236px，日历整体缩小、日期靠左，省出的宽度全给医生列区。 */
.apt-cal { padding: 8px 9px 9px; }
.mc-w { font-size: 11px; padding: 2px 0 4px; }
.mc-cell { padding: 3px 0 4px; }
.mc-cell b { font-size: 13.5px; line-height: 17px; }
.mc-cell span { font-size: 9px; line-height: 12px; }
.mc-cell.mc-sel b { width: 21px; height: 21px; line-height: 21px; }
.mc-jumps { gap: 4px; margin-top: 8px; }
.mc-jumps .mc-j { padding: 4px 1px; font-size: 11px; }

/* 「待安排」区块（并入左侧状态栏，不再单独占右栏） */
.apt-pendbox { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.apt-pendhead { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 4px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.apt-pendhead b { background: var(--primary-soft); color: var(--primary); border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 600; }
.apt-pend-hint { font-size: 10.5px; color: var(--muted); line-height: 1.5; padding: 0 2px 6px; }
.apt-pendbox .apt-pend-list { max-height: 240px; margin-top: 0; display: flex; flex-direction: column; gap: 5px; }
.apt-pendbox .pend-item { margin-bottom: 0; padding: 5px 8px; }
.apt-pendbox .pend-item .pi-n { font-size: 12.5px; }

/* 医生列头：列宽自适应后变窄，改为「省略号」而非逐字换行（2026-09-21） */
/* 2026-09-21 追加：昵称跟在名字后面，列窄放不下才折到下一行；每行各自省略 */
.cal-colhead .ch-name { font-size: 12.5px; line-height: 16px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; row-gap: 0; overflow: hidden; }
.cal-colhead .ch-real { flex: 0 0 auto; max-width: 100%; }
.cal-colhead .ch-nick { flex: 0 0 auto; max-width: 100%; }
.cal-colhead .ch-name > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-colhead .ch-nick { font-weight: 400; font-size: 10px; color: var(--muted); }
.cal-colhead .ch-title { font-size: 10px; margin-left: 4px; }
.cal-colhead .ch-sub { gap: 4px; }
.cal-colhead .ch-shift { font-size: 10px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-colhead .ch-badge { font-size: 10px; padding: 0 5px; }
.cal-colhead .ch-load { font-size: 10px; white-space: nowrap; }
/* 时间轴刻度与预约块：窄列下同步收紧，保证信息可读 */
.cal-corner { font-size: 11px; padding: 7px 4px; }
.cal-tick, .cal-nowtime { font-size: 10px; right: 4px; }
/* 🔴 这条**不是**「窄列专用」—— 它没写在任何 @media 里，且排在文件后面，
   实际就是 `.cal-appt` 的**生效基准**（上面那条 line 771 的 padding/font-size 被它盖掉）。
   2026-10-05 卡片重排后按新字号重定：左边框 5px 宽 ⇒ 左右各留 5px 内边距。
   🔴 `line-height` 也在这里定（1.28）：卡片内容分级显示的**高度阈值就是按它算的**，
      改了行高必须回头重算 `showItem/showTime/showMrn` 那三个阈值，否则会裁半行。 */
.cal-appt { padding: 2px 5px; font-size: 11.5px; line-height: 1.28; }

/* 病历号规则示意（设置页） */
.mrn-preview { display: flex; gap: 14px; align-items: flex-start; margin-top: 6px; }
.mrn-demo { display: flex; gap: 3px; flex: none; padding-top: 2px; }
.mrn-seg { padding: 5px 9px; border: 1px solid var(--border); border-radius: 6px; background: #f6f9fb;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1; }
.mrn-seq { background: #e8f2ff; border-color: #b8d4f5; color: #1a5fae; font-weight: 600; }

/* ===== 双周循环排班（2026-09-21）：交叉格网格 + 当日在岗统计 =====
   2026-09-25 船长定：人员池卡片已删（绿框），当日在岗统计移到顶部（红框），
   角色用底色区分（医生浅蓝 / 护士浅粉 / 前台浅橘黄），周六周日红字。 */
/* 「姓名（昵称）」里的昵称部分淡化显示（2026-09-21 船长定） */
.nk { font-weight: 400; color: var(--muted); font-size: .92em; }
.pool-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pool-tags i { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary); }
.pool-tags.muted, .pool-tags .muted { color: var(--muted); font-size: 12px; background: none; padding: 0; }

.sch-grid-card { padding: 0; }
/* 网格高度「自适应、尽量高」（船长 2026-09-25 定）：
   固定高度（JS 按可视区精算，见 fitSchGrid）+ 表格 height:100%
   → 人员少时行高自动撑开吃满剩余高度，人员多时网格内部滚动，两种情况下都不留空白 */
.sch-grid-wrap { overflow: auto; height: calc(100vh - 340px); min-height: 220px; }
.sch-grid { border-collapse: separate; border-spacing: 0; width: 100%; height: 100%; table-layout: fixed; }
.sch-grid th, .sch-grid td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  padding: 3px 5px; vertical-align: middle; }
.sch-grid .col-name, .sch-grid .cell-name { width: 170px; text-align: left; position: sticky; left: 0;
  background: var(--panel); z-index: 2; }
.sch-grid .col-name { background: #f7fafc; }
.cell-name b { font-size: 13px; }
.cell-name .pool-tags { display: flex; margin-top: 3px; }
.sch-grid thead th { position: sticky; top: 0; background: #f7fafc; z-index: 3; font-size: 12px; text-align: center; }
.sch-grid thead th.col-name { z-index: 4; text-align: left; }

/* ── 角色底色：医生浅蓝 / 护士浅粉 / 前台浅橘黄（船长 2026-09-25 定）──
   整行淡底色 + 姓名列实底色与左侧色条，一眼分清哪个是医生、哪个是护士、哪个是前台 */
.sch-grid tr.role-doctor .cell-day { background: #f5faff; }
.sch-grid tr.role-nurse .cell-day { background: #fff8fc; }
.sch-grid tr.role-reception .cell-day { background: #fffcf4; }
.sch-grid tr.role-doctor .cell-name { background: #e3effd; box-shadow: inset 4px 0 0 #7cb6ee; }
.sch-grid tr.role-nurse .cell-name { background: #fde9f3; box-shadow: inset 4px 0 0 #ef9dc6; }
.sch-grid tr.role-reception .cell-name { background: #fdefd8; box-shadow: inset 4px 0 0 #eec07a; }
.sch-grid tr.role-doctor .cell-name b { color: #14559c; }
.sch-grid tr.role-nurse .cell-name b { color: #a4266f; }
.sch-grid tr.role-reception .cell-name b { color: #8f5716; }

.col-day { cursor: pointer; min-width: 72px; }
.col-day .d1 { font-size: 12px; }
.col-day .d2 { font-size: 11px; color: var(--muted); }
.cell-day { text-align: center; cursor: pointer; }
.cell-day:hover { box-shadow: inset 0 0 0 2px var(--primary-soft); }
.cell-day.sel { box-shadow: inset 0 0 0 2px var(--primary); }
.col-day.sel { background: var(--primary-soft); }
.col-day.sel .d1, .col-day.sel .d2 { font-weight: 700; }
/* 周六 / 周日红字（放在 .sel 之后 → 选中的周末当天也照样是红的） */
.col-day.wkend { background: #fff5f5; }
.col-day.wkend .d1, .col-day.wkend .d2 { color: #d92f2f; font-weight: 700; }
.col-day.wkend.sel { background: #ffe9e9; }
/* 只读角色（如运营主管）：交叉格不可点，别给「能点」的错觉 */
.cell-day.ro { cursor: default; }
.cell-day.ro:hover { box-shadow: none; }

/* 一个班次一块、**单行**显示（不再分行占高）；一天多个班次上下排列，顺序＝上班时刻先后。
   🔵 2026-10-15 船长定：**底色＝分院、边框＝角色**
     · 本院块 → 实线边框，里面写班次名（「班」/「上午班」/「下午班」）
     · 别院块（.out）→ **虚线**边框，里面写**院名**（跨院医生"上下午在不同院"时出现的第二个色块）
   底色走 .cl-red / .cl-amber / .cl-blue，值取自 `clinics.theme_color`（与控制台 CLINIC_C 同一套色）。
   🔴 原来这里按**角色**上底色的三条（role-doctor → #d9eafd）**必须删掉**：
     它们特异性更高（0,3,0 > .rost-chip.cl-* 的 0,2,0），留着会把分院底色整个盖回去。 */
.rost-chip { display: flex; align-items: center; justify-content: center; gap: 4px; line-height: 1.15;
  background: #f1f4f7; color: #5b6773; border: 1px solid #d5dde5;
  border-radius: 5px; padding: 1px 5px; margin: 2px 0; font-size: 10.5px; white-space: nowrap; overflow: hidden; }
.rost-chip b { font-weight: 600; }
.rost-chip em { font-style: normal; }
.rost-chip.cl-red { background: #fbe3e3; color: #8c2020; }
.rost-chip.cl-amber { background: #fdeed3; color: #8a5310; }
.rost-chip.cl-blue { background: #dbe9fa; color: #14559c; }
.rost-chip.out { border-style: dashed; }
.sch-grid tr.role-doctor .rost-chip { border-color: #7cb6ee; }
.sch-grid tr.role-nurse .rost-chip { border-color: #ef9dc6; }
.sch-grid tr.role-reception .rost-chip { border-color: #eec07a; }
/* 🔵 2026-10-15 船长：「休息用斜杠或什么来表示一下」—— 原来那格是空白，一眼看不出是「休息」还是「没加载」。
   平时显示一个灰斜杠；鼠标移到格子上时变成「+」（提示这里可以点着排班）；
   只读账号（.ro）固定显示斜杠、不出现「+」。 */
.rost-rest { color: #c7d0da; font-size: 15px; line-height: 1; }
.rost-rest i { font-style: normal; }
.rost-rest .rr-p { display: none; }
.rost-rest.ro { color: #dde3ea; }
.cell-day:not(.ro):hover .rost-rest .rr-s { display: none; }
.cell-day:not(.ro):hover .rost-rest .rr-p { display: inline; color: var(--primary); font-size: 13px; }
/* 请假/停诊登记表给网格「让位」：高度封顶（超出内部滚动），网格才能吃满剩下的高度 */
.sch-leave-card { max-height: 210px; overflow: auto; }

/* 顶部**只留一行**（2026-09-25 船长要求）：标题 · 周期导航 · 当日在岗 · 人员筛选 · ⚙️设置
   nowrap + 横向可滚：宁可横向滚，也不折成第二行把网格挤下去
   其余（视图周数 / 复制周 / 登记请假 / 只看有排班 / 清空筛选）收进「⚙️ 设置」弹窗 */
.sch-topbar { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; overflow-x: auto;
  padding: 5px 12px; margin-bottom: 8px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); }
.sch-topbar .st-title { margin: 0; font-size: 15px; white-space: nowrap; }
.sch-topbar .st-nav { display: flex; align-items: center; gap: 4px; }
.sch-topbar .st-nav .pat-sel { width: 130px; padding: 3px 6px; }
.sch-topbar .st-duty { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sch-topbar .st-d1 { color: var(--text); }
.sch-topbar .st-n { padding: 1px 7px; border-radius: 6px; font-size: 11.5px; white-space: nowrap; }
.sch-topbar .st-n b { margin-left: 2px; font-size: 12.5px; }
.sch-topbar .st-n.doctor { background: #e3effd; color: #14559c; }
.sch-topbar .st-n.nurse { background: #fde9f3; color: #a4266f; }
.sch-topbar .st-n.reception { background: #fdefd8; color: #8f5716; }
.sch-topbar .st-n.total { background: var(--primary); color: #fff; }
.sch-topbar .st-n.total b { color: #fff; }
.sch-topbar .st-clin { font-size: 11.5px; }
.sch-topbar .st-filter { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.sch-topbar .st-filter .pat-sel { width: 104px; padding: 3px 6px; }
.sch-topbar .st-set { flex: none; }
/* 角色筛选胶囊（顶部行与设置弹窗共用） */
.fb-chips { display: flex; gap: 4px; }
.fb-chip { font-size: 12px; padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; }
.fb-chip:hover { border-color: var(--primary); color: var(--primary); }
.fb-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
/* 角色小标签（设置弹窗里的图例） */
.lg-doctor, .lg-nurse, .lg-reception { font-style: normal; padding: 1px 7px; border-radius: 6px; font-size: 11px; }
.lg-doctor { background: #e3effd; color: #14559c; }
.lg-nurse { background: #fde9f3; color: #a4266f; }
.lg-reception { background: #fdefd8; color: #8f5716; }

/* 排班弹窗：上午 / 下午 快捷时段 */
.ros-shift .rs-quick { display: flex; gap: 6px; margin-right: 4px; }
.ros-shift .rs-quick .rs-q { min-width: 52px; }
.ros-shift .rs-quick .rs-q.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 排班弹窗：一天多个班次（每个班次各自时段 + 分院） */
.ros-shifts { display: flex; flex-direction: column; gap: 10px; }
.ros-shift { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fbfcfd; }
.ros-shift .rs-h { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ros-shift .rs-h .rs-hint { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.ros-shift .rs-time { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ros-shift .rs-time label { font-size: 12.5px; color: var(--muted); }
.ros-shift .rs-time .ros-x { margin-left: auto; }
.ros-shift .check-row { display: flex; gap: 14px; flex-wrap: wrap; }
.ros-shift .rs-foot { min-height: 6px; }
.ros-shift .rs-warn { color: var(--danger); font-size: 12px; }



/* ===== 处置记录（患者详情页页签，版式参照 E看牙）===== */
.tt-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tt-count { font-size: 13px; color: var(--muted); }
.tt-bar-btns { margin-left: auto; display: flex; gap: 8px; }
/* 🆕 2026-10-24 船长：卡片按容器自适应 —— 宽屏一行两张、窄屏一张，间距均分 */
.tt-list { display: block; }

/* 卡片宽度由网格格子决定（一行均分），不再固定 620px */
.tt-card { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.tt-list .tt-card { margin-bottom: 14px; }
/* 🆕 2026-10-09 船长：「内容左右紧凑显示」⇒ **只压缩留白**（保持两端对齐，不改成左聚拢）：
   卡片内边距 14→10px、卡头 10→8px、明细列间距 10→6px、牙位区与表格间距 14→8px、底栏 22→18px。
   改完必须量真实 rect 复核（别信 CSS 字面值）。 */
.tt-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f7f9fc; border-bottom: 1px solid var(--border); }
.tt-hmeta { display: flex; flex-wrap: wrap; gap: 5px 16px; font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
.tt-hmeta > span > b { color: var(--text); font-weight: 500; }
.tt-hact { display: flex; gap: 6px; flex: none; }
.tt-body { padding: 8px 10px 10px; }
.tt-diag { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tt-diag > b { color: var(--text); font-weight: 500; }
.tt-noitems { font-size: 12px; color: var(--muted); padding: 6px 0; }
.tt-notes { font-size: 12px; color: var(--muted); margin-top: 8px; padding-top: 8px; border-top: 1px dashed #eef1f5; }

/* 明细行：行1 = 牙位 | 项目 单价 数量 门市价 费用；行2 = 处置医生 护士 助理 咨询师 */
.tt-items { display: block; }
.tt-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 118px 104px 122px 122px;
  grid-template-areas:
    "tooth name f1 f2 f3 f4"
    "tooth roles roles roles roles roles";
  gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid #f2f5f9;
}
.tt-item:last-child { border-bottom: 0; }
.tt-tooth { grid-area: tooth; display: flex; align-items: flex-start; justify-content: center; }
.tt-name { grid-area: name; font-size: 13px; font-weight: 500; align-self: center; word-break: break-all; }
.tt-item > .tt-f { font-size: 12px; color: var(--muted); align-self: center; }
.tt-item > .tt-f:nth-child(3) { grid-area: f1; }
.tt-item > .tt-f:nth-child(4) { grid-area: f2; }
.tt-item > .tt-f:nth-child(5) { grid-area: f3; }
.tt-item > .tt-f:nth-child(6) { grid-area: f4; }
.tt-item > .tt-f > em { font-style: normal; color: var(--text); font-weight: 500; }
.tt-item > .tt-f > em.cut { color: var(--primary); }
.tt-roles { grid-area: roles; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; font-size: 12px; color: var(--muted); }
.tt-roles > span > b { color: var(--text); font-weight: 500; }
/* 🔵 2026-10-10 迷你牙位图改用全系统统一的 .tcr 十字线（见「牙位十字线」那段），
   原 .tt-tooth-mini / .tt-tooth-row / .tt-tooth-none 三个类已无人使用，整体删除。 */
/* 底部金额汇总 */
.tt-foot { display: flex; align-items: center; justify-content: flex-start; gap: 18px; padding: 8px 10px; border-top: 1px dashed #e6ebf2;
  font-size: 12px; color: var(--muted); background: #fcfdff; flex-wrap: wrap; }
.tt-foot b { color: var(--text); font-weight: 600; }
.tt-foot b.cut { color: var(--primary); }
.tt-foot b.warn { color: var(--danger); }
.tt-debt { margin-left: auto; }
/* 🆕 2026-10-24 船长：页脚五个板块均分宽度（非紧凑卡）；欠费块高亮 */
.tt-foot-grid { display: flex; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 0; padding: 0; }
.tt-foot-grid > span { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 7px 4px; border-left: 1px solid #eef1f5; text-align: center; }
.tt-foot-grid > span:first-child { border-left: 0; }
/* 🆕 2026-10-24：打印按钮在右下角，欠费块紧挨它左侧 */
.tt-foot-grid .tt-print { flex: none; align-self: center; margin: 0 8px; }
.tt-foot-grid em { font-style: normal; font-size: 11px; color: var(--muted); }
.tt-foot-grid b { font-size: 13px; }
.tt-foot-grid .tt-debt.on { background: #fff8f8; }
.tt-foot-grid .tt-debt.on em { color: var(--danger); }

/* ══ 🆕 2026-10-09 处置卡片「紧凑横向」版式（船长逐条定）══
   ① 明细行去掉人员那一行（处置医生/护士/助理/咨询师）
   ② 一行横向排成：项目 ｜ 单价 ｜ 数量 ｜ 折扣 ｜ 实付
   ③ 牙位区＝**四行十字线**（乳上 / 恒上 / 恒下 / 乳下），编号恒牙 1-8、乳牙字母 A-E，**无汉字**
   ④ 卡片右上角状态徽标：待收费（黄）／欠费（红）／已收费（绿）
   🔴 颜色口径（船长）＝**十字线与涉及的牙位用系统蓝 `var(--primary)`**，其余一律默认黑灰。
      别在这里写死色值 —— 全站主色换过一次（青绿→品牌蓝），写死的会漏改。 */
.tt-tooth-col { flex: none; }
/* ══ 🆕 2026-10-10 牙位十字线（船长定「只标牙号、不打刻度格」）══
   两条线：横＝牙列方向、竖＝中缝；牙号按「上/下颌 × 患者右/左」分成四组，
   分别写在横线的上/下、中线的左/右 —— 牙号本身就是「离中线第几颗」。
   🔴 全系统只有这一份实现（处置卡片 / 收费卡片 / 病历 / 影像都用它），别在模块里另写。
   🔴 颜色：只染这两条线与牙号（var(--primary)），其余默认黑灰。 */
/* ══ 牙位十字线（全系统唯一实现，见 core/ui.js 的 `UI.toothCross`）══
   船长 2026-10-11 三次定稿 —— **牙号按四个象限落在十字线分出的四个区域里**：

    患者右侧（视图左半）│患者左侧（视图右半）
         DDE         │        DDE          ← 上颌牙号贴横线**上沿**
    ─────────────────┼──────────────────   ← 浅蓝十字线（浅蓝＝参考线，牙号深灰＝内容）
         ED          │        DE           ← 下颌牙号贴横线**下沿**

   🔴🔴 三条硬规矩（船长原话：「无论怎么选择都不能超过十字线」）：
     ① **两列各占一半**（`minmax(0,1fr) minmax(0,1fr)`）⇒ 竖线正好落在两列之间，
        **永远不会从牙号中间穿过去**（老写法整排居中，字缝里穿线、像把牙号切断）。
     ② 上排 `align-self:end` + `padding-bottom:4px`、下排 `align-self:start` + `padding-top:4px`
        ⇒ 横线也不穿牙号。
     ③ 盒子**按牙号总宽撑开**（`min-width:40px`，不写死 84px）＋ `overflow:hidden`
        ⇒ **十字线随牙号自适应伸缩**：牙号少就短、多就长，横线永远不短于牙号、牙号永远越不出十字线。
   🔴 牙号之间的**间隙必须留着**（`letter-spacing` 逐档递减但不归零，船长 2026-10-11：
      「数字字母之间保持适当的间隙」）—— 收字号时把字距也归零会让牙号挤成一条。
   🔴 别再改回「整排居中 / 左半｜竖线｜右半 两张皮」这两种写法（前者穿字、后者不连贯）。 */
.tcr { position: relative; display: inline-grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); height: 36px; min-width: 108px; max-width: 100%;
  overflow: hidden; font-size: 11.5px; font-weight: 500; line-height: 1; letter-spacing: 0; color: var(--text); }
/* 🔴 字距写在 `.tcr` 上、格子 `inherit` —— 因为 `tcr-sN` 要把它归零（收字号时再留字距就白收了） */
.tcr-c { position: relative; z-index: 1; width: 100%; white-space: nowrap; overflow: hidden;
  min-width: 0; letter-spacing: inherit; }
/* 🔵 牙号颜色照 E看牙 定（10-10 实测取色：牙位号 rgb(69,69,69) 深灰、十字线浅蓝）——
   原来牙号是主色蓝，与"这是可点的牙位"混在一起；E看牙 把**数字当内容用深色**、
   只有十字线用浅蓝 ⇒ 数字读起来更清楚。若哪天觉得牙位不醒目了，改回 var(--primary) 即可。 */
.tcr-h { position: absolute; left: 0; right: 0; top: 50%; height: 1px; margin-top: -.5px; background: #8fc0e2; }
.tcr-mid { position: absolute; left: 50%; top: 1px; bottom: 1px; width: 1px; margin-left: -.5px; background: #8fc0e2; }
/* 四个格子：位置写死（左上/右上/左下/右下），牙号各自**贴着中线**（左格右对齐、右格左对齐），
   离开中线 3px ⇒ 连起来读仍是 E看牙 的 `DDE` / `EDDE`，但线不会切到字 */
.tcr-ul { grid-area: 1 / 1 / 2 / 2; text-align: right; align-self: end; padding: 0 3px 4px 0; }
.tcr-ur { grid-area: 1 / 2 / 2 / 3; text-align: left; align-self: end; padding: 0 0 4px 3px; }
.tcr-dl { grid-area: 2 / 1 / 3 / 2; text-align: right; align-self: start; padding: 4px 3px 0 0; }
.tcr-dr { grid-area: 2 / 2 / 3 / 3; text-align: left; align-self: start; padding: 4px 0 0 3px; }
/* 「全口」：上下各横跨两格、居中写一次 */
.tcr-all-u { grid-area: 1 / 1 / 2 / 3; text-align: center; align-self: end; padding-bottom: 4px; }
.tcr-all-d { grid-area: 2 / 1 / 3 / 3; text-align: center; align-self: start; padding-top: 4px; }
/* 牙号多的分档收字号（宁可小一点，也不能越过十字线）。用 `.tcr.tcr-sN` 是为了盖过 `.rf-tw .tcr`。
   🔴 **每一档都留字距**（1px → 0.5px），牙号之间不许挤成一条（船长 2026-10-11）：
      11.5px 时 4 个字 ≈ 27px、8.5px 时 8 个字 ≈ 41px（都算上字距） */
.tcr.tcr-s1 { font-size: 10.5px; letter-spacing: .5px; }
.tcr.tcr-s2 { font-size: 9.5px; letter-spacing: .5px; }
.tcr.tcr-s3 { font-size: 8.5px; letter-spacing: .5px; }
.tt-items { display: flex; gap: 8px; align-items: flex-start; }
/* 处置明细表：牙位 + 项目/单价/数量/折扣/实付，按内容收窄 */
.tt-rows { flex: 1; min-width: 0; }
/* 🔴 2026-11-05 船长：「牙位与处置不是在一行」——
   原来牙位是**整单并集**塞在左边一整列（.tt-tooth-col），项目各行共用，
   看不出"哪一项对应哪颗牙"。E看牙 是**每行行首一个牙位小十字**，这里改成逐行。
   ⇒ 第一列 46px 给牙位，其余五列不变。 */
.tt-r-h, .tt-r { display: grid; grid-template-columns: 46px minmax(0, 1fr) 72px 56px 62px 84px; gap: 0 6px; align-items: center; }
.tt-r-h { font-size: 11px; color: var(--muted); padding-bottom: 4px; border-bottom: 1px solid var(--border); }
/* 第 1 列（牙位）居中、第 2 列（项目）左对齐，后面四列数字右对齐 */
.tt-r-h > span:nth-child(n+3), .tt-r > span:nth-child(n+3) { text-align: right; }
.tt-r { padding: 6px 0; border-bottom: 1px solid #f2f5f9; font-size: 12px; color: var(--muted); }
.tt-r:last-child { border-bottom: 0; }
.tt-r-n { color: var(--text); word-break: break-all; }
.tt-r .cut { color: var(--primary); }
.tt-r-f { color: var(--text); font-weight: 600; }
/* 逐行牙位（迷你十字线）—— 与 E看牙 一致：没填牙位的行也画空十字，一眼看出"这行没标牙位" */
.tt-r-h > span.tt-c-tooth, .tt-r > span.tt-c-tooth { text-align: center; }
/* 🔴 .tcr 默认 min-width:108px，塞进 46px 的列会撑破整行 —— 这里必须显式收窄 */
.tt-c-tooth .tcr { margin: 0 auto; width: 44px; min-width: 0; height: 28px; font-size: 9.5px; }
.tt-c-tooth .tcr-ul, .tt-c-tooth .tcr-ur { padding-bottom: 2px; }
.tt-c-tooth .tcr-dl, .tt-c-tooth .tcr-dr { padding-top: 2px; }
@media (max-width: 820px) {
  .tt-r-h, .tt-r { grid-template-columns: 38px minmax(0, 1fr) 56px 44px 48px 62px; gap: 0 5px; }
  .tt-foot-grid { flex-wrap: wrap; }
  .tt-foot-grid .tt-print { margin: 4px 8px; }
}
/* 状态徽标（工具条与卡片头共用） */
.tt-stat { display: flex; gap: 8px; }
.tt-badge { font-size: 11.5px; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.tt-badge.today { background: #fdf3e0; color: #a86b12; }
.tt-badge.debt { background: #fdecec; color: var(--danger); }
.tt-badge.paid { background: #eaf6ee; color: #2f7d4f; }
/* 收费 / 收欠费 弹层里的金额条 */
.chg-sum { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
.chg-sum b { color: var(--text); }
.chg-sum .debt b { color: var(--danger); }

/* ══ 2026-11-19 系统设置「合并页」的页内子页签（数据与上传 / 数据采集 / 系统参数 / 日志）══ */
.set-subtabs { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.set-subtabs button { border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 5px 14px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.set-subtabs button:hover { border-color: var(--primary); color: var(--primary); }
.set-subtabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ══ 2026-11-19 统一收费弹窗（船长：两套合并成一套 + 组合收费）═══════════════
   结构：汇总条 → 明细（默认展开，可折叠）→ 待收清单（每条一个 .chg-owe）→ 取消
   收款行复用 .tt-pay-row / .tt-pm / .tt-dlg-pay-amt（原来诊疗记录页那套），不再新造。 */
.chg-detail { border: 0.5px solid var(--border); border-radius: 8px; margin: 8px 0; overflow: hidden; }
.chg-detail-h { padding: 6px 10px; background: #f7f9fc; font-size: 12px; color: var(--muted);
  cursor: pointer; user-select: none; }
.chg-detail.closed .chg-detail-b { display: none; }
.chg-detail-b { padding: 6px 10px; }
.chg-dr { display: grid; grid-template-columns: minmax(0, 1fr) 72px 40px 88px; gap: 6px;
  font-size: 12px; padding: 3px 0; align-items: baseline; }
.chg-dr > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chg-dr > span:nth-child(2), .chg-dr > span:nth-child(3), .chg-dr > span:nth-child(4) { text-align: right; }
.chg-dr-h { color: var(--muted); font-size: 11px; border-bottom: 1px solid #eef1f6; padding-bottom: 3px; }
.chg-dr-sum { grid-template-columns: minmax(0, 1fr) 88px; color: var(--muted); }
.chg-dr-sum > span:last-child { text-align: right; color: var(--text); }
.chg-dr-hist { grid-template-columns: 96px minmax(0, 1fr) 88px; }
.chg-dr-hist > span:nth-child(2) { text-align: left; }
.chg-dh { font-size: 11.5px; color: var(--muted); margin-top: 8px; padding-top: 6px;
  border-top: 1px solid #eef1f6; }
.chg-owe-list { margin-top: 8px; }
.chg-owe { border: 0.5px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.chg-owe.closed .chg-owe-b { display: none; }
.chg-owe-h { display: flex; gap: 10px; align-items: center; font-size: 12px; padding-bottom: 6px;
  border-bottom: 1px dashed #eef1f6; margin-bottom: 6px; }
.chg-owe-d { margin-left: auto; color: var(--danger); }
.chg-owe-h .chg-owe-x { padding-left: 4px; }
.chg-owe-x { color: var(--primary); cursor: pointer; }
.chg-none { padding: 16px; text-align: center; color: var(--muted); font-size: 12px; }
.ttpr-cpn { display: flex; align-items: center; gap: 6px; font-size: 11.5px;
  color: var(--muted); margin: 0 0 8px; }
.ttpr-cpn select { flex: 1; min-width: 0; font-size: 11.5px; padding: 3px 4px; }

/* ===== E看牙 原始收费单（只读快照）—— 收费页签与处置页签**共用** ===== */
/* 船长 2026-10-03：「完全搬运 E看牙」：应收/让利/实收/支付明细 + 牙位/折扣/单价×数量 */
.ek-list { display: block; }
.ek-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.ek-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: #f7f9fc; border-bottom: 1px solid var(--border); }
.ek-hmeta { display: flex; flex-wrap: wrap; gap: 5px 20px; font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
.ek-hmeta > span > b { color: var(--text); font-weight: 500; }
.ek-hsum { display: flex; gap: 16px; font-size: 12px; color: var(--muted); flex: none; }
.ek-hsum b { color: var(--text); font-weight: 600; }
.ek-hsum b.cut { color: var(--primary); }
.ek-hsum .ek-warn b { color: var(--danger); }
.ek-body { padding: 8px 14px 10px; }
.ek-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px dashed #e6ebf2; background: #fcfdff; font-size: 12px; color: var(--muted); }
.ek-pays { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ek-src { margin-left: auto; font-size: 11.5px; color: #aab3c0; }

/* ══ 「收费信息」页签（照 E看牙 整页重排 · 2026-10-09 船长定）· 开始 ══
   版式：一条工具条（页内页签 + 汇总 + 会员卡一行文字 + 收费按钮）＋ 两栏
   （左＝收费项目树，右＝表格区）。船长原话「取消卡片显示」⇒ 原来那两张 `.card`
   外壳不再用，改成页内页签切换（内容一条没少）。
   🔴 `pay-` 前缀在本段之前只被 `.pay-neg` 用过（就 1 处、不冲突）；
      新类名的**每一处出现都必须在上面/下面这对标记之间** —— 自检按这条断言（防撞名）。 */
.pay-page { display: flex; flex-direction: column; gap: 10px; }
.pay-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.pay-tabs { display: inline-flex; gap: 2px; flex: none; }
.pay-tab { padding: 5px 11px; border-radius: 7px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.pay-tab:hover { background: #eef3f8; color: var(--text); }
.pay-tab.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pay-tab i { font-style: normal; font-size: 11.5px; opacity: .7; margin-left: 3px; }
.pay-bar-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.pay-mc { font-size: 12px; color: #1d6b4a; background: #eaf7f0; border: 1px solid #cbe8da;
  border-radius: 8px; padding: 3px 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-mc.off { color: var(--muted); background: #f4f6f8; border-color: var(--border); }
.pay-body { display: flex; gap: 10px; align-items: flex-start; }
.pay-tree { flex: none; width: 178px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px; max-height: 60vh; overflow-y: auto; }
.pay-tree-h { font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 4px 8px; }
.pay-tree-g { font-size: 12.5px; color: var(--text); padding: 6px 8px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; }
.pay-tree-g:hover { background: #eef3f8; }
.pay-tree-g.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pay-tree-g b { margin-left: auto; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.pay-tree-i { font-size: 12.5px; color: #3d4b5c; padding: 5px 8px 5px 18px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; }
.pay-tree-i:hover { background: #f2f7fc; color: var(--primary); }
.pay-tree-i span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-tree-i em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--muted); flex: none; }
.pay-main { flex: 1; min-width: 0; }
/* 表格区：取消卡片外壳后仍要一层底/边，否则表格贴在页面背景上认不出边界 */
.pay-main > .table-card, .pay-main > .tbl, .pay-mtb { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.pay-mtb-sum td { font-weight: 600; background: #f7f9fc; }
/* 🔵 2026-10-09 船长：「输入拼音码在左侧收费项目字体下方」⇒ 搜索框搬进树里、紧贴标题 */
/* 🆕 2026-10-09「处置·收费」合并页：页内小页签（复用收费页那套 .pay-tabs/.pay-tab 样式） */
.tsw-tabs { margin-bottom: 10px; }
/* 🆕 2026-10-09 左侧收费列表：小类平铺列表 + 顶部「全部大类」下拉（船长定） */
.pt-sel { padding: 0 0 6px; }
.pt-sel-i { width: 100%; box-sizing: border-box; font-size: 12.5px; padding: 5px 6px;
  border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); }
.pay-tree-kw { width: 100%; box-sizing: border-box; margin: 0 0 6px; font-size: 12.5px; }
/* 🔵 2026-10-09 船长：「会员卡移动至支付方式上方」⇒ 主区下方两块：会员卡在上、支付方式在下 */
.pay-foot { display: flex; flex-direction: column; gap: 8px; }
.pay-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.pay-box-h { font-size: 12.5px; font-weight: 600; color: var(--muted); flex: none; }
/* 🔴 窄屏覆盖必须排在上面那些规则**之后**（同优先级靠"后来者胜"，写前面等于白写） */
@media (max-width: 820px) {
  .pay-body { flex-direction: column; }
  .pay-tree { width: 100%; max-height: 220px; }
}
/* 🔵 2026-10-10 船长：「参照 E看牙 排版」「上下两行 + 中缝一条竖线」「牙号 8…1 ｜ 1…8」。
   ⇒ 这套 .tc-* 是**全系统唯一的完整牙位图**：病历表单里点选、卡片里点开看，都用它。
   每格＝简号（恒牙 1-8 / 乳牙 A-E）大字 ＋ FDI 号小字；用到的牙＝主题色底。 */
.tc-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0 2px; }
.tc-blk { display: flex; flex-direction: column; gap: 6px; }
.tc-name { font-size: 12px; color: var(--muted); text-align: center; }
.tc-body { display: flex; align-items: stretch; }
.tc-half { display: flex; flex-direction: column; }
.tc-row { display: flex; }
.tc-h { height: 1px; background: #8fc0e2; margin: 6px 0; }   /* 十字线的横线（上颌与下颌之间） */
.tc-mid { width: 1px; background: #8fc0e2; margin: 0 12px; } /* 十字线的竖线（左右半侧之间） */
.tc-cell { width: 34px; height: 40px; margin: 0 2px; border-radius: 8px; background: #f4f7fa;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.tc-cell b { font-size: 14px; font-weight: 500; color: #8b96a5; line-height: 1; }
.tc-cell em { font-style: normal; font-size: 9.5px; color: #b3bcc7; line-height: 1; }
/* 🔵 2026-10-10 病历表单里的牙位图已改成「点小十字弹选牙卡片」（.twp），
   原先内嵌的 .rf-ft-panel 一套已整体删除。 */
.tc-cell.on { background: var(--primary-soft); }
.tc-cell.on b, .tc-cell.on em { color: var(--primary); }
.tc-cell.on b { font-weight: 600; }
.tc-sel { font-size: 12.5px; color: #5a6675; text-align: center; }
/* 🔵 2026-10-09 船长：「去除价格树」⇒ 左树去掉后主区占满；`.pay-body` 保留 flex（单栏时也正常） */
.pay-body .pay-main { width: 100%; }
/* ══ 「收费信息」页签 · 结束 ══ */

/* ══ 🆕 2026-10-09 船长：「新建收费时弹出这个卡片…显示历史收费记录，包含牙位处置项目、费用、
      折扣、实收等信息」⇒ 弹窗加宽成**两栏**：左＝开单表单（原来的字段一行没动），右＝历史收费记录。
   🔴 窄屏（≤900px）必须回落单栏 —— 两栏各剩不到 200px 时输入框会挤成一团。
   ⚠️ 类名一律 `pf-` 前缀：弹窗里的 `pf_item` / `pf_amount` 等是 **id**、不是类，两者不冲突。 ══ */
.modal.modal-pay { width: min(1060px, 96vw); max-height: 92vh; padding: 20px 22px; }
.modal.modal-pay .pf-body { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.05fr); gap: 18px; align-items: start; }
.modal.modal-pay .pf-form { min-width: 0; }
.modal.modal-pay .pf-hist { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; min-width: 0; }
.pf-hist-h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: #fafbfc;
  border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: #33404f; }
.pf-hist-h .cnt { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.pf-hist-body { max-height: 54vh; overflow-y: auto; }
/* 🔴 时间列给到 112px + nowrap：写 78px 时「2026-07-26 17:19」会折成两行（日期一行、时间一行），很乱；
   96px 实测**仍会折**（数字字形比估算宽）⇒ 直接 112px 并锁死不换行。 */
.pf-hrow { display: grid; grid-template-columns: 112px 1fr; column-gap: 10px; padding: 8px 12px; border-bottom: 1px solid #f4f6f9; font-size: 12.5px; }
.pf-hrow:last-child { border-bottom: 0; }
.pf-hrow .t { color: var(--muted); font-size: 11.5px; padding-top: 1px; white-space: nowrap; }
.pf-hrow .nm { color: var(--text); line-height: 1.45; word-break: break-all; }
.pf-hrow .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.pf-hrow .meta b { color: #33404f; font-weight: 600; }
.pf-hrow .tooth { color: #2f6fd0; }
.pf-hrow .debt { color: #c0392b; font-size: 11px; }
.modal.modal-pay .m-foot { margin-top: 14px; }
@media (max-width: 900px) {
  .modal.modal-pay .pf-body { grid-template-columns: 1fr; }
  .modal.modal-pay .pf-hist-body { max-height: 34vh; }
}
/* —— 明细表（收费视角）—— */
.ek-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ek-tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ek-tbl td { padding: 7px 8px; border-bottom: 1px solid #f2f5f9; }
.ek-tbl tr:last-child td { border-bottom: 0; }
.ek-tbl .num { text-align: right; white-space: nowrap; }
.ek-tbl .cut { color: var(--primary); }
.ek-td-tooth { color: #2f6fd8; white-space: nowrap; }
.ek-cat { font-style: normal; margin-left: 6px; font-size: 11px; color: var(--muted); background: #eef1f5; border-radius: 4px; padding: 0 5px; }
/* —— 明细行（处置视角，与 .tt-item 同一版式）—— */
.ek-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 96px 82px 100px 76px 100px 100px;
  grid-template-areas:
    "tooth name f1 f2 f3 f4 f5 f6"
    "tooth roles roles roles roles roles roles roles";
  gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid #f2f5f9;
}
.ek-row:last-child { border-bottom: 0; }
.ek-row > .ek-tooth { grid-area: tooth; display: flex; align-items: flex-start; justify-content: center; }
.ek-row > .ek-name { grid-area: name; font-size: 13px; font-weight: 500; align-self: center; word-break: break-all; }
.ek-row > .ek-f { font-size: 12px; color: var(--muted); align-self: center; }
.ek-row > .ek-f:nth-child(3) { grid-area: f1; }
.ek-row > .ek-f:nth-child(4) { grid-area: f2; }
.ek-row > .ek-f:nth-child(5) { grid-area: f3; }
.ek-row > .ek-f:nth-child(6) { grid-area: f4; }
.ek-row > .ek-f:nth-child(7) { grid-area: f5; }
.ek-row > .ek-f:nth-child(8) { grid-area: f6; }
.ek-row > .ek-f > em { font-style: normal; color: var(--text); font-weight: 500; }
.ek-row > .ek-f > em.cut { color: var(--primary); }
.ek-row > .ek-roles { grid-area: roles; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; font-size: 12px; color: var(--muted); }
.ek-row > .ek-roles > span > b { color: var(--text); font-weight: 500; }
/* 窄屏（≤820px）：网格拆成竖排，明细表横向可滚 —— 别让卡片被挤爆 */
@media (max-width: 820px) {
  .ek-head { flex-direction: column; align-items: flex-start; }
  .ek-hsum { width: 100%; }
  .ek-row { display: block; }
  .ek-row > .ek-tooth { justify-content: flex-start; margin-bottom: 4px; }
  .ek-row > .ek-f { display: inline-block; margin-right: 12px; }
  .ek-row > .ek-roles { grid-template-columns: repeat(2, 1fr); margin-top: 6px; }
  .ek-body { overflow-x: auto; }
  .ek-tbl { min-width: 900px; }
}

/* —— 录入弹窗 —— */
.tt-edit { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fcfdff; }
.tt-edit-bar { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.tt-edit-bar > b { font-size: 13px; flex: none; line-height: 30px; }
.tt-add { flex: 1; }
.tt-add > input { width: 100%; }
.tt-edit-head, .tt-edit-row { display: grid; gap: 6px; align-items: center;
  grid-template-columns: minmax(120px, 1fr) 108px 78px 62px 58px 86px 86px 30px; }
.tt-edit-head { font-size: 12px; color: var(--muted); padding: 0 2px 6px; border-bottom: 1px solid var(--border); }
.tt-edit-row { padding: 6px 2px; border-bottom: 1px dashed #eef1f5; }
.tt-edit-row > input { width: 100%; }
.tt-edit-empty { font-size: 12px; color: var(--muted); padding: 12px 0; text-align: center; }
.tt-tooth-cell { display: flex; gap: 4px; align-items: center; }
.tt-tooth-cell > input { flex: 1; min-width: 0; }
.tt-tooth-btn { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 4px 6px; cursor: pointer; line-height: 1; }
.tt-tooth-btn:hover { border-color: var(--primary); }
/* 🆕 2026-10-24 船长：牙位格默认十字线；整块可点 */
/* 2026-11-16：牙位格换成整块十字线（病例同款 UI.toothCross） */
.tt-tooth-cell .tt-tooth-btn { display: block; width: 100%; min-width: 0; padding: 1px 2px; color: var(--text); }
.tt-tooth-cell .tt-tooth-btn .tcr { width: 100%; min-width: 0; }
.tt-tooth-cell .tt-tooth-btn:hover { border-color: var(--primary); background: #f5fbff; }
.tt-tooth-cell .tt-tooth-btn:hover { border-color: var(--primary); background: #f5fbff; }
.tt-tooth-cross { display: flex; flex: none; }
.tt-tooth-txt { font-size: 10px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-tooth-txt.ph { color: var(--muted); }
.tt-tooth-cell .tt-tooth-btn em { font-style: normal; font-size: 9px; color: var(--primary); margin-left: auto; }
.tt-edit-row input[readonly] { background: #f7f9fc; color: var(--muted); cursor: not-allowed; }

/* ══ 🆕 2026-10-09「新建处置」照 E看牙「处置收费」页改版（船长逐条定）══
   左栏收费项目树 ＋ 右栏**十列**明细表（牙位/项目名称/项目编码/单位/单价/数量/金额/折扣%/医生/操作）；
   顶部只留 处置时间 / 出诊医生 / 就诊类型 三项，其余折进「更多」；
   折扣% 由**会员卡**带出（无卡 100），不设整单折扣输入框；
   本弹窗**不含收款**（船长选：弹窗只开单、收钱回卡片上按）。
   🔴 列宽必须与 .tt-edit-row 完全一致，否则表头与数据错位（改一处要改两处）。 */
.tt-edit-head, .tt-edit-row, .tt-tbl-head {
  gap: 5px;
  /* 2026-10-24 「适用于」移到价目表项目里，明细回归 10 列 */
  /* 🆕 2026-11-13 船长：券列移到最前（牙位之前）、取消「项目编码」列 ⇒ 仍 10 列 */
  /* 🔴 2026-11-17：8 列（去掉行内医生）—— 9 列总宽 668px 撑不进 539px 的容器，
     右侧医生与删除按钮一直被裁掉。现在固定列和 396 + 7 个 gap，名称列吃剩余。 */
  grid-template-columns: 52px 84px minmax(120px, 1fr) 56px 44px 70px 50px 28px;
}
/* 行内「券」按钮：可用＝蓝边，已用＝实心蓝，麻醉/商品＝灰底禁用 */
.tt-cpn { width: 100%; height: 28px; border: 1px solid #bcd8ea; background: #f4faff; color: #14618f;
  border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.tt-cpn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.tt-cpn.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.tt-cpn:disabled { background: #f1f3f6; border-color: #e2e7ee; color: #9aa6b2; cursor: not-allowed; }
/* 行内选券小面板 */
.modal.modal-ttcpn { width: min(520px, 94vw); }
.ttc-pickbox { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow: auto; }
.ttc-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  border: 1px solid #dbe6f0; background: #fbfdff; border-radius: 9px; padding: 7px 11px; cursor: pointer; text-align: left; }
.ttc-pick:hover:not(:disabled) { border-color: var(--primary); background: #f4faff; }
.ttc-pick b { font-size: 13px; color: var(--text); }
.ttc-pick span { font-size: 12px; color: #4a5b6b; }
.ttc-pick em { font-style: normal; font-size: 11px; color: #b45309; }
.ttc-pick:disabled { opacity: .6; cursor: not-allowed; }
.ttc-none { font-size: 12.5px; color: var(--muted); padding: 12px 4px; }
.tt-tbl-head { display: grid; gap: 6px; align-items: center; font-size: 12px; color: var(--muted);
  padding: 0 2px 6px; border-bottom: 1px solid var(--border); }
.tt-edit-row > select { width: 100%; }
.tt-total { display: flex; justify-content: flex-end; gap: 22px; align-items: center;
  padding: 8px 2px 0; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.tt-total b { color: var(--text); font-weight: 600; font-size: 13px; }
.tt-total .tt-payable b { color: var(--primary); font-size: 15px; }
.tt-total #ttDiscSrc { margin-left: 4px; font-size: 11px; }
/* 弹窗外壳：左树 ＋ 右主区 */
.ttf-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ttf-title { font-size: 15px; font-weight: 500; }
.ttf-tip { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.ttf-wrap { display: flex; gap: 14px; align-items: stretch; }
/* 🆕 2026-10-31 船长：「左侧处置项目列表变宽，尽量容下所有内容」⇒ 232 太窄，
   分类下的项目名（如「2024年6月版儿童会员常用处置」）全被省略号截掉。
   改成随窗口自适应：窄窗 300、常规 335 左右、宽屏封顶 360（再宽就挤右边 10 列表格了）。*/
.ttf-tree { flex: none; width: clamp(280px, 25vw, 330px); border: 1px solid var(--border); border-radius: 10px; padding: 8px;
  background: #fcfdff; display: flex; flex-direction: column; max-height: 68vh; }
.ttf-tree-h { font-size: 12px; font-weight: 600; color: var(--text); padding: 2px 4px 6px; }
.ttf-tree .pay-tree-list { flex: 1; overflow-y: auto; min-height: 120px; }
/* 🆕 2026-11-16 船长：「左侧价格、中间处置、右侧卡券，处置卡片加大」
   ⇒ 主区从「竖排一列」改两列网格：左＝表单+明细+合计，右＝卡券（跨满整列，自己滚动）。
   🔴 行高用 minmax(0,1fr) 给明细，否则内容一多就把卡券挤出视口。 */
.ttf-main { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 342px;
  grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 0 12px; align-content: stretch; }
.ttf-fields { grid-column: 1; grid-row: 1; }
.ttf-more { grid-column: 1; grid-row: 2; }
.tt-edit { grid-column: 1; grid-row: 3; margin-top: 10px !important; display: flex; flex-direction: column; min-height: 0; }
#ttCoupons { grid-column: 2; grid-row: 1 / 4; min-height: 0; display: flex; flex-direction: column; }
#ttSum { grid-column: 1; grid-row: 4; }
.ttf-main > .m-foot { grid-column: 1 / -1; grid-row: 5; }
#ttRows { flex: 1; min-height: 0; overflow: auto; }
/* 右栏卡券外框撑满整列 */
#ttCoupons .tt-cp { height: 100%; margin: 0; display: flex; flex-direction: column; }
#ttCoupons .tt-cp-grid { flex: 1; min-height: 0; max-height: none !important; }
.ttf-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.ttf-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ttf-more .field.full { grid-column: 1 / -1; }
.ttf-more.hidden { display: none; }
.ttf-more-btn { height: 32px; }
.tt-cell-out { font-size: 12px; color: var(--text); text-align: right; padding-right: 4px; }
.tt-row-del { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 6px;
  width: 26px; height: 26px; cursor: pointer; line-height: 1; padding: 0; }
.tt-row-del:hover { color: var(--danger); border-color: var(--danger); }
.tt-tooth-panel { margin-top: 8px; padding: 10px; border: 1px solid var(--primary); border-radius: 9px; background: #fff; }
.tt-tp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.tt-tp-set { display: flex; gap: 4px; }
.tt-tp-set > button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.tt-tp-set > button.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.tt-tp-set > button:disabled { opacity: .45; cursor: not-allowed; }
.tt-tp-note { font-size: 11px; color: var(--danger); }
.tt-tp-note2 { text-align: center; font-size: 11px; color: var(--muted); margin-top: 4px; }
.tt-tp-note2 b { color: var(--primary); }
.tt-tp-head .btn:first-of-type { margin-left: auto; }
.tt-tp-grid { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; justify-content: center; }
.tt-tooth-pick { min-width: 30px; height: 26px; border: 1px solid var(--border); background: #fff; border-radius: 5px;
  font-size: 11px; cursor: pointer; color: var(--text); padding: 0 4px; }
.tt-tooth-pick:hover { border-color: var(--primary); }
.tt-tooth-pick.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tt-sum { display: flex; gap: 26px; padding: 12px 2px; font-size: 13px; color: var(--muted); }
.tt-sum > b, .tt-sum > span > b { color: var(--text); font-weight: 600; }
.tt-sum > span > b.cut { color: var(--primary); }
.tt-charge { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px dashed #eef1f5; font-size: 13px; }
.tt-charge > label { display: flex; align-items: center; gap: 5px; cursor: pointer; flex: none; white-space: nowrap; }
.tt-charge > select { width: auto; min-width: 92px; }

/* 预约详情卡的信息栏里用的是紧凑版（同一套卡片，去掉角色行、压缩列宽） */
.tt-compact .tt-head { padding: 8px 12px; }
.tt-compact .tt-body { padding: 8px 12px 10px; }
.tt-compact .tt-foot { padding: 8px 12px; gap: 16px; }
.tt-compact .tt-roles { display: none; }
/* 紧凑版明细行：窄栏里改成两行式（项目名 + 费用 / 小字单价×数量·门市价），避免项目名被压成竖排 */
.tt-ci { display: grid; grid-template-columns: 108px minmax(0, 1fr) 96px;
  grid-template-areas: "tooth name fee" "tooth sub sub"; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid #f2f5f9; }
.tt-ci:last-child { border-bottom: 0; }
.tt-ci > .tt-tooth { grid-area: tooth; }
.tt-ci-name { grid-area: name; font-size: 13px; font-weight: 500; word-break: break-all; align-self: center; }
.tt-ci-fee { grid-area: fee; text-align: right; align-self: center; }
.tt-ci-fee > em { font-style: normal; font-weight: 600; font-size: 13px; }
.tt-ci-fee > em.cut { color: var(--primary); }
.tt-ci-sub { grid-area: sub; font-size: 11px; color: var(--muted); }
.tt-compact .tt-card { margin-bottom: 10px; }
.tt-compact .tt-count, .tt-compact .tt-bar { display: none; }

/* ===== 3D 口扫板块（2026-09-21 新增；独立类名，不影响既有布局与手机端断点）===== */
.scan-head-tools { display: flex; align-items: center; gap: 8px; }
.scan-kw { width: 220px; }
.inp.scan-kw { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; color: var(--text); }

.scan-wrap { display: flex; gap: 14px; align-items: stretch; height: calc(100vh - 168px); min-height: 460px; }
.scan-side { width: 264px; flex: 0 0 264px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
.scan-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

.scan-list { padding: 8px; }
.scan-item { position: relative; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.scan-item:hover { background: #f6f9fb; }
.scan-item.active { background: var(--primary-soft); border-color: var(--primary); }
.si-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 13.5px; color: var(--text); }
.si-size { font-size: 11.5px; color: var(--muted); flex: 0 0 auto; }
.si-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.si-parts { font-size: 11.5px; color: var(--primary); margin-top: 3px; }
.si-note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
/* 🆕 2026-10-28 口扫条目左侧小预览图（船长：这张缩略图也用到列表里） */
.scan-item .si-row { display: flex; gap: 10px; align-items: flex-start; }
.scan-item .si-thumb { flex: 0 0 66px; width: 66px; height: 46px; border-radius: 8px; overflow: hidden;
  background: #f3f6f9; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #eaf2fb; background-image: linear-gradient(150deg, #2b3440, #46515f); }
.scan-item .si-thumb.has-img { background-image: none; background: #0c141c; }
/* 🆕 2026-10-29 真渲染图（浅底）与类型示意图（暗底）分开，一眼能看出哪张是"这次扫描自己的" */
.scan-item .si-thumb.has-img.is-real, .scan-row-thumb.has-img.is-real { background: #eef3f8; }
.scan-item .si-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.scan-item .si-body { flex: 1 1 auto; min-width: 0; }
/* 加了预览图后文字栏变窄：让「5 个文件」这种整体不被拆到两行 */
.scan-item .si-sub .nb { white-space: nowrap; }
.si-del { position: absolute; right: 10px; bottom: 8px; font-size: 11.5px; color: var(--danger); display: none; }
.scan-item:hover .si-del { display: block; }

/* CT 检查条目：点一下是新窗口开读片器，与口扫（本页内嵌）用左侧色条区分开 */
.scan-item.is-ct { border-left: 3px solid #7c5cff; }
.scan-item.is-ct:hover { background: #f4f2ff; }
.ct-tag { display: inline-block; padding: 0 5px; margin-right: 6px; border-radius: 4px;
  background: #ece8ff; color: #5b46c9; font-size: 10.5px; font-weight: 600; letter-spacing: .5px; }
.ct-open { color: var(--muted); }

.scan-bar { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 12px; }
.scan-bar-empty { color: var(--muted); font-size: 13px; }
.sb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 7px; }
.sb-row:last-child { margin-bottom: 0; }
.sb-label { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.sb-patient { font-size: 14px; color: var(--text); }
.sb-meta { font-size: 12px; color: var(--muted); margin-left: auto; }
.sb-seg { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.sb-btn { background: #fff; border: none; border-right: 1px solid var(--border); padding: 5px 11px; font-size: 12.5px;
  color: var(--text); cursor: pointer; font-family: inherit; }
.sb-btn:last-child { border-right: none; }
.sb-btn:hover { background: #f2f7f9; }
.sb-btn.on { background: var(--primary); color: #fff; }
.sb-chk { font-size: 12.5px; color: var(--text); display: flex; align-items: center; gap: 5px; cursor: pointer; }
.sb-warn { font-size: 12px; color: var(--warn); margin-top: 4px; }

.scan-stage { position: relative; flex: 1 1 auto; min-height: 320px; background: #f3f6f9;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.scan-stage canvas { display: block; width: 100%; height: 100%; }
.scan-hint { font-size: 12px; color: var(--muted); }
/* 🆕 2026-10-28 口扫弹层（船长：点开后要有返回键，取消都回当前患者界面；头部信息+部位一行） */
.scan-modal { position: fixed; inset: 0; z-index: 130; background: #eef2f6;
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; }
.scan-modal .scan-stage { background: #f3f6f9; }
/* 头部：一行装完（返回 · 患者 · 时间/部位/面数 · 部位开关 · 显示 · 自转 · 截图 · 关闭） */
.sb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sb-head .sb-patient { font-size: 14px; }
.sb-head .sb-meta { font-size: 12px; color: var(--muted); }
.sb-flex { flex: 1 1 auto; }
.sb-head .sb-lb { font-size: 12px; color: var(--muted); }
.sb-head .sb-chk { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.sb-head .sb-seg { display: inline-flex; gap: 4px; }
.sb-chip { border-radius: 6px !important; border: 1px solid var(--border) !important; padding: 3px 10px !important; background: #fff; }
.sb-chip.on { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
/* 视角：悬浮透明卡片，压在 3D 视图底部中间 */
.sbv-float { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5;
  max-width: calc(100% - 20px); padding: 6px;
  background: rgba(255,255,255,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,.06); border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.sbv-row { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.sbv-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 8px 4px;
  background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  color: #4a5a6a; font-size: 10px; line-height: 1.15; }
.sbv-btn:hover { background: rgba(255,255,255,.8); }
.sbv-btn.on { background: #fff; border-color: var(--primary); color: var(--primary); }
.sbv-btn svg { width: 18px; height: 18px; display: block; }
/* 五视图拼版覆盖层 */
.sbv-five { position: absolute; inset: 0; z-index: 8; background: rgba(255,255,255,.97);
  display: flex; align-items: center; justify-content: center; padding: 12px; }
.sbv-five-box { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.sbv-five-box img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.sbv-five-bar { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 12px; color: var(--muted); }
.scan-hint-inline, .scan-loading, .scan-err { display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--muted); font-size: 13px; flex-direction: column; gap: 10px; }
.scan-err { color: var(--danger); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: scan-spin .8s linear infinite; }
@keyframes scan-spin { to { transform: rotate(360deg); } }

.scan-up .fld { margin-bottom: 12px; }
.scan-up .fld label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.scan-up input[type=text], .scan-up input:not([type]) { width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit; }
.scan-tip { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.su-list { max-height: 190px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: #fafcfe; }
.su-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 0; border-bottom: 1px dashed #eef2f7; }
.su-item:last-child { border-bottom: none; }
.su-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.su-size { flex: 0 0 auto; color: var(--muted); font-size: 11.5px; }
.su-tag { flex: 0 0 auto; font-size: 11px; color: var(--primary); background: var(--primary-soft);
  border-radius: 20px; padding: 2px 9px; }
.su-sum { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.6; }
.su-sum .ok { color: var(--ok); }
.su-sum .warn { color: var(--warn); }
.su-prog { font-size: 12px; color: var(--muted); min-height: 18px; margin-top: 6px; word-break: break-all; }

.scan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.scan-row:last-child { border-bottom: none; }
.scan-row .si-parts { margin-top: 0; }
.scan-row button { margin-left: auto; }
/* 🆕 2026-10-28 患者详情「口扫模型」行的小预览图 */
.scan-row-thumb { flex: 0 0 76px; width: 76px; height: 52px; border-radius: 8px; overflow: hidden;
  background: #f3f6f9; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #eaf2fb; background-image: linear-gradient(150deg, #2b3440, #46515f); }
.scan-row-thumb.has-img { background-image: none; background: #0c141c; }
.scan-row-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* 🔵 2026-10-09 船长「删除工作台」⇒ 工作台上的「库房摘要卡 / 近期口扫卡」随之删除，
   原这里那 6 条 .dash-scans / .dash-scan-row / .ds-time 规则已无任何使用者，一并清掉
   （留着就是屎山检查会报的"死样式"）。 */

/* ==================== 亲友关系板块（船长 2026-09-22 定）====================
   位置：患者详情页「患者信息」页签，替换原「管理信息」板块。图谱用 SVG，浅色主题。 */
.pd-rel-sect h4 { display: flex; align-items: center; gap: 8px; }
.rel-hops { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.rel-hops .btn { height: 26px; padding: 0 10px; }
/* 🗑 2026-11-18：三个胶囊与旧设置按钮样式已删（统一走 .set-ico） */
.pd-rel-box { padding: 6px 0 10px; }
.pd-rel-loading { color: var(--muted); font-size: 12px; padding: 14px; text-align: center; }
.pd-rel-empty { text-align: center; padding: 26px 0 18px; color: var(--muted); }
.pd-rel-empty p { margin: 6px 0 12px; }
.pd-rel-eico { font-size: 26px; opacity: .45; }
.pd-rel-sect.flash { animation: relflash 1.4s ease; }
@keyframes relflash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 2px var(--primary-soft); } }
/* 2026-11-13 亲友关系（船长参考图二次改版）：一级本人居中 + 二级分组一排 + 直角连接线。
   旧版 SVG 环形放射图（rel-graphwrap / rel-spoke / rel-arc）连线交叉，已整段删除。 */
.relx-tree { position: relative; padding: 2px 0 6px; overflow-x: auto; overflow-y: hidden; }
.relx-top { display: flex; justify-content: center; padding-top: 4px; }
/* 🔴 头像必须单独居中：姓名/meta 用绝对定位浮在右侧，不参与居中计算。
   否则「头像+文字」整块居中会让头像偏左 ⇒ 单人亲友那根竖线与上方错开，看起来像断线。 */
.relx-self { position: relative; display: flex; align-items: center; }
.relx-ava { position: relative; width: 48px; height: 48px; flex: none;
  border-radius: 50%; overflow: hidden; background: #f2f6fb; }
/* 默认头像是「人物撑满方形」的 8 张图：contain 不裁人；真实照片才 cover */
.relx-ava > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.relx-ava > img.relx-photo { object-fit: cover; }
.relx-ava.big { width: 66px; height: 66px; box-shadow: 0 0 0 3px #fff, 0 0 0 4px #e6ebf2; }
.relx-selfmeta { position: absolute; left: calc(100% + 11px); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.relx-selfmeta b { font-size: 15px; color: var(--text); }
.relx-selfmeta span { font-size: 12px; color: var(--muted); }
/* 二级：padding-top 留出「横线 + 竖线」的高度；人多时横向滚动（连接线跟着内容宽走） */
.relx-kids { display: flex; justify-content: center; align-items: flex-start; gap: 16px;
  padding: 46px 8px 2px; }
.relx-grp { display: flex; flex-direction: column; align-items: center; flex: none; }
/* 成对组：两人之间留虚线 + 关系胶囊的位置；胶囊绝对定位在**虚线上方**（船长 11-13 晚定） */
.relx-pair { display: flex; align-items: flex-start; gap: 26px; position: relative; }
.relx-pair-rel { position: absolute; left: 50%; top: 1px; transform: translateX(-50%); z-index: 2;
  padding: 1px 9px; border-radius: 4px; background: #eaf3ff; font-size: 12px; line-height: 19px;
  color: #1677ff; white-space: nowrap; box-shadow: 0 0 0 2px #fff; }
.relx-pair-rel.kin { font-weight: 600; }
.relx-pair-rel.far { color: #6b7684; background: #f1f3f6; font-weight: 400; }
.relx-kid { width: 88px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 2px 0; cursor: pointer; border-radius: 8px; }
.relx-kid:hover { background: #f6f9fd; }
.relx-kid:hover .relx-name { color: var(--primary); }
.relx-name { font-size: 12.5px; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 每个头像下方＝这个亲友与当前患者建关系时选的关系（灰字，不与虚线上方的组关系抢色） */
.relx-kid-rel { font-size: 11.5px; line-height: 1.3; color: #7b8794; white-space: nowrap; }
.relx-kid-rel.kin { color: #1677ff; font-weight: 600; }
.relx-kid-rel.far { color: #9aa6b3; }
.relx-tree.no-words .relx-kid-rel,
.relx-tree.no-words .relx-pair-rel { display: none; }
.relx-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.relx-line { fill: none; stroke: #cfd8e3; stroke-width: 1.2; }
/* 亲友之间本来还有关系 ⇒ 头像之间一条虚线（不是直系亲属就保持虚线） */
.relx-link { fill: none; stroke: #b9c6d6; stroke-width: 1.2; stroke-dasharray: 4 4; }
.relx-link.kin { stroke: #8fb4d8; stroke-dasharray: none; }
@media (max-width: 760px) {
  .relx-selfmeta { left: calc(100% + 6px); }
  .relx-selfmeta b { font-size: 13px; }
  .relx-selfmeta span { font-size: 11px; }
}
.rel-tablewrap { overflow-x: auto; }
.rel-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rel-table th, .rel-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.rel-table th { color: var(--muted); font-weight: 500; background: #fafbfd; }
/* 右列容器较窄：备注列省略号截断，操作列吸附在右边（不会被横向滚动推走） */
.rel-table td.rel-td-note { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.rel-table th:last-child, .rel-table td.rel-td-op { position: sticky; right: 0; background: #fff; box-shadow: -6px 0 6px -6px rgba(31, 45, 61, .12); }
.rel-table th:last-child { background: #fafbfd; }
.rel-link { color: var(--primary); cursor: pointer; }
/* 新建亲友关系弹窗 */
.rel-form { padding: 2px 0 0; }
.rel-lb { font-size: 13px; color: var(--text); margin: 12px 0 6px; }
.rel-lb.req::before { content: '*'; color: var(--danger); margin-right: 4px; }
.rel-lb em { font-style: normal; color: var(--muted); font-size: 12px; }
.rel-pick { display: flex; gap: 8px; }
.rel-pick input { flex: 1; height: 34px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; font-size: 13px; font-family: inherit; }
.rel-newbtn { position: relative; }
.rel-newbtn .caret { font-style: normal; opacity: .6; margin-left: 2px; }
.rel-newmenu { position: absolute; right: 0; top: 34px; min-width: 118px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); display: none; z-index: 6; }
.rel-newmenu.open { display: block; }
.rel-newmenu a { display: block; padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--text); }
.rel-newmenu a:hover { background: var(--primary-soft); color: var(--primary); }
.rel-drop { margin-top: 10px; }
.rel-nodata { text-align: center; color: var(--muted); padding: 12px 0 4px; }
.rel-nodata p { margin: 6px 0 0; font-size: 13px; }
.rel-illu { width: 118px; height: 86px; }
.rel-rlist { max-height: 190px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.rel-ritem { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; border-bottom: 1px solid #f2f5f9; }
.rel-ritem:last-child { border-bottom: 0; }
.rel-ritem:hover { background: #f6f9fc; }
.rel-rav { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 auto; }
.rel-rname { font-size: 13px; }
.rel-rsub { margin-left: auto; font-size: 12px; color: var(--muted); }
.rel-picked { display: flex; align-items: center; gap: 8px; border: 1px solid var(--primary); background: var(--primary-soft); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.rel-pksub { color: var(--muted); font-size: 12px; }
.rel-pkx { margin-left: auto; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 13px; }
.rel-sel, .rel-ta { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
.rel-ta { min-height: 74px; resize: vertical; }

/* 🔵 2026-10-09：原「侧栏内联二级项」那一套（.nav-subwrap / a.nav-sub + 小圆点）已删 ——
   二级的落点一路变过：塞在侧栏里 → 贴着一级项的浮层 → 最终定为「左侧独立竖栏 .subrail」。
   ⚠️ 下面两条**保留**：一级项上的 ▸ 箭头（有二级的板块靠它提示）。 */
/* 🔴 2026-10-21 竖排后：二级箭头从「行末」改成**文字后面的 ›**（船长指定）。
   竖排时行末没空间放箭头了，放图标右上角又会盖住图标。 */
.sidebar nav a .caret { margin: 0; float: none; font-style: normal; font-size: 11px; opacity: .8;
  transition: transform .15s; margin-left: 2px; }
.sidebar nav a.sub-open .caret { transform: rotate(180deg); }

/* 🔵 2026-10-09 船长：「二级菜单改竖版放在一级菜单右侧，类似一级菜单的版式」
   ⇒ 这一整块 **二级浮层样式（.nav-subwrap.nav-flyout / .nfly-t / 浮层内 a.nav-sub）已整体删除**，
     配套的 JS（showNavFly / hideNavFly / 悬停与点击开合 / navFlyTimer）也一并删了。
   二级现在只有一处落点：左侧独立竖栏 `.subrail`（样式见前面 .sidebar 之后那一段）。
   ⚠️ 同一天里这套交互被推翻过三版（侧栏内联 → 鼠标划过浮层 → 点击展开缩回 → 竖栏），别再照旧日志加回来。 */

/* ===== 🆕 2026-10-08：内容区顶部「卡片式二级页签」（照系统设置 .page-tabs 的样子） =====
   独立于 #main，由 app.js renderSubTabs() 填充；无二级/单二级模块自动隐藏。 */
/* 🔵 2026-10-09：桌面端二级改走**左侧竖排栏**(.subrail) ⇒ 这块顶部卡片页签默认**不显示**，
   只在手机端（≤760px，整条侧栏都隐藏时）作为二级入口露出来，见文件末尾「手机端适配」段。
   DOM 照旧由 renderSubTabs() 填充，只是不显示 —— 保留渲染是为了 resize 时不用重新算。 */
.subtabs { flex: none; display: none; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 12px 26px 0; border-bottom: 1px solid var(--border); }
.subtabs.hidden { display: none; }
.subtabs a { padding: 9px 16px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; }
.subtabs a:hover { color: var(--primary); }
.subtabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== 营销中心 · 积分体系（2026-09-22 照船长参考图：分区竖线标题 + 规则表 + 绿色开关）===== */
.mk-sec { margin-bottom: 22px; }
.mk-sec-h { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--text);
  padding-left: 9px; border-left: 3px solid var(--primary); line-height: 1.3; margin-bottom: 10px; }
.mk-table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.mk-row { display: grid; grid-template-columns: 176px minmax(0, 1fr); border-top: 1px solid var(--border); }
.mk-row:first-child { border-top: 0; }
.mk-row.mk-head { background: #f6f8fb; font-weight: 600; color: var(--muted); }
.mk-c { padding: 11px 14px; font-size: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.mk-row .mk-c:last-child { flex-direction: column; align-items: stretch; gap: 8px; }
.mk-row .mk-c + .mk-c { border-left: 1px solid var(--border); }
.mk-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mk-tag { background: #eef2f7; color: #4a5a70; border-radius: 4px; padding: 1px 6px; font-size: 12px; flex: none; }
.mk-num { width: 62px !important; text-align: center; padding: 4px 6px; }
.mk-hint { color: var(--muted); font-size: 12px; }
.mk-i { display: inline-flex; width: 14px; height: 14px; align-items: center; justify-content: center; border-radius: 50%;
  background: #dfe6ee; color: #6b7b90; font-size: 10px; cursor: help; flex: none; }
.mk-radio { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 0 0 10px 10px; white-space: nowrap; }
.mk-radio input[type=radio] { width: 15px; height: 15px; flex: none; accent-color: #52c41a; }
/* 全局 select/input 是 width:100%，这里必须收回，否则「每年 01-21」那一行会被下拉框撑满整行 */
.mk-radio select { width: auto; min-width: 84px; padding: 4px 8px; font-size: 13px; flex: none; }
.mk-radio:last-child { margin-bottom: 0; }
/* 绿色开关（参考图的 iOS 款） */
.mk-sw { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.mk-sw input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.mk-sw i { position: absolute; inset: 0; background: #cfd6e0; border-radius: 11px; transition: background .18s; }
.mk-sw i::before { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: #fff;
  border-radius: 50%; transition: transform .18s; }
.mk-sw input:checked + i { background: #52c41a; }
.mk-sw input:checked + i::before { transform: translateX(18px); }
.mk-sw input:disabled + i { opacity: .5; }
.mk-foot { display: flex; align-items: center; gap: 10px; }
.mk-foot .mk-hint { margin-left: 4px; }
#mkPoints input:disabled, #mkPoints select:disabled { background: #f5f7fa; color: var(--muted); border-color: #e6eaf0; }
/* 变更日志弹窗 */
.mk-loglist { max-height: 360px; overflow-y: auto; }
.mk-logitem { border-bottom: 1px dashed var(--border); padding: 9px 0; font-size: 13px; }
.mk-logitem:last-child { border-bottom: 0; }
.mk-loghd { display: flex; gap: 8px; align-items: baseline; }
.mk-loghd .mk-hint { margin-left: auto; }
.mk-logitem ul { margin: 5px 0 0; padding-left: 18px; color: var(--muted); }
.mk-logitem s { color: #a0a8b4; }

/* ===== 推荐激励（营销中心 → 推荐激励，三页签：到店 / 单笔消费 / 累计消费）=====
   排版思路：参考图的信息结构保留（页签 / 启用开关 / 有效期 / 方式 / 模式 / 规则明细 / *注 / 帮助链接），
   但把「标签：值」的纯文本行改成定宽两列网格、规则明细改成带竖线的缩进块，层级和可读性更稳。 */
.mk-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); padding: 0 2px 0 2px; }
.mk-tab { position: relative; padding: 2px 0 11px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.mk-tab:hover { color: var(--text); }
.mk-tab.on { color: var(--text); font-weight: 600; }
.mk-tab.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }

/* 状态条：启用 / 未启用 分段控件（参考图同款形态，选中色换成系统语义色）*/
.mk-segbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 0 14px; border-bottom: 1px dashed var(--border); }
.mk-seg { display: inline-flex; background: #eef1f5; border-radius: 999px; padding: 3px; gap: 3px; }
.mk-seg label { display: block; }
.mk-seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.mk-seg span { display: block; padding: 4px 16px; border-radius: 999px; font-size: 12.5px; color: #8b95a1; cursor: pointer; transition: background .15s; }
.mk-seg input[value="1"]:checked + span { background: #52c41a; color: #fff; }
.mk-seg input[value="0"]:checked + span { background: #98a2b3; color: #fff; }
.mk-seg input:disabled + span { cursor: not-allowed; opacity: .65; }
.mk-seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }

/* 配置网格：label 定宽，值区可换行 */
.mk-grid { display: grid; grid-template-columns: 92px 1fr; align-items: center; row-gap: 12px; column-gap: 10px; padding: 16px 0 2px; }
.mk-gl { font-size: 13px; color: var(--muted); }
.mk-gv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; min-height: 26px; }
.mk-gv select { width: auto; min-width: 88px; }

/* 激励规则：左侧竖线 + 每行小横线（照参考图的层级感，颜色收淡）*/
.mk-subwrap { margin: 16px 0 0; }
.mk-subh { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.mk-sub { border-left: 2px solid #dbe2ea; margin-left: 6px; padding-left: 22px; }
.mk-subline { position: relative; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 0; font-size: 13px; line-height: 1.8; }
.mk-subline + .mk-subline { border-top: 1px dashed #eef1f5; }
.mk-subline::before { content: ''; position: absolute; left: -22px; top: 50%; width: 16px; height: 2px; background: #dbe2ea; }
.mk-subline b { font-weight: 600; }
#mkRef .mk-num { width: 76px !important; }
/* 规则行里的下拉同样会被全局 input,select{width:100%} 撑变形（整行被挤成多段），必须收回宽度 */
.mk-subline select { width: auto !important; min-width: 96px; flex: none; padding: 4px 8px; font-size: 13px; }
.mk-subline input { flex: none; }
.mk-ratiohint { margin: 10px 0 2px 22px; line-height: 1.7; }
.mk-dt { width: 110px !important; text-align: center; padding: 4px 6px; }
.mk-del { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: #fff;
  color: #98a2b3; font-size: 12px; line-height: 1; cursor: pointer; }
.mk-del:hover { color: #e5484d; border-color: #f3b9bb; background: #fdf3f3; }
#mkRefAdd { margin: 10px 0 0 28px; }

/* 绿色勾选框（参考图里的方框勾选，换成系统绿）*/
.mk-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.mk-chk input { position: absolute; opacity: 0; width: 0; height: 0; }
.mk-chk i { flex: none; width: 15px; height: 15px; border: 1px solid #c3ccd6; border-radius: 3px; background: #fff; position: relative; }
.mk-chk input:checked + i { background: #52c41a; border-color: #52c41a; }
.mk-chk input:checked + i::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg); }
.mk-chk input:disabled + i { opacity: .5; }
.mk-chk input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 1px; }

/* 备注块：与配置区拉开视觉层次 */
.mk-note { margin: 14px 0 0; padding: 10px 12px; background: #f7f9fb; border-radius: 8px; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; }
.mk-note b { font-weight: 600; color: #8b95a1; flex: none; }
.mk-note ol { margin: 0; padding-left: 16px; }
.mk-note li { line-height: 1.9; }

/* 底部帮助链接 + 按钮条 */
.mk-gohelp { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.mk-lnk { color: var(--primary); font-weight: 600; cursor: pointer; }
.mk-lnk:hover { text-decoration: underline; }
#mkRef .mk-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
#mkRef input:disabled, #mkRef select:disabled { background: #f5f7fa; color: var(--muted); border-color: #e6eaf0; }
#mkRef .mk-num.mk-off, #mkRef select.mk-off { opacity: .5; }
#mkRef .hidden { display: none; }

/* ---------- 营销中心：积分账户一览表（测试/核对）---------- */
.mk-acct-bar { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; }
.mk-acct-bar .mk-hint { flex: 1; }
.mk-acct-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mk-acct-tbl th { text-align: left; color: #8a94a6; font-weight: 500; padding: 6px 8px; border-bottom: 1px solid #eceff3; }
.mk-acct-tbl td { padding: 6px 8px; border-bottom: 1px solid #f2f5f8; }
.mk-acct-tbl tr.mk-acct-row { cursor: pointer; }
.mk-acct-tbl tr.mk-acct-row:hover { background: #f7faf9; }
.mk-acct-tbl td.bal { color: var(--primary); font-weight: 600; }

/* ---------- 患者详情「积分」页签（2026-09-22 建）---------- */
.pt-pt { padding: 12px 14px; }
.pt-pt-cards { display: flex; gap: 10px; margin-bottom: 10px; }
.pt-pt-card { flex: 1; background: #f7f9fb; border: 1px solid #e5e9ef; border-radius: 8px; padding: 10px 12px; }
.pt-pt-card span { display: block; font-size: 12px; color: #8a94a6; }
.pt-pt-card b { display: block; font-size: 18px; margin-top: 4px; color: var(--primary); }
.pt-pt-card.big b { font-size: 26px; }
.pt-pt-card b.sm { font-size: 13px; color: #333; font-weight: 600; }
/* 🆕 2026-10-13 满期标记（船长定：只标记、不扣减）—— 卡片上的小字提示 + 明细上方的说明条 */
.pt-exp-tip { display: inline-block; margin-top: 2px; font-size: 11.5px; font-style: normal; color: #b07d0a; }
.pt-exp-line { margin: 0 0 10px; padding: 7px 10px; font-size: 12.5px; color: #8a6410;
  background: #fff9e8; border: 1px solid #f2e3b8; border-radius: 8px; }
/* 🔴 全局有 `input/select{width:100%}` ⇒ 这里必须显式给宽度，否则 select 撑满整行、
   把「有效提现 N 笔 ｜ …」那行汇总挤成竖排（2026-10-13 实测踩到，和 .me-clinic 同一个坑）。 */
.mk-sel-sm { width: 132px; flex: none; padding: 3px 8px; font-size: 12.5px; border: 1px solid #e3e8ef; border-radius: 7px; background: #fff; }
#mkCashSum { margin-left: auto; white-space: nowrap; }
.pt-pt-dl { font-size: 12px; color: #6b7688; margin-bottom: 10px; }
.pt-pt-h { font-size: 13px; font-weight: 600; margin: 14px 0 8px; }
/* 🆕 2026-10-15 患者打卡区（患者详情 → 积分页签）：摘要行 ＋ 近 30 天格子 ＋ 明细表
   🔴 格子用 <i> ⇒ 必须显式给 width/height（行内元素不吃宽高）＋ 清掉斜体。 */
.pt-pt-ck { margin-top: 16px; }
.pt-ck-grid { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 12px; }
.pt-ck-d { width: 14px; height: 14px; border-radius: 3px; background: #E6EAF0; display: inline-block; font-style: normal; }
.pt-ck-d.on { background: #73A63C; }
.pt-ck-d.td { box-shadow: inset 0 0 0 2px #27500A; }
.pt-ck-ph { color: var(--primary); cursor: pointer; }
.pt-ck-phbox { text-align: center; }
.pt-ck-phbox > img { max-width: 100%; max-height: 66vh; border-radius: 8px; background: #f4f6fa; }
.pt-pt-h .sub-muted { font-weight: 400; margin-left: 6px; }
.pt-pt-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pt-pt-tbl th { text-align: left; color: #8a94a6; font-weight: 500; padding: 6px 8px; border-bottom: 1px solid #eceff3; }
.pt-pt-tbl td { padding: 6px 8px; border-bottom: 1px solid #f2f5f8; }
.pt-pt-tbl td.up { color: var(--primary); font-weight: 600; }
.pt-pt-tbl td.down { color: #e5484d; font-weight: 600; }
.pt-pt-tbl td.rmk { color: #6b7688; }
.pt-pt-tbl td.empty { text-align: center; color: #a0a8b4; padding: 18px; }
/* 「使用积分」操作条：权限不足时不渲染按钮，只给一句说明 */
.pt-pt-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.pt-pt-bar .sub-muted { font-size: 12px; }
.pt-use-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.pt-use-line b { color: var(--primary); font-size: 16px; }
.pt-use-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pt-use-remark { flex: 1; min-width: 160px; padding: 5px 8px; border: 1px solid #d9dfe7; border-radius: 6px; font-size: 13px; }
/* 营销中心 → 哪些岗位可以使用积分 */
.mk-perm { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 4px 0 8px; }
.mk-perm-item { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.mk-perm-item.locked { color: #8a94a6; cursor: default; }

/* ---------- 患者档案「转介绍 → 搜索选推荐人」---------- */
.ref-pick { position: relative; }
.ref-list { position: absolute; left: 0; right: 0; top: 34px; z-index: 30; background: #fff; border: 1px solid #e5e9ef;
  border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .08); max-height: 210px; overflow: auto; }
.ref-opt { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.ref-opt:hover { background: #f2f8f6; }
.ref-opt span { color: #8a94a6; font-size: 12px; }
.ref-none { padding: 8px 10px; color: #a0a8b4; font-size: 12px; }
.ref-chip { display: inline-flex; align-items: center; gap: 6px; background: #e8f4fd; color: var(--primary);
  border: 1px solid #bfe6dc; border-radius: 14px; padding: 2px 10px; font-size: 12.5px; }
.ref-chip i { cursor: pointer; font-style: normal; color: #8a94a6; }

/* ===== 病历模板 · 便签墙（2026-09-23 船长要求：便签墙排列，同类型在一个横向选框内）=====
   全部为新增类（tplw- 前缀）：不改动任何既有选择器，也不新增媒体查询（手机端暂停中）；
   列数由 auto-fill 自适应，不依赖断点。色带沿用系统既有状态配色（蓝=st-wait / 紫=st-treat / 灰=st-cancel） */
.tplw-wall{display:flex;flex-direction:column;gap:14px}
.tplw-group{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px 14px}
.tplw-gh{display:flex;align-items:center;gap:10px;margin-bottom:10px;padding-bottom:8px;border-bottom:1px dashed var(--border)}
.tplw-gh b{font-size:14px}
.tplw-gh .tplw-gn{font-size:12px;color:var(--muted)}
.tplw-gh .tplw-gm{margin-left:auto;font-size:12px;color:var(--muted)}
.tplw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:10px}
.tplw-note{position:relative;background:#fafbfc;border:1px solid var(--border);border-radius:10px;
  padding:11px 11px 12px;min-height:84px;cursor:pointer;overflow:hidden;color:var(--text);
  transition:transform .12s ease,box-shadow .12s ease}
.tplw-note:hover{transform:translateY(-2px);box-shadow:var(--shadow),0 6px 16px rgba(31,45,61,.12);z-index:2}
.tplw-band{display:block;position:absolute;left:0;top:0;right:0;height:3px;background:var(--band,#9aa3ad)}
.tplw-note.k-初诊{--band:#2f6fd8;background:#f7fbff;border-color:#dce8fb}
.tplw-note.k-复诊{--band:#7b3fd8;background:#faf8ff;border-color:#e6dffb}
.tplw-note.k-通用{--band:#9aa3ad;background:#fafbfc;border-color:var(--border)}
.tplw-note.off{opacity:.5;filter:grayscale(.35)}
.tplw-t{font-weight:600;font-size:13.5px;line-height:1.45;margin:2px 0 6px}
.tplw-tags{display:flex;flex-wrap:wrap;gap:4px}
.tplw-note .tag{font-size:11px;padding:0 6px;border-radius:8px}
.tplw-r{font-size:11px;padding:0 6px;border-radius:8px;background:#fdecec;color:#b23c3c;border:1px solid #f6d5d5}
.tplw-s{font-size:11px;padding:0 6px;border-radius:8px;background:#eaf7ef;color:#2b7a4b;border:1px solid #d4ecdd}
.tplw-s.off{background:#f1f3f6;color:var(--muted);border-color:var(--border)}
.tplw-warn{position:absolute;right:8px;top:9px;font-size:11px;color:#8a5a10;
  background:#fff4e2;border:1px solid #e6a23c;border-radius:8px;padding:0 5px}
.tplw-ops{position:absolute;left:0;right:0;bottom:0;display:flex;gap:4px;justify-content:flex-end;
  padding:5px 7px;opacity:0;transition:opacity .12s ease;
  background:linear-gradient(180deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.97) 50%)}
.tplw-note:hover .tplw-ops,.tplw-note:focus-within .tplw-ops{opacity:1}
.tplw-b{border:1px solid var(--border);background:#fff;border-radius:6px;padding:0 7px;
  font-size:11px;line-height:19px;cursor:pointer;color:var(--text)}
.tplw-b:hover{background:#f2f6ff;border-color:#cfe0ff}
.tplw-b.del{color:var(--danger);border-color:#f0d5d5}
.tplw-b.del:hover{background:#fdf1f1}

/* ===== 自动化工作台（auw-，2026-09-23）===== 全部新增类；不新增媒体查询（手机端暂停中） */
.auw{--auw-ac:#2f6fd8;--auw-bg:#eaf2ff;--auw-bd:#cfe0ff}
.auw.auw-t-tpl{--auw-ac:#7b3fd8;--auw-bg:#f4efff;--auw-bd:#e0d3fb}
.auw-tabs{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:0}
.auw-tabs button{display:flex;align-items:flex-start;gap:11px;text-align:left;border:2px solid var(--border);background:var(--panel);
  border-radius:12px;padding:9px 16px 10px;cursor:pointer;min-width:288px;position:relative}
.auw-tabs button .ic{font-size:22px;line-height:1.15}
.auw-tabs button b{display:block;font-size:15.5px;color:var(--text);margin-bottom:1px}
.auw-tabs button i{font-style:normal;font-size:11.5px;color:var(--muted)}
.auw-tabs button.on{border-color:var(--auw-ac);background:var(--auw-bg)}
.auw-tabs button.on b{color:var(--auw-ac)}
.auw-tabs button.on::after{content:"当前板块";position:absolute;right:10px;top:-10px;background:var(--auw-ac);color:#fff;
  font-size:10.5px;border-radius:8px;padding:0 7px}
.auw-band{background:var(--auw-bg);border:1px solid var(--auw-bd);border-radius:8px;padding:6px 12px;margin:8px 0 10px;
  font-size:12.5px;color:var(--auw-ac);font-weight:600}
.auw-main{display:flex;gap:12px;align-items:flex-start}
/* 🔵 2026-11-03 船长：「工作台提高度自适应，去除上下滑动的进度条」
   ⇒ 左积木栏 / 右镜像栏原来是 max-height:70vh + overflow:auto（各自内部滚一条竖条），
     现在改成**随内容撑开**，整页一起滚 —— 不再出现两三条并排的竖滚动条。
   🔴 别把 max-height 加回来：加了就会在栏内出现滚动条。 */
/* 🔵 2026-11-03 船长：「压缩一下图标文字大小，自适应高度宽度」
   ⇒ 两侧栏宽度不再写死 290/300px，改成跟着窗口走（窄屏收、宽屏放），
     字号/行高/内边距整体压一档 —— 内容项多（675 个处置项目），压紧一档高度能降三成。 */
.auw-pal{width:var(--rail-w);flex:none;background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);padding:8px 9px}
.auw-stage{flex:1;min-width:0;background:var(--panel);border:1px solid var(--border);border-top:3px solid var(--auw-ac);border-radius:var(--radius);padding:9px 11px}
.auw-mirror{width:clamp(196px, 15.2vw, 252px);flex:none;background:var(--panel);border:1px solid var(--border);border-top:3px solid var(--auw-ac);border-radius:var(--radius);padding:8px 9px}
.auw-ph{font-weight:700;font-size:12.5px;margin-bottom:5px;display:flex;gap:6px;align-items:center}
.auw-ph small{font-weight:400;color:var(--muted);font-size:11px}
.auw-sel{width:100%;border:1px solid var(--border);border-radius:6px;padding:3px 6px;font-size:11.5px;margin-bottom:5px;background:#fff;color:var(--text)}
.auw-gt{font-size:11px;font-weight:600;color:var(--muted);margin:5px 0 1px}
.auw-grp{border-bottom:1px solid #f1f4f8}
.auw-grp>b{display:flex;align-items:center;gap:4px;font-size:11.5px;font-weight:600;padding:3px 4px;cursor:pointer;color:var(--text)}
.auw-grp>b:hover{background:#f7f9fc}
.auw-grp>b .car{color:#9aa3ad;font-size:9.5px;width:9px}
.auw-grp>b i{font-style:normal;font-weight:400;color:#9aa3ad;font-size:10.5px}
.auw-grp>b .auw-mv{margin-left:auto}
.auw-gb{padding:1px 0 4px 11px;background:#fafbfd;border-left:2px solid var(--auw-bd);margin-left:4px}
.auw-bit{display:flex;align-items:center;gap:5px;padding:1.5px 5px;border-radius:6px;cursor:grab;font-size:11.5px;line-height:1.5;border:1px solid transparent}
.auw-bit:hover{background:var(--auw-bg);border-color:var(--auw-bd)}
.auw-bit .pn{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.auw-bit .pp{color:var(--muted);font-size:10.5px;flex:none}
.auw-bit .tk{font-size:10px;padding:0 4px;border-radius:6px;border:1px solid var(--border);color:var(--muted);flex:none}
.auw-mv{flex:none;border:1px solid var(--border);background:#fff;color:var(--auw-ac);border-radius:5px;
  font-size:10.5px;line-height:15px;padding:0 5px;cursor:pointer;font-weight:700}
.auw-mv:hover{background:var(--auw-ac);color:#fff;border-color:var(--auw-ac)}
.auw-target{font-size:11.5px;background:var(--auw-bg);border:1px dashed var(--auw-bd);border-radius:7px;padding:4px 9px;margin-bottom:7px;color:var(--auw-ac);font-weight:600}
.auw-drop{display:flex;flex-direction:column;gap:7px}
.auw-drop.grid2{display:grid;grid-template-columns:repeat(auto-fill,minmax(256px,1fr));gap:7px}
.auw-node{border:1px solid var(--border);border-radius:9px;background:#fcfdfe;padding:7px 9px}
.auw-node.hot{border-color:var(--auw-ac);box-shadow:0 0 0 3px var(--auw-bg)}
.auw-node.cur{border-color:var(--auw-ac);box-shadow:0 0 0 2px var(--auw-bg)}
.auw-nh{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.auw-nh b{font-size:12.5px}
.auw-nh .d{font-size:10.5px;color:var(--muted)}
.auw-nh .n{margin-left:auto;font-size:10.5px;color:var(--muted)}
.auw-dropzone{min-height:22px;display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}
.auw-empty{font-size:10.5px;color:#9aa3ad;border:1px dashed var(--border);border-radius:6px;padding:2px 7px}
.auw-chip{display:inline-flex;align-items:center;gap:4px;background:#fff;border:1px solid var(--border);border-radius:7px;padding:1px 5px;font-size:11.5px;max-width:100%}
.auw-chip.cat,.auw-chip.tpl{background:var(--auw-bg);border-color:var(--auw-bd);border-left:3px solid var(--auw-ac)}
.auw-chip u{text-decoration:none;cursor:pointer;color:var(--danger);font-weight:700;padding:0 1px}
.auw-chip .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:186px}
.auw-chip .tk{font-size:10.5px;padding:0 5px;border-radius:7px;border:1px solid var(--border);color:var(--muted)}
.auw-chip .tk.k1{color:#2f6fd8;border-color:#cfe0ff;background:#eaf2ff}
.auw-chip .tk.k2{color:#7b3fd8;border-color:#e6dffb;background:#faf8ff}
.auw-ex{margin-top:5px;border-top:1px dashed var(--border);padding-top:4px}
.auw-ex.hide{display:none}
.auw-exrow{display:flex;align-items:center;gap:5px;font-size:11.5px;padding:1px 0}
.auw-exrow .en{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.auw-exrow select{width:auto;max-width:200px;font-size:10.5px;padding:1px 4px}
.auw-src{flex:none;font-size:10px;border-radius:6px;padding:0 4px;border:1px solid var(--border);color:var(--muted)}
.auw-src.self{color:var(--auw-ac);border-color:var(--auw-bd);background:var(--auw-bg)}
.auw-src.inh{color:#2b7a4b;border-color:#cfeedd;background:#eefaf3}
.auw-mi{display:flex;align-items:center;gap:5px;padding:2px 0;border-bottom:1px dotted var(--border);font-size:11.5px}
.auw-mi .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.auw-mi select{width:auto;max-width:92px;font-size:10.5px;padding:1px 4px}
.auw-mfoot{margin-top:6px;font-size:11px;color:var(--muted);line-height:1.65}
.auw-warn{background:#fff8ec;border:1px solid #f0dcae;border-radius:8px;padding:6px 10px;margin-bottom:10px;color:#7a5510;font-size:12px;line-height:1.7}
.auw-legend{font-size:11.5px;color:var(--muted);margin-top:9px;line-height:1.8}
.auw-legend code{background:#f2f5f9;border-radius:4px;padding:0 4px}
.auw .kbd{border:1px solid var(--border);background:#fff;border-radius:5px;padding:0 5px;font-size:11px}

/* ===== 待办事项（td-，2026-09-23）===== 全新增类；不新增媒体查询（手机端暂停中） */
.td-seg{display:flex}
.td-seg button{border:1px solid var(--border);background:#fff;padding:5px 14px;font-size:12.5px;cursor:pointer;color:var(--text)}
.td-seg button:first-child{border-radius:8px 0 0 8px}
.td-seg button:last-child{border-radius:0 8px 8px 0;border-left:0}
.td-seg button.on{background:var(--accent-bg,#eaf2ff);color:#2f6fd8;border-color:#cfe0ff;font-weight:600}
.td-bar{display:flex;align-items:center;gap:16px;padding:9px 14px;margin-bottom:12px;flex-wrap:wrap}
.td-bar-l{display:flex;gap:18px;font-size:13px}
.td-bar-l b{color:#2f6fd8;font-size:15px}
.td-basis{margin-left:auto;font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px}
.td-basis button{border:1px solid var(--border);background:#fff;border-radius:7px;padding:3px 9px;font-size:11.5px;cursor:pointer;color:var(--text)}
.td-basis button.on{background:#eaf2ff;border-color:#cfe0ff;color:#2f6fd8;font-weight:600}
.td-warn{background:#fff8ec;border:1px solid #f0dcae;border-radius:9px;padding:8px 12px;margin-bottom:12px;color:#7a5510;font-size:12.5px;line-height:1.75}
.td-group{padding:0;margin-bottom:12px;overflow:hidden}
.td-gh{display:flex;align-items:center;gap:10px;padding:10px 14px;background:#f7f9fc;border-bottom:1px solid var(--border);flex-wrap:wrap}
.td-gh b{font-size:14px}
.td-gh .td-gn{background:#2f6fd8;color:#fff;border-radius:9px;padding:0 8px;font-size:11.5px}
.td-gh-hint{font-size:11.5px;color:var(--muted);margin-left:auto;text-align:right}
.td-tbl{margin:0}
.td-tbl th{background:#fff;font-weight:600;font-size:12px;color:var(--muted)}
.td-tbl td{font-size:12.5px;vertical-align:middle}
.td-pt{color:#2f6fd8;font-weight:600;text-decoration:none}
.td-pt:hover{text-decoration:underline}
.td-owed{display:inline-block;margin-left:6px;font-size:11px;color:#b23c3c;background:#fdecec;border:1px solid #f6d5d5;border-radius:7px;padding:0 5px}
.td-ok{font-size:11px;color:#2b7a4b;background:#eefaf3;border:1px solid #cfeedd;border-radius:7px;padding:0 5px}
.td-tag{display:inline-block;font-size:11px;color:#7a5510;background:#fff8ec;border:1px solid #f0dcae;border-radius:7px;padding:0 6px;margin:0 4px 2px 0}
.td-btn-ig{color:#8a5a10;border-color:#f0dcae}
.td-foot{padding:10px 14px;font-size:11.5px;color:var(--muted);line-height:1.8}
.td-foot a{color:#2f6fd8}

/* ===== 收费台账：「零售」章（金额前，2026-09-23 船长要求）=====
   一眼分清哪些不是诊疗收入——商品零售不算到店、不计入医生流水，绩效单独核算 */
.retail-mark{display:inline-block;font-size:10.5px;font-weight:700;color:#8a5a10;background:#fff4e2;
  border:1px solid #e6a23c;border-radius:4px;padding:0 4px;margin-right:5px;letter-spacing:.5px;vertical-align:1px}

/* ===== 角色流水台账（收费台账页，2026-09-23 船长要求：零售单独计提、每角色单独流水）===== */
.rl-pools{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:10px;margin-top:8px}
.rl-pool{border:1px solid var(--border);border-radius:10px;padding:9px 11px;background:#fcfdfe}
.rl-ph{display:flex;align-items:center;gap:8px;margin-bottom:2px}
.rl-ph b{font-size:13.5px}
.rl-total{margin-left:auto;font-weight:700;color:#2f6fd8}
.rl-pool .tbl th{font-size:11.5px;padding:3px 6px;background:#fff}
.rl-pool .tbl td{font-size:12px;padding:3px 6px}

/* ===== 提成比例矩阵（分类 × 角色，2026-09-23 船长定）===== */
.cr-note{font-size:12.5px;color:#7a5510;background:#fff8ec;border:1px solid #f0dcae;border-radius:8px;
  padding:7px 11px;line-height:1.75;margin-bottom:9px}
.cr-bulk{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:12.5px;margin-bottom:9px}
.cr-bulk label{display:flex;align-items:center;gap:4px}
.cr-bulk input{width:58px;padding:3px 6px;border:1px solid var(--border);border-radius:6px;font-size:12.5px}
.cr-wrap{max-height:52vh;overflow:auto;border:1px solid var(--border);border-radius:10px}
.cr-tbl{margin:0}
.cr-tbl th{position:sticky;top:0;background:#f7f9fc;z-index:2;text-align:center;font-size:12px}
.cr-tbl th:first-child{text-align:left}
.cr-tbl td{text-align:center;padding:3px 5px}
.cr-tbl td:first-child{text-align:left;font-size:12.5px}
.cr-grp td{background:#eef3fa;font-weight:600;font-size:12px;text-align:left;color:#3d4b5c}
.cr-in{width:62px;padding:3px 5px;border:1px solid var(--border);border-radius:6px;font-size:12.5px;text-align:center}
.cr-mk{font-size:10.5px;color:#8a5a10;background:#fff4e2;border:1px solid #e6a23c;border-radius:4px;padding:0 4px}
.cr-hit{color:#2b7a4b;font-weight:600}

/* ===== 到达播报与医生端气泡（2026-09-23 船长定）=====
   气泡：右下角、10 秒静默消除、点「接诊」推进到治疗中；不新增媒体查询（手机端暂停中） */
.apt-vb{display:flex;align-items:center;gap:10px;margin:0 0 10px;font-size:12.5px;min-height:0}
.apt-vb:empty{display:none}
.apt-vb-on{color:#2b7a4b;background:#eefaf3;border:1px solid #cfeedd;border-radius:8px;padding:3px 10px}
.apt-vb-off{color:#8a5a10;background:#fff8ec;border:1px solid #f0dcae;border-radius:8px;padding:3px 10px}
.apt-bubbles{position:fixed;right:18px;bottom:18px;z-index:9000;display:flex;flex-direction:column;gap:10px;
  max-width:344px;pointer-events:none}
.apt-bubble{pointer-events:auto;background:#fff;border:1px solid var(--border);border-left:4px solid #2f6fd8;
  border-radius:12px;box-shadow:0 8px 26px rgba(20,35,60,.18);padding:11px 13px;
  opacity:0;transform:translateY(12px);transition:opacity .22s ease,transform .22s ease}
.apt-bubble.on{opacity:1;transform:none}
.apt-bubble .ab-h{display:flex;align-items:center;gap:7px;margin-bottom:5px}
.apt-bubble .ab-h b{font-size:14px}
.apt-bubble .ab-h span{font-size:11px;background:#eaf2ff;color:#2f6fd8;border-radius:8px;padding:0 6px}
.apt-bubble .ab-cake{font-size:11px;background:#fff1e0;color:#b56a00;border-radius:8px;padding:0 6px}   /* 当天生日的小朋友（医生端气泡） */
.apt-bubble .ab-m{font-size:12.5px;color:var(--muted);line-height:1.7}
.apt-bubble .ab-f{display:flex;gap:7px;justify-content:flex-end;margin-top:9px}


/* ══════════ 库房（船长 2026-09-24）══════════ */
/* 说明：这些都是库房模块自己的类，不改动既有断点；
   窄屏下靠 flex-wrap 自然折行（手机端整体梳理另开一轮做）。 */
.wh-tabs { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.wh-tab { padding: 5px 13px; border-radius: 99px; background: var(--panel, #fff);
  border: 1px solid var(--border, #e3e8f0); color: var(--text, #1f2d3d);
  text-decoration: none; font-size: 13px; white-space: nowrap; }
.wh-tab.on { background: var(--primary, #00A0E8); color: #fff; border-color: transparent; }
/* 🆕 2026-11-13 三级分类卡片：复用 .page-tabs（系统设置「员工账号/员工档案/角色与权限」那一套）。
   最左「全部」固定，其余依次排列；⚙ 仅管理员可见。 */
.wh-cats { align-items: center; margin-bottom: 12px; }
#whCatEdit { width: 96px; padding: 2px 6px; border: 1px solid var(--primary, #00A0E8);
  border-radius: 4px; font-size: 14px; text-align: center; }
/* 分类管理弹窗（改名 / 新增 / 删除 / 排序） */
.wh-cat-mrow { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f0f2f6; }
.wh-cat-mno { width: 20px; text-align: center; color: var(--muted, #7a8699); font-size: 12px; flex: none; }
.wh-cat-mname { flex: 1; min-width: 0; }
.wh-cat-mop { width: 28px; height: 28px; flex: none; border: 1px solid var(--border, #e3e8f0);
  background: #fff; border-radius: 5px; cursor: pointer; color: var(--muted, #7a8699); }
.wh-cat-mop:hover { color: var(--primary, #00A0E8); border-color: var(--primary, #00A0E8); }
.wh-cat-mop.danger:hover { color: #c0392b; border-color: #c0392b; }
.wh-cat-mfoot { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.wh-cat-mbtns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@media (max-width: 760px) {
  .wh-cats a { padding: 7px 11px; font-size: 13px; }
  .wh-cat-mfoot .muted-line { display: none; }
}
.wh-tag { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11.5px;
  background: #eef2f7; color: var(--muted, #7a8699); }
.wh-tag.warn { background: #fff4d6; color: #8a6100; }
.wh-tag.danger { background: #fde8e8; color: var(--danger, #c0392b); }
.wh-tag.ok { background: #e2f3fd; color: var(--primary); }
.wh-row-low td { background: #fffaf0; }
.wh-scanbar { display: flex; gap: 8px; margin: 12px 0 4px; align-items: center; flex-wrap: wrap; }
.wh-scanbar input { flex: 1 1 180px; font-size: 15px; padding: 8px 10px; }
.wh-cart input { font-size: 13px; }

/* 库房：商品图片（船长 2026-09-24 晚；2026-09-25 扩成「一组最多 5 张」） */
.wh-photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wh-photo-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
/* 照片条：一排缩略图 + 「加一张」；第一张带「主图」角标（扫码时带出的就是它）
   ⚠️ 同样**不写窄屏媒体查询**（手机端暂停中）—— flex-wrap 自己会折行 */
.wh-photos { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.wh-photo { position: relative; width: 78px; text-align: center; }
.wh-photo img { width: 78px; height: 78px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); cursor: zoom-in; display: block; }
.wh-photo.is-main img { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.wh-photo-tag { position: absolute; left: 0; top: 0; font-style: normal; font-size: 10px;
  background: var(--primary); color: #fff; padding: 1px 5px; border-radius: 8px 0 8px 0; }
.wh-photo-kind { position: absolute; right: 2px; bottom: 2px; font-style: normal; font-size: 10px;
  background: rgba(31, 45, 61, .72); color: #fff; padding: 1px 4px; border-radius: 5px; }
.wh-photo-ops { display: flex; gap: 3px; justify-content: center; margin-top: 3px; }
.wh-photo-ops .btn { padding: 1px 5px; font-size: 11px; }
.wh-photo-add { width: 78px; height: 78px; font-size: 12px; line-height: 1.3; color: var(--muted); }
.wh-photo-add:hover { color: var(--primary); }
/* 拍照 OCR 识别出的候选文字（点按钮填进名称/规格）
   ⚠️ 刻意**不写窄屏媒体查询**：船长定过「手机端暂停，未说开干不新增窄屏样式」。
   基础样式本来就是 flex + 省略号，窄屏自己会挤，不需要额外的断点。 */
.wh-ocr-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.wh-ocr-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; font-size: 13px; }
.wh-ocr-row .btn { flex: none; }
/* 入库必填设置的每一行：勾选框 + 字段名 + 说明 */
.wh-req-row { display: flex; align-items: flex-start; gap: 9px; padding: 9px 2px; border-bottom: 1px solid var(--border); cursor: pointer; }
.wh-req-row:last-child { border-bottom: none; }
.wh-req-row input { margin-top: 3px; }
.wh-req-row b { min-width: 84px; }
.wh-req-row .muted-line { font-size: 12.5px; line-height: 1.5; }

/* ══════════ 经营报表（5 个主题页共用） ══════════
   风格沿用现有：卡片/表格/统计卡都用既有类，这里只补报表特有的筛选条、口径条、图表容器。
   ⚠️ 刻意不写窄屏媒体查询：手机端排版暂停中（船长 2026-09-20 定） */
.rp-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-filter input[type=date] { width: 140px; }
.rp-filter .rf-lab { color: var(--muted); font-size: 13px; }
.rp-filter .rf-ico { color: var(--muted); font-size: 13px; }
.rp-filter .rf-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-filter .rf-quick .btn { padding: 5px 10px; font-size: 12px; }
.rp-filter .rf-spacer { flex: 1; }
.rp-filter .rf-note { color: var(--muted); font-size: 12px; }
.rp-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px;
  margin: 12px 0 10px; padding: 8px 12px; background: var(--primary-soft); border-radius: 8px; }
.rp-meta b { color: var(--text); }
/* 口径/数据缺口条：黄底。它是要让人看见的，不做折叠 */
.rp-gaps { background: #fff8e6; border: 1px solid #f0dca8; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.rp-gaps b { font-size: 13px; }
.rp-gaps ul { margin: 6px 0 0 18px; padding: 0; }
.rp-gaps li { font-size: 12.5px; line-height: 1.75; color: #7a5c14; }
/* 图表容器：高度由内联 style 给（各图不一样），这里只做兜底 */
.rp-chart { width: 100%; min-height: 180px; }
.chart-err { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;
  color: var(--danger); font-size: 13px; text-align: center; gap: 6px; padding: 20px; }
.chart-err .sub-muted { color: var(--muted); font-size: 12px; }
.rp-ch { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
/* 🆕 2026-11-18 船长：「支付方式」要能看具体数额、并能切饼图/柱状图 */
.rp-sw { display: inline-flex; align-self: center; flex: none; border: 1px solid var(--border);
  border-radius: 7px; overflow: hidden; background: #fff; }
.rp-sw b { font-size: 12px; font-weight: 400; padding: 3px 10px; cursor: pointer; user-select: none;
  color: var(--muted); line-height: 1.7; }
.rp-sw b + b { border-left: 1px solid var(--border); }
.rp-sw b:hover { color: var(--primary); }
.rp-sw b.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.rp-fsum { margin-top: 2px; text-align: center; font-size: 12px; color: var(--muted); }
.rp-fsum b { color: var(--text); font-weight: 600; }
.rp-tip { color: var(--muted); font-size: 12px; }
/* 指标卡的环比标 */
.rp-d { font-size: 12px; margin-top: 4px; color: var(--muted); }
.rp-d.good { color: var(--ok); }
.rp-d.bad { color: var(--danger); }
.rp-d span { color: var(--muted); margin-left: 4px; }
.rp-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.rp-link { color: var(--primary); cursor: pointer; text-decoration: none; }
.rp-link:hover { text-decoration: underline; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 来源树（纯展示，说明「一级归口」是怎么来的） */
.rp-tree { font-size: 13px; line-height: 1.9; max-height: 280px; overflow-y: auto; }
.rp-tree-n.lv0 { font-weight: 600; }
.rp-tree-n.lv1 { padding-left: 16px; color: var(--muted); }
.rp-tree-n.lv2 { padding-left: 32px; color: var(--muted); font-size: 12px; }
/* 指标说明弹窗 */
.rp-def { max-height: 60vh; overflow-y: auto; }
.rp-def-row { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; line-height: 1.75; }
.rp-def-row:last-child { border-bottom: none; }
.rp-def-row b { display: block; margin-bottom: 2px; }
.rp-def-row span { color: var(--muted); }
.rp-def-note { margin-top: 10px; padding: 10px 12px; background: var(--primary-soft); border-radius: 8px;
  font-size: 12.5px; line-height: 1.7; color: var(--muted); }

/* ══════════ 设置类弹窗：卡片式分组（船长 2026-09-25 要求）══════════
   为什么不用 .form-grid：两列栅格下，某一项说明文字长一点就把整行撑高，
   另一列的控件被拉到半空、标签与控件错位（截图里就是这样）。
   改成「一行一项：左标签 / 右控件 / 说明跟在控件下」，行高互不影响，怎么加项都不会歪。 */
.modal.modal-set { width: min(880px, 94vw); padding: 22px 26px; }
.set-card { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; background: #fff; }
.set-card-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 11px 16px; background: #f8fafc; border-bottom: 1px solid var(--border); }
.set-card-h h4 { margin: 0; font-size: 14px; }
.set-card-h .set-sub { color: var(--muted); font-size: 12px; line-height: 1.6; }
.set-card-h .set-badge { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary); }
.set-card-b { padding: 2px 16px 8px; }
.set-row { display: grid; grid-template-columns: 116px 1fr; gap: 4px 16px; align-items: start;
  padding: 11px 0; border-bottom: 1px dashed var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row > .set-lab { font-size: 13px; padding-top: 7px; }
.set-row > .set-lab small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; margin-top: 2px; }
.set-ctl { min-width: 0; }
.set-ctl input[type=text], .set-ctl input:not([type]), .set-ctl select { max-width: 100%; }
.set-help { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 5px; }
.set-inline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.set-inline label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; }
.set-inline input[type=radio], .set-inline input[type=checkbox] { width: auto; margin: 0; }
.set-sliders { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px 12px; }
.set-sliders > span { color: var(--muted); font-size: 13px; }
.set-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* 「预约状态配色」：2026-11-03 起每个状态三个取色器（底 / 边 / 字）+ 一个实时预览胶囊 */
.stc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 8px; }
.stc-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 9px; background: #fff; }
.stc-card:hover { border-color: #9fd4f2; }
.stc-h { display: flex; align-items: center; justify-content: space-between; }
.stc-prev { font-size: 11.5px; line-height: 18px; padding: 0 9px; border: 1px solid; border-radius: 10px; }
.stc-cols { display: flex; gap: 8px; }
.stc-cols label { display: flex; align-items: center; gap: 3px; font-size: 10.5px; color: #8a93a3; cursor: pointer; }
.stc-c { width: 26px; height: 20px; padding: 0; border: 1px solid var(--border); border-radius: 4px;
  background: none; cursor: pointer; }
.stc-c:disabled { cursor: not-allowed; opacity: .5; }
.set-act .set-help { margin: 0; }
.set-ph { margin-top: 8px; }
.set-ph .btn { margin: 0 6px 6px 0; }
.set-tpl { width: 100%; }
.set-num { display: inline-flex; align-items: center; gap: 8px; }
.set-num b { display: inline-block; width: 34px; text-align: center; font-size: 15px; }

/* ══════════════════════════════════════════════════════════════
   护理面板（船长 2026-10-03 定）
   认领患者 → 传病例照片 → 配台数 +1（记在护士头上，多人同台平分）
   ══════════════════════════════════════════════════════════════ */
.nr-stat { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 14px; }
.nr-stat-main { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.nr-stat-main > b { font-size: 28px; line-height: 1; color: var(--primary); font-weight: 700; }
.nr-stat-main > em { font-style: normal; color: var(--muted); font-size: 12px; }
.nr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.nr-pane { padding: 12px 14px; margin-bottom: 12px; }
.nr-ph { display: flex; align-items: baseline; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.nr-ph > b { font-size: 14px; }
.nr-wait { max-height: 360px; overflow: auto; }
.nr-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #eef1f5; }
.nr-row:last-child { border-bottom: 0; }
.nr-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nr-row-main > b { font-size: 13.5px; }
.nr-sub { font-size: 12px; color: var(--muted); word-break: break-all; }
.nr-vt { font-style: normal; margin-left: 6px; padding: 0 5px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: 11px; }
.nr-acts { flex: none; display: flex; gap: 6px; align-items: center; }
.nr-onit { font-size: 12px; color: var(--primary); }
.nr-free { color: var(--muted); }
.nr-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.nr-search > input { flex: 1 1 220px; }
.wh-cons-card { padding: 12px 14px; margin-bottom: 12px; }
.wh-cons-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-bottom: 8px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.wh-cons-h > b { font-size: 14px; }
.wh-cons { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.wh-cons > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.wh-cons select, .wh-cons input { min-width: 120px; }

/* 窄屏（护士多半用手机/Pad 干活）：两栏拆竖排、按钮整行 */
@media (max-width: 820px) {
  .nr-grid { grid-template-columns: 1fr; }
  .nr-row { flex-wrap: wrap; }
  .nr-acts { width: 100%; }
  .nr-acts .btn { flex: 1; }
  .wh-cons { flex-direction: column; align-items: stretch; }
  .wh-cons select, .wh-cons input { min-width: 0; width: 100%; }
  .nr-wait { max-height: none; }
}

/* 预约页工具栏的「设置」入口（船长 2026-10-03）：**只要齿轮、不写文字**，放在这一行最右。 */
/* 🆕 2026-10-05 二次照图（船长当天第二次）：
     · **一行四件**：日/周/月看板标签（左） · 搜索患者（**居中**） · ＋新建预约 · ⚙（右）
     · 整行高度缩到与标签一致（--apt-top-h：84 → 42）
   🔴 这**反转**了 10-04 的「齿轮放大 3 倍、与＋新建预约同高 84px」—— 船长本次明确要"缩小高度"。
   🔴 高度统一走 --apt-top-h（定义在 .apt-page），加控件自动跟齐。 */
.apt-gear { width: 42px; height: var(--apt-top-h, 42px); font-size: 22px; line-height: 1; padding: 0; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; }
.apt-gear:hover { border-color: var(--primary); color: var(--primary); }
/* 🔵 2026-10-10：`.apt-big`（顶栏「＋ 新建预约」文字按钮）已随船长「简化成符号」撤掉 ——
   全仓已无引用（改成 `.apt-newone` 图标按钮）。留着会变成"改名只改了一半"的残留。 */

/* ── 第 1 行：视图标签页 + 主操作 ───────────────────────────────── */
/* ══════════ 预约页顶部（照 E看牙 参考图，2026-10-04）· 开始 ══════════
   🔴 这一段里所有类名都必须是**全站唯一**的（`apt-dbar` / `apd-*`）。
   为什么单列一段并写这句：2026-10-04 新日期条原本叫 `.apt-datebar` / `.db-nav`，
   和文件前面那组**已经没人用的**旧日期条样式（第 1106 行起）撞名 ——
   旧规则里的 `height: 46px` 把新日期条顶高了 12px，且**不报任何错**。
   以后往这里加类名，先在 style.css 里 grep 一遍。 */
/* 🆕 2026-10-05 二次照图：**一行三栏** —— 左「标签」/ 中「搜索」（居中）/ 右「按钮」。
   🔴 左右两栏都写 `flex: 1 1 0`（**等宽**）⇒ 中间那栏天然落在整行正中 —— 这就是"搜索框居中"的实现，
      别用 `margin: 0 auto` 或绝对定位：窗口一变宽就偏（左右内容宽度不等时尤其明显）。 */
.apt-top1 { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.apt-topacts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 1 1 0; min-width: 0; }
/* 🔴 左栏必须**也**是 `flex: 1 1 0`（等宽），否则搜索框不居中 —— 实测偏右 78px：
   下面那条旧的 `.apt-views.apt-tabs{flex:1}` 会生效，而它按内容宽参与分配。
   这里用 `.apt-top1 .apt-views.apt-tabs`（特异性 0,3,0 > 旧的 0,2,0）**与位置无关地**压住它。 */
.apt-top1 .apt-views.apt-tabs { flex: 1 1 0; min-width: 0; }

/* ── 顶栏「搜索患者」（船长图上那个蓝框）──────────────────────────────
   🔴 高度吃 --apt-top-h ⇒ 与标签行、两个按钮**同一高度**。 */
.apt-ps { position: relative; flex: 0 0 360px; min-width: 150px; }
.apt-ps-in { width: 100%; height: var(--apt-top-h, 42px); box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
  padding: 0 30px 0 12px; font: inherit; font-size: 13.5px; outline: none; }
.apt-ps-in:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft, #eef7f5); }
.apt-ps-in::placeholder { color: #b3bac4; }
.apt-ps-clr { position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: 0; border-radius: 50%; background: #eef1f5; color: #6b7480;
  cursor: pointer; font-size: 15px; line-height: 1; }
.apt-ps-clr:hover { background: #e2e7ee; }
/* 下拉：绝对定位在下，不占用布局高度（否则展开会把看板挤下去） */
.apt-ps-drop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .14); max-height: 360px; overflow: auto; }
.apt-ps-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.apt-ps-row:hover { background: var(--primary-soft, #eef7f5); }
.apt-ps-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.apt-ps-main b { font-size: 14px; color: var(--text); }
.apt-ps-main span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apt-ps-new { flex: none; }
/* 「没有匹配的患者」这一行：文字与「＋ 新建」按钮**并排居中**
   （船长 2026-10-05 图上绿框要的就是这个按钮） */
.apt-ps-empty { display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px; font-size: 13px; color: var(--muted); }
.apt-ps-newpt { flex: none; }
/* 有匹配时，列表末尾那个「用「xxx」新建患者」入口 */
.apt-ps-newpt-row { display: flex; margin-top: 4px; padding: 6px 4px 2px; border-top: 1px solid var(--border); }
.apt-ps-newpt-row .apt-ps-newpt { flex: 1; }
/* 标签页外观：容器仍是 `.apt-views`（前端有三处按它查视图按钮），这里只把外观从
   「分段控件小按钮」换成「下划线标签」—— 所以要逐条把 .apt-views 那套外框覆盖掉。 */
.apt-views.apt-tabs { flex: 1; min-width: 0; align-items: flex-end; gap: 2px; padding: 0;
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.apt-tab { appearance: none; border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 15px; color: var(--muted); padding: 9px 16px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; white-space: nowrap; }
.apt-tab:hover { color: var(--primary); background: var(--primary-soft, #eef7f5); }
.apt-tab.on { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

/* ── 第 2 行：日期条 ───────────────────────────────────────────── */
.apt-dbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 4px 12px; margin-bottom: 10px; min-height: 44px; }
.apd-ym { display: flex; align-items: center; gap: 4px; }
.apd-u { font-size: 13px; color: var(--muted); }
.apd-sel { border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
  padding: 4px 6px; font-size: 13.5px; text-align: center; }
/* 🔴 下拉必须写死宽度 + `flex: none`：放在 flex 行里会被压窄，
   「2026」被压成「202」这种**看着像数据错了**的样子（实测踩到）。 */
#aptY { flex: none; width: 72px; }
#aptM { flex: none; width: 58px; }
/* 🆕 2026-10-05：‹ › 已移进这一行（日期的左右两侧）⇒ 对齐从 baseline 改成 center
   （按钮没有文字基线，用 baseline 会让它们歪），间距收窄。
   ⚠️ `.apd-nav` 那组容器已不再生成 —— 样式留着无害，但**别再往那个 div 里塞按钮**。 */
.apd-date { display: flex; align-items: center; gap: 6px; }
.apd-step { font-size: 16px; padding: 0 8px; flex: none; }
.apd-date .apd-d { font-size: 21px; font-weight: 700; letter-spacing: .5px; color: var(--text); }
.apd-date .apd-w { font-size: 14px; color: var(--muted); }
/* 🆕 2026-10-05 船长：「今天」挪到 › 右侧，外观**参照日历表那个绿色**
   （月历里"今天"＝绿字 #52c41a、选中日＝绿圆）⇒ 两处说的是同一件事，就该同一个色。
   ⚠️ 刻意不用 --ok(#52a352)：那是"成功"语义色；这里要的是"今天"，跟日历表对齐才不打架。 */
.apd-today { font-style: normal; font-size: 12px; color: #fff; background: #52c41a;
  border-radius: 6px; padding: 2px 7px; align-self: center; }
/* 不是今天时那颗是**按钮**（点了回今天）⇒ 外观与上面那颗标记一致。
   🔴 必须写 `.btn.apd-today-btn`（双类名，特异性 0,2,0）：单类名 0,1,0 **压不过** `.btn.btn-sm`（0,2,0）
      ⇒ 会静默保持白底灰边（看着像"没改成功"，但哪里都不报错）。 */
.btn.apd-today-btn { align-self: center; background: #52c41a; border-color: #52c41a; color: #fff; }
.btn.apd-today-btn:hover { background: #45a815; border-color: #45a815; }
/* 🗑 2026-10-05 船长「删除休息显示」：「休」那颗红标已从日期条删掉
   ⇒ .apd-hol 现在**只代表补班**，底色直接就是蓝（原来那条 .apd-hol.work 覆盖已删，不再需要）。
   将来若要恢复「休」，再按语义补一个红底色（月历里法定休息是用 #e5484d 红字表达的）。 */
.apd-hol { font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: #2f6fd8;
  border-radius: 6px; padding: 2px 7px; align-self: center; }
.apd-nav { display: flex; align-items: center; gap: 4px; }
/* ‹ › 从「日/周/月/列表」那一组挪到日期条上（参考图里它就在日期旁边），箭头稍微放大一点好点 */
.apd-nav .apt-step { font-size: 16px; padding: 0 10px; }
.apd-right { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; margin-left: auto; }
/* 医生范围（照 E看牙「当值医生 / 全部医生」）：分段控件，选中项深灰底白字 */
.apd-scope { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.apd-scope button { border: 0; background: #fff; color: var(--text); cursor: pointer;
  padding: 6px 12px; font: inherit; font-size: 13px; white-space: nowrap; }
.apd-scope button + button { border-left: 1px solid var(--border); }
.apd-scope button.on { background: #6b7480; color: #fff; font-weight: 600; }
.apd-scope button.on b { color: #fff; }
.apd-scope button:disabled { background: #f6f7f9; color: #b9c0c9; cursor: not-allowed; }
/* 状态按钮条：配色复用系统既有的 `.st-*`（所以这里**不要**写 background/color/border-color，
   否则会盖掉 .st-* 的那套颜色 —— 它们同优先级，靠文件顺序定输赢）。
   ⚠️ 尺寸要**紧凑**：这一条得和年/月、大号日期、‹ ›、医生范围挤在**同一行**里 ——
   一旦换行，日期条就从 44px 变 100px，看板直接矮掉 60px（船长明确要保住看板高度）。 */
.apd-chips { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; margin: 0; }
.apd-chip { border-width: 1px; border-style: solid; border-radius: 6px; cursor: pointer;
  padding: 2px 7px; font: inherit; font-size: 12px; line-height: 1.45; white-space: nowrap; }
.apd-chip:hover { filter: brightness(.96); }
.apd-chip.on { font-weight: 700; box-shadow: 0 0 0 2px var(--primary) inset; }
.apd-chip-all { background: #eef1f5; border-color: #8b96a5; color: #55606d; }
/* 收起＝只留「全部 / 主链 6 态 / 当前选中的那一颗」；旁路三态（已过期·爽约·已取消）藏起来。
   🔴 选择 `:not(.on)` 是必须的：留着 `on` 的那颗 —— 不然选了「爽约」再收起，
      按钮条上就**看不出当前正筛着什么**了。 */
/* 🗑 2026-10-05 船长「删除取消按键」⇒ `.apd-chips.folded` 与 `.apd-fold` 两条已作废（状态条始终全展开）。 */
/* 左侧小计里的「筛选中」提示条（2026-10-04） */
.apd-fstat { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px;
  padding: 5px 9px; border-radius: 8px; background: #f4f8ff; border: 1px solid #cfe0f5; font-size: 12px; }
.apd-fstat b { color: var(--primary); }
.apd-fstat button { margin-left: auto; }

/* 窄屏（≤820px）：桌面那套「一行塞下全部」在手机上必然溢出（实测 390 宽时状态条内容 650px、
   标签页被「＋新建预约」压住）。手机上改成**让每块自己换行/横滑**，绝不横向溢出整页。
   齿轮与「＋新建预约」也缩回常规高度 —— 桌面那个 84px 巨钮在手机上会把整行撑爆。 */
@media (max-width: 820px) {
  /* ⚠️ 窄屏的 --apt-top-h 覆盖**不写在这里** —— 必须排在 .apt-page 那条定义**之后**，
     否则被反覆盖（2026-10-05 实测踩到：窄屏量出来还是桌面值）。真正的覆盖在文件下方紧挨 .apt-page 那条。 */
  /* 窄屏一行放不下四件 ⇒ 标签与按钮同排，**搜索框整行落到第二行**（order:3 + flex-basis:100%） */
  .apt-top1 { flex-wrap: wrap; align-items: center; row-gap: 6px; }
  .apt-views.apt-tabs { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
  .apt-views.apt-tabs::-webkit-scrollbar { display: none; }
  .apt-tab { padding: 6px 10px; font-size: 14px; }
  .apt-topacts { flex: none; gap: 6px; }
  .apt-ps { flex: 1 1 100%; order: 3; min-width: 0; }
  .apt-ps-in { font-size: 13px; padding: 0 28px 0 11px; }
  .apt-gear { width: 38px; font-size: 19px; }
  .apt-dbar { gap: 10px; }
  .apd-date .apd-d { font-size: 18px; }
  /* 医生范围＋状态条：整块另起一行，状态条允许换行（宁可两行，不要横向溢出） */
  .apd-right { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 8px; }
  .apd-chips { flex-wrap: wrap; }
  .apd-scope button { padding: 5px 9px; font-size: 12.5px; }
}

/* 预约页专用：把上方留白压到最小。
   注意**不改 `.main` 的全局 padding**（那会连累别的页面），只在本页抵消一点顶部空隙。 */
/* 🆕 2026-10-05 二次调：整行压到与「日/周/月看板」标签**同高**（原来 84px，比标签高一倍）。 */
.apt-page { --apt-top-h: 42px; margin-top: -10px; }
/* 🔴 窄屏覆盖**必须紧跟上面那条之后**：CSS 同优先级靠"后来者胜"，
   写到文件上方那个 ≤820 媒体查询块里会被这里的 42px 反覆盖（2026-10-05 实测踩到）。 */
@media (max-width: 820px) { .apt-page { --apt-top-h: 38px; } }
.apt-page .page-head { margin-bottom: 8px; }
.apt-page .page-head h2 { font-size: 17px; }
.apt-page .toolbar { gap: 8px; }

/* 项目色（船长 2026-10-03，**2026-10-05 按新参考图改过分工**）：
   配了色的项目 ⇒ **项目文字**用项目色；左侧那条竖色**归状态**（参考图里竖条就是状态色）。
   🔴 原来这里还有一条 `.cal-appt.has-ic { border-left-color: var(--item-c) }` ——
      它会让左侧竖条变成"项目色"、把状态色顶掉，与本次「左侧竖条＝状态色块」直接冲突，**已删**。
      删它不影响项目色功能：颜色改由 .a2 承载（仍是零新增、没配色的项目观感零变化）。 */
.cal-appt.has-ic .a2 { color: var(--item-c); }

/* ══ 会员卡券：卡内内容（权益项 + 券三态）—— 板块与患者页签共用（船长 2026-10-03）══ */
.mc-open { cursor: pointer; border-bottom: 1px dashed var(--primary); }
.mc-open:hover { color: var(--primary); }
.mc-caret { font-style: normal; margin-left: 3px; color: var(--muted); font-size: 10px; }
.mc-tr-open > td { background: var(--primary-soft); }
.mc-tr-detail > td { background: #fafbfd; padding: 0 !important; }
.mc-inner { padding: 10px 12px 12px; }
.mc-inner .mm-tbl { margin-bottom: 4px; }
.mc-inner-h { font-size: 12px; font-weight: 600; color: var(--text); margin: 10px 0 6px; }
.mc-inner-h:first-child { margin-top: 0; }
.mc-tks { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-tk2 { font-size: 12px; padding: 2px 9px; border-radius: 20px; background: #fff; border: 1px solid var(--border); color: var(--text); }
.mc-tk2.used { background: #f0f0f0; color: #8b96a5; text-decoration: line-through; }
.mc-tk2.dead { background: #f7f7f7; color: #b6bcc5; text-decoration: line-through; }
.mc-f { margin-top: 8px; }

/* 患者详情「会员卡券」页签：卡内权益表（船长 2026-10-03） */
.mp-eq { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 8px 12px 10px; margin-bottom: 8px; }
.mp-eq-h { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.mp-eq-h > .sub { font-weight: 400; font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.mp-eq-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mp-eq-t th { text-align: left; font-weight: 400; color: var(--muted); font-size: 11.5px; padding: 3px 0; border-bottom: 1px dashed #eef1f5; }
.mp-eq-t td { padding: 4px 0; border-bottom: 1px dashed #f4f6fa; }
.mp-eq-t tr:last-child td { border-bottom: 0; }
.mp-eq-t .num { text-align: right; font-variant-numeric: tabular-nums; }

/* 微信生态入口页（企业微信 / 小程序 / 公众号）—— 船长 2026-10-03 */
.mkch { display: flex; gap: 22px; align-items: flex-start; padding: 18px 20px; flex-wrap: wrap; }
.mkch-qr { width: 240px; height: 240px; flex: none; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 12px; background: #fafbfd; }
.mkch-qr-img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; background: #fff; }
.mkch-qr-none { color: var(--muted); font-size: 12.5px; }
.mkch-info { flex: 1 1 260px; min-width: 0; }
.mkch-h { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.mkch-desc { font-size: 13px; line-height: 1.8; white-space: pre-wrap; color: var(--text); }
.mkch-url { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mkch-url > a { color: var(--primary); word-break: break-all; }

/* 积分商城（船长 2026-10-03） */
.mkm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mkm-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.mkm-img { height: 120px; background: #f4f6fa; display: flex; align-items: center; justify-content: center; color: #b6bcc5; font-size: 12px; }
.mkm-img > img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.mkm-bd { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mkm-nm { font-size: 13.5px; font-weight: 600; }
.mkm-cost { font-size: 12.5px; color: var(--muted); }
.mkm-cost > b { color: var(--warn); font-size: 16px; }
.mkm-line { font-size: 12px; color: var(--muted); }
.mkm-note { font-size: 11.5px; color: var(--muted); }
.mkm-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.mkm-plist { max-height: 190px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; margin-top: 6px; }
.mkm-plist:empty { display: none; }
.mkm-p { display: flex; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: none;
  text-align: left; padding: 7px 10px; border-bottom: 1px dashed #eef1f5; cursor: pointer; font-size: 12.5px; }
.mkm-p:last-child { border-bottom: 0; }
.mkm-p:hover { background: var(--primary-soft); }
.mkm-p.on { background: var(--primary-soft); }
/* 🆕 2026-10-15 船长：积分商品分类 —— 上方筛选条 + 卡片角标 */
.mkm-cats { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 12px; }
.mkm-cat { font-size: 12.5px; color: var(--text); background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 3px 11px; cursor: pointer; user-select: none; white-space: nowrap; }
.mkm-cat:hover { border-color: var(--primary); color: var(--primary); }
.mkm-cat.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
/* 父级 .mkm-bd 是纵向 flex，不给 align-self 这标签会被拉成整条色带 */
.mkm-cat-tag { align-self: flex-start; font-size: 11px; color: var(--primary); background: var(--primary-soft);
  border-radius: 4px; padding: 1px 6px; }
@media (max-width: 820px) { .mkm-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }

/* ===== 系统设置·预约项目（2026-10-08 船长：预约卡「项目」二级菜单的菜单源）=====
   🔴 全局 `input,select,textarea{width:100%}`（style.css:22）会把行内小输入框撑满整行 ⇒
      这里凡是「输入框 + 按钮」同排的，都显式给输入框 `flex:1;min-width:0`、按钮 `flex:none`。 */
.ai-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: start; }
.ai-ch { font-size: 11.5px; color: var(--muted); padding: 2px 6px 6px; }
.ai-col-g { background: #f7f9fb; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.ai-col-i { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ai-g { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px;
  font-size: 13px; color: var(--text); cursor: pointer; margin-bottom: 2px; }
.ai-g:hover { background: var(--primary-soft); }
.ai-g.on { background: var(--primary); color: #fff; }
.ai-g .ai-gn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-g em { flex: none; font-style: normal; font-size: 11px; color: var(--muted); }
.ai-g.on em { color: rgba(255, 255, 255, .85); }
.ai-ihead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ai-ihead label { flex: none; font-size: 12px; color: var(--muted); margin: 0; }
.ai-ihead input { flex: 1; min-width: 0; }
.ai-ihead .btn { flex: none; }
.ai-irow { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px dashed #e6ebf1; }
.ai-irow:last-child { border-bottom: 0; }
.ai-irow input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; }
.ai-irow .btn { flex: none; width: auto; }
.ai-paste { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.ai-paste label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.ai-paste textarea { font-size: 13px; }
@media (max-width: 820px) { .ai-wrap { grid-template-columns: 1fr; } }

/* ===== 右侧预约卡·极限压缩表单（船长 2026-10-08：标签左置、两列并排、删诊室、加项目/备注）=====
   🔴 全局 `input,select,textarea{width:100%}`（style.css:22）会把行内控件撑满、把按钮挤出去 ⇒
      行内控件一律 `flex:1;min-width:0`，按钮/标签 `flex:none`。 */
.rt-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.rt-form .full { grid-column: 1 / -1; }
.rt-f { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rt-f > label { flex: none; width: 30px; font-size: 12px; color: var(--muted); margin: 0; text-align: right; }
.rt-f > input, .rt-f > select, .rt-f > .field, .rt-f > .rt-w, .rt-f > .rt-pick { flex: 1; min-width: 0; }
.rt-f .field { margin: 0; }
.rt-f .field > label { display: none; }        /* 标签由 .rt-f 自己给，别出双标签 */
.rt-f input, .rt-f select, .rt-f .dt-in { padding: 5px 8px; font-size: 13px; }
.rt-f select { padding-right: 4px; }
.rt-w { position: relative; }                   /* 患者：输入框 + 候选 chips 的容器 */
.rt-line { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); line-height: 1.45; min-height: 0; }
.rt-line:empty { display: none; }
.rt-line b { color: var(--primary); font-weight: 600; }
/* 项目：只读按钮（船长定「只能从菜单选」） */
.rt-pick { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
  cursor: pointer; text-align: left; min-width: 0; }
.rt-pick:hover { border-color: var(--primary); }
.rt-pick > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-pick > span.ph { color: var(--muted); }
.rt-pick > i { font-style: normal; color: var(--muted); font-size: 10px; flex: none; }
/* 项目二级菜单：一级＝分组 chips，二级＝该组项目；面板就地展开 */
.rt-panel { grid-column: 1 / -1; border: 1px solid var(--primary); border-radius: 10px; padding: 8px; background: #fbfdff; }
.rt-pg { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.rt-pg a { font-size: 12px; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
.rt-pg a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.rt-pg a em { font-style: normal; font-size: 10.5px; color: var(--muted); margin-left: 4px; }
.rt-pg a.on em { color: rgba(255, 255, 255, .8); }
.rt-pis { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 7px; max-height: 170px; overflow-y: auto; }
.rt-pis a { font-size: 12.5px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; }
.rt-pis a:hover { border-color: var(--primary); color: var(--primary); }
.rt-pis a.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.rt-pfoot { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--border); }
.rt-pfoot a { font-size: 12px; color: var(--primary); cursor: pointer; }
.rt-pfoot .muted-line { font-size: 11px; }
.rt-empty { font-size: 12px; color: var(--muted); padding: 4px 0; }

/* 占用块三行（姓名 / 项目 / 时间·时长）—— 按**真实像素高**自动降级（与 .cal-appt 同一套判据）：
   <30px 只留姓名；30~51px 姓名 + 项目；≥52px 三行全上。级别由 JS 写进 data-lv。
   🔴 降级时**先舍时间、留项目**：块在时间轴上的位置本身已经表达了时间，项目才是位置给不出的信息。 */
.cal-selblock { padding: 1px 6px 7px; }
.cal-selblock .sb-n { display: block; font-size: 11.5px; line-height: 1.15; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-selblock .sb-p, .cal-selblock .sb-t { display: none; font-weight: 600; font-size: 11px; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.cal-selblock[data-lv="1"] { padding-bottom: 6px; }
.cal-selblock[data-lv="1"] .sb-n { font-size: 10.5px; line-height: 1.06; }
.cal-selblock[data-lv="2"] .sb-p { display: block; font-size: 10.5px; line-height: 1.06; }
.cal-selblock[data-lv="3"] .sb-p, .cal-selblock[data-lv="3"] .sb-t { display: block; }
.cal-selblock .sb-h { height: 7px; }
.cal-selblock .sb-h::before { bottom: 2px; height: 3px; }

/* ===== 预约卡「项目」勾选面板（船长 2026-10-08：勾选式、可多选、必选；全览/卡片双模式）===== */
.rt-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.rt-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 9px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary); cursor: pointer; max-width: 100%; }
.rt-chip > b { font-weight: 700; font-size: 11px; opacity: .7; }
.rt-chip:hover > b { opacity: 1; }
/* 二级菜单切换条（全览 / 卡片） */
.rt-modes { gap: 6px; align-items: center; }
.rt-modes > a { font-weight: 600; }
.rt-modes > .muted-line { font-size: 11px; margin-left: 4px; }
/* 面板主体：分组 + 勾选项，超高就面板内滚（8 组一次全列也不撑破卡片） */
.rt-pbody { max-height: 268px; overflow-y: auto; }
.rt-grp { padding: 6px 0; border-bottom: 1px dashed #e6ebf1; }
.rt-grp:last-child { border-bottom: 0; padding-bottom: 2px; }
.rt-gt { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text); }
.rt-gt > span { font-weight: 400; font-size: 11px; color: var(--muted); }
.rt-cbs { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 5px; }
/* 勾选项：真·勾选框样式（方框 + 勾），选中＝主色底 */
.rt-cb { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 3px 8px; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; max-width: 100%; }
.rt-cb > i { flex: none; width: 12px; height: 12px; border-radius: 3px; border: 1px solid #c6cfd9; background: #fff; position: relative; }
.rt-cb > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-cb:hover { background: #f4f7fa; }
.rt-cb.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.rt-cb.on > i { background: var(--primary); border-color: var(--primary); }
.rt-cb.on > i::after { content: ''; position: absolute; left: 3px; top: 3.5px; width: 5px; height: 2.5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
/* ══ 2026-11-18 船长：「项目有些显示不全」══
   带进来的老项目（E看牙 长文本，如「乳牙玻璃离子充填（国产）」）比菜单项长得多，
   若跟普通项目挤同样的窄格子，要么被省略号截掉、要么把整块列宽撑大（少一列）。
   ⇒ 让它**独占整行**：自己完整显示，也不参与列宽计算（rtColNeed 只量菜单项）。 */
.rt-cb.extra { background: #eef1f5; grid-column: 1 / -1; justify-self: start; max-width: 100%; }
/* 🔴 上面这行写在 `.rt-cb.on` 之后 ⇒ 同为 2 个类、后者胜 ⇒ **已勾选的「不在菜单里」项会被灰底盖掉**，
   看着像没选（实测抓到）。这里用 3 个类（.on.extra）把优先级压回来。 */
.rt-cb.on.extra { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* 🆕 2026-10-08 船长：备注升到「项目」上方；「全览」模式勾选面板**吃掉卡片下方剩余高度**。
   🔴 面板必须放在 `.rt-form` **外面**（栅格撑不满容器剩余高度），出来以后才能 `flex:1`。 */
.rt-wrap { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.rt-form { flex: none; }
/* 右侧表单卡：把卡片正文变成一列，让 .rt-wrap 撑满、面板再吃掉剩余高度 */
.apt-drawer-wrap.rtform .rtcard-b { display: flex; flex-direction: column; }
.apt-drawer-wrap.rtform .rtcard-b > .rt-wrap { flex: 1 1 auto; min-height: 0; }
/* 面板：默认吃掉剩余高度；矮窗口下兜一个下限（再小就整卡滚动，不把面板压没） */
.rt-panel { flex: 1 1 auto; min-height: 168px; display: flex; flex-direction: column; }
/* 列表：占满面板剩余高度、内部滚动（原来是写死 max-height:268px ⇒ 全览时只露一小截） */
.rt-pbody { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
/* 居中弹窗（.modal 不是 flex 列）里保持内容高度，别硬撑 */
.modal .rt-panel { flex: none; }
.modal .rt-pbody { max-height: 46vh; }
/* 全览要「尽量全部显示」：分组更紧凑一点，省下的高度都留给项目 */
.rt-grp { padding: 5px 0; }
.rt-cbs { padding-top: 4px; gap: 4px; }
/* 「全览」模式（现在是唯一模式）：2026-11-13 船长「行间距增大」⇒ 行高与组间距都放宽 */
.rt-panel[data-mode="all"] .rt-grp { padding: 8px 0; }
.rt-panel[data-mode="all"] .rt-gt { font-size: 12px; margin-bottom: 2px; }
.rt-panel[data-mode="all"] .rt-cbs { gap: 8px; padding-top: 6px; }
.rt-panel[data-mode="all"] .rt-cb { font-size: 12.5px; padding: 4px 9px; gap: 5px; border-radius: 7px; line-height: 1.45; }
.rt-panel[data-mode="all"] .rt-cb > i { width: 12px; height: 12px; }
.rt-panel[data-mode="all"] .rt-cb.on > i::after { left: 3px; top: 3px; width: 5px; height: 2.5px; }

/* 🆕 2026-10-09 船长：预约卡上方删掉「项目 / 状态」两行、只压提示行。 */
/* 🔴 排班提示被挤成半宽的根因：aptPaintDuty 会 `hint.className = 'sub-muted'`，
   **把原来挂在元素上的 `rt-line` 类覆盖掉了** ⇒ `grid-column: 1 / -1` 失效，
   提示行只占一格（约半宽），于是「✅ 在上班时段内（08:30-18:30）」被折成两行。
   这里按 id 把跨列补回来（不动那段通用逻辑，避免连累别的调用方）。 */
#apf_time_hint { grid-column: 1 / -1; font-size: 11px; line-height: 1.3; }
/* 日期下面那行农历：11px 一行，不换行、超长省略（船长：缩小农历） */
.rt-f .field .sub-muted { font-size: 11px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 已选患者那一行也收成一行（原来那段「（换人就改上面的关键词重新搜）」已去掉） */
#apf_picked { font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 系统设置·更新日志（船长 2026-10-09）=====
   🔴 全局 `input,select,textarea{width:100%}`（style.css:22）⇒ 搜索框必须显式给宽度，否则整行占满、
      把模块筛选挤到下一行。 */
.chg-head { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: baseline; }
.chg-head b { color: var(--primary); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.chg-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.chg-kw { flex: 0 1 240px; min-width: 150px; }
.chg-mods { display: flex; flex-wrap: wrap; gap: 5px; }
.chg-mods a { font-size: 12px; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
.chg-mods a em { font-style: normal; font-size: 10.5px; color: var(--muted); margin-left: 4px; }
.chg-mods a:hover { border-color: var(--primary); }
.chg-mods a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chg-mods a.on em { color: rgba(255, 255, 255, .8); }
.chg-list { border-top: 1px solid var(--border); max-height: 62vh; overflow-y: auto; }
.chg-item { padding: 10px 2px; border-bottom: 1px dashed #e6ebf1; }
.chg-item:last-child { border-bottom: 0; }
.chg-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chg-v { font-size: 12px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.chg-at { font-size: 11.5px; color: var(--muted); }
.chg-mod { font-size: 11px; padding: 1px 8px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); }
.chg-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin: 3px 0 2px; }
.chg-items { margin: 0; padding-left: 18px; }
.chg-items li { font-size: 12.5px; color: var(--muted); line-height: 1.65; }

/* ===== 项目勾选面板：搜索框 + 分组折叠（船长 2026-10-09）=====
   🔴 全局 `input{width:100%}` ⇒ 搜索框必须显式 `width:auto; flex:1`，否则会把「全览/卡片」挤出去。 */
.rt-sbar { display: flex; align-items: center; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--border); flex: none; }
/* 2026-11-13 船长：底部提示条整条去掉（占位挤掉最后一组项目），「清空」缩成搜索行右侧小链接 */
.rt-clear { flex: none; font-size: 12px; color: #8a93a3; cursor: pointer; padding: 0 1px; }
.rt-clear:hover { color: var(--danger); }
.rt-kw { flex: 1 1 auto; width: auto; min-width: 0; padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.rt-modes { flex: none; display: flex; gap: 5px; }
.rt-modes a { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
.rt-modes a:hover { border-color: var(--primary); }
.rt-modes a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
/* 分组标题：整行可点、右侧一个小箭头（收起时转 90°） */
.rt-gt { cursor: pointer; user-select: none; align-items: center; }
.rt-gt:hover { color: var(--primary); }
.rt-gt > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-grp.closed .rt-cbs { display: none; }
.rt-chev { flex: none; width: 8px; height: 8px; margin-right: 2px; opacity: .55;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px); transition: transform .15s; }
.rt-grp.closed .rt-chev { transform: rotate(-45deg); }
/* 搜索命中：项目高亮边框；组名命中时组名变色 */
.rt-cb.hit { background: #fff4e0; color: #8a5a00; font-weight: 600; }
.rt-cb.hit.on { background: var(--primary-soft); color: var(--primary); }
.rt-gt.hit { color: var(--primary); }

/* ===== 系统设置·客户端安装（船长 2026-10-09：固定地址 + 三步装成应用 + hosts 片段）===== */
.cs-head { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: baseline; }
.cs-head b { color: var(--primary); font-size: 13px; }
.cs-addr { display: grid; grid-template-columns: minmax(0, 1fr) 194px; gap: 18px; align-items: center;
  padding-bottom: 14px; border-bottom: 1px dashed #e6ebf1; }
.cs-lb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cs-url-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-url { font-size: 14px; font-weight: 600; color: var(--primary); background: var(--primary-soft);
  padding: 5px 10px; border-radius: 8px; word-break: break-all; }
.cs-code { font-size: 12.5px; background: #f1f5f9; padding: 2px 6px; border-radius: 5px; }
.cs-sub { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.65; }
.cs-warn { margin-top: 8px; font-size: 12px; color: #7a5a10; background: #fffaf0; border: 1px solid #f0e0b8;
  border-radius: 8px; padding: 7px 10px; }
.cs-qr { text-align: center; }
.cs-qr svg { display: block; margin: 0 auto; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; padding: 6px; box-sizing: content-box; width: 168px; height: 168px; }
.cs-qr-t { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.cs-sec { margin-top: 14px; }
.cs-sec-h { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.cs-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cs-step { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.cs-step > b { font-size: 13px; display: block; margin-bottom: 5px; }
.cs-step > div { font-size: 12px; color: var(--muted); line-height: 1.65; }
.cs-step code, .cs-sec-h code { font-size: 11.5px; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
.cs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed #e6ebf1; }
.cs-row-l { flex: 1; min-width: 0; }
.cs-row-l > b { font-size: 13px; display: block; }
.cs-row-l > div { font-size: 12px; color: var(--muted); }
.cs-pre { margin: 0; background: #f7f9fb; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  font-size: 12.5px; line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-all; }
.cs-row2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cs-faq > div { font-size: 12.5px; color: var(--muted); line-height: 1.95; }
.cs-faq b { color: var(--text); font-weight: 600; }
@media (max-width: 820px) { .cs-addr { grid-template-columns: 1fr; } .cs-steps { grid-template-columns: 1fr; } }

/* 🆕 2026-10-09 船长定稿（看完三张小样后选了「灰底通栏」那种，并要求**层级再强一些**、
   **去掉勾选项周边那圈灰框**）：
   · 分组标题＝**浅灰底通栏 ＋ 左侧一条主色竖条**；下面的项目**不带任何边框**（只缩进 12px）
     ⇒ 上下级一眼分得开。每组比原来多约 5px 高（10 组约 50px，全览滚动略多一点点）。
   · 勾选项去掉灰框：描边改 `transparent` 而**不是**删掉 `border` —— 删掉会让每个项左右各缩 1px、
     整片项目会轻微跳动。悬停给一层**中性浅灰底**而不是蓝框（蓝框会被误认成「已勾选」）；
     已勾选＝浅蓝底 ＋ 蓝勾 ＋ 主色粗体，两者不会混。 */
.rt-gt { background: #e9eef5; border-left: 3px solid var(--primary); border-radius: 6px;
  padding: 3px 8px 3px 7px; font-size: 12px; font-weight: 600; }
.rt-cbs { padding-left: 12px; }

/* ══ 🆕 2026-10-10 会员卡设置界面（照 E看牙「查看非等级会员」复刻 + 可编辑）══
   左侧档位列表沿用 .mm-sid；右侧换成：两个大页签 → 页内六个小页签 */
.mt-main { flex: 1; min-width: 0; }
/* 🆕 2026-10-10 船长：「排列在一页里，卡片形式展示，可以上下拖动」⇒ 八张卡片纵向铺开、可拖拽换序。
   拖拽只认手柄（.mt-grip）—— 整卡 draggable 会连输入框的点击都吃掉。 */
.mt-blocks { display: flex; flex-direction: column; gap: 12px; padding-bottom: 26px; }
.mt-block { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  transition: box-shadow .15s; }
.mt-block.dragging { opacity: .45; border-style: dashed; border-color: var(--primary); }
.mt-bh { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px;
  background: #f7f9fc; border-bottom: 1px solid var(--border); }
.mt-grip { cursor: grab; color: #c3ccd6; font-size: 15px; line-height: 1; padding: 2px 3px;
  user-select: none; -webkit-user-select: none; }
.mt-grip:hover { color: var(--primary); }
.mt-grip:active { cursor: grabbing; }
.mt-bt { font-size: 12.5px; font-weight: 600; color: #33404f; }
.mt-bsp { flex: 1; }
.mt-bb { padding: 12px 14px 14px; }
.mt-warn { background: #fff8e6; border: 1px solid #f3e0b5; color: #8a6d1f; border-radius: 8px;
  padding: 7px 11px; font-size: 12px; margin-bottom: 10px; }

.mt-status { display: flex; align-items: center; gap: 12px; justify-content: space-between;
  border-radius: 9px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 12px; }
.mt-status.on { background: #eef8f1; color: #1c7a45; }
.mt-status.off { background: #f5f6f8; color: #6b7684; }

.mt-cols { display: flex; gap: 22px; align-items: flex-start; }
.mt-form { flex: 1 1 auto; min-width: 0; }
.mt-f { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px 12px;
  align-items: center; margin-bottom: 9px; font-size: 12.5px; }
.mt-f > label { color: var(--muted); text-align: right; }
.mt-f > label.mt-lb-top { align-self: start; padding-top: 7px; }
.mt-fh { color: #9aa6b4; font-size: 11.5px; }
.mt-inp { width: 100%; box-sizing: border-box; padding: 5px 9px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 12.5px; background: #fff; }
.mt-inp:disabled { background: #f7f8fa; color: #6b7684; }
.mt-num { width: 92px; }
.mt-inline { display: inline-flex; align-items: center; gap: 6px; }
.mt-ro2 { font-size: 12.5px; line-height: 1.9; }

.mt-demo { flex: none; width: 252px; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; background: #fbfcfe; }
.mt-demo-h { font-size: 12.5px; font-weight: 600; color: #33404f; margin-bottom: 8px; }
.mt-demo-row { display: flex; align-items: center; gap: 7px; padding: 5px 0; font-size: 12.5px;
  border-bottom: 1px dashed #eef1f6; }
.mt-demo-row:last-child { border-bottom: 0; }
.mt-ava { width: 22px; height: 22px; border-radius: 50%; background: #e8f2fd; color: #2E86D9;
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; flex: none; }
.mt-demo-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-demo-x { color: #d0d5dc; font-size: 11px; }
.mt-demo-ph { font-size: 12px; color: var(--muted); line-height: 1.7; padding: 6px 0; }
.mt-demo-ph span { font-size: 11.5px; color: #a8b2bf; }
.mt-abbr { background: #FAC775; color: #633806; border-radius: 6px; padding: 1px 8px;
  font-weight: 600; font-size: 12px; }
.mt-abbr-line { display: inline-flex; align-items: center; gap: 8px; }
/* 🔵 2026-10-16：改 124px → 92px。原来两列排布后这一格只有 165px 宽，
   「徽章 + 124px 输入框」放不下 ⇒ 徽章被挤成竖排的「护/航1」。 */
.mt-abbr-line .mt-inp { width: 92px; }

.mt-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.mt-tbl th { background: #f7f9fc; color: #5a6675; font-weight: 500; font-size: 11.5px;
  text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mt-tbl td { padding: 5px 9px; border-bottom: 1px solid #f1f4f8; }
.mt-tbl tr:last-child td { border-bottom: 0; }
.mt-tbl .mt-inp { padding: 4px 7px; }
.mt-tr-def td { background: #fbfcfe; }
.mt-dim { color: #b6bec9; }
.mt-del { border: 0; background: transparent; color: #c6ccd6; cursor: pointer; font-size: 13px; padding: 2px 6px; }
.mt-del:hover { color: #e05252; }
/* 🔵 2026-10-16 排版优化②：原来这里把「售卖规则」表限死在 470px ⇒ 812px 的卡片里右边空一半。
   改为吃满宽度（同一张卡片里其他表本来就是满宽，只有它一个窄的，看着最别扭）。 */
.mt-rule { max-width: none; }

/* 项目折扣表 8 列，在窄容器里会被压到「默认」两个字都折行 ⇒ 给个最小宽度 + 横滚兜底 */
.mt-scroll { overflow-x: auto; }
.mt-scroll .mt-tbl { min-width: 780px; }
.mt-tbl .mt-col-nm { min-width: 150px; }
.mt-qty { display: flex; gap: 4px; align-items: center; }
.mt-qty .i-tm { flex: 1; min-width: 0; }
.mt-qty .i-ti { width: 52px; flex: none; }
.mt-qty .f-tm { flex: 1; min-width: 0; }   /* 免费项目的数量格同款宽度 */
.mt-qty .f-ti { width: 52px; flex: none; }

/* ═══ 会员卡设置 · 2026-10-16 排版优化 ＋ 三个板块改造 ═══ */
/* ① 卡片内字段两列（基本信息 / 售卖规则）。窄屏自动回单列 —— 断点放在 1280，
     因为主区宽度 ≈ 视口 − 侧栏 262 − 一级栏 − 内边距；低于这个数两列会挤到看不清。
   🔴 标签列 90px：72px 时「启用售卖规则」六个字会折成两行（实测）。 */
.mt-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; }
.mt-grid2 .mt-f { grid-template-columns: 90px minmax(0, 1fr); gap: 6px 8px; }
.mt-grid2 .mt-f-full { grid-column: 1 / -1; }
@media (max-width: 1280px) { .mt-grid2 { grid-template-columns: minmax(0, 1fr); } }

/* ③ 三个板块的「启用」开关 —— 放在**卡片标题栏**里，关着时正文只剩一行灰字 */
.mt-hsw { border: 1px solid var(--border); background: #fff; color: #9aa6b4; border-radius: 12px;
  padding: 1px 10px; font-size: 11.5px; cursor: pointer; flex: none; margin-left: 2px; }
.mt-hsw.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.mt-hsw:disabled { opacity: .6; cursor: default; }
.mt-off { font-size: 12.5px; color: #9aa6b4; padding: 1px 0; }

/* 「点击选择项目」那一格（四张表共用） */
.mt-pick { width: 100%; box-sizing: border-box; text-align: left; border: 1px solid var(--border);
  background: #fff; border-radius: 7px; padding: 4px 7px; font-size: 12.5px; color: var(--text);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-pick:hover { border-color: var(--primary); color: var(--primary); }
.mt-pick:disabled { background: #f7f8fa; color: #6b7684; cursor: default; }
.mt-pick-ph { color: #b6bec9; }

/* 充值满赠的「赠送内容」格：送金额 / 送项目 两态（用 hidden 属性切） */
.r-gift { min-width: 210px; }
.r-gift .r-ii { display: flex; gap: 6px; align-items: center; }
.r-gift .r-ii .mt-pick { flex: 1; min-width: 0; }
.r-gift .r-iq { width: 66px; flex: none; }

/* ═══ 价目选择器（会员卡专用 · 左右两栏）═══ */
.mkp-modal { width: min(880px, 94vw); }
.mkp { display: grid; grid-template-columns: 258px minmax(0, 1fr);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 10px;
  height: min(58vh, 520px); }
.mkp-l { border-right: 1px solid var(--border); background: #fbfcfe;
  display: flex; flex-direction: column; min-height: 0; }
.mkp-kw { margin: 8px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; }
.mkp-scroll { overflow: auto; min-height: 0; }
.mkp-l .mkp-scroll { flex: 1; }
.mkp-g { padding: 6px 10px 3px; font-size: 11.5px; color: #9aa6b4; background: #f4f7fb;
  position: sticky; top: 0; z-index: 1; }
.mkp-c { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12.5px; cursor: pointer; }
.mkp-c span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkp-c b { color: #b6bec9; font-weight: 400; font-size: 11.5px; }
.mkp-c:hover { background: #eef5fd; }
.mkp-c.on { background: var(--primary-soft); color: var(--primary); }
.mkp-take { font-style: normal; font-size: 11.5px; color: var(--primary);
  border: 1px solid var(--primary); border-radius: 6px; padding: 0 6px; flex: none; }
.mkp-cap { padding: 7px 10px; font-size: 11.5px; color: #5a6675; background: #f4f7fb;
  position: sticky; top: 0; z-index: 1; }
.mkp-i { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: 12.5px; cursor: pointer; }
.mkp-i span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkp-i em { font-style: normal; color: #12a150; flex: none; }
.mkp-i:hover { background: #eef5fd; }
/* 「或」组多选：选中的项目高亮 + 左侧打勾（2026-11-16） */
.mkp-i.on { background: #e8f1ff; box-shadow: inset 3px 0 0 #2563eb; }
.mkp-i.on span::before { content: "✓ "; color: #2563eb; font-weight: 700; }
.mkp-hint { padding: 14px 12px; font-size: 12.5px; color: #9aa6b4; line-height: 1.8; }
/* 🆕 2026-11-15 会员卡「处置组 / 处置」选择器：
   组＝蓝色粗体（可整组选走），单项＝深灰常规 —— 船长明确「用不同字体颜色区别组和单项」 */
.mkp-g2 { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12.5px;
  font-weight: 600; color: #1d4ed8; cursor: pointer; }
.mkp-g2 span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkp-g2:hover { background: #eef4ff; }
.mkp-g2.on { background: #e8f0fe; }
.mkp-g2 .mkp-take { background: #fff; color: #0d7a68; border-color: #b7dccf; }
.mgp-take-all { color: #0d7a68; cursor: pointer; margin-left: 6px; }
.mgp-legend-g { color: #1d4ed8; font-weight: 600; }
@media (max-width: 760px) {
  .mkp { grid-template-columns: minmax(0, 1fr); height: auto; max-height: 74vh; }
  .mkp-l { border-right: 0; border-bottom: 1px solid var(--border); }
  .mkp-l .mkp-scroll { max-height: 34vh; }
}


.mt-hint { font-size: 11.5px; color: var(--muted); margin: 2px 0 8px; }
.mt-none { font-size: 12.5px; color: #a8b2bf; padding: 8px 2px 4px; }
.mt-note { font-size: 12.5px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.mt-note-sub { font-size: 11.5px; color: var(--muted); line-height: 1.8; margin-top: 8px; }

.mt-save { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
@media (max-width: 820px) {
  .mt-cols { flex-direction: column; }
  .mt-demo { width: 100%; }
  .mt-f { grid-template-columns: 78px minmax(0, 1fr); }
}

/* ══ 🆕 2026-10-10 患者详情「就诊记录」（船长照参考图定）
   筛选行 + 左侧日期徽章（带竖线连成时间轴）+ 右侧卡片；点卡片仍是右侧滑出预约详情 ══ */
.apt-logbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 12px; font-size: 12.5px; }
.apt-logtag { background: var(--primary); color: #fff; border-radius: 6px; padding: 3px 11px;
  font-weight: 600; }
.apt-loglb { color: var(--muted); }
.apt-ck { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.apt-ck input { margin: 0; }
.apt-ck i { font-style: normal; width: 13px; height: 13px; line-height: 14px; text-align: center;
  border-radius: 50%; background: #dfe6ef; color: #6b7684; font-size: 10px; cursor: help; }
.apt-logsp { flex: 1; }
.apt-logcnt { color: var(--muted); font-size: 12px; }

.apt-flow { display: flex; flex-direction: column; }
.apt-fc { display: flex; gap: 10px; align-items: stretch; }
.apt-fc-d { flex: none; width: 58px; display: flex; flex-direction: column; align-items: center; }
.apt-fc-d b { display: block; width: 58px; text-align: center; color: #fff; font-weight: 600;
  font-size: 11.5px; line-height: 1.5; background: linear-gradient(160deg, #4a8fdc, #2f6fd0);
  border-radius: 8px 8px 0 0; padding: 5px 2px 1px; }
.apt-fc-d i { font-style: normal; display: block; width: 58px; text-align: center; color: #fff;
  font-size: 10px; background: linear-gradient(160deg, #2f6fd0, #2a63ba);
  border-radius: 0 0 8px 8px; padding: 0 2px 5px; }
.apt-fc-d::after { content: ''; flex: 1; width: 2px; background: #d7e3f2; margin: 4px 0 0; }
.apt-fc:last-child .apt-fc-d::after { display: none; }

.apt-fc-c { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px; margin-bottom: 12px; cursor: pointer; }
.apt-fc-c:hover { border-color: #bcd6f0; box-shadow: 0 2px 8px rgba(47, 111, 208, .07); }
.apt-fc-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.apt-fc-t { font-size: 15px; font-weight: 600; color: #33404f; }
.apt-fc-ty { font-size: 12.5px; color: #4a5568; }
.apt-fc-st { font-size: 11px; padding: 1px 8px; border-radius: 5px; border: 1px solid; }
.apt-fc-cl { font-size: 12px; color: #9aa6b4; }
.apt-fc-sp { flex: 1; }
.apt-fc-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.apt-fc-btns .btn { padding: 3px 10px; font-size: 12px; }
.apt-fc-b { margin-top: 7px; font-size: 12.5px; color: #4a5568; line-height: 2; }
.apt-fc-b > div > span { color: var(--text); }
.apt-fc-f { text-align: right; font-size: 11.5px; color: #9aa6b4; margin-top: 5px; }
.apt-more { text-align: center; padding: 4px 0 16px; }

/* 日志弹窗（.modal-aplog）已改成五列表格，样式见文件上方的 .apl-* 一套 */
@media (max-width: 820px) {
  .apt-fc-btns { width: 100%; }
}

/* 🆕 2026-10-09 船长：「会员卡券 → 开卡右侧：发券」弹窗
   左＝券模板（只列启用中）／右＝已选券的规则 + 有效期三选一 + 张数 + 备注 */
/* 弹窗本身要宽：默认 .modal 只有 min(680px,94vw)，两栏一挤，「到期 2028-10-09」会被折成半截 */
.modal.modal-issue { width: min(1020px, 96vw); max-height: 92vh; padding: 20px 22px; }
.cis { display: flex; gap: 14px; margin: 10px 0 4px; align-items: stretch; }
.cis-l { flex: 1.15; min-width: 0; display: flex; flex-direction: column; }
.cis-fl { display: flex; gap: 8px; margin-bottom: 8px; }
.cis-fl select { flex: none; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; }
.cis-fl input { flex: 1; min-width: 0; padding: 5px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; }
.cis-list { flex: 1; max-height: 44vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.cis-it { display: flex; align-items: center; gap: 10px; padding: 7px 11px; font-size: 12.5px; cursor: pointer; border-bottom: 1px solid #f2f5f9; }
.cis-it:last-child { border-bottom: 0; }
.cis-it:hover { background: #f6f9fc; }
.cis-it.on { background: #eef6ff; color: var(--primary); font-weight: 600; }
.cis-it .cis-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cis-it em { font-style: normal; color: var(--muted); font-size: 11.5px; flex: none; }
.cis-it.on em { color: var(--primary); }
.cis-r { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fbfcfe; }
.cis-ph { font-size: 12.5px; color: var(--muted); padding: 8px 2px; }
.cis-t { font-size: 14px; font-weight: 600; color: #33404f; }
.cis-sub { font-size: 12px; color: var(--primary); margin: 3px 0 6px; }
.cis-rule { font-size: 12px; color: var(--muted); line-height: 1.7; padding-bottom: 8px; border-bottom: 1px dashed #e6ebf2; margin-bottom: 8px; }
.cis-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; margin-bottom: 6px; }
.cis-row > span:first-child { color: var(--muted); flex: none; }
.cis-row input { padding: 5px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; }
.cis-lb { font-size: 12.5px; font-weight: 600; color: #33404f; margin: 8px 0 5px; }
.cis-op { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; padding: 5px 7px; border-radius: 8px; cursor: pointer; line-height: 1.5; }
.cis-op:hover { background: #f1f5fa; }
/* 🔴 全局 input 是 width:100%（表单项），radio 会被撑成整行宽 ⇒ 把 span 挤成 0 宽（文字竖排）。
   单选框必须显式收窄，别指望浏览器默认尺寸。 */
.cis-op > input[type=radio] { flex: none; width: 14px; height: 14px; margin: 2px 0 0; }
.cis-op > span { display: block; flex: 1; min-width: 0; }
.cis-op em { font-style: normal; color: var(--muted); font-size: 11.5px; }
/* 算出来的到期日另起一行 —— 挤在同一行会在 340px 宽的面板里折成半截，读不出来 */
.cis-op em.to { display: block; margin-top: 1px; }
.cis-op input[type=date], .cis-op input[type=number] { padding: 4px 7px; border: 1px solid var(--border); border-radius: 7px; font-size: 12.5px; }
@media (max-width: 820px) { .cis { flex-direction: column; } .cis-list { max-height: 30vh; } }

/* ══════════════════════════════════════════════════════════════════════════
   牙周检查表（电子牙周检查 · 六点法）—— 船长 2026-10-12
   ──────────────────────────────────────────────────────────────────────────
   落点在「病历信息」页（不新增页签），卡片里列出历次检查；点开是全屏编辑器。
   网格＝两道牙 × 颊侧B/舌侧L × PD/GM/BOP/PLI × 每牙 3 格；**PD 行下面还有一条折线**
   （船长当天补的要求：「通过颜色变化显示，高值牙周深度」），折线由 perio.js 用 SVG 画。
   🔴 类名统一加 `pz-` / `perio-` 前缀 —— 短类名（.tn / .pl / .pr 这种）在这个文件里
      太容易和别处撞（价格表就有一堆 .pl-*），撞了是静默改样式，很难查。
   ══════════════════════════════════════════════════════════════════════════ */
.perio-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 14px; }
.perio-card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.perio-card-t { font-size: 15px; font-weight: 600; }
.perio-card-t .n { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.perio-card-ops { display: flex; gap: 8px; }
.perio-empty { padding: 16px 14px; color: var(--muted); font-size: 13px; }
.perio-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.perio-tbl th, .perio-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap; }
.perio-tbl thead th { background: #fafbfd; color: var(--muted); font-weight: 600; }
.perio-tbl tr:last-child td { border-bottom: 0; }
.perio-bad { color: var(--danger); font-weight: 600; }
.perio-warn { color: var(--warn); font-weight: 600; }
.perio-tagcell { max-width: 250px; white-space: normal; }
.perio-tag { display: inline-block; background: var(--primary-soft); color: #0a6ea3;
  border-radius: 5px; padding: 1px 6px; font-size: 11px; margin: 1px 3px 1px 0; }
.perio-del { color: var(--danger); }

/* ── 全屏编辑器 ─────────────────────────────────────────────────────────── */
.perio-ov { position: fixed; inset: 0; background: rgba(20,28,40,.42); z-index: 9000;
  display: flex; align-items: center; justify-content: center; padding: 14px; }
.perio-panel { background: #fff; border-radius: var(--radius); width: 100%; max-width: 1520px;
  max-height: 96vh; display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.perio-head { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.perio-head-t { font-size: 15px; font-weight: 600; }
.perio-head-t .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.perio-ro { display: inline-block; margin-left: 8px; font-size: 11px; background: #eef2f7;
  color: #5b6a7d; border-radius: 5px; padding: 1px 7px; }
.perio-head-ops { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.perio-head-ops .pf { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px;
  white-space: nowrap; flex: none; }
/* 🆕 2026-11-16 图例右侧的「输入顺序」下拉（PD 自动跳格的方向） */
.perio-legend .pf { display: flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; }
.perio-legend select { font-size: 11.5px; color: var(--text); height: 26px; max-width: 230px; }
.perio-head-ops input { border: 1px solid var(--border); border-radius: 7px; padding: 3px 7px;
  font-size: 12.5px; color: var(--text); }
.perio-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 6px 14px; font-size: 11.5px;
  color: var(--muted); background: #fbfcfe; border-bottom: 1px solid var(--border); align-items: center; }
.perio-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  margin-right: 5px; vertical-align: -2px; border: 1px solid #dfe5ee; }
.perio-legend .lg1 { background: #e9f7ee; border-color: #c7e8d4; }
.perio-legend .lg2 { background: #fff7e2; border-color: #efdcae; }
.perio-legend .lg3 { background: #fde6e3; border-color: #f1c4be; }
.perio-legend .lgb { background: #f2a5a0; border-color: #e08a84; }
.perio-legend .lgp { background: #cfe6f7; border-color: #a8d4ef; }
.perio-legend .lm { margin-left: auto; }
.perio-body { padding: 12px 14px; overflow: auto; flex: 1 1 auto; }
.perio-foot { border-top: 1px solid var(--border); padding: 8px 14px 10px; }
.perio-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-bottom: 8px; }
.perio-tags .pt-lb { font-size: 11.5px; color: var(--muted); }
.perio-tag-btn { border: 1px solid var(--border); border-radius: 14px; padding: 2px 10px;
  font-size: 12px; cursor: pointer; color: #42506a; background: #fff; }
.perio-tag-btn.on { background: var(--primary-soft); border-color: #b9dff5; color: var(--primary); font-weight: 600; }
.perio-sum { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12.5px; color: #42506a;
  padding-top: 6px; border-top: 1px dashed var(--border); }
.perio-sum b { color: var(--primary); font-size: 14px; }
.perio-sum .warn b { color: var(--warn); }
.perio-sum .bad b { color: var(--danger); }

/* ── 网格 ───────────────────────────────────────────────────────────────── */
.perio-arch { margin-bottom: 12px; }
.perio-ar-cap { font-size: 11.5px; color: #95a1b0; margin: 0 0 3px 68px; }
.pz-r { display: flex; align-items: center; height: 21px; }
.pz-r.pg { height: 18px; }
.pz-r.psep { height: 6px; }
.pz-l { width: 62px; flex: none; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; }
.pz-l.hi { color: var(--primary); font-weight: 700; font-size: 11.5px; }
.pz-t { display: flex; }
.pz-n { width: 49px; flex: none; text-align: center; font-size: 11px; font-weight: 600; color: #42506a; }
.pz-c { display: flex; gap: 1px; width: 49px; flex: none; }
.pg-i { width: 15px; height: 17px; border: 1px solid #dfe5ee; border-radius: 2px; background: #fff;
  font-size: 10px; line-height: 15px; text-align: center; color: #3a4657; padding: 0; }
.pg-i:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.pg-i.pd1 { background: #e9f7ee; border-color: #c7e8d4; color: #2f6b45; }
.pg-i.pd2 { background: #fff7e2; border-color: #efdcae; color: #8a6a12; }
.pg-i.pd3 { background: #fde6e3; border-color: #f1c4be; color: #a8382f; font-weight: 700; }
.pg-i.f { background: var(--primary-soft); border-color: #b9dff5; font-weight: 600; }
.pg-i.pg-t { width: 49px; }
.pg-sq { display: inline-block; width: 15px; height: 17px; border: 1px solid #dfe5ee;
  border-radius: 2px; background: #fff; cursor: pointer; }
.pg-sq.on { background: #f2a5a0; border-color: #e08a84; }
.pg-sq[data-m=pli].on { background: #cfe6f7; border-color: #a8d4ef; }

/* ── 折线图（牙周深度剖面）：PD 行下面那一条 ────────────────────────────── */
.pz-r.pz-lr { height: 34px; }
.pz-lwrap { position: relative; flex: 1 1 auto; min-width: 0; height: 100%; }
.pz-line { display: block; width: 100%; height: 100%; }

/* ── 0–15 取值小键盘 ────────────────────────────────────────────────────── */
.perio-picker { display: none; position: fixed; z-index: 9100; background: #fff;
  border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 8px 26px rgba(20,30,45,.2); padding: 7px 9px; }
.perio-picker.on { display: block; }
.pk-t { font-size: 11px; color: var(--muted); margin-bottom: 5px; white-space: nowrap; }
.pk-g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.pk-v { display: block; width: 26px; height: 22px; line-height: 20px; text-align: center;
  font-size: 12px; border: 1px solid #e3e8f0; border-radius: 4px; cursor: pointer; color: #33404f; }
.pk-v:hover { background: var(--primary-soft); border-color: #b9dff5; color: var(--primary); font-weight: 600; }

/* 窄屏：格子收一档（表格仍可横向滚动，不做列折叠 —— 牙位表折叠了就没法读） */
@media (max-width: 760px) {
  .perio-panel { max-width: 100%; }
  .perio-head { padding: 8px 10px; }
  .perio-sum { gap: 12px; }
  .pz-l { width: 46px; }
  .pz-n, .pz-c, .pg-i.pg-t { width: 39px; }
  .pg-i, .pg-sq { width: 12px; height: 16px; line-height: 14px; }
  .perio-ar-cap { margin-left: 52px; }
}
/* 打印：编辑器铺满纸面（真正的打印版式走 perio.js 另开的新窗口，这里是兜底） */
@media print {
  .perio-ov { position: static; background: #fff; padding: 0; }
  .perio-panel { max-height: none; box-shadow: none; }
  .perio-head-ops, .perio-tags, .perio-picker { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   治疗建议 / 牙齿问题图（NBA 第一期 · 船长 2026-10-13）
   患者详情「治疗计划」页签用；类名统一 `nba-` 前缀（本文件里只此一份，别在别处再定义）
   ═══════════════════════════════════════════════════════════════════════════ */
.nba-wrap { display: flex; flex-direction: column; gap: 10px; }
.nba-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nba-bar .nba-hint { margin-left: auto; font-size: 12px; color: #95a1b0; }
.nba-stats { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 12px;
  background: #f7f9fb; border: 1px solid #e5e9ef; border-radius: 9px; font-size: 12.5px; color: #6b7688; }
.nba-st b { font-size: 15px; color: #33404f; margin-right: 2px; }
.nba-st.todo b { color: #b07d0a; }
.nba-st.wait b { color: var(--primary); }
.nba-st.done b { color: #2f7d4f; }
.nba-st.warn b { color: #c0392b; }
.nba-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nba-f { padding: 4px 12px; font-size: 12.5px; border-radius: 8px; cursor: pointer;
  background: #fff; border: 1px solid #e3e8ef; color: #4a5666; user-select: none; }
.nba-f.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.nba-card { background: #fff; border: 1px solid #e9edf2; border-radius: 10px; overflow: hidden; }
.nba-card.haswait { border-color: #cfe3fb; }
.nba-card.alldone { opacity: .72; }
.nba-tooth { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fafbfd; border-bottom: 1px solid #f0f3f7; }
/* 🔴 全局有 `input/select{width:100%}` ⇒ 这里凡是 select/input 都要显式给宽度（否则会把行撑爆） */
.nba-tno { flex: none; width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #dbe6f5; border-radius: 7px; background: #fff; color: var(--primary); font-weight: 600; font-size: 14px; }
.nba-tno.small { width: 28px; height: 24px; font-size: 12.5px; }
.nba-tinfo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nba-tfdi { font-style: normal; font-size: 11.5px; color: #a2abb8; }
.nba-problem { font-size: 12.5px; color: #8a4b1e; background: #fff7ec; border: 1px solid #f2e0c8; border-radius: 6px; padding: 1px 7px; }
.nba-problem.none { color: #a2abb8; background: #f6f7f9; border-color: #eceff3; }
.nba-tstat { margin-left: auto; font-size: 12px; color: #8a94a6; }
.nba-items { display: flex; flex-direction: column; }
.nba-item { display: flex; align-items: center; gap: 9px; padding: 7px 12px; border-bottom: 1px solid #f5f7fa; font-size: 12.5px; }
.nba-item:last-child { border-bottom: none; }
.nba-item.done { background: #f8fdfa; }
.nba-item.void { opacity: .5; }
.nba-badge { flex: none; min-width: 52px; text-align: center; font-size: 11.5px; padding: 1px 7px; border-radius: 6px;
  background: #fff7ec; color: #b07d0a; border: 1px solid #f2e0c8; }
.nba-badge.wait { background: #eef5ff; color: var(--primary); border-color: #cfe3fb; }
.nba-badge.done { background: #eefaf3; color: #2f7d4f; border-color: #cdebd9; }
.nba-badge.void { background: #f6f7f9; color: #95a1b0; border-color: #eceff3; }
.nba-kw { font-weight: 600; color: #33404f; }
.nba-raw { color: #8a94a6; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nba-raw-s { color: #a2abb8; font-style: normal; margin-left: 3px; }
.nba-next { color: #6b7688; }
.nba-link { color: var(--primary); cursor: pointer; }
.nba-ops { margin-left: auto; display: flex; gap: 10px; flex: none; }
.nba-ops a { color: var(--primary); cursor: pointer; font-size: 12px; }
.nba-ops a.danger { color: #c0392b; }
.nba-ex-list { max-height: 46vh; overflow: auto; border: 1px solid #eceff3; border-radius: 8px; margin: 6px 0; }
.nba-ex-row { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #f5f7fa; font-size: 12.5px; }
.nba-ex-row:last-child { border-bottom: none; }
.nba-form .nba-f-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start; }
.nba-form .nba-f-row > label { flex: none; width: 76px; font-size: 12.5px; color: #6b7688; padding-top: 6px; text-align: right; }
.nba-form .nba-f-body { flex: 1 1 auto; min-width: 0; }
.nba-form .req { color: #c0392b; margin-left: 2px; }
.nba-in { width: 100%; max-width: 320px; padding: 5px 8px; font-size: 13px; border: 1px solid #e3e8ef; border-radius: 7px; }
.nba-form select.nba-in { width: 220px; }
.nba-f-picked { margin-top: 6px; font-size: 12.5px; color: var(--primary); }
.nba-pick { display: flex; flex-direction: column; gap: 4px; }
.nba-pick-r { display: flex; gap: 4px; flex-wrap: wrap; }
.nba-pb { flex: none; min-width: 30px; padding: 3px 5px; font-size: 12px; line-height: 1.1; cursor: pointer;
  background: #fff; border: 1px solid #e3e8ef; border-radius: 6px; color: #4a5666; }
.nba-pb i { display: block; font-style: normal; font-size: 9px; color: #a2abb8; }
.nba-pb.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.nba-pb.on i { color: #dbe9fb; }

/* ══ NBA「治疗计划」左牙位图 ＋ 右竖列表（船长 2026-10-13 定稿）═════════════
   左：恒牙 + 乳牙**两块常显**；格子 `flex:1 1 0` 按容器宽度自适应 ⇒ 宽屏与手机同一套写法。
   右：沿用「一牙一块」卡片列表。点左边牙位 → 弹这颗牙的详情。
   🔴 牙位数据只用 core/ui.js 的 `UI.TOOTH_Q`（真源），这里只管画。 */
.nba-split { display: flex; gap: 14px; align-items: flex-start; }
.nba-left { flex: 0 0 44%; max-width: 470px; min-width: 300px; background: #fbfcfe;
  border: 1px solid #eef2f7; border-radius: 10px; padding: 10px 10px 8px; }
.nba-right { flex: 1 1 auto; min-width: 0; }
.nba-quad { display: flex; justify-content: space-between; font-size: 11px; color: #a2abb8; padding: 0 8px 6px; }
.nba-blk-name { font-size: 11.5px; color: #a2abb8; text-align: center; padding: 7px 0 4px; }
.nba-body { display: flex; align-items: stretch; }
.nba-half { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.nba-arow { display: flex; }
.nba-v { flex: none; width: 1px; background: #8fc0e2; margin: 0 6px; }
.nba-h { flex: none; height: 1px; background: #8fc0e2; }
.nba-cell { flex: 1 1 0; min-width: 0; margin: 0 2px; padding: 0; height: 38px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f4f7fa; border: 1px solid transparent; border-radius: 8px; overflow: hidden; }
.nba-cell b { font-weight: 500; font-size: 13px; line-height: 1.1; color: #8b96a5; }
.nba-cell em { font-style: normal; font-size: 9px; line-height: 1.1; color: #b3bcc7; }
.nba-cell:hover { border-color: #bcd9ee; }
/* 🆕 2026-10-15 船长：「牙位上用**彩色框线**标注」⇒ 由「底色填充」改为**边框染色**（底色只留极淡一档）。
   ⚠️ 这是**全系统唯一一份**牙位染色定义（治疗计划页签与患者360 共用），别在别处再写一份。 */
.nba-cell.st-todo { border-color: #f0a52a; border-width: 2px; background: #fffaf0; } .nba-cell.st-todo b { color: #b47200; } .nba-cell.st-todo em { color: #dfa34d; }
.nba-cell.st-wait { border-color: #0C7FC2; border-width: 2px; background: #f5fbff; } .nba-cell.st-wait b { color: #0C7FC2; } .nba-cell.st-wait em { color: #5cb4e0; }
.nba-cell.st-done { border-color: #24a06e; border-width: 2px; background: #f4fdf9; } .nba-cell.st-done b { color: #1a9b6c; } .nba-cell.st-done em { color: #63c39c; }
.nba-legend { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 6px 0; font-size: 11.5px; color: #6b7688; }
.nba-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 4px; vertical-align: -1px; }
.nba-legend .lg-todo { background: #fffaf0; border: 2px solid #f0a52a; }
.nba-legend .lg-wait { background: #f5fbff; border: 2px solid #0C7FC2; }
.nba-legend .lg-done { background: #f4fdf9; border: 2px solid #24a06e; }
.nba-legend .lg-none { background: #f4f7fa; border: 1px solid #e4e9f0; }
.nba-chart-hint { font-size: 11.5px; color: #a2abb8; padding: 6px 6px 0; }
/* 单颗牙详情弹窗 */
.nba-td { border: 1px solid #eef2f7; border-radius: 9px; overflow: hidden; margin: 8px 0; }
.nba-td-h { display: flex; align-items: center; gap: 9px; padding: 8px 11px; background: #fafbfd;
  border-bottom: 1px solid #f0f3f7; flex-wrap: wrap; }
.nba-td-fdi { font-size: 11.5px; color: #a2abb8; }
.nba-td-sum { margin-left: auto; font-size: 12px; color: #8a94a6; }
.nba-td-r { display: flex; align-items: center; gap: 9px; padding: 7px 11px;
  border-bottom: 1px solid #f5f7fa; font-size: 12.5px; }
.nba-td-r:last-child { border-bottom: none; }
.nba-src { font-size: 11px; color: #a2abb8; border: 1px solid #eceff3; border-radius: 6px; padding: 0 5px; }
.nba-td-ops { margin-left: auto; display: flex; gap: 10px; flex: none; }
.nba-td-ops a { color: var(--primary); cursor: pointer; font-size: 12px; }
.nba-td-ops a.danger { color: #c0392b; }
/* 🔴 窄屏档必须排在宽档之后（同权重「后写的赢」）—— 上下堆叠，牙位图占满宽 */
@media (max-width: 820px) {
  .nba-split { flex-direction: column; gap: 12px; }
  .nba-left, .nba-right { flex: 1 1 auto; width: 100%; max-width: none; min-width: 0; box-sizing: border-box; }
  .nba-cell { height: 34px; margin: 0 1px; border-radius: 7px; }
  .nba-cell b { font-size: 11.5px; }
  .nba-quad { padding: 0 2px 6px; }
  .nba-v { margin: 0 3px; }
}

/* ================= 积分查询平台（船长 2026-10-14） =================
   位置：营销中心 → 积分体系 →「积分查询」页签。
   ⚠️ 全局有 input{width:100%}（见 .vset-row 那条教训）⇒ 这里所有输入框显式 width:auto，
      否则一个搜索框会把整行撑爆。 */
.mk-ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 14px; }
.mk-ptab { border: 0; background: transparent; padding: 9px 16px; font-size: 13.5px; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; }
.mk-ptab:hover { color: var(--text); }
.mk-ptab.on { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

.mk-qtabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.mk-qtab { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 14px;
  font-size: 13px; color: var(--text); cursor: pointer; }
.mk-qtab.on { background: var(--primary-soft); border-color: #bcd9f2; color: var(--primary); font-weight: 600; }

.mk-qsubtabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.mk-qsub { border: 1px solid var(--border); background: #fff; border-radius: 16px; padding: 4px 13px;
  font-size: 12.5px; color: var(--muted); cursor: pointer; }
.mk-qsub.on { background: var(--primary-soft); border-color: #bcd9f2; color: var(--primary); font-weight: 600; }

.mk-qkpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.mk-qkpi { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 14px 16px; }
.mk-qk { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.mk-qic { width: 17px; height: 17px; border-radius: 50%; display: inline-block; flex: none; }
.mk-qic.b1 { background: #dbe9fb; } .mk-qic.b2 { background: #ffe4ee; } .mk-qic.b3 { background: #e5e1fb; }
.mk-qv { font-size: 23px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.mk-qv small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 4px; }

.mk-qgrid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; margin-bottom: 14px; }
.mk-qcard { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 13px 15px; }
.mk-qcard h4 { font-size: 13.5px; margin: 0 0 9px; display: flex; align-items: center; gap: 7px; font-weight: 600; }
.mk-qcard h4::before { content: ""; width: 3px; height: 13px; background: var(--primary); border-radius: 2px; }
.mk-qchart { height: 260px; }
.mk-qtop { margin: 0; padding-left: 20px; font-size: 12.5px; }
.mk-qtop li { padding: 3px 0; display: flex; justify-content: space-between; gap: 10px; }
.mk-qtop li b { font-variant-numeric: tabular-nums; color: #3d4a5c; }

.mk-qbar { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.mk-qinp { width: auto; border: 1px solid var(--border); border-radius: 7px; padding: 5px 9px;
  font-size: 12.5px; color: var(--text); background: #fff; min-width: 120px; }
.mk-qinp.mk-qdate, .mk-qinp.mk-qnum { min-width: 0; width: 132px; }
.mk-qinp.mk-qnum { width: 74px; }

.mk-qscroll { overflow-x: auto; }
.mk-qtbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mk-qtbl th { background: #eef3f9; color: #3d4a5c; font-weight: 600; text-align: left;
  padding: 8px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px; }
.mk-qtbl td { padding: 7px 9px; border-bottom: 1px solid #f0f3f7; white-space: nowrap; }
.mk-qtbl tbody tr:nth-child(even) { background: #fbfcfe; }
.mk-qtbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.mk-qtbl .mk-qneg { color: var(--danger); }
.mk-qmk { max-width: 260px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.mk-qtag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11.5px;
  background: var(--primary-soft); color: var(--primary); }
.mk-qlink { color: var(--primary); cursor: pointer; }
.mk-qlink:hover { text-decoration: underline; }

.mk-qpager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 11px; }
.mk-qpg { font-size: 12.5px; color: var(--muted); padding: 0 4px; font-variant-numeric: tabular-nums; }

/* 窄屏：三个 KPI 挤成一行会截字；两块图表并排也放不下 ⇒ 一律单列（本档写在文件最末＝后写优先） */
@media (max-width: 900px) {
  .mk-qkpis { grid-template-columns: 1fr; }
  .mk-qgrid { grid-template-columns: 1fr; }
}

/* ══ 抓取包（E看牙 导入）病历卡片 · 与官方那份统一（船长 2026-10-15）══
   船长原话：「没有十字线，牙位还是在文字范围内，应当摘取牙位数字对应到十字线的上下左右」。
   ⇒ `records.js` 的 `ekanRecCard()` 改成和 `ekanOfficialCard()` 同一套三列结构
      （标签 84px ｜ 牙位 92px ｜ 正文 1fr），牙位由 `UI.toothCross` 落到四个象限。
   🔴 规格与 `.rec-card.ek-official .eks-seg` 保持一致（那边是 10-10 照 E看牙 定的），
      改一边记得改另一边；`ek-fetch` 是本卡片自己的类，不动官方那条路径。 */
.rec-card.ek-fetch .eks-seg {
  display: grid; grid-template-columns: 84px 92px minmax(0, 1fr);
  align-items: center; column-gap: 8px; padding: 9px 0;
  border-bottom: 1px solid #f2f5f9;
}
.rec-card.ek-fetch .eks-seg.cont { border-bottom: 0; padding-bottom: 2px; }
.rec-card.ek-fetch .eks-seg:last-child { border-bottom: 0; }
.rec-card.ek-fetch .eks-k { text-align: right; color: var(--muted); }
.rec-card.ek-fetch .eks-tw { text-align: center; }
.rec-card.ek-fetch .eks-v { min-width: 0; white-space: pre-wrap; }
/* 🆕 2026-10-16 船长：「口腔检查，诊断，治疗计划，这一数列标题应该是自适应上下居中」。
   多段字段改成「整组」：标签提到外层，`grid-row:1/-1` + `align-self:center`
   ⇒ 组里有几段、每段多高都不用管，标签**始终相对整组垂直居中**（纯 CSS，不靠数行）。
   🔴 组内的行只剩**两列**（牙位 92px ｜ 正文 1fr）——
      84px（外层标签列）＋ gap 8px ＋ 92px ＝ 与改前的三列**总对齐完全一致**。
   ⚠️ `.eks-rows .eks-seg` 是 0-4-0，比 `.eks-seg` 的 0-3-0 高 ⇒ 不靠顺序也能覆盖；窄屏要一起写（见文件末）。 */
.rec-card.ek-fetch .eks-grp { display: grid; grid-template-columns: 84px minmax(0, 1fr); column-gap: 8px; }
.rec-card.ek-fetch .eks-gk {
  grid-column: 1; grid-row: 1 / -1; align-self: center;
  text-align: right; color: var(--muted);
}
.rec-card.ek-fetch .eks-rows { grid-column: 2; grid-row: 1 / -1; min-width: 0; }
.rec-card.ek-fetch .eks-rows .eks-seg { grid-template-columns: 92px minmax(0, 1fr); }
/* 🆕 2026-11-10 船长：「主诉 / 现病史 / 相关影像等不含牙位的内容左移，与牙位左侧对齐」
   ⇒ 这类行渲染时不再输出空 `.eks-tw`，并打 `.notw`：正文直接占据「原牙位列 ＋ 正文列」，
      左边缘正好落在**牙位十字的左缘**（原来被 92px 空格推右 100px）。
   🔴 组内 / 组外两种列数都要写（组内是两列，组外是三列）；官方卡片那边同步有同一段。 */
.rec-card.ek-fetch .eks-seg.notw { grid-template-columns: 84px minmax(0, 1fr); }
.rec-card.ek-fetch .eks-rows .eks-seg.notw { grid-template-columns: minmax(0, 1fr); }
.rec-card.ek-fetch .eks-ph.notw { grid-template-columns: 84px minmax(0, 1fr); }
.rec-card.ek-fetch .eks-ph {
  display: grid; grid-template-columns: 84px 92px minmax(0, 1fr);
  align-items: flex-start; column-gap: 8px; padding: 12px 0;
  border-bottom: 1px solid #f2f5f9;
}
.rec-card.ek-fetch .eks-ph > .eks-k { text-align: right; margin-bottom: 0; }
.rec-card.ek-fetch .eks-ph > .eks-tw { display: block; }
.rec-card.ek-fetch .eks-src { margin-top: 6px; }
.rec-card.ek-fetch .eks-src summary { cursor: pointer; color: var(--primary); font-size: 12.5px; }
.rec-card.ek-fetch .eks-src pre { max-height: 300px; overflow: auto; background: #0f1720; color: #d6e4f0;
  padding: 10px; border-radius: 8px; font-size: 11.5px; white-space: pre-wrap; }
/* 窄屏：与官方卡片同档（三列压窄）——写在文件最末＝后写优先 */
@media (max-width: 760px) {
  .rec-card.ek-fetch .eks-seg,
  .rec-card.ek-fetch .eks-ph { grid-template-columns: 64px 64px minmax(0, 1fr); column-gap: 6px; }
  /* 多段字段的「整组」结构（见上方 .eks-grp）窄屏也要跟着收窄，否则 84px 标签列在窄屏上不动 */
  .rec-card.ek-fetch .eks-grp { grid-template-columns: 64px minmax(0, 1fr); column-gap: 6px; }
  .rec-card.ek-fetch .eks-rows .eks-seg { grid-template-columns: 64px minmax(0, 1fr); }
}

/* ══ 患者360 ＝ 口腔档案（船长 2026-10-15「患者360开干」）══
   版式：**上下堆叠**（船长选）—— 上＝牙齿问题图（复用 .nba-* 那份唯一实现），下＝治疗项目合集。
   数据＝ nba_advices（治疗建议引擎）；状态口径＝**必须处置单收满费**才算「已做」。 */
.p360-wrap { display: flex; flex-direction: column; gap: 12px; }
.p360-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff;
  border: 1px solid #eef2f7; border-radius: 10px; padding: 9px 14px; font-size: 12.5px; }
.p360-i { color: #3d4a5c; display: inline-flex; align-items: baseline; gap: 5px; }
.p360-i b { color: #98a3b3; font-weight: 400; }
.p360-allergy { color: #c0392b; }
.p360-allergy b { color: #c0392b; }
.p360-sp { flex: 1 1 auto; }

.p360-card { background: #fff; border: 1px solid #eef2f7; border-radius: 10px; padding: 12px 14px; }
.p360-h { font-size: 13.5px; font-weight: 600; display: flex; align-items: baseline; gap: 9px; margin-bottom: 8px; }
.p360-h::before { content: ""; width: 3px; height: 13px; background: var(--primary); border-radius: 2px;
  align-self: center; flex: none; }
.p360-n { font-size: 11.5px; font-weight: 400; color: #98a3b3; }

.p360-kpis { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.p360-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 106px;
  border: 1px solid #eaeff5; background: #fff; border-radius: 9px; padding: 6px 12px; cursor: pointer; text-align: left; }
.p360-kpi b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; color: #3d4a5c; line-height: 1.2; }
.p360-kpi span { font-size: 11.5px; color: #8a94a6; }
.p360-kpi.on { border-color: #a9d2f2; background: #f5fbff; }
.p360-kpi.k-todo b { color: #d98a00; } .p360-kpi.k-wait b { color: #0C7FC2; } .p360-kpi.k-done b { color: #1a9b6c; }

.p360-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.p360-tbl th { background: #f2f6fa; color: #5a6779; font-weight: 600; text-align: left; padding: 7px 9px;
  font-size: 11.5px; white-space: nowrap; position: sticky; top: 0; }
.p360-tbl td { padding: 6px 9px; border-bottom: 1px solid #f2f5f9; vertical-align: top; }
.p360-tbl tr:hover td { background: #fafcff; }
.p360-tw { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: #3d4a5c; }
.p360-tw small { color: #b3bcc7; font-weight: 400; font-size: 10px; }
.p360-kw { color: var(--primary); }
.p360-prob { color: #6b7688; }
.p360-raw { color: #a2abb8; font-size: 11.5px; margin-top: 2px; }
.p360-badge { display: inline-block; border-radius: 5px; padding: 1px 8px; font-size: 11px; white-space: nowrap; }
.p360-badge.b-todo { background: #fff3e0; color: #b47200; }
.p360-badge.b-wait { background: #e2f3fd; color: #0089c9; }
.p360-badge.b-done { background: #e6f9ef; color: #1a9b6c; }
.p360-whole { font-size: 11.5px; color: #98a3b3; padding: 8px 4px 0; }
.p360-whole b { color: #3d4a5c; }

/* 悬停小卡片（fixed：跟着视口走，不受容器滚动影响） */
.p360-tip { position: fixed; z-index: 3000; min-width: 220px; max-width: 320px; background: #fff;
  border: 1px solid #dfe6ee; border-radius: 9px; box-shadow: 0 8px 22px rgba(20,40,70,.16);
  padding: 9px 11px; pointer-events: none; font-size: 12px; }
.p360-tip .t-h { font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: #2c3644; }
.p360-tip .t-h em { font-style: normal; color: #a2abb8; font-weight: 400; margin-left: 5px; font-size: 11px; }
.p360-tip .t-r { display: flex; gap: 7px; align-items: baseline; padding: 2px 0; }
.p360-tip .t-r .k { flex: none; width: 34px; color: #a2abb8; }
.p360-tip .t-r .kw { color: #0C7FC2; }
.p360-tip .t-raw { color: #98a3b3; font-size: 11.5px; }
.p360-tip .t-b { flex: none; margin-left: auto; border-radius: 5px; padding: 0 6px; font-size: 10.5px; }
.p360-tip .t-b.b-todo { background: #fff3e0; color: #b47200; }
.p360-tip .t-b.b-wait { background: #e2f3fd; color: #0089c9; }
.p360-tip .t-b.b-done { background: #e6f9ef; color: #1a9b6c; }

/* 底部「原始档案」折叠区（从旧版患者360 保留，别丢信息） */
.p360-raw-file { background: #fff; border: 1px solid #eef2f7; border-radius: 10px; padding: 10px 14px; }
.p360-raw-file > summary { cursor: pointer; color: var(--primary); font-size: 12.5px; }
.p360-raw-file[open] > summary { margin-bottom: 8px; }
/* 窄屏：堆叠更紧、表格可横滚（本档写在文件最末＝后写优先） */
@media (max-width: 820px) {
  .p360-info { gap: 9px; font-size: 12px; }
  .p360-kpi { min-width: 88px; padding: 5px 9px; }
  .p360-kpi b { font-size: 17px; }
  .p360-card { padding: 10px; }
  .p360-card .p360-tbl { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ══ 病历卡片：「检查」两行空也常在（船长 2026-10-15）══
   起因：船长报「病例界面缺少检查」—— 「口腔检查 / 影像检查」原来**有内容才渲染**，
   而 E看牙 这批病历的对应 list 本来就是空数组 ⇒ 整行消失，看着就像界面缺了检查。
   现在这两行常在、空时写淡色「未记录」+ 一句提示。其余栏继续「有才显示」。
   ⚠️ 与 `.rec-card.ek-official` / `.rec-card.ek-fetch` 两条卡片路径共用 —— 改一处两边都变（有意）。 */
.rec-card .eks-none-v { color: #c3cad3; }
.rec-card .eks-hint { color: #b3bcc7; font-size: 11.5px; margin-left: 7px; }

/* ══════════════════════════════════════════════════════════════════════════
   录入病历弹窗 · 船长 2026-10-15 定稿版式
   「上栏四个选择器（病例日期/医生/护士/病例模板）＋ 下方 3/4 病例书写 ＋ 1/4 病历记录」
   ＋「自适应网页宽高（宽 min(1560px,97vw)、高 94vh），只滚中间两块」。
   原左栏（近今日拍摄影像 + 病历模板列表）已删 —— 影像走表单「相关影像」行，模板改成上栏下拉。
   🔴 全局有 `input{width:100%}`（见 .vset-row 那条教训）⇒ 上栏所有输入一律显式定宽。
   ══════════════════════════════════════════════════════════════════════════ */
.modal.modal-record {
  width: min(1560px, 97vw);
  height: 94vh;               /* 自适应高度：长满可视高度（原来只有 max-height，弹窗是"内容多高就多高"） */
  max-height: 94vh;
  display: flex; flex-direction: column;
  /* 🔴 不能写 overflow:hidden/auto —— 上栏的护士下拉是**浮层**，会被裁掉或带出滚动条。
     靠"子项各自受限"来保证不溢出：只有 .rf-body / .rec-rail 内部滚。 */
  overflow: visible;
}
.modal-record > h3, .modal-record .rec-draftbar, .modal-record .rec-topbar { flex: none; }
.modal-record .rec-split {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);   /* 单行 1fr ⇒ 子项被容器压住，内部才滚得起来 */
  gap: 14px; align-items: stretch;
}
.modal-record .rec-write { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.modal-record .rf-body { flex: 1 1 auto; min-height: 0; overflow: auto; max-height: none; }
.modal-record .m-foot, .modal-record #rf_check { flex: none; }
.modal-record .rec-rail { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 10px; }

/* 上栏四个选择器 */
.rec-topbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #f7f9fc;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 8px 0 12px; }
.rec-topbar .tb-lb { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.rec-topbar .tb-in { width: auto; height: 30px; padding: 4px 9px; font-size: 12.5px; border-radius: 7px;
  border: 1px solid var(--border); background: #fff; color: var(--text); }
.rec-topbar #rf_date { width: 152px; }
.rec-topbar #rf_doctor, .rec-topbar #rf_nurse { width: 148px; }
/* 2026-10-16：原来这里还有一条 `.rec-topbar #rf_tplsel { width:178px }` ——
   该下拉已删（与类型行的「模板库」按钮重复），宽度规则一并撤掉，不留死规则。 */
.rec-topbar .tb-tip { font-size: 11.5px; color: #a2abb8; }
.tb-pick { position: relative; display: inline-flex; align-items: center; }
.tb-n { font-size: 11.5px; color: #0C7FC2; background: var(--primary-soft); border-radius: 9px;
  padding: 1px 8px; white-space: nowrap; }
.tb-flag { font-size: 11px; color: #b47200; background: #fff8e8; border: 1px solid #f3e2bb;
  border-radius: 9px; padding: 1px 8px; white-space: nowrap; }

/* 护士下拉（position:fixed ⇒ 不受弹窗任何 overflow 影响；开面板时由 JS 定坐标） */
.nurse-dd { position: fixed; z-index: 4000; min-width: 264px; max-height: 288px; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 26px rgba(20, 40, 70, .16); padding: 4px 0; }
.nurse-dd .ndd-g { font-size: 11.5px; color: #a2abb8; padding: 6px 12px 3px; }
.nurse-dd .ndd-i { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.nurse-dd .ndd-i:hover { background: #f5fbff; }
.nurse-dd .ndd-i.on { background: #f5fbff; }
.nurse-dd .ndd-i.hint { background: #fffaf0; }
.nurse-dd .ndd-i.hint:hover { background: #fff5e4; }
.nurse-dd .ndd-w { margin-left: auto; font-size: 11px; color: #b3bcc7; white-space: nowrap; }
.nurse-dd .ndd-i.hint .ndd-w { color: #c9a15a; }
.nurse-dd .ndd-b { color: #b47200; }
.nurse-dd .ndd-e { padding: 8px 12px; font-size: 12px; color: #b3bcc7; }
.nurse-dd .ndd-warn { margin: 6px 10px 8px; background: #fff8e8; border: 1px solid #f3e2bb;
  border-radius: 8px; padding: 6px 9px; font-size: 11.5px; color: #8a6d1f; }

/* 书写区顶部的细行（类型 / 分院 / 复诊 / 模板库） */
.rf-typebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 9px; margin-bottom: 9px; border-bottom: 1px solid var(--border); flex: none; }

/* 右栏：病例记录（可折叠可展开，每条可点开、可引用到当前栏） */
.rec-rail .railtip { background: #f7fcff; border: 1px solid #d9eaf7; border-radius: 9px;
  padding: 8px 11px; font-size: 11.5px; color: #4a7ea3; line-height: 1.7; }
.rec-rail .rec-box.hist-folded .rec-box-b { display: none; }
.hist-item { border-bottom: 1px solid #eef1f5; }
.hist-item:last-child { border-bottom: 0; }
.hist-h { display: flex; align-items: center; gap: 6px; padding: 6px 2px; font-size: 12.5px; cursor: pointer; }
.hist-h:hover { background: #fafcff; }
.hist-h b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hist-kind { flex: none; background: #eefaf3; color: #2f7d4f; border-radius: 4px; padding: 0 5px; font-size: 11px; white-space: nowrap; }
.hist-dx { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 11.5px; }
.hist-ar { font-style: normal; color: #b3bcc7; font-size: 11px; }
.hist-b { display: none; padding: 2px 2px 8px 10px; border-left: 2px solid #d9eaf7; margin-left: 2px; }
.hist-item.open .hist-b { display: block; }
/* 病历条目里的「字段名 : 值」行（2026-11-10 起要显示完整病历，字段可能十项）
   🔴 值包在 .hist-v 里，选择器用 `>` 直接子代 —— 否则值内部的 span 也会被染成灰字。 */
.hist-l { display: flex; gap: 8px; font-size: 12px; color: #4a5666; padding: 3px 0;
  line-height: 1.7; word-break: break-word; }
.hist-l > span { width: 52px; flex: none; color: #a2abb8; }
.hist-l > .hist-v { flex: 1; min-width: 0; }
/* 病历头部的小签：牙位 / 医生 */
.hist-tooth { font-size: 10.5px; color: #0F6E56; background: #E1F5EE; border-radius: 4px;
  padding: 0 5px; white-space: nowrap; }
.hist-doc { margin-left: auto; color: #b3bcc7; font-size: 11px; }
.hist-ops a { color: #0C7FC2; font-size: 11.5px; margin-right: 10px; cursor: pointer; }
.hist-ops a:hover { text-decoration: underline; }

/* 🆕 2026-11-10 船长：右栏改「辅助菜单」—— 顶部选就诊日，下面五个标签
   （影像 / 病历 / 处置 / 预约 / 知情），默认今天。
   🔴 滚动分工：标签栏与选择器**钉住**，只有 .rec-aux-body 内部滚；
      所以上面 .modal-record .rec-rail 的 overflow 由 auto 改成了 hidden。 */
.rec-aux { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.rec-aux-top { flex: none; display: flex; align-items: center; gap: 7px; padding: 8px 10px;
  border-bottom: 1px solid var(--border); background: #f7fafd; }
.rec-aux-lb { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rec-aux-sel { flex: 1 1 auto; min-width: 0; height: 30px; padding: 4px 8px; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); }
.rec-aux-tabs { flex: none; display: flex; gap: 2px; padding: 0 6px; border-bottom: 1px solid var(--border); }
.rec-tab { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 2px 7px; font-size: 12.5px; color: var(--muted); background: none; border: 0;
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.rec-tab:hover { color: var(--primary); }
.rec-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
/* 「全部病历」模式：影像/处置/预约/知情 需要具体日期，灰掉并给提示 */
.rec-tab.dis { opacity: .42; cursor: not-allowed; }
.rec-tab.dis:hover { color: var(--muted); }
.rec-tab i { font-style: normal; font-size: 10.5px; color: #0C7FC2; background: var(--primary-soft);
  border-radius: 7px; padding: 0 5px; line-height: 15px; }
.rec-tab i.z { color: #b3bcc7; background: #f2f4f7; }
.rec-aux-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 8px 10px; }
.rec-aux-empty { font-size: 12px; color: var(--muted); padding: 14px 2px; text-align: center; }
.rec-aux-note { font-size: 11px; color: #a2abb8; text-align: center; padding: 6px 0 2px; }

/* 影像标签：3 列缩略图 */
.rec-imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rec-img { margin: 0; border: 1px solid #eef1f6; border-radius: 7px; overflow: hidden;
  background: #fbfcfd; cursor: pointer; }
.rec-img img { width: 100%; height: 66px; object-fit: cover; display: block; }
.rec-img .noimg { display: flex; align-items: center; justify-content: center; height: 66px;
  font-size: 10.5px; color: #b3bcc7; }
.rec-img figcaption { font-size: 10.5px; color: var(--muted); padding: 3px 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-img:hover { border-color: var(--primary); }

/* 🆕 2026-11-10 船长：「与打印一起放置病历卡片末端的居中位置」
   ⇒ 头部不再放按钮，卡片读完在底部分隔线下方居中排两枚（打印 / 日志）。
   三套卡片（抓取包 / 官方包 / 无 raw 兜底）共用这一个类。 */
/* ⚠️ 2026-11-17 起 `.eks-foot` 已无人使用（船长把底部按钮挪到卡片右上角），保留样式不影响。
   新位置：卡片头部 `.rec-acts`（打印 / 日志），右侧对齐、贴着「收起」。 */
.rec-card .eks-foot { margin-top: 10px; padding-top: 10px;
  border-top: 1px solid #f2f5f9;
  display: flex; justify-content: center; align-items: center;
  gap: 8px; flex-wrap: wrap;
}
.rec-card .eks-foot .btn { min-width: 84px; }

/* 🆕 2026-11-17 船长：「取消详情，这个按键位置替换成打印，与日志一起移动至右上角」 */
.rec-acts { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; flex: none; }
.rec-act { font-size: 12px; color: var(--primary); cursor: pointer; user-select: none; white-space: nowrap; }
.rec-act:hover { text-decoration: underline; }
.rec-sum .rec-acts { margin-left: 0; }
.rec-head .rec-acts { margin-left: auto; }

/* 处置标签 —— 🔴 类名必须带 rec-trt 前缀：原来叫 `.rec-row`，与病历记录页的
   `.rec-row { display:flex }`（style.css 1384 行，那是"一行两张病历卡"的布局）撞名，
   结果三个子块被横排、挤成一列窄条（2026-11-10 踩到）。换前缀避开。 */
.rec-trt { border: 1px solid #eef1f6; border-radius: 8px; padding: 7px 9px; margin-bottom: 7px; }
.rec-trt-h { display: flex; align-items: baseline; gap: 6px; }
.rec-trt-t { font-size: 11.5px; color: var(--primary); font-weight: 500; white-space: nowrap; }
/* 牙位小签（处置单的牙位，如 62 / 54,55） */
.rec-trt-th { font-size: 10.5px; color: #0F6E56; background: #E1F5EE; border-radius: 4px;
  padding: 0 5px; white-space: nowrap; }
.rec-trt-m { margin-left: auto; font-size: 12px; font-weight: 500; }
.rec-trt-b { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; font-size: 11.5px; }
.rec-chip { background: var(--primary-soft); color: #0C7FC2; border-radius: 4px; padding: 0 5px; }
.rec-trt-f { margin-top: 5px; display: flex; align-items: center; gap: 8px; font-size: 11px; min-width: 0; }
.rec-trt-f .sub { flex: 1 1 auto; color: #a2abb8; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-lk { margin-left: auto; color: #0C7FC2; cursor: pointer; font-size: 11px; white-space: nowrap; flex: none; }
.rec-lk:hover { text-decoration: underline; }

/* 状态小签（预约 / 知情共用） */
.rec-st { font-size: 10.5px; border-radius: 8px; padding: 0 6px; white-space: nowrap; }
.rec-st.ok { color: #1D9E75; background: #E1F5EE; }
.rec-st.wait { color: #185FA5; background: #E6F1FB; }
.rec-st.off { color: #A32D2D; background: #FCEBEB; }

/* 预约标签 */
.rec-apt { padding: 6px 0; border-bottom: 1px solid #f2f5f8; }
.rec-apt:last-child { border-bottom: 0; }
.rec-apt-t { font-size: 12.5px; font-weight: 500; color: var(--primary); margin-right: 5px; }
.rec-apt-b { font-size: 11.5px; color: #4a5666; margin-top: 3px; }

/* 知情同意标签 */
.rec-cst { border: 1px solid #eef1f6; border-radius: 8px; padding: 7px 9px; margin-bottom: 7px; cursor: pointer; }
.rec-cst:hover { border-color: var(--primary); background: #fbfdff; }
.rec-cst-h { display: flex; align-items: center; gap: 6px; }
.rec-cst-t { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-cst-b { font-size: 11px; color: #a2abb8; margin-top: 3px; }
.rec-cst-doc { font-size: 12.5px; line-height: 1.8; color: #37475a; max-height: 58vh; overflow: auto;
  background: #fbfcfd; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }

/* 窄屏：3:1 收成 2:1；再窄改成上下堆叠（写在文件最末＝后写优先） */
@media (max-width: 1100px) {
  .modal-record .rec-split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .rec-topbar .tb-tip { display: none; }
}
@media (max-width: 820px) {
  .modal.modal-record { height: auto; min-height: 0; max-height: 94vh; overflow: auto; }
  .modal-record .rec-split { display: block; }
  .modal-record .rec-write { display: block; }
  .modal-record .rf-body { max-height: none; overflow: visible; }
  .modal-record .rec-rail { margin-top: 12px; max-height: 200px; overflow: auto; }
  .rec-topbar #rf_date, .rec-topbar #rf_doctor, .rec-topbar #rf_nurse { width: 132px; max-width: 132px; }
}
/* 矮窗兜底：宁可整窗滚，也不把内容挤没 */
@media (max-height: 620px) {
  .modal.modal-record { height: auto; min-height: 560px; overflow: auto; }
}

/* ══ 正畸头影测量（投影测量） ceph.js / ceph-geo.js ═══════════════════════
   船长 2026-10-20：影像里点开头颅侧位片 → 进测量视图 → 点选标志点 → 即时算角
   设计约束（改动前先看）：
     · 画布区是**深色**（片子本身深浅不定），右侧面板跟随站点亮/暗两套
     · 异常色沿用 --danger、偏离用 --warn，别另造一套（医生看到红色就该是异常）
   ══════════════════════════════════════════════════════════════════════ */
.ceph-sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.ceph-wrap { display: flex; gap: 12px; align-items: stretch; min-height: 0; }
.ceph-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ceph-right { flex: 0 0 380px; max-width: 46%; display: flex; flex-direction: column; gap: 10px; overflow: auto; }

.ceph-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ceph-tools .btn { white-space: nowrap; }
.ceph-status { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.cs-chip { font-size: 12px; padding: 2px 9px; border-radius: 12px; background: #f2f5f8; color: var(--muted); border: 1px solid var(--border); }
.cs-chip b { color: var(--primary); }
.cs-chip.cs-ok { background: rgba(82,163,82,.12); color: #3d7a3d; border-color: rgba(82,163,82,.35); }
.cs-chip.cs-warn { background: rgba(230,162,60,.14); color: #a9741f; border-color: rgba(230,162,60,.4); }
.cs-chip.cs-mid { background: rgba(230,162,60,.1); color: #a9741f; border-color: rgba(230,162,60,.3); }
.cs-chip.cs-bad { background: rgba(217,83,79,.12); color: #b03a37; border-color: rgba(217,83,79,.35); }
.cs-chip.cs-ai { background: rgba(155,89,182,.12); color: #7d3c98; border-color: rgba(155,89,182,.35); }

.ceph-canvas-box { position: relative; background: #1a1a1a; border-radius: 8px; overflow: hidden; height: 62vh; min-height: 380px; }
.ceph-canvas-box canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.ceph-hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.ceph-hint b { color: var(--primary); }

.ceph-sec { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #fff; }
.ceph-sec-h { font-size: 13px; font-weight: 600; margin-bottom: 8px; }

.ceph-pts { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 5px; max-height: 168px; overflow: auto; }
.cpt { display: flex; align-items: baseline; gap: 5px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; background: #fafbfc; cursor: pointer; text-align: left; font-size: 11px; color: var(--muted); }
.cpt b { font-size: 13px; color: var(--text); font-family: ui-monospace, Menlo, monospace; }
.cpt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpt:hover { border-color: var(--primary); }
.cpt.has { background: rgba(0,160,232,.08); border-color: rgba(0,160,232,.35); }
.cpt.has b { color: var(--primary); }
.cpt.on { background: var(--primary); border-color: var(--primary); }
.cpt.on b, .cpt.on span { color: #fff; }
.cpt.ai::after { content: 'AI'; font-size: 9px; padding: 0 3px; border-radius: 3px; background: #9b59b6; color: #fff; margin-left: auto; }

.ceph-filters { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.fbtn { font-size: 12px; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--border); background: #f2f5f8; color: var(--muted); cursor: pointer; }
.fbtn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.ceph-hide { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.ceph-hide input { width: auto; flex: none; }

.ceph-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ceph-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; padding: 4px 5px; border-bottom: 1px solid var(--border); }
.ceph-table td { padding: 4px 5px; border-bottom: 1px solid #f0f2f5; }
.ceph-table tbody tr:hover { background: #f7fafc; }
.ceph-table .ct-lab { color: var(--text); }
.ceph-table .ct-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ceph-table .ct-nor, .ceph-table .ct-dev { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ceph-table .ct-eye { width: 22px; text-align: center; }
.cbtn { border: 0; background: none; cursor: pointer; color: var(--primary); font-size: 12px; padding: 0; }
.cs-soft { font-style: normal; font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 3px; margin-left: 4px; }
.cs-na { color: var(--muted); font-weight: 400; font-size: 11px; }
/* 分级配色：与图上标签同一套语义（红=异常、橙=偏离、无色=正常） */
.ceph-table tr.lv-high .ct-val, .ceph-table tr.lv-low .ct-val { color: var(--danger); }
.ceph-table tr.lv-warn .ct-val { color: #b8860b; }
.ceph-table tr.lv-none .ct-val { color: var(--muted); font-weight: 400; }
.ceph-table tr.lv-high, .ceph-table tr.lv-low { background: rgba(217,83,79,.05); }
.ceph-table tr.lv-warn { background: rgba(230,162,60,.06); }
.ceph-empty { text-align: center; color: var(--muted); padding: 18px 0 !important; }

.ceph-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.ceph-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lg { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.lg-ok { background: rgba(12,127,194,.88); }
.lg-mid { background: rgba(230,162,60,.92); }
.lg-bad { background: rgba(217,83,79,.92); }
.lg-ai { background: #9b59b6; border-radius: 50%; }

/* 窄屏：右侧面板落到画布下方（.ceph-wrap 是 flex，窄屏改竖排） */
@media (max-width: 900px) {
  .ceph-wrap { flex-direction: column; }
  .ceph-right { flex: 1 1 auto; max-width: 100%; }
  .ceph-canvas-box { height: 52vh; min-height: 300px; }
}

/* ══ 头影测量 AI 描点（ceph.js）══════════════════════════════════════════
   船长 2026-10-20：AI 自动描点为主 + 医生修个别点。
   置信度圆点是这套流程的核心：**一眼看出该先修哪几个点**。
   ══════════════════════════════════════════════════════════════════════ */
.btn-ai { background: linear-gradient(135deg, #9b59b6, #6c5ce7); color: #fff; border-color: #6c5ce7; }
.btn-ai:hover { background: linear-gradient(135deg, #8e44ad, #5a4fd1); color: #fff; }
.btn-ai:disabled { background: #c9c9d4; border-color: #c9c9d4; color: #fff; cursor: not-allowed; opacity: .75; }

.ceph-ai-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cf { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 3px; vertical-align: 1px; flex: none; }
.cf-lo { background: var(--danger); }
.cf-mid { background: #e6a23c; }
.cf-hi { background: #52a352; }
.cpt .cf { margin-left: auto; }
.cpt.on .cf { box-shadow: 0 0 0 1px rgba(255,255,255,.6); }

/* ══ 头影测量 · 全屏卡片版（2026-10-20 船长改版）══════════════════════════
   要求：全屏卡片形式 / 侧位片为主充满整个画面高度 / 参数用细字体 / 测量线用主色蓝
   ══════════════════════════════════════════════════════════════════════ */
.modal.modal-ceph {
  width: min(1680px, 97vw);
  max-height: 96vh;
  height: min(94vh, 980px);
  padding: 14px 18px;
  border-radius: 16px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal.modal-ceph h3 { margin-bottom: 10px; flex: none; font-size: 15px; }
.modal.modal-ceph .ceph-wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; }

/* 画布区：占满左栏高度（侧位片按高度铺满，见 ceph.js 的 fitGeo） */
.ceph-canvas-box { height: 100%; min-height: 0; flex: 1 1 auto; }
.ceph-left { height: 100%; }
.ceph-right { height: 100%; }

/* 参数用细字体（船长要求）：整表降到 11px、字重 400 */
.ceph-table { font-size: 11px; font-weight: 400; }
.ceph-table th { font-size: 10px; font-weight: 400; color: var(--muted); padding: 3px 4px; }
.ceph-table td { padding: 2.5px 4px; }
.ceph-table .ct-lab { font-weight: 400; }
.ceph-table .ct-val { font-weight: 500; font-size: 11.5px; }
.ceph-table .ct-nor, .ceph-table .ct-dev { font-size: 10.5px; font-weight: 400; }
.ceph-sec-h { font-size: 12px; font-weight: 500; }
.ceph-pts { max-height: 150px; }
.cpt { font-size: 10.5px; padding: 4px 6px; }
.cpt b { font-size: 12px; font-weight: 500; }
.ceph-hint { font-size: 11px; }
.ceph-status { font-size: 11px; }
.cs-chip { font-size: 11px; padding: 1px 8px; }
.ceph-legend { font-size: 10.5px; }
.ceph-tools .btn { font-size: 12px; }

/* ══ 头影测量：标题行 + 右上角关闭 + 退出按钮（2026-10-20 船长要求）═════════
   全屏卡片几乎占满视口 ⇒ 必须有明确的「复位」与「退出」，
   而且关闭路径（点遮罩/ESC/×/按钮）都要拦住"有未保存改动"的情况。 */
.modal.modal-ceph .ceph-head {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding-right: 34px;                 /* 给右上角 × 让位 */
}
.modal.modal-ceph .ceph-head .ceph-sub { flex: 1 1 auto; }
.ceph-x {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; line-height: 1;
  border: 1px solid var(--border); border-radius: 50%;
  background: #fff; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 0;
  transition: background .12s, color .12s;
}
.ceph-x:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ceph-exit { margin-left: 4px; }
.btn-ceph-exit:hover { border-color: var(--danger); color: var(--danger); }

/* ══ 头影测量：牙龄期条 + 分析结论列 + AI 免责提示（2026-10-20 对齐爱乐慕）══ */
.ceph-phase-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 8px; margin-bottom: 8px;
  background: var(--panel-2, #f6f8fb); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px;
}
.ceph-phase-bar label { font-weight: 500; }
.ceph-phase-bar select { font-size: 12px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border); }
.ceph-phase-tip { font-size: 11px; color: var(--muted); flex: 1 1 auto; }
.ceph-ai-note {
  flex: 1 1 100%; margin-top: 2px; font-size: 11px; color: #7a5c00;
  background: #fff8e1; border: 1px solid #f0d98c; border-radius: 6px; padding: 4px 8px;
}
.ceph-table .ct-concl { font-size: 10.5px; color: var(--text-2, #555); line-height: 1.35; }
.ceph-table .ct-val .cs-up { color: #e04b4b; font-style: normal; font-weight: 600; margin-left: 1px; }
.ceph-table .ct-val .cs-dn { color: #2e9e4f; font-style: normal; font-weight: 600; margin-left: 1px; }
.ceph-table .ct-nor .cs-fb {
  font-style: normal; font-size: 9px; margin-left: 3px; padding: 0 3px;
  border: 1px solid #ccc; border-radius: 3px; color: #999; vertical-align: 1px;
}

/* ══ 头影测量报告（2026-10-20 对齐爱乐慕报告页）══════════════════════════ */
.modal.modal-ceph-report { width: min(880px, 94vw); max-height: 92vh; }
.rp-doc { background: #fff; color: #222; font-size: 13px; }
.rp-title { text-align: center; font-size: 19px; font-weight: 600; margin: 4px 0 16px; letter-spacing: 2px; }
.rp-info { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 12.5px; }
.rp-info td { border: 1px solid #dcdcdc; padding: 6px 9px; }
.rp-info td:nth-child(odd) { background: #f7f8fa; color: #666; width: 92px; font-weight: 500; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rp-table th { border: 1px solid #dcdcdc; background: #f2f4f7; padding: 7px 9px; font-weight: 600; text-align: center; }
.rp-table td { border: 1px solid #dcdcdc; padding: 5px 9px; }
.rp-table .rp-val { text-align: center; font-weight: 600; white-space: nowrap; }
.rp-table .rp-nor { text-align: center; color: #666; }
.rp-table .rp-concl { color: #333; }
.rp-abn { color: #d93636; }
.rp-warn { color: #b88230; }
.rp-up, .rp-dn { font-style: normal; font-weight: 700; }
.rp-up { color: #d93636; }
.rp-dn { color: #2e9e4f; }
.rp-note { font-size: 11px; color: #888; margin-top: 12px; line-height: 1.6; }
.rp-sign { font-size: 12.5px; margin-top: 18px; text-align: right; color: #444; }
@media print {
  body * { visibility: hidden; }
  .modal-ceph-report, .modal-ceph-report * { visibility: visible; }
  .modal-ceph-report { position: absolute; left: 0; top: 0; width: 100%; max-height: none; }
  .modal-ceph-report .m-foot, .modal-ceph-report > h3 { display: none; }
}

/* ══ 曲面断层片（全景片）独立查看器（2026-10-20 船长要求）══════════════════
   与头影测量视图同一套版式（全屏卡片 + 右上角 ×），医生不用适应两种窗口。
   独有：亮度/对比度滑块（X 光的窗宽窗位）、镜像、90°旋转、反色、右下角状态条。
   ══════════════════════════════════════════════════════════════════════ */
.modal.modal-pano {
  width: min(1680px, 97vw); max-height: 96vh; height: min(92vh, 940px);
  padding: 14px 18px; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden;
}
.modal.modal-pano h3.pano-head { position: relative; display: flex; align-items: center; gap: 8px;
  padding-right: 34px; margin-bottom: 10px; flex: none; font-size: 15px; }
.modal.modal-pano .pano-sub { flex: 1 1 auto; font-weight: 400; }
.modal.modal-pano .pano-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.modal.modal-pano .pano-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pano-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; margin-bottom: 8px; }
.pano-tools input[type=range] { width: 110px; vertical-align: middle; }
.pano-tool-t { font-size: 12px; color: var(--muted); }
.pano-tools .btn.on { background: #eaf6ff; border-color: var(--primary, #00A0E8); color: #0079b5; }
.pano-canvas-box { flex: 1 1 auto; min-height: 0; background: #0b0b0b; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
/* 🔴 canvas 的 CSS 尺寸必须由容器决定（100%），位图属性才 = CSS×dpr。
   不设 width/height:100% ⇒ canvas 的 CSS 宽度 = 属性宽度，
   于是「属性 = 容器宽×dpr」和「容器被 canvas 撑开」互相循环 ⇒ dpr 失效（实测 cv=css）。 */
.pano-canvas-box canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.pano-hint { flex: none; font-size: 11px; color: var(--muted); margin-top: 6px; }
.pano-hud { flex: none; display: flex; gap: 16px; align-items: center; justify-content: flex-end;
  font-size: 11px; color: var(--muted); padding-top: 6px; min-height: 20px; }
.pano-hud-item b { color: var(--text); font-weight: 500; }
.pano-hud-flag { color: #0a7ea4; }
.pano-hud-dirty { color: #b88230; }
/* 轮廓开关（AI 自动分割的软组织侧貌/骨性轮廓）—— 打开时高亮 */
.ceph-tools .btn.on { background: #eaf6ff; border-color: #00A0E8; color: #0079b5; }

/* ══ 全景片 AI 辅助诊断面板（2026-10-21）══════════════════════════════════
   铁规矩：AI 只做**初筛提示**，面板顶部挂固定警告（该模型按恒牙列 32 颗设计，
   替牙期「缺失牙」会误报）；结果**必须医生逐条确认**才落库。
   ══════════════════════════════════════════════════════════════════════ */
.pano-tools .btn-pano-ai { background: linear-gradient(135deg,#9b59b6,#6c5ce7); color:#fff; border-color:#6c5ce7; }
.pano-tools .btn-pano-ai:disabled { background:#c9c9d4; border-color:#c9c9d4; color:#fff; cursor:not-allowed; }
.pano-ai-panel {
  flex: none; margin-top: 8px; max-height: 40vh; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fbfcfd;
}
.pano-ai-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.pano-ai-head b { font-weight: 600; }
.pano-ai-meta { font-size: 11px; color: var(--muted); }
.pano-ai-warn {
  font-size: 11.5px; color: #8a5b00; background: #fff8e1;
  border: 1px solid #f0d98c; border-radius: 6px; padding: 5px 8px; margin-bottom: 8px; line-height: 1.5;
}
.pano-ai-ok { font-size: 12px; color: #2e7d4f; padding: 8px 0; }
.pano-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pano-ai-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: #eef4fb; border: 1px solid #cfe0f2; color: #14608f;
}
.pano-ai-chip b { font-weight: 600; }
.pano-ai-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.pano-ai-table th { border: 1px solid var(--border); background: #f2f4f7; padding: 4px 6px; font-weight: 500; }
.pano-ai-table td { border: 1px solid var(--border); padding: 3px 6px; }
.pano-ai-fdi { font-family: ui-monospace, Menlo, monospace; font-weight: 600; text-align: center; width: 62px; }
.pano-ai-sc { text-align: center; font-weight: 500; width: 62px; }
.pano-ai-sc.hi { color: #d93636; }
.pano-ai-sc.mid { color: #b88230; }
.pano-ai-sc.lo { color: #6b7a8a; }
.pano-ai-yn {
  font-size: 11px; padding: 1px 7px; margin-right: 4px;
  border: 1px solid var(--border); border-radius: 5px; background: #fff; cursor: pointer;
}
.pano-ai-yn.sel[data-act="yes"] { background: #52a352; border-color: #52a352; color: #fff; }
.pano-ai-yn.sel[data-act="no"]  { background: #b9c2cc; border-color: #b9c2cc; color: #fff; }
.pano-ai-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pano-ai-tip { font-size: 11px; color: var(--muted); }
.pano-ai-fail { color: #d93636; }

/* ══ 全景片 AI 标注框联动（2026-10-21）════════════════════════════════════
   表格 ↔ 片上框双向联动：点表格行高亮框、点框高亮行、点 chip 只看该类。
   ══════════════════════════════════════════════════════════════════════ */
.pano-ai-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
.pano-ai-chip { cursor: pointer; user-select: none; }
.pano-ai-chip.on { background: #d6ecfb; border-color: #00A0E8; color: #005f8f; font-weight: 600; }
.pano-ai-boxsw { font-size: 11px; color: var(--muted); cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 3px; }
.pano-ai-table tr.hasbox { cursor: pointer; }
.pano-ai-table tr.hasbox:hover td { background: #f2f8fd; }
.pano-ai-table tr.sel td { background: #e2f2fd !important; }

/* ══ 全景片查看器 v2：左右布局 + 右侧 AI 面板（2026-10-21 照爱乐慕参考图改）══
   顶部工具栏 → 左侧片子(自适应) + 右侧面板(固定 320) 并排；片子下方固定免责+图例。
   ══════════════════════════════════════════════════════════════════════ */
.pano-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 10px; }
.pano-body.noside .pano-main { flex: 1 1 100%; }
.pano-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pano-tsep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }
.pano-foot {
  flex: none; display: flex; align-items: center; gap: 14px;
  padding: 6px 2px 0; font-size: 10.5px; color: var(--muted); white-space: nowrap;
}
.pano-disclaimer { flex: 1 1 auto; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; }
.pano-disclaimer b { color: #b0483c; }
.pano-foot .lg {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin: 0 1px 0 4px; vertical-align: -1px;
}
.pano-foot .lgwrap { flex: none; display: inline-flex; align-items: center; }
.pano-foot .lg-hi { background: #e04b4b; } .pano-foot .lg-mid { background: #f0a13a; }
.pano-foot .lg-lo { background: #52a352; } .pano-foot .lg-no { background: #fff; border: 1px solid #b9c2cc; }

/* 右侧 AI 面板 */
.pano-side {
  flex: 0 0 320px; width: 320px; min-height: 0; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 8px; background: #fbfcfd; overflow: hidden;
}
.pano-side-hd {
  flex: none; padding: 8px 10px; font-size: 12.5px; font-weight: 600; background: #eef3f8;
  border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
}
.pano-side-x { border: 0; background: transparent; cursor: pointer; font-size: 13px; color: var(--muted); padding: 0 2px; }
.pano-side-tabs { flex: none; display: flex; border-bottom: 1px solid var(--border); background: #fff; }
.pano-tab {
  flex: 1 1 0; padding: 7px 4px; font-size: 11.5px; border: 0; background: transparent;
  cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent;
}
.pano-tab b { font-weight: 600; }
.pano-tab.on { color: #0a6fa8; border-bottom-color: #00A0E8; background: #f4faff; }
.pano-side-filter { flex: none; display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border); }
.pano-fbtn {
  flex: 1 1 0; font-size: 10.5px; padding: 4px 2px; border: 1px solid var(--border);
  border-radius: 5px; background: #fff; cursor: pointer; color: var(--muted);
}
.pano-fbtn.on { background: #00A0E8; border-color: #00A0E8; color: #fff; }
.pano-side .pano-ai-panel { flex: 1 1 auto; max-height: none; margin: 0; border: 0; border-radius: 0; background: #fff; }
.pano-side-foot { flex: none; padding: 6px 8px; border-top: 1px solid var(--border); background: #f7f9fb; }
.pano-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 10px; }
.pano-ai-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pano-ai-table th { border-bottom: 1px solid var(--border); background: #f4f6f9; padding: 5px 4px; font-weight: 500; color: var(--muted); font-size: 10.5px; text-align: left; }
.pano-ai-table td { border-bottom: 1px solid #eef0f3; padding: 5px 4px; vertical-align: top; }
.pano-ai-table tr.hasbox { cursor: pointer; }
.pano-ai-table tr.hasbox:hover td { background: #f4f9fd; }
.pano-ai-table tr.sel td { background: #e6f4fd !important; }
.pano-ai-fdi { font-family: ui-monospace, Menlo, monospace; font-weight: 600; text-align: center; }
.pano-ai-src { color: var(--muted); font-size: 10.5px; }
.pano-ai-prio {
  display: inline-block; font-size: 9.5px; padding: 0 4px; border-radius: 3px;
  color: #fff; margin-right: 4px; font-weight: 600;
}
.pano-ai-prio.lg-hi { background: #e04b4b; } .pano-ai-prio.lg-mid { background: #f0a13a; }
.pano-ai-prio.lg-lo { background: #52a352; }

/* AI 进度弹窗（照参考图：中央深色框 + 百分比 + 免责） */
.pano-progress { position: fixed; inset: 0; z-index: 9998; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35); }
.pano-progress-box {
  background: #2b3a4a; color: #e8eef5; border-radius: 10px; padding: 24px 30px;
  text-align: center; min-width: 300px; box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
.pano-progress-icon { font-size: 30px; margin-bottom: 10px; }
.pano-progress-txt { font-size: 14px; margin-bottom: 8px; }
.pano-progress-sub { font-size: 11.5px; opacity: .85; margin-bottom: 14px; line-height: 1.5; }
.pano-progress-sub b { color: #ffc9c2; }

/* ══ 翠鸟档案库同名归位面板（2026-10-21）═══════════════════════════════════ */
.modal.modal-km { width: min(1760px, 97vw); height: min(92vh, 960px); padding: 0; border-radius: 14px; overflow: hidden; }
.km-wrap { display: flex; flex-direction: column; height: 100%; }
.km-hd { flex: none; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 500; position: relative; }
.km-hd .ceph-x { position: absolute; right: 14px; }
.km-hd-sub { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.km-body { flex: 1 1 auto; min-height: 0; display: flex; }
.km-list { flex: 0 0 268px; border-right: 1px solid var(--border); overflow-y: auto; background: #fafbfc; }
.km-search { padding: 8px; border-bottom: 1px solid var(--border); }
.km-search input { width: 100%; }
.km-count { padding: 5px 10px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--border); }
.km-item { padding: 7px 11px; border-bottom: 1px solid #f0f2f5; cursor: pointer; }
.km-item:hover { background: #eef6fc; }
.km-n { font-size: 13px; }
.km-d { font-size: 11px; color: var(--muted); margin-top: 2px; }
.km-cl { display: inline-block; margin-right: 4px; padding: 0 4px; border-radius: 3px; background: #eef2f7; }
.km-detail { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: 14px 18px; }
.km-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.km-fail { color: #d93636; }
.km-dh { font-size: 16px; font-weight: 500; margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.km-raw { font-size: 11px; color: var(--muted); font-weight: 400; }
.km-sum { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: auto; }
.km-warn { font-size: 12px; color: #8a5b00; background: #fff8e1; border: 1px solid #f0d98c; border-radius: 6px; padding: 6px 10px; margin-bottom: 10px; }
.km-ok { font-size: 12px; color: #2e7d4f; background: #eefaf1; border: 1px solid #b9e2c4; border-radius: 6px; padding: 6px 10px; margin-bottom: 10px; }
.km-flds { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 14px; }
.km-flds th { border: 1px solid var(--border); background: #f3f5f8; padding: 5px 8px; font-weight: 500; text-align: left; }
.km-flds td { border: 1px solid var(--border); padding: 5px 8px; }
.km-c { font-size: 10.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.km-bad { background: #fdeceb; color: #b0342c; font-weight: 500; }
.km-rec { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.km-rec.km-base { border-color: #00A0E8; }
.km-rec-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; background: #f4f6f9; font-size: 12px; font-weight: 500; }
.km-base-pick { margin-left: auto; font-weight: 400; font-size: 11.5px; cursor: pointer; }
.km-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 7px; padding: 9px; }
.km-thumb { border: 1px solid var(--border); border-radius: 5px; overflow: hidden; cursor: zoom-in; background: #0d0d0d; }
.km-thumb:hover { border-color: #00A0E8; box-shadow: 0 0 0 1px #00A0E8; }
/* 🔴 必须给**固定尺寸**：<img> 没有 src 时高度是 0 ⇒ IntersectionObserver 视它为不可见 ⇒ 永不触发
   ⇒ 缩略图一直不加载（踩过：130 张 loaded=0）。这里给 aspect-ratio 让它占位。 */
.km-thumb img { width: 100%; aspect-ratio: auto; max-height: 300px; object-fit: contain; display: block;
  background: #111 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E") center no-repeat; }
.km-tl { font-size: 10px; color: #d7dde5; background: #2b3440; padding: 2px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.km-nothumb { grid-column: 1/-1; padding: 10px; text-align: center; color: var(--muted); font-size: 11.5px; }
.km-pairs { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.km-ow { margin-left: auto; font-weight: 400; font-size: 11.5px; cursor: pointer; }
.km-pair { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-top: 1px solid #f0f2f5; font-size: 12px; flex-wrap: wrap; }
.km-pd { font-weight: 500; min-width: 128px; }
.km-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 9px; }
.km-tag-add { background: #e7f6ec; color: #2e7d4f; }
.km-tag-dup { background: #fff3e0; color: #a2630b; }
.km-tag-keep { background: #eef2f7; color: #5f6b7a; }
.km-pick { display: flex; gap: 12px; align-items: center; }
.km-auto { font-size: 11.5px; color: var(--muted); }
.km-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0 4px; border-top: 1px solid var(--border); }
.km-kb { font-size: 12px; cursor: pointer; }
.km-tip { font-size: 11px; color: var(--muted); }

/* ══ 两账号左右配对（2026-10-21 船长：照片也按左右两个账号合并）═════════════ */
.km-two { display: flex; align-items: stretch; gap: 10px; margin-bottom: 10px; }
.km-acct { flex: 1 1 0; background: var(--color-background-primary); border: 0.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-lg); padding: 8px 11px; }
.km-acct:first-child { border-color: var(--color-border-info); }
.km-acct-hd { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.km-badge-a { font-size: 10.5px; font-weight: 400; background: var(--color-background-info); color: var(--color-text-info);
  border-radius: 3px; padding: 1px 6px; }
.km-acct-sub { font-size: 11px; color: var(--color-text-secondary); margin-top: 3px; }
.km-vs { flex: 0 0 26px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--color-text-tertiary); }
.km-cmp { background: var(--color-background-primary); border: 0.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-lg); padding: 7px 11px; margin-bottom: 8px; }
.km-cmp-row { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 8px; font-size: 12px; padding: 2px 0; }
.km-cmp-k { color: var(--color-text-tertiary); }
.km-cmp-v { color: var(--color-text-primary); }
.km-pairs2 { background: var(--color-background-primary); border: 0.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-lg); padding: 9px 11px; margin-bottom: 12px; }
.km-pairs2-hd { font-size: 12.5px; font-weight: 500; margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; }
.km-pairs2-sum { font-size: 11px; font-weight: 400; color: var(--color-text-secondary); margin-left: auto; }
.km-pair2 { border-top: 1px solid #eef0f3; padding: 8px 0; }
.km-pair2-lb { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.km-pair2-t { font-size: 12px; font-weight: 500; }
.km-pair2-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
/* 🔴 不要在这里再套一层 grid：多一层 grid 会把宽度吃掉（实测父容器只剩 2px）。
   .km-side 只做「块容器」，真正分列交给 .km-side-scroll。 */
.km-side { display: block; min-height: 46px; min-width: 0; }
.km-none { display: flex; align-items: center; justify-content: center; min-height: 46px;
  border: 0.5px dashed var(--color-border-tertiary); border-radius: var(--border-radius-md);
  font-size: 10.5px; color: var(--color-text-tertiary); }
.km-choose { display: flex; gap: 16px; margin-top: 6px; font-size: 11.5px; }
.km-choose label { cursor: pointer; }
/* 左右两栏各自限高滚动（194 张也不能把行撑爆） */
.km-side-hd { font-size: 10.5px; color: var(--color-text-secondary); margin-bottom: 4px; }
/* 🔴 缩略图要够大才看得清（口内照本身偏暗，96px 会缩成黑条）⇒ 固定 3 列 × 128px，
     左右两栏宽度一致 ⇒ 照片左右严格对齐，便于逐张比对。 */
/* 🔴 缩略图尺寸可切（船长 2026-10-21「缩略图图片太小」）：
     --km-cols 控制每边几列（3=小 / 2=中（默认） / 1=大）；左右列数相同 ⇒ 左右严格对齐。
     口内照偏暗且多为竖图 ⇒ 用 contain（完整显示，不裁切）。 */
.km-side-scroll { max-height: 430px; overflow-y: auto; display: grid;
  grid-template-columns: repeat(var(--km-cols, 2), minmax(0, 1fr)); gap: 8px; align-content: start;
  padding-right: 2px; min-width: 0; }
.km-side-scroll::-webkit-scrollbar { width: 6px; }
.km-side-scroll::-webkit-scrollbar-thumb { background: #c3ccd6; border-radius: 3px; }
.km-more { grid-column: 1/-1; font-size: 10.5px; padding: 4px 0; margin-top: 2px;
  border: 0.5px dashed var(--color-border-secondary); border-radius: var(--border-radius-md);
  background: transparent; color: var(--color-text-secondary); cursor: pointer; }
.km-more:hover { background: #f2f8fd; color: var(--color-text-info); }
/* 缩略图尺寸档按钮（小/中/大） */
.km-size-btns { margin-left: auto; display: inline-flex; gap: 3px; }
.km-sizebtn { font-size: 10.5px; padding: 2px 9px; border: 1px solid var(--color-border-tertiary);
  border-radius: 4px; background: #fff; color: var(--color-text-secondary); cursor: pointer; }
.km-sizebtn.on { background: var(--color-background-info); border-color: var(--color-border-info); color: var(--color-text-info); font-weight: 500; }


/* ══ 3D 口腔解剖页（2026-10-21）═════════════════════════════════════════════ */
.an-status { flex: none; margin-bottom: 8px; font-size: 12.5px; min-height: 22px; }
.an-status .an-ok { color: #2e7d4f; }
.an-status .an-err { color: #d93636; }
.an-status .an-tip { color: var(--muted); }
.an-status .an-new { color: #a2630b; background: #fff8e1; border: 1px solid #f0d98c; border-radius: 6px; padding: 4px 9px; display: inline-block; }
.an-inline { font-size: 11px; padding: 1px 8px; margin-left: 6px; border-radius: 4px;
  border: 0.5px solid #a2630b; background: #fff; color: #a2630b; cursor: pointer; }
.an-frame-box { flex: 1 1 auto; min-height: 420px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #f7f5f0; }
.an-frame-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.an-foot { flex: none; margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.55; }
.an-foot b { color: #b0483c; }

/* 全景 AI 面板：低置信度折叠开关（2026-10-21） */
.pano-ai-toggle { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted);
  padding: 4px 2px 6px; }
.pano-ai-toggle b { color: var(--text-primary); }
.pano-ai-toggle-btn { font-size: 11px; padding: 2px 9px; border-radius: 4px;
  border: 0.5px solid var(--color-border-tertiary); background: #fff; color: var(--color-text-secondary); cursor: pointer; }
.pano-ai-toggle-btn:hover { border-color: #00A0E8; color: #00A0E8; }

/* ══ 全景 AI：牙齿图标网格 + 0~100 健康分（2026-10-21 船长要）══════════════ */
.pano-tg { border-bottom: 1px solid var(--border); padding: 10px 12px 12px; }
.pano-tg-score { display: flex; align-items: flex-end; gap: 10px; }
.pano-tg-score-l { flex: 1 1 auto; min-width: 0; }
.pano-tg-score-t { font-size: 12.5px; font-weight: 500; }
.pano-tg-score-s { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.pano-tg-score-n { font-size: 28px; font-weight: 500; line-height: 1; text-align: right; }
.pano-tg-score-n i { display: block; font-size: 10.5px; font-style: normal; font-weight: 400; margin-top: 3px; }
/* 渐变条：红→黄→绿（0 需处理 → 100 健康） */
.pano-tg-bar { position: relative; height: 7px; border-radius: 4px; margin-top: 8px;
  background: linear-gradient(90deg, #e24b4a 0%, #ef9f27 45%, #639922 100%); }
.pano-tg-knob { position: absolute; top: -3px; width: 3px; height: 13px; border-radius: 2px;
  background: #2c2c2a; transform: translateX(-50%); }
.pano-tg-scale { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); margin-top: 4px; }
.pano-tg-title { font-size: 12.5px; font-weight: 500; margin: 14px 0 2px; }
.pano-tg-sub { font-size: 10.5px; color: var(--muted); margin-bottom: 7px; }
.pano-tg-rows { display: flex; flex-direction: column; gap: 3px; }
.pano-tg-row { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; }
.tg-cell { position: relative; background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 2px 0 1px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0; }
.tg-cell .tooth-ico { width: 100%; max-width: 22px; height: 22px; display: block; }
.tg-cell i { font-style: normal; font-size: 8px; line-height: 1.1; color: var(--muted); }
.tg-cell.tg-none { color: #b9c2cc; }
.tg-cell.tg-lo { color: #3B6D11; background: #f2f8ea; }
.tg-cell.tg-mid { color: #854F0B; background: #fdf3e2; }
.tg-cell.tg-hi { color: #A32D2D; background: #fdeceb; }
.tg-cell:hover { border-color: #00A0E8; }
.tg-cell.sel { border-color: #00A0E8; box-shadow: 0 0 0 1px #00A0E8; }
.pano-tg-legend { display: flex; gap: 11px; font-size: 10px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.pano-tg-legend .tg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; vertical-align: middle; margin-right: 3px; }
.tg-dot.tg-hi { background: #e24b4a; } .tg-dot.tg-mid { background: #ef9f27; }
.tg-dot.tg-lo { background: #97c459; } .tg-dot.tg-none { background: #b9c2cc; }
.pano-tg-note { font-size: 10px; color: var(--muted); margin-top: 7px; line-height: 1.5; }

/* ══ 儿童口腔「闯关计分」（2026-10-21 船长：患者360 里的游戏化关卡）══════════
   皮肤靠后端下发的 CSS 变量（--kg-*）驱动，前端不硬编码任何一套皮肤。
   🔴 素材全部原创（星星/雪花/旗子都是字符或自绘），不使用第三方 IP 形象。 */
.kg-wrap { background: var(--kg-bg, #FAEEDA); border: 1px solid var(--kg-border, #EF9F27);
  border-radius: 12px; padding: 12px 14px 11px; margin-bottom: 12px; }
.kg-hd { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.kg-hd-t { font-size: 13px; font-weight: 500; color: var(--kg-ink, #854F0B); }
.kg-hd-s { font-size: 10.5px; color: var(--kg-accent, #BA7517); margin-top: 2px; }
.kg-themes { margin-left: auto; display: flex; gap: 5px; flex: none; }
.kg-theme { font-size: 10.5px; padding: 3px 9px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--kg-border, #EF9F27); background: var(--kg-bg2, #fff8e8); color: var(--kg-accent, #BA7517); }
.kg-theme.on { background: var(--kg-accent, #BA7517); color: #fff; border-color: var(--kg-accent, #BA7517); }
.kg-score { display: flex; align-items: center; gap: 13px; padding: 9px 11px;
  background: var(--kg-bg2, #fff8e8); border-radius: 10px; }
.kg-score-n { font-size: 27px; font-weight: 500; line-height: 1; color: var(--kg-accent, #BA7517); text-align: center; min-width: 54px; }
.kg-score-n i { display: block; font-style: normal; font-size: 10.5px; font-weight: 400; margin-top: 3px; }
.kg-score-bar { position: relative; flex: 1 1 auto; min-width: 0; height: 9px; border-radius: 5px; background: var(--kg-track, #FAC775); }
.kg-score-knob { position: absolute; top: -3px; width: 3px; height: 15px; border-radius: 2px;
  background: var(--kg-ink, #412402); transform: translateX(-50%); }
.kg-score-s { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--kg-accent, #BA7517); margin-top: 4px; }
.kg-badge { margin-top: 9px; padding: 6px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 500;
  background: var(--kg-ok, #639922); color: #fff; text-align: center; }
.kg-lvs { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.kg-lv { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px;
  background: var(--kg-bg2, #fff8e8); border: 1px solid var(--kg-border, #EF9F27); }
.kg-lv-no { width: 26px; height: 26px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; background: var(--kg-accent2, #EF9F27); color: #fff; }
.kg-lv-main { flex: 1 1 auto; min-width: 0; }
.kg-lv-t { font-size: 12.5px; font-weight: 500; color: var(--kg-ink, #854F0B); }
.kg-lv-s { font-size: 10.5px; color: var(--kg-accent, #BA7517); margin-top: 1px; }
.kg-lv-st { font-size: 11px; font-weight: 500; flex: none; color: var(--kg-accent, #BA7517); }
.kg-lv.kg-done { border-color: var(--kg-ok, #639922); }
.kg-lv.kg-done .kg-lv-no { background: var(--kg-done, #3B6D11); }
.kg-lv.kg-done .kg-lv-t, .kg-lv.kg-done .kg-lv-s { color: var(--kg-done, #3B6D11); }
.kg-lv.kg-done .kg-lv-st { color: var(--kg-done, #3B6D11); }
.kg-lv.kg-wait { border-color: var(--kg-accent2, #EF9F27); }
.kg-empty { padding: 12px; text-align: center; font-size: 11.5px; color: var(--kg-accent, #BA7517);
  background: var(--kg-bg2, #fff8e8); border-radius: 9px; }
.kg-note { margin-top: 8px; font-size: 10px; color: var(--kg-accent, #BA7517); line-height: 1.5; opacity: .85; }
/* ≥14 岁默认不显示时的那条提示 */
.kg-off { display: flex; align-items: center; gap: 9px; padding: 8px 11px; margin-bottom: 12px;
  border: 1px dashed var(--color-border-tertiary); border-radius: 9px; }
.kg-off-t { font-size: 12px; font-weight: 500; color: var(--color-text-secondary); }
.kg-off-n { font-size: 10.5px; color: var(--color-text-tertiary); flex: 1 1 auto; }

/* ══ 儿童闯关「地图」（2026-10-21 船长：不同问题变成大小关卡，开完处置关卡通过）════ */
.kg-mapbox { margin-top: 10px; padding: 10px 12px 8px; border-radius: 11px;
  background: var(--kg-bg2, #fff8e8); border: 1px solid var(--kg-border, #EF9F27); }
.kg-map { width: 100%; height: auto; display: block; max-height: 320px; }
.kg-node { cursor: pointer; }
.kg-node circle { transition: transform .12s ease; transform-origin: center; }
.kg-node:hover circle { stroke-width: 3.5; }
.kg-maplegend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10px;
  color: var(--kg-accent, #BA7517); margin-top: 6px; }
.kg-maplegend i { display: inline-block; vertical-align: middle; margin-right: 4px; }
.kg-dotbig { width: 13px; height: 13px; border-radius: 50%; background: #E24B4A; }
.kg-dotmid { width: 11px; height: 11px; border-radius: 50%; background: #EF9F27; }
.kg-dotsm  { width: 8px;  height: 8px;  border-radius: 50%; background: #FAC775; }
.kg-dotdone { width: 11px; height: 11px; border-radius: 50%; background: #3B6D11; }
.kg-dotend  { width: 11px; height: 11px; border-radius: 50%; background: transparent; border: 2px dashed #3B6D11; }
.kg-lv.sel { outline: 2px solid #00A0E8; outline-offset: -1px; }

/* 小鲨鱼海洋：平滑卡通地图（2026-10-21 船长「去除像素风」） */
.kg-smooth { background: #B3E5FC; border-color: #6EC6F2; }
.kg-map-smooth { width: 100%; height: auto; display: block; border-radius: 9px; }
.kg-map-smooth .kg-node circle { transition: transform .12s ease; }
.kg-map-smooth .kg-node:hover { transform: translateY(-2px); }
.kg-smooth .kg-maplegend { color: #08315C; }
.kg-tb { transition: transform .15s ease; }
.kg-doctor { animation: kgFloat 2.6s ease-in-out infinite; }
@keyframes kgFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .kg-doctor { animation: none; } }

/* ══ 🆕 2026-10-24 处置记录页（左侧按天时间线 / 右侧处置明细） ══ */
.tr-page { display: flex; flex-direction: column; gap: 10px; }
/* 🆕 2026-11-18 船长：「处置记录默认显示当天本院所有医生开具处置列表，按就诊时间排序」 */
.tr-daybar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-daybar .tr-daycnt { font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.tr-listwrap { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
.tr-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.tr-list thead th { position: sticky; top: 0; z-index: 1; background: #fafcfe; color: #5b6775;
  font-weight: 600; font-size: 12.5px; text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.tr-list tbody td { padding: 9px 10px; border-bottom: 1px solid #f2f5f9; vertical-align: middle; }
.tr-list tbody tr { cursor: pointer; }
.tr-list tbody tr:hover { background: #f7fbff; }
.tr-list td.num, .tr-list th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-list td.tr-litem { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3d4855; }
.tr-list .tr-lmrn { font-style: normal; display: block; font-size: 11px; color: var(--muted); }
.tr-list tfoot td { padding: 10px; background: #fafcfe; font-weight: 600; border-top: 1px solid #eef2f7; }
.tr-list tfoot td.num { font-variant-numeric: tabular-nums; }
.tr-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tr-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.tr-pick { position: relative; width: 320px; max-width: 100%; }
.tr-pick input { width: 100%; }
.tr-pick .pick-hits { position: absolute; z-index: 60; left: 0; right: 0; top: 100%; margin-top: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px; box-shadow: 0 6px 24px rgba(16,30,54,.12);
  max-height: 260px; overflow: auto; }
.tr-pick .pick-hits:empty { display: none; }
.tr-who { margin-left: auto; font-size: 12px; color: var(--muted); }
.tr-who b { color: var(--text); font-weight: 500; }
.tr-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; align-items: start; }
.tr-tl { padding: 8px; max-height: calc(100vh - 220px); overflow: auto; }
.tr-tl-h { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.tr-day { border: 1px solid transparent; border-radius: 8px; margin-bottom: 4px; }
.tr-day.open { border-color: #9FE1CB; background: #F3FBF8; }
.tr-day-h { display: flex; align-items: center; gap: 6px; padding: 6px 7px; font-size: 12px; cursor: pointer; border-radius: 8px; }
.tr-day-h:hover { background: #f2f8f6; }
.tr-day-h b { font-weight: 600; }
.tr-cnt { color: var(--primary); font-size: 11px; }
.tr-sum { margin-left: auto; color: var(--muted); font-size: 11px; }
.tr-car { color: var(--primary); font-size: 10px; }
.tr-item { display: flex; gap: 8px; padding: 6px 8px; cursor: pointer; border-top: 1px solid #eef1f5; }
.tr-item:hover { background: #f7fbfa; }
.tr-item.on { background: #E1F5EE; }
.tr-dot { width: 7px; height: 7px; border-radius: 50%; background: #cfd8e3; margin-top: 5px; flex: none; }
.tr-item.on .tr-dot { background: var(--primary); }
.tr-item-main { min-width: 0; flex: 1; }
.tr-item-t { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-item-s { font-size: 11px; color: var(--muted); margin-top: 1px; }
.tr-item-st { font-size: 11px; margin-top: 2px; }
.tr-item-st.paid { color: #2F7D4F; }
.tr-item-st.today { color: #A86B12; }
.tr-item-st.debt { color: var(--danger); }
.tr-item-st.muted { color: var(--muted); }
.tr-detail .tt-card { max-width: 640px; }
.tr-appt-card { max-width: 640px; }
.tr-dayhead { display: flex; align-items: center; gap: 10px; padding: 4px 2px 8px; font-size: 12px; color: var(--muted); }
.tr-dayhead b { font-size: 14px; font-weight: 600; color: var(--text); }
.tr-dayhead span:last-child { margin-left: auto; }
#trCards .tt-card:last-child { margin-bottom: 0; }
.tr-focus { outline: 2px solid var(--primary); outline-offset: -2px; }
@media (max-width: 900px) {
  .tr-grid { grid-template-columns: 1fr; }
  .tr-tl { max-height: none; }
  .tr-who { margin-left: 0; }
}

/* ══ 🆕 2026-10-24 处置记录重设计：每天大板块，左预约 / 右收费 ══ */
.tr-days { display: flex; flex-direction: column; gap: 10px; }
.tr-bar { display: flex; align-items: center; gap: 8px; }
.tr-bar .tr-count { font-size: 12px; color: var(--muted); }
.tr-bar .tr-btns { margin-left: auto; display: flex; gap: 6px; }
.tr-daypanel { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tr-daypanel.open { border-color: var(--primary); }
.tr-daypanel-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f7f9fc; cursor: pointer; font-size: 12px; }
.tr-daypanel.open .tr-daypanel-h { background: #EAF4FF; }
.tr-daypanel-h b { font-size: 13px; font-weight: 600; }
.tr-daycnt { color: var(--muted); font-size: 11px; }
.tr-doc { font-size: 11px; color: var(--muted); }
.tr-daysum { margin-left: auto; color: var(--muted); font-size: 11px; }
.tr-car { color: var(--primary); font-size: 10px; }
.tr-future { font-size: 10px; color: #A86B12; background: #FDF3E0; border-radius: 4px; padding: 0 5px; }
.tr-daypanel-b { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.tr-col { display: flex; flex-direction: column; }
.tr-col-body { flex: 1; padding: 8px 10px; min-width: 0; }
.tr-col-l { border-right: 1px solid var(--border); }
.tr-col-l .tr-col-body { display: flex; flex-direction: column; justify-content: center; }
.tr-col-h { padding: 5px 10px; background: #fcfdff; border-bottom: 1px solid var(--border); font-size: 10.5px; color: var(--muted); }
.tr-apt { padding: 7px 10px; border-bottom: 1px solid #eef1f5; }
.tr-apt:last-child { border-bottom: 0; }
.tr-apt-t { font-size: 12px; color: var(--text); }
.tr-apt-t b { font-weight: 600; }
.tr-apt-s { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tr-apt-n { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.tr-apt-none .tr-apt-t { color: var(--muted); font-size: 11px; }
.tr-st { font-weight: 500; }
.tr-st.done { color: var(--muted); }
.tr-st.arrived { color: var(--primary); }
.tr-st.wait { color: #A86B12; }
.tr-st.cancel { color: var(--danger); }
.tr-logbtn { margin-top: 4px; border: 0; background: none; color: var(--primary); font-size: 10.5px; cursor: pointer; padding: 0; }
.tr-logbtn:hover { text-decoration: underline; }
.tr-col-r { min-width: 0; }
.tr-tc { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.tr-tc:last-child { margin-bottom: 0; }
.tr-tc-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 9px; background: #f7f9fc; font-size: 10.5px; color: var(--muted); }
.tr-tc-h b { color: var(--text); font-weight: 500; }
.tr-tc-st { border-radius: 4px; padding: 0 5px; font-size: 10px; }
.tr-tc-st.paid { background: #EAF6EE; color: #2F7D4F; }
.tr-tc-st.today { background: #FDF3E0; color: #A86B12; }
.tr-tc-st.debt { background: #FDECEC; color: var(--danger); }
.tr-tc-acts { display: flex; gap: 6px; margin-left: auto; padding: 0; }
.tr-tc-diag { padding: 6px 9px 0; font-size: 11px; color: var(--muted); }
.tr-tc-diag b { color: var(--text); font-weight: 500; }
.tr-tc-items { padding: 0 9px; }
.tr-tc-item { display: grid; grid-template-columns: 46px minmax(110px, 1fr) 78px 40px 86px 78px;
  grid-template-areas: "tooth name price qty list fee" "tooth roles roles roles roles roles";
  gap: 2px 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #eef1f5; font-size: 11px; }
.tr-tc-item:last-child { border-bottom: 0; }
.tr-tc-tooth { grid-area: tooth; display: flex; justify-content: center; }
.tr-tc-name { grid-area: name; font-size: 12px; font-weight: 500; color: var(--text); word-break: break-all; }
.tr-tc-price { grid-area: price; text-align: right; color: var(--muted); }
.tr-tc-qty { grid-area: qty; text-align: right; color: var(--muted); }
.tr-tc-list { grid-area: list; text-align: right; color: var(--muted); }
.tr-tc-list.cut { color: #E24B4A; text-decoration: line-through; }
.tr-tc-fee { grid-area: fee; text-align: right; color: var(--text); font-weight: 500; }
.tr-tc-roles { grid-area: roles; font-size: 10.5px; color: var(--muted); }
/* 🆕 2026-10-24 船长参考「E看牙 处置明细」：处置 | 项目名称 | 单价 | 数量 | 折扣 | 应收金额 | 实收金额 | 欠费金额 | 备注 */
.tr-tc-table { margin: 0 9px; overflow-x: auto; }
.tr-tc-thead, .tr-tc-trow { display: grid; grid-template-columns: 46px minmax(120px, 1fr) 72px 36px 48px 78px 78px 78px 110px; gap: 0 8px; align-items: center; min-width: 720px; }
.tr-tc-thead { background: #EAF4FF; color: var(--muted); font-size: 10.5px; padding: 5px 8px; border-radius: 5px 5px 0 0; }
.tr-tc-thead > span:nth-child(n+3) { text-align: right; }
.tr-tc-thead > span:last-child { text-align: left; }
.tr-tc-trow { padding: 7px 8px; border-bottom: 1px solid #eef1f5; font-size: 11px; }
.tr-tc-trow:last-child { border-bottom: 0; }
.tr-tc-ttooth { display: flex; justify-content: center; }
.tr-tc-tname { font-size: 12px; font-weight: 500; color: var(--text); word-break: break-all; }
.tr-tc-num { text-align: right; color: var(--muted); white-space: nowrap; }
.tr-tc-num.tr-debt { color: var(--danger); }
.tr-tc-note { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-tc-notes { padding: 4px 9px; font-size: 10.5px; color: var(--muted); }
.tr-tc-foot { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 9px; border-top: 1px dashed #e6ebf2; background: #fcfdff; font-size: 11px; color: var(--muted); }
.tr-tc-foot b { color: var(--text); font-weight: 600; }
.tr-tc-debt { margin-left: auto; }
.tr-tc-debt b { color: var(--danger); }
.tr-logs { max-height: 60vh; overflow: auto; }
.tr-log { padding: 7px 0; border-bottom: 1px solid #eef1f5; }
.tr-log:last-child { border-bottom: 0; }
.tr-log-h { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.tr-log-h span { color: var(--muted); font-size: 11px; }
.tr-log-d { font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (max-width: 900px) {
  .tr-daypanel-b { grid-template-columns: 1fr; }
  .tr-col-l { border-right: 0; border-bottom: 1px solid var(--border); }
  .tr-tc-item { grid-template-columns: 40px minmax(80px, 1fr) 64px 32px 70px 64px; }
}

/* ══ 🆕 2026-10-24 处置记录：按天一张卡，左半预约 / 右半处置 ══ */
.tt-days { display: flex; flex-direction: column; gap: 12px; }
.tt-day { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tt-day-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f7f9fc; border-bottom: 1px solid var(--border); font-size: 12px; }
.tt-day-h b { font-size: 13px; font-weight: 600; }
.tt-day-cnt { color: var(--muted); font-size: 11px; }
.tt-day-sum { margin-left: auto; color: var(--muted); font-size: 11px; }
.tt-day-b { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.tt-day-l { border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; padding: 10px 12px; }
/* 🆕 2026-10-24 B 版：左时间轴 */
.tt-tl { position: relative; display: flex; flex-direction: column; gap: 12px; }
.tt-tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: #e3e9f0; }
.tt-tl-i { display: flex; gap: 8px; position: relative; }
.tt-tl-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfe0ee; background: #0C7FC2; flex: none; margin-top: 3px; z-index: 1; }
.tt-tl-dot.treat { background: #E2A33B; }
.tt-tl-dot.paid { background: #24a06e; }
.tt-tl-dot.debt { background: #C0392B; }
.tt-tl-b { flex: 1; min-width: 0; font-size: 11px; }
.tt-tl-t { font-size: 12px; color: var(--text); }
.tt-tl-t b { font-weight: 600; }
.tt-tl-s { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tt-tl-n { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.tt-tl-none { font-size: 11px; color: var(--muted); padding-left: 19px; }
/* 右半：每组处置 + 六列明细 + 列表合计 + 日合计 */
.tt-day-grp { border-bottom: 1px solid #eef1f5; }
.tt-day-grp:last-of-type { border-bottom: 0; }
.tt-day-grp-h { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 11px; color: var(--muted); background: #fcfdff; }
.tt-day-grp-h b { color: var(--text); font-weight: 600; }
.tt-day-badge { border-radius: 4px; padding: 0 5px; font-size: 10px; white-space: nowrap; }
.tt-day-badge.paid { background: #EAF6EE; color: #2F7D4F; }
.tt-day-badge.today { background: #FDF3E0; color: #A86B12; }
.tt-day-badge.debt { background: #FDECEC; color: var(--danger); }
.tt-day-ops { margin-left: auto; display: flex; gap: 4px; }
.tt-day-ops .btn { padding: 2px 8px; font-size: 11px; }
.tt-day-tbl { padding: 0 10px; }
.tt-day-thead, .tt-day-trow { display: grid; grid-template-columns: 108px minmax(0, 1fr) 60px 40px 60px 60px; gap: 0 6px; align-items: center; }
.tt-day-thead { font-size: 10px; color: var(--muted); padding: 3px 0; border-bottom: 1px solid #eef1f5; }
.tt-day-thead span:nth-child(n+3) { text-align: right; }
.tt-day-trow { font-size: 12px; padding: 5px 0; border-bottom: 1px solid #f3f6f9; }
.tt-day-trow:last-child { border-bottom: 0; }
.tt-day-trow span:nth-child(n+3) { text-align: right; }
.tt-day-tooth { font-size: inherit; color: #1f2d3d; }
.tt-day-tooth .tcr { font-size: inherit; letter-spacing: 0; }
.tt-day-noitems { padding: 6px 0; color: var(--muted); font-size: 11px; }
.tt-day-lt { display: flex; gap: 14px; padding: 6px 10px; font-size: 11px; color: var(--muted); border-top: 1px dashed #e6ebf2; background: #fcfdff; }
.tt-day-lt b { color: var(--text); font-weight: 600; }
.tt-day-foot { display: flex; gap: 14px; padding: 6px 10px; font-size: 11px; color: var(--muted); background: #fcfdff; border-top: 1px dashed #e6ebf2; }
.tt-day-foot .debt { margin-left: auto; color: var(--danger); }
.tt-day-foot b { color: var(--text); }
.tt-day-lh, .tt-day-rh { padding: 5px 10px; background: #fcfdff; border-bottom: 1px solid var(--border); font-size: 10.5px; color: var(--muted); }
.tt-apt { padding: 7px 10px; border-bottom: 1px solid #eef1f5; }
.tt-apt:last-child { border-bottom: 0; }
.tt-apt-t { font-size: 12px; color: var(--text); }
.tt-apt-t b { font-weight: 600; }
.tt-apt-s { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tt-apt-n { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.tt-apt-st { font-weight: 500; }
.tt-apt-st.done { color: var(--muted); }
.tt-apt-st.arrived { color: var(--primary); }
.tt-apt-st.wait { color: #A86B12; }
.tt-apt-st.cancel { color: var(--danger); }
.tt-apt-log { margin-top: 4px; border: 0; background: none; color: var(--primary); font-size: 10.5px; cursor: pointer; padding: 0; }
.tt-apt-log:hover { text-decoration: underline; }
.tt-apt-none { padding: 10px; color: var(--muted); font-size: 11px; }
/* 右半沿用旧版处置卡片，但去掉内层卡片边框，让它融进当天大卡 */
.tt-day-r .tt-card { border: 0; border-radius: 0; margin: 0; }
.tt-day-r .tt-card + .tt-card { border-top: 1px solid var(--border); }
.tt-day-r .tt-card .tt-head { background: #fcfdff; }
.tt-logs { max-height: 60vh; overflow: auto; }
.tt-log { padding: 7px 0; border-bottom: 1px solid #eef1f5; }
.tt-log:last-child { border-bottom: 0; }
.tt-log-h { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.tt-log-h span { color: var(--muted); font-size: 11px; }
.tt-log-d { font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (max-width: 900px) {
  .tt-day-b { grid-template-columns: 1fr; }
  .tt-day-l { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* ══ 🆕 2026-10-24 B 版当天卡（treat-day.js）：左栏 128、橙色欠费胶囊、弹窗明细 ══ */
.tt-day-b { grid-template-columns: 168px minmax(0, 1fr); }
.tt-day-h { flex-wrap: nowrap; }
.tt-day-btns { margin-left: auto; display: flex; gap: 5px; flex: none; }
.tt-day-btns .btn { padding: 2px 8px; font-size: 11px; }
.tt-day-l { padding: 8px; }
.tt-tl { gap: 9px; }
.tt-day-foot { display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px; padding: 5px 10px; background: #fcfdff; border-top: 1px dashed #e6ebf2; }
.tt-pill { display: inline-flex; align-items: center; gap: 3px; background: #FFF4E0; border: 1px solid #F0C27A; border-radius: 999px; padding: 2px 9px; font-size: 11px; color: #C0392B; white-space: nowrap; }
.tt-pill[data-debt] { cursor: pointer; }
.tt-pill i { font-style: normal; font-size: 9px; color: #B26A00; }
.tt-payrec { display: inline-flex; flex-direction: column; gap: 1px; font-size: 11px; color: #0C7FC2; line-height: 1.5; }
.tt-collect { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 5px 10px; font-size: 11px; border-bottom: 1px solid #f3f6f9; background: #fffaf0; }
.tt-collect b { color: var(--text); }
.tt-collect-m { margin-left: auto; color: #0C7FC2; }
.tt-dlg { max-height: 66vh; overflow: auto; }
.tt-dlg-sum { display: flex; gap: 18px; padding: 7px 10px; background: #FFF8EE; border: 1px solid #F0D8AC; border-radius: 7px; font-size: 12px; margin: 4px 0 10px; }
.tt-dlg-h { font-size: 12px; font-weight: 600; margin: 8px 0 4px; }
.tt-dlg-box { border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.tt-dlg-grp { border-bottom: 1px solid #eef1f5; }
.tt-dlg-grp:last-child { border-bottom: 0; }
.tt-dlg-gh { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #f8fafc; font-size: 11px; }
.tt-dlg-gh span { margin-left: auto; color: var(--muted); }
.tt-dlg-r { display: grid; grid-template-columns: minmax(0, 1fr) 76px 52px 72px; gap: 4px; align-items: center; padding: 4px 8px; font-size: 12px; border-top: 1px solid #f3f6f9; }
.tt-dlg-r span:nth-child(n+2) { text-align: right; }
.tt-dlg-r button { justify-self: end; }

/* 🆕 2026-10-24 概览条 + 已收费锁定 */
.tt-sumstrip { border: 1px solid var(--border); border-radius: 9px; background: #fff; padding: 8px; margin-bottom: 10px; }
.tt-sumcards { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.tt-sumc { border: 1px solid #eef2f7; border-radius: 6px; padding: 4px 6px; background: #fbfcfe; }
.tt-suml { font-size: 8px; color: var(--muted); }
.tt-sumv { font-size: 14px; font-weight: 600; line-height: 1.3; }
.tt-sums { font-size: 7px; color: var(--muted); }
.c-red { color: #C0392B; } .c-amber { color: #B26A00; } .c-purple { color: #7E57C2; }
.c-teal { color: #2E86BE; } .c-blue { color: #0C7FC2; } .c-indigo { color: #6C63B5; } .c-cyan { color: #1996A8; }
.tt-sumbtns { display: flex; justify-content: flex-end; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.tt-locked { pointer-events: none; opacity: .62; }
.tt-lock-tip { background: #FFF4E0; border: 1px solid #F0C27A; border-radius: 6px; padding: 5px 9px; font-size: 12px; color: #A86B12; margin-bottom: 6px; }

/* 🆕 2026-10-24 概览条放大 + 修改预约入口 */
.tt-suml { font-size: 10px; }
.tt-sumv { font-size: 19px; }
.tt-sums { font-size: 9px; }
.tt-sumc { padding: 6px 8px; }
.tt-apt-edit { border: 0; background: none; color: var(--primary); font-size: 10.5px; cursor: pointer; padding: 0; margin-right: 8px; }

/* 概览条数字彩色（强制生效，避免被基础色盖掉） */
.tt-sumv.c-red { color: #C0392B !important; }
.tt-sumv.c-amber { color: #B26A00 !important; }
.tt-sumv.c-purple { color: #7E57C2 !important; }
.tt-sumv.c-teal { color: #2E86BE !important; }
.tt-sumv.c-blue { color: #0C7FC2 !important; }
.tt-sumv.c-indigo { color: #6C63B5 !important; }
.tt-sumv.c-cyan { color: #1996A8 !important; }

/* 2026-10-25 分割线右移（左栏 200）+ 右侧处置明细紧凑 */
.tt-day-b { grid-template-columns: 200px minmax(0, 1fr); }
.tt-day-thead, .tt-day-trow { padding: 2px 0; }
.tt-day-grp-h { padding: 4px 10px; }
.tt-day-lt { padding: 4px 10px; }
.tt-day-foot { padding: 4px 10px; }
.tt-day-noitems { padding: 4px 0; }

/* 2026-10-25 收欠费内联收款（不再弹第二个窗） */
.tt-dlg-owe { border-top: 1px solid #f3f6f9; padding: 4px 0; }
.tt-dlg-owe:first-child { border-top: 0; }
.tt-dlg-pay { display: block; padding: 4px 8px 6px; }
/* 🆕 2026-10-31 组合收费：一张单可拆多行（方式 + 金额），所以这里从「一行 flex」改成「块 + 行列表」 */
.tt-pay-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.tt-dlg-pay-m { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
.tt-pm { border: 0.5px solid var(--border); border-radius: 5px; background: #fff; font-size: 11px; padding: 2px 8px; cursor: pointer; color: var(--muted); }
.tt-pm.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.tt-dlg-pay-amt { width: 96px; text-align: right; border: 0.5px solid var(--border); border-radius: 5px; padding: 2px 6px; font-size: 12px; }
.tt-pay-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; }
.tt-pay-del:hover { color: var(--danger); }
.tt-pay-add { font-size: 11.5px; color: var(--primary); cursor: pointer; padding: 2px 0 8px; user-select: none; }
.tt-pay-foot { display: flex; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--border); }
.tt-pay-sum { font-size: 12px; color: var(--muted); flex: 1; }
.tt-pay-sum b { color: var(--text); font-size: 13px; }

/* ── 操作日志时间轴（预约日志 / 病历操作记录 共用）────────────────────
   船长 2026-10-26 定稿：顶部蓝框给结论，下面时间轴由下向上；
   主标题=状态怎么变，副标题=谁+哪天，正文=精确时间+其余字段。 */
.oplog-tl { position: relative; padding-left: 24px; max-height: 56vh; overflow: auto; }
.oplog-tl::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1.5px; background: #e5e9f0; }
.oplog-it { position: relative; padding-bottom: 16px; }
.oplog-dot { position: absolute; left: -24px; top: 5px; width: 9px; height: 9px; margin-left: 2px; border-radius: 50%; background: #B4B2A9; }
.oplog-dot.now { outline: 3px solid #eef1f6; }
.oplog-dot.ok { background: #1D9E75; }
.oplog-dot.info { background: #378ADD; }
.oplog-dot.warn { background: #EF9F27; }
.oplog-dot.purple { background: #7F77DD; }
.oplog-main { display: block; font-size: 14px; font-weight: 500; color: #5F5E5A; line-height: 1.45; }
.oplog-main.ok { color: #0F6E56; }
.oplog-main.info { color: #185FA5; }
.oplog-main.warn { color: #854F0B; }
.oplog-main.purple { color: #534AB7; }
.oplog-sub { font-size: 12px; color: #6b7a90; margin-top: 2px; }
.oplog-body { font-size: 12px; color: #98a2b3; margin-top: 2px; word-break: break-all; }
.oplog-foot { margin-top: 2px; padding-top: 8px; border-top: 1px dashed #e5e9f0; font-size: 11px; color: #98a2b3; }
/* 🆕 2026-11-05 操作记录：字段 / 原状态 / 操作后 三列对照
   船长：「左边是医生操作的原始状态，右边是医生操作后的状态，要完整展示」
   ⇒ 不再把「旧 → 新」挤成一行、也不再只列前 6 项。 */
.oplog-chg { margin-top: 6px; border: 1px solid #e9eef5; border-radius: 8px; overflow: hidden; background: #fcfdff; }
.oplog-chg-h, .oplog-chg-r { display: grid; grid-template-columns: 82px minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; padding: 6px 10px; font-size: 12px; align-items: start; }
.oplog-chg-h { background: #f5f8fc; color: #6b7a90; font-size: 11px; padding: 5px 10px; }
.oplog-chg-r { border-top: 1px solid #eef2f8; }
.oplog-chg-r .c-k { color: #6b7a90; }
/* 旧值用浅灰 + 删除线（一眼看出"被改掉的"），新值正常深色 */
.oplog-chg-r .c-b { color: #98a2b3; text-decoration: line-through; text-decoration-color: #e0a5a0; word-break: break-all; }
.oplog-chg-r .c-a { color: #2C2C2A; word-break: break-all; }
.oplog-chg-r .c-nil { color: #c4c9d2; font-style: normal; text-decoration: none; }
.oplog-sub .oplog-at { margin-left: 10px; color: #98a2b3; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  /* 窄屏三列会被挤成竖排（字段名一行、旧值一行、新值一行）⇒ 改成一行文本流：
     「字段　旧值 → 新值」，长文本自然换行，读起来还是"左旧右新" */
  .oplog-chg-h { display: none; }
  .oplog-chg-r { display: block; padding: 6px 10px; line-height: 1.5; }
  .oplog-chg-r .c-k { display: inline-block; min-width: 56px; color: #6b7a90; font-size: 11px; vertical-align: top; }
  .oplog-chg-r .c-b { display: inline; }
  .oplog-chg-r .c-b:not(:empty)::after { content: ' → '; color: #c4c9d2; text-decoration: none; display: inline-block; }
  .oplog-chg-r .c-a { display: inline; }
}

/* ================= 手机端真排版（2026-10-29 船长开工）=================
   背景：之前 index.html 把窄屏视口钉成 1280px，手机上看到的是「桌面版缩小」，
   下面这些窄屏规则全都不生效。现在钉视口那段已删，这段开始真正接管手机排版。
   规则：本段必须留在文件最末尾（媒体查询不提升优先级，靠后定义才盖得住前面）。 */
@media (max-width: 760px) {
  /* ── 患者页：筛选收进「筛选」按钮，首屏只留搜索 ── */
  .pat-filters { gap: 8px; }
  .pat-filters > .pf-lb,
  .pat-filters > #patScope,
  .pat-filters > #patDoctor,
  .pat-filters > #patFirst,
  .pat-filters > #patImport { display: none; }
  .pat-filters.pf-open > .pf-lb,
  .pat-filters.pf-open > #patScope,
  .pat-filters.pf-open > #patDoctor,
  .pat-filters.pf-open > #patFirst,
  .pat-filters.pf-open > #patImport { display: block; }
  .pat-filters.pf-open > .pf-lb { align-self: center; font-size: 12px; color: #7b8794; }
  .pat-filters.pf-open > #patImport { width: 100%; }
  /* 排布：第 1 行＝字段＋搜索＋「更多条件」，第 2 行＝展开后的筛选项，最后才是「新建档案」 */
  #patField { order: 0; flex: 0 0 92px; min-width: 0; }
  .pat-search { order: 0; flex: 1 1 auto; width: auto; min-width: 0; }
  .pf-toggle { order: 1; display: inline-flex; align-items: center; flex: 0 0 auto; font-size: 12.5px; padding: 6px 10px; }
  .pat-filters.pf-open > .pf-lb,
  .pat-filters.pf-open > #patScope,
  .pat-filters.pf-open > #patDoctor,
  .pat-filters.pf-open > #patFirst,
  .pat-filters.pf-open > #patImport { order: 2; }
  .pat-filters > #patNew { order: 9; flex: 0 0 auto; }
  .pat-actions { gap: 8px; padding: 8px 0 4px; }
  .pat-actions .btn { flex: 0 0 auto; font-size: 12.5px; padding: 5px 12px; }
  .pat-tabs { gap: 18px; }

  /* ── 患者页：左右分栏 → 上下堆叠（分类变顶部横排小胶囊）── */
  .pat-body { flex-direction: column; gap: 10px; }
  .pat-cats { width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .pat-cats .cat { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; gap: 6px; }
  .pat-cats .cat.active { border-color: var(--primary); }
  .pat-cats > div[style] { border-top: 0 !important; margin-top: 0 !important; padding: 0 !important; font-size: 12px; }
  .pat-table-wrap { overflow-x: visible; }

  /* ── 患者名单：表格 → 紧凑列表（船长选定「一行一人」）── */
  .pat-tbl thead { display: none; }
  .pat-tbl { display: block; min-width: 0 !important; }
  .pat-tbl tbody { display: block; }
  .pat-tbl tr {
    display: flex; flex-wrap: wrap; align-items: center;
    padding: 9px 12px; border-bottom: 1px solid #eef2f6;
  }
  .pat-tbl tr:last-child { border-bottom: 0; }
  .pat-tbl td { display: block; border: 0; padding: 0; white-space: normal; }
  /* 第一行：头像 + 姓名 + 昵称 */
  .pat-tbl td.pat-name { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; font-size: 15px; }
  .pat-tbl td.pat-name b { font-size: 15px; font-weight: 600; }
  .pat-tbl .pat-av { margin-right: 0; vertical-align: 0; }
  .pat-tbl td.pat-set-td { display: none; }
  /* 第二行：可见列（性别 / 年龄 / 手机 / 主治…）小字并排 */
  .pat-tbl td:not(.pat-name):not(.pat-ops):not(.pat-set-td) {
    flex: 0 0 auto; font-size: 12px; color: #7b8794; margin-right: 10px;
  }
  /* 第三行：操作（字号收小，一行放得下） */
  .pat-tbl td.pat-ops { flex: 1 1 100%; display: flex; gap: 12px; margin-top: 4px; }
  .pat-tbl td.pat-ops a { font-size: 12.5px; }
  .pat-sortbar { display: none; }
  .pat-count { padding: 10px 12px; font-size: 12px; }

  /* ── 页面顶部筛选区：手机上控件一律整行，别挤在半屏 ── */
  .page-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .page-head h2 { font-size: 18px; }
  .page-head .toolbar { flex-wrap: wrap; gap: 8px; }
  .page-head .toolbar > input,
  .page-head .toolbar > select { flex: 1 1 46%; width: auto !important; min-width: 0; }
  .page-head .toolbar > .btn { flex: 0 0 auto; }

  /* ── 影像资料：日期/类型/关键字 收进「筛选」胶囊，首屏只留搜索 ── */
  .page-head .toolbar > #imgDate,
  .page-head .toolbar > #imgCat,
  .page-head .toolbar > #imgKw { display: none; }
  .page-head .toolbar.mopen > #imgDate,
  .page-head .toolbar.mopen > #imgCat,
  .page-head .toolbar.mopen > #imgKw { display: block; flex: 1 1 46%; width: auto !important; }
  .img-mfilter { display: inline-flex; align-items: center; font-size: 12.5px; padding: 6px 10px; }
  #imgPat { flex: 1 1 100% !important; width: auto !important; }
  #imgSearch { flex: 0 0 auto; }

  /* 分组卡（CT/口扫）整行 + 图左文右，否则 3 列窄格塞不下「18.9MB + 三维查看」 */
  .img-cell.is-groupcell { grid-column: 1 / -1; }
  .img-cell.is-groupcell .img-item { display: flex; align-items: stretch; }
  .img-cell.is-groupcell .grp-thumb { width: 104px; flex: none; height: auto; min-height: 86px; }
  .img-cell.is-groupcell .img-item .meta { flex: 1; min-width: 0; }
  .img-cell.is-groupcell .grp-act { margin-top: 6px; }
  .img-cell.is-groupcell .grp-act .btn { width: 100%; }
  /* 整行后图只有 104px：图上那行「5 个文件 · 18.9MB」压不下，右侧已经显示大小了，收掉 */
  .img-cell.is-groupcell .grp-n { display: none; }
  .img-cell.is-groupcell .grp-thumb { display: flex; align-items: flex-end; }
  /* 窄格里 3~4 行文字太挤：上传时间收起来（大小保留），拍摄日期才是关键 */
  .img-cell .meta .time.up .up-time { display: none; }
  .img-cell .meta .time.up { margin-top: 1px; }
  .img-cell .meta .time.shot { font-size: 11.5px; }

  /* ── 影像资料：3 列缩略图 ── */
  .img-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px !important; }
  .img-item img, .img-cell > img { height: 86px; }
  .img-item .meta, .img-cell .meta { padding: 5px 6px; font-size: 11px; }
  .img-item .meta .cat, .img-cell .meta .cat { font-size: 11.5px; }
  .img-cell .meta .time.up, .img-item .meta .time { font-size: 10.5px; }
  /* 卡片上的「三维查看 / 查看 CT」按钮在窄格里会撑破，收成小一号 */
  .img-item .grp-act .btn { padding: 3px 6px; font-size: 11px; }

  /* ── 预约页：手机端（默认走「列表」视图）── */
  /* 年月选择器是给日/周/月看板翻页用的，列表视图按区间查，用不上 ⇒ 收掉省 40px */
  .apt-mode .apd-ym { display: none; }
  /* 日期区间：两个框并排，别各占 150px 撑成两行 */
  #aptLFrom, #aptLTo { flex: 1 1 0 !important; width: auto !important; min-width: 0; }
  .apt-mode .toolbar > .muted-line:first-child { display: none; }
  /* 快捷按钮（全部历史 / 近 7 天 / 近 30 天 / 今年）一行横滑，不换行 */
  .apt-mode .toolbar { flex-wrap: wrap; gap: 6px; }
  .apt-mode .toolbar > .btn { flex: 0 0 auto; font-size: 12px; padding: 5px 9px; }
  /* 列表表格：五列在 390px 下偏挤，字号收一档、手机号允许折行 */
  .apt-mode table.tbl { font-size: 12.5px; }
  .apt-mode table.tbl th, .apt-mode table.tbl td { padding: 8px 6px; }

  /* ── 患者详情：手机端两屏切换（名单 / 详情），不再左右挤成一列竖排 ── */
  .pd-wrap { height: calc(100vh - 132px); border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
  .pd-rail { width: 100%; flex: 1 1 auto; border-right: 0; }
  .pd-main { display: none; }
  .pd-wrap.has-sel .pd-rail { display: none; }
  .pd-wrap.has-sel .pd-main { display: flex; flex: 1 1 auto; }
  .pd-mback { display: inline-flex; align-items: center; gap: 4px; margin: 8px 12px 0; padding: 5px 10px;
    border: 1px solid var(--border); background: #fff; border-radius: 8px; font-size: 12.5px; color: #5b6773; }
  /* 🔴 实测：头像 62 + 右侧操作区 200 ⇒ 中间只剩 48px，姓名与资料全被挤成竖排（一字一行）。
     手机上把操作区挪到第二行，中间那块独占整行。 */
  .pd-head { padding: 10px 14px 8px; flex-wrap: wrap; row-gap: 8px; }
  .pd-head-mid { flex: 1 1 0; min-width: 0; }   /* basis 0：跟头像同一行，按剩余宽分配 */
  .pd-head-ops { flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .pd-name { font-size: 16px; }
  .pd-head-kv { font-size: 12.5px; gap: 4px 14px; }
  .pd-head-kv > span { white-space: nowrap; }
  .pd-body { padding: 12px 14px 16px; }
  /* 基本信息原来是两列（每列 159px）⇒ 病历号/手机号被切成两行；手机上一个字段占一整行。
     🔴 别写成 `84px minmax(0,1fr)`：`.pd-f` 自己就是「76px 标签 + 1fr 值」的两列，
        外层再给 84px 等于把**整个字段**塞进 84px ⇒ 值宽 0、姓名/病历号/手机号一字一行（实测 760px 复现）。
        标签与值的分配交给 `.pd-f` 自己做。 */
  .pd-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 9px; font-size: 12.5px; }
  .pd-grid > * { min-width: 0; }
  .pd-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .pd-tabs > * { flex: none; white-space: nowrap; }

  /* ── 患者抽屉：页签名横向滚动，不换行 ── */
  .drawer .d-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .drawer .d-tabs > * { flex: none; white-space: nowrap; }
}

/* ================= 手机端三页：今日 / 工作台 / 我的（2026-10-29）=================
   只在手机端用；桌面端进不到这三个页面（底部标签栏仅 ≤760px 出现）。
   触控目标一律 ≥44px，正文 ≥12px。 */
.nh-page { padding: 12px 12px 18px; }
.nh-hello { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 4px 2px 12px; }
.nh-hello b { display: block; font-size: 17px; font-weight: 600; color: var(--text); }
.nh-hello span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.nh-refresh { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: #6b7787; font-size: 16px; }

/* 三个数字卡 */
.nh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nh-stat { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px; text-align: center; }
/* 🆕 2026-10-29 船长：三个数字可点（预约/到店/待收费）⇒ 可点状态给手感，别让人以为只是数字 */
.nh-stat[data-go] { cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.nh-stat[data-go]:active { transform: scale(.97); border-color: var(--primary); }
.nh-stat span { display: block; font-size: 12px; color: var(--muted); }
.nh-stat b { display: block; margin-top: 4px; font-size: 20px; font-weight: 600; color: var(--text); }
.nh-stat:nth-child(1) b { color: var(--primary); }
.nh-stat:nth-child(2) b { color: #1D9E75; }
.nh-stat:nth-child(3) b { color: #BA7517; }

/* 分块 */
.nh-sec { margin-top: 14px; }
.nh-sec-h { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px; }
.nh-sec-h b { font-size: 14px; font-weight: 600; color: var(--text); }
.nh-sec-h .lnk { font-size: 12px; color: var(--primary); }

/* 今日日程时间轴 */
.nh-tl { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.nh-item { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-bottom: 1px solid #f0f3f5; }
.nh-item:last-child { border-bottom: 0; }
.nh-item:active { background: #f7fafc; }
.nh-time { flex: 0 0 42px; font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.nh-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #cfd8e2; }
.nh-item.live .nh-dot { background: #1D9E75; box-shadow: 0 0 0 3px rgba(29,158,117,.14); }
.nh-item.done .nh-dot { background: #b7c1cd; }
.nh-body { flex: 1; min-width: 0; }
.nh-name { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nh-name em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 6px; }
.nh-sub { margin-top: 2px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nh-tag { flex: none; font-size: 11px; padding: 2px 7px; border-radius: 9px; background: #f1f3f5; color: #7b8794; }
.nh-tag.live { background: rgba(29,158,117,.12); color: #0F6E56; }
.nh-tag.done { background: #eef1f5; color: #6b7787; }
.nh-more { padding: 10px 12px; text-align: center; font-size: 12px; color: var(--primary); border-top: 1px solid #f0f3f5; }

/* 待办 */
.nh-todo { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.nh-todo-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 12px; border-bottom: 1px solid #f0f3f5; font-size: 13.5px; color: var(--text); }
.nh-todo-row:last-child { border-bottom: 0; }
.nh-todo-row b { font-size: 14px; color: #BA7517; }
.nh-none { padding: 18px 12px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* 工作台九宫格 */
.nh-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 8px; }
.nh-cell { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px; background: transparent; border: 0; border-radius: 10px; font-size: 12px; color: #3d4b5c; line-height: 1.2; }
.nh-cell:active { background: #f2f7fc; }
.nh-cell i { font-style: normal; font-size: 21px; line-height: 1; }
/* 🆕 2026-11-03 宫格图标改线条 SVG：原 emoji 是 21px 字，SVG 要显式尺寸 */
.nh-cell > svg { width: 23px; height: 23px; flex: none; color: #3d4b5c; }

/* 我的 */
.nh-me-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.nh-me-av { width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; }
.nh-me-info b { display: block; font-size: 16px; font-weight: 600; }
.nh-me-info span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.nh-list { margin-top: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.nh-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 14px; min-height: 48px; background: transparent; border: 0; border-bottom: 1px solid #f0f3f5; font-size: 14px; color: var(--text); text-align: left; }
.nh-row:last-child { border-bottom: 0; }
.nh-row:active { background: #f7fafc; }
.nh-row em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.nh-out { width: 100%; margin-top: 16px; padding: 13px; border-radius: 12px; border: 1px solid #f0d0d0; background: #fff; color: #B4443B; font-size: 14.5px; }
.nh-foot { margin-top: 18px; text-align: center; font-size: 11.5px; color: #a8b1bb; }
@media (max-width: 760px) {
  /* 底部标签栏 ~56px + 安全区：不留够的话「退出登录」会被压住一半 */
  .nh-page { padding-bottom: 76px; }
  .nh-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ================= 手机端预约页（2026-10-29 船长定版式「乙」）=================
   只在 ≤760px 出现（.aptm 由 appointments.js 的 aptMShell() 生成，桌面端不渲染这块）。
   版式：分院胶囊 → 日期条 → 医生/状态两个胶囊 → 卡片列表 → 右下「+」。
   🔴 本段必须在文件最末尾：媒体查询与同名类都靠后定义才盖得住。 */
.aptm { padding: 8px 12px 90px; }
.aptm-hd { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 10px; }
.aptm-clinic { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1px solid #1D9E75;
  background: #E1F5EE; color: #0F6E56; border-radius: 9px; font-size: 13px; }
.aptm-clinic i { font-style: normal; font-size: 10px; opacity: .7; }
.aptm-n { font-size: 12px; color: var(--muted); }

.aptm-date { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 0 12px; }
.aptm-date b { font-size: 17px; font-weight: 600; color: var(--text); }
.aptm-date span { font-size: 12px; color: var(--muted); }
.aptm-date button { width: 30px; height: 30px; border: 1px solid var(--border); background: #fff;
  border-radius: 9px; color: #5b6773; font-size: 15px; line-height: 1; }
.aptm-date .aptm-today { width: auto; padding: 0 10px; font-size: 12px; color: #0F6E56; border-color: #9FE1CB; }

.aptm-chips { display: flex; gap: 8px; padding: 0 0 10px; }
.aptm-chip { padding: 7px 12px; border: 1px solid var(--border); background: #fff; border-radius: 999px;
  font-size: 12.5px; color: #5b6773; }
.aptm-chip.on { background: #1D9E75; border-color: #1D9E75; color: #fff; }

.aptm-list { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.aptm-row { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid #f2f5f8; }
.aptm-row:last-child { border-bottom: 0; }
.aptm-row:active { background: #f6fafc; }
.aptm-tm { flex: 0 0 44px; font-size: 13.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.aptm-bd { flex: 1; min-width: 0; }
.aptm-nm { font-size: 14.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aptm-nm em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.aptm-mt { margin-top: 2px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aptm-st { flex: none; font-size: 11px; padding: 3px 8px; border-radius: 9px; }
.aptm-empty { padding: 34px 12px; text-align: center; font-size: 12.5px; color: var(--muted); }

.aptm-fab { position: fixed; right: 16px; bottom: 82px; width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: #1D9E75; color: #fff; font-size: 26px; line-height: 1; z-index: 60;
  box-shadow: 0 6px 16px rgba(29,158,117,.34); }

/* 底部抽屉 */
.aptm-sheet-wrap { position: fixed; inset: 0; z-index: 1200; }
.aptm-sheet-mask { position: absolute; inset: 0; background: rgba(20,30,40,.34); }
.aptm-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 16px 16px 0 0;
  padding: 12px 0 16px; max-height: 76vh; overflow: auto; animation: aptmUp .18s ease-out; }
@keyframes aptmUp { from { transform: translateY(20px); opacity: .55; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .aptm-sheet { animation: none; } }
.aptm-sh-h { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 10px; }
.aptm-sh-h b { font-size: 14px; font-weight: 600; }
.aptm-sh-h span { font-size: 12.5px; color: #1D9E75; }
.aptm-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; border-top: 1px solid #f4f7f9; font-size: 13.5px; color: var(--text); }
.aptm-opt:active { background: #f7fafc; }
.aptm-opt.on { background: #E1F5EE; color: #0F6E56; font-weight: 600; }
.aptm-opt em { font-style: normal; font-size: 12px; color: var(--muted); }

/* 预约详情 */
.aptm-det-h { padding: 4px 16px 12px; border-bottom: 1px solid #f0f3f5; }
.aptm-det-h .n { font-size: 17px; font-weight: 600; }
.aptm-det-h .n em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.aptm-det-h .t { margin-top: 3px; font-size: 12.5px; color: #6b7787; }
.aptm-kv { display: flex; gap: 10px; padding: 10px 16px; font-size: 13px; border-bottom: 1px solid #f7f9fb; }
.aptm-kv i { font-style: normal; width: 52px; flex: none; color: var(--muted); }
.aptm-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px 4px; }
.aptm-act { text-align: center; padding: 11px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; color: #3d4b5c; background: #fff; }
.aptm-act.pri { background: #1D9E75; border-color: #1D9E75; color: #fff; font-weight: 600; }
.aptm-act.danger { border-color: #f0d0d0; color: #B4443B; }
.aptm-act.open { border-color: #B5D4F4; color: #185FA5; }
.aptm-act-wrap { padding: 4px 16px 10px; }
.aptm-act-wrap .aptm-act { width: 100%; }
/* 医生抽屉：今天有排班但 0 位预约的医生 —— 保留可见（前台要看谁在岗），标「空闲」且不可点 */
.aptm-opt.off { color: #a8b1bb; }
.aptm-opt.off em { color: #a8b1bb; }

/* ================= 手机端工作台（2026-10-29 船长定版式「甲」）=================
   常用（按岗位预设 4 个）→ 就诊/经营/后勤 分组九宫格；顶部搜索一次搜功能与患者。
   角标：收费台账＝待收费笔数、医疗质控＝未完成数。 */
.nh-srch { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; background: #fff; color: var(--text); }
.nh-srch::placeholder { color: #b4bfca; }
.nh-srch:focus { outline: none; border-color: #9FE1CB; }
.nh-res { margin-top: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.nh-res-h { padding: 8px 12px 4px; font-size: 11px; color: var(--muted); }
.nh-res-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px;
  border: 0; border-top: 1px solid #f4f7f9; background: #fff; font-size: 13px; color: var(--text); text-align: left; }
.nh-res-row:active { background: #f7fafc; }
.nh-res-row i { font-style: normal; width: 20px; text-align: center; }
.nh-res-row > svg { width: 19px; height: 19px; flex: none; color: #5a6675; }
.nh-res-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nh-res-row em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.nh-hint { font-size: 11.5px; color: var(--muted); }
.nh-cell { position: relative; }
.nh-badge { position: absolute; top: 1px; right: calc(50% - 24px); min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: #E24B4A; color: #fff; font-size: 10px; line-height: 16px; text-align: center; }

/* ================= 手机端「我的」（2026-10-29 船长定版式「甲」+ 三个数字）=================
   账号卡 → 本月预约/已接诊/待办 → 账号 / 使用 / 关于 三组 → 退出登录。 */
.nh-me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.nh-me-st { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 4px; text-align: center; }
.nh-me-st span { display: block; font-size: 11px; color: var(--muted); }
.nh-me-st b { display: block; margin-top: 3px; font-size: 18px; font-weight: 600; color: #0F6E56; }
.nh-sec-h2 { margin: 14px 2px 6px; font-size: 11.5px; color: var(--muted); }
.nh-list { margin-top: 0; }

/* ================= 手机端「查看流水」（2026-10-29 船长：折线图 + 点某天看当天）=================
   今天＝不放折线（只有一天没意义），直接收款方式 + 逐笔；本周/本月＝按天折线，点圆点就地展开。 */
.fl-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; }
.fl-back { border: 1px solid var(--border); background: #fff; border-radius: 9px; padding: 6px 10px; font-size: 12.5px; color: #5b6773; }
.fl-scope { border: 1px solid #9FE1CB; background: #E1F5EE; color: #0F6E56; border-radius: 9px; padding: 6px 10px; font-size: 12.5px; }
.fl-scope.off { border-color: var(--border); background: #fff; color: #98a3af; }
.fl-seg { display: flex; background: #e9eef2; border-radius: 9px; padding: 3px; margin-bottom: 8px; }
.fl-seg span { flex: 1; text-align: center; font-size: 12.5px; padding: 7px 0; color: #5b6773; border-radius: 7px; }
.fl-seg span.on { background: #fff; color: #0F6E56; font-weight: 600; }
.fl-range { font-size: 11.5px; color: var(--muted); padding: 0 2px 8px; }
.fl-chart { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 8px 2px; margin-bottom: 10px; }
.fl-chart-h { display: flex; justify-content: space-between; padding: 0 4px 6px; font-size: 11.5px; color: var(--muted); }
.fl-chart svg { display: block; width: 100%; }
.fl-chart-x { position: relative; height: 16px; }
.fl-xl { position: relative; height: 16px; }
.fl-xl span { position: absolute; transform: translateX(-50%); font-size: 10px; color: #98a3af; white-space: nowrap; }
.fl-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.fl-card-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; font-size: 11.5px; color: var(--muted); }
.fl-card-h b { color: var(--text); font-size: 13.5px; }
.fl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid #f4f7f9; }
.fl-card-h + .fl-row { border-top: 0; }
.fl-row .l { min-width: 0; }
.fl-row .l b { font-size: 13px; }
.fl-row .l span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-row .r { text-align: right; flex: none; }
.fl-row .r b { font-size: 13px; color: #0F6E56; }
.fl-row .r span { display: block; font-size: 10.5px; color: var(--muted); }
.fl-day-sum { display: flex; gap: 14px; padding: 2px 12px 8px; font-size: 11.5px; color: var(--muted); }
.fl-day-sum b { color: var(--text); font-size: 13px; font-weight: 600; }
.fl-more { display: block; width: calc(100% - 24px); margin: 0 12px 12px; padding: 10px; border: 1px solid #B5D4F4;
  background: #fff; color: #185FA5; border-radius: 10px; font-size: 12.5px; }
.fl-more.in { width: 100%; margin: 0; border: 0; border-top: 1px solid #f4f7f9; border-radius: 0; color: #1D9E75; }
.nh-sheet-wrap { position: fixed; inset: 0; z-index: 1200; }
.nh-sheet-mask { position: absolute; inset: 0; background: rgba(20,30,40,.34); }
.nh-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 16px 16px 0 0;
  padding: 12px 0 18px; max-height: 76vh; overflow: auto; }
.nh-sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 8px; }
.nh-sheet-h b { font-size: 14px; }
.nh-sheet-h span { font-size: 12.5px; color: #1D9E75; }
.nh-sheet-sub { padding: 0 16px 8px; font-size: 11.5px; color: var(--muted); }

/* ================= 手机端体检修复（2026-10-29）================= */
/* 二级页统一「‹ 上级」：只在手机端出现，桌面端不占位 */
.m-back { display: none; }
@media (max-width: 760px) {
  .m-back { display: inline-flex; align-items: center; gap: 4px; margin: 8px 12px 2px; padding: 6px 10px;
    border: 1px solid var(--border); background: #fff; border-radius: 9px; font-size: 12.5px; color: #5b6773; }
  /* 患者详情页签：只留 5 个常用 + 「更多」，一行放得下 */
  .pd-tabs { gap: 14px; }
  .pd-tabs .pd-more { flex: none; align-self: center; padding: 3px 8px; border: 1px solid var(--border);
    background: #fff; border-radius: 8px; font-size: 11.5px; color: #5b6773; }
  .pd-mlist { display: flex; flex-direction: column; }
  .pd-mlist .nh-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px;
    border: 0; border-bottom: 1px solid #f2f5f8; background: transparent; font-size: 13.5px; color: var(--text); }
  .pd-mlist .nh-row em { font-style: normal; font-size: 11.5px; color: var(--muted); }
}

/* 🆕 2026-10-31 处置收费弹窗在窄屏竖排：左栏「收费项目列表」占满一行（列表限高 220 可滚），
   右侧表单落到下面。原来左栏固定 232px + 右侧 10 列表格 ⇒ 手机上一整块横向溢出 1200+ px。 */
@media (max-width: 820px) {
  .ttf-wrap { flex-direction: column; gap: 10px; }
  .ttf-tree { width: 100%; }
  .ttf-tree .pay-tree-list { max-height: 220px; }
}

/* 🆕 2026-11-02 系统设置 → 🗄️ 主数据库（仅 admin 可见）
   🔴 radio/checkbox 必须显式 flex:none;width:14px —— 全局 input{width:100%} 会把单选框拉成整行。 */
.dl-stat .dl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dl-k { font-size: 11px; color: var(--muted); }
.dl-v { font-size: 14px; font-weight: 500; margin-top: 2px; }
.dl-v.dl-ok, .dl-hint.dl-ok { color: #0F6E56; }
.dl-v.dl-bad, .dl-hint.dl-bad { color: #C0392B; }
.dl-live { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); word-break: break-all; }
.dl-live code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; background: #f4f6fa; padding: 1px 6px; border-radius: 4px; }
.dl-reason { margin-top: 6px; font-size: 12px; color: var(--muted); }
.dl-modes { display: flex; flex-direction: column; gap: 0; margin-bottom: 10px; }
.dl-mode { display: flex; gap: 8px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.dl-mode:last-child { border-bottom: 0; }
.dl-mode input[type=radio] { flex: none; width: 14px; height: 14px; margin: 3px 0 0; }
.dl-mode b { font-weight: 500; font-size: 13px; }
.dl-mode i { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 1px; }
.dl-pane { padding: 10px 0 2px; }
.dl-lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.dl-drives { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dl-drive { flex: none; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; text-align: left; max-width: 260px; }
.dl-drive b { display: block; font-weight: 500; font-size: 12.5px; }
.dl-drive span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.dl-drive.on { border-color: var(--primary); background: var(--primary-soft); }
.dl-row { display: flex; gap: 8px; align-items: center; }
.dl-row input { flex: 1; min-width: 0; }
/* 🔴 全局 input{width:100%} + 上面那条 flex:1 ⇒ 间隔输入框会被拉满整行（实测踩到），单独放开 */
.dl-row input.dl-min { flex: none; width: 76px; text-align: center; }
.dl-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; min-height: 16px; }
.dl-check { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 12.5px; cursor: pointer; }
.dl-check input[type=checkbox] { flex: none; width: 14px; height: 14px; margin: 2px 0 0; }
@media (max-width: 820px) {
  .dl-stat .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-drive { max-width: 100%; }
}

/* 🆕 2026-11-02 收费台账 · 医生业绩表（原「按归属医生」的标签行升级） */
.pay-perf-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pay-perf-head b { font-size: 14px; font-weight: 500; }
.pay-perf th, .pay-perf td { padding: 6px 8px; }
.pay-perf tfoot td { border-top: 1px solid var(--border); background: #fafbfc; font-weight: 500; }
.pay-perf-bar { height: 5px; border-radius: 3px; background: #edeff3; overflow: hidden; margin-bottom: 3px; }
.pay-perf-bar i { display: block; height: 100%; background: var(--primary); }

/* ══ 🆕 2026-11-02 患者标签 + 患者列表压缩 ══════════════════════════════ */

/* 标签徽章：10px 小方块，跟在名字后面 */
/* 🆕 2026-11-03 船长：「标签底色修改为圆形，去除暗色，全部变更为糖果色」
   · 形状：胶囊（border-radius:999px）。文字标签做不成正圆，胶囊两端是半圆，视觉上就是"圆"。
   · 配色：浅亮糖果底 + 同色系深字（底色在 JS 里内联给）。
     🔴 糖果色明度太高，配白字对比只有 1.6~2:1，10px 小字会糊成一片白块 —— 必须配深字。
   · 字重 500 + 左右内边距 7px，小字才不显虚。 */
.ptag { display: inline-block; font-size: 10.5px; line-height: 1.6; padding: 0 7px; border-radius: 999px;
  font-weight: 500; vertical-align: middle; white-space: nowrap;
  -webkit-font-smoothing: antialiased; }
/* 「+N」是折叠计数，不属于任何分类色 ⇒ 中性糖果灰，不抢前面真标签的色 */
.ptag-more { background: #E4E9F0; color: #44515F; }
/* 表格姓名列不是 flex，徽章会紧贴姓名的最后一个字（实测「康展弘」和「约」糊在一起）；
   左栏 .pd-pc-top 已经是 flex+gap，不需要这条，所以只作用在表格单元格里。 */
td.pat-name .ptag { margin-left: 5px; }

/* 列表只留一行：姓名 + 标签（2026-11-02 船长：「其余全部取消显示」）
   🔴 必须限定在 #pdRailList 内：`.pd-pc-top` / `.pd-pc-line` 这套类名
      305 总库的远端搜索结果卡也在用，全局改会把那张卡也压成单行。 */
#pdRailList .pd-pcard { padding: 6px; margin-bottom: 2px; }
#pdRailList .pd-pc-top { align-items: center; justify-content: flex-start; gap: 4px; overflow: hidden; }
/* 🆕 2026-11-03 船长：头像 → 姓名 → 标签。窄栏只有 190px，姓名最多让到 96px，超了省略 */
#pdRailList .pd-pc-top .pd-pc-av { flex: none; display: flex; align-items: center; }
#pdRailList .pd-pc-top .pd-pc-av img { border-radius: 50%; }
#pdRailList .pd-pc-top b { font-size: 14px; font-weight: 500; line-height: 1.5; flex: none;
  max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pdRailList .pd-pc-top .ptag { flex: none; }
/* 昵称排在「姓名 → 标签」之后（2026-11-03 船长定顺序）。窄栏只有 190px，
   姓名+标签占完后剩余空间不固定 ⇒ 昵称必须可收缩 + 省略号，否则会把整行顶出边框。 */
#pdRailList .pd-pc-top .pat-nick { flex: 0 1 auto; min-width: 0; margin-left: 1px;
  font-size: 11.5px; color: #9aa6b4; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

/* 标签选择（建档弹窗、列表快捷菜单共用） */
.ptag-pickwrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0; }
/* 🆕 2026-11-20 船长：建档标签改下拉（展开后列出全部标签，仍可多选） */
.ptag-dd { position: relative; }
.ptag-dd-btn { width: 100%; display: flex; align-items: center; gap: 6px; text-align: left;
  border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 7px 10px;
  font-size: 13px; color: #6b7787; cursor: pointer; }
.ptag-dd-btn.has { color: #1f2d3d; }
.ptag-dd-btn #f_tags_txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptag-dd-c { font-size: 11.5px; color: #95a1b0; background: #f1f4f8; border-radius: 999px; padding: 1px 7px; }
.ptag-dd-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid #95a1b0; margin-left: 2px; }
.ptag-dd-panel { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px;
  box-shadow: 0 8px 22px rgba(20, 35, 55, .10); max-height: 240px; overflow: auto; }
.ptag-toggle { border: 1px solid var(--border); background: #fff; color: #6b7787; border-radius: 999px;
  font-size: 12.5px; padding: 5px 13px; cursor: pointer; }
.ptag-toggle:hover { border-color: #c9d2dd; }
.ptag-toggle.on { font-weight: 500; border-color: transparent; }

/* 色板 */
.ptag-pal { display: flex; flex-wrap: wrap; gap: 6px; }
/* 色板按钮：糖果底 + 深字，形状也做成药丸。
   未选中用「淡描边 + 稍透明」，选中用深描边 + 外环（浅底上内白环会看不太出来）。 */
.ptag-pick { border: 1px solid rgba(0, 0, 0, .06); border-radius: 999px; font-size: 12px; padding: 5px 14px;
  cursor: pointer; opacity: .8; font-weight: 500; }
.ptag-pick:hover { opacity: 1; }
.ptag-pick.on { opacity: 1; font-weight: 600; box-shadow: 0 0 0 2px var(--ink); }

/* 标签设置页表格 */
.ptag-tbl th, .ptag-tbl td { padding: 8px 8px; vertical-align: middle; }
.ptag-desc { color: var(--muted); font-size: 12.5px; }

/* 🆕 2026-11-02 手机端患者名单：姓名后面已经跟了标签徽章，
   而「患者标签」这一列在窄屏会另起一行再显示一遍 ⇒ 同一行里标签出现两次。
   这里只隐藏重复的那一列，其它信息（分院/病历号/手机/年龄）照旧。
   🟢 2026-11-02 另外：左栏患者列表已改成只显示「姓名 + 标签」，本文件里
   #pdRailList 那几条是它的样式，别删。 */
@media (max-width: 760px) {
  .pat-tbl td[data-k="tags"] { display: none; }
}

/* ══ 🆕 2026-11-03 内窥镜接入检查（App.endoWizard） ══════════════════ */
.modal-endo { width: min(760px, 94vw); }
.endo-diag { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.endo-loading { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.endo-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.endo-row.ok { border-color: #cfe8dd; background: #f7fcfa; }
.endo-row.warn { border-color: #f2e0bd; background: #fffcf5; }
.endo-row.bad { border-color: #f3cfcb; background: #fffafa; }
.endo-ico { flex: none; width: 20px; height: 20px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; margin-top: 1px; }
.endo-row.ok .endo-ico { background: #12805c; }
.endo-row.warn .endo-ico { background: #b8791a; }
.endo-row.bad .endo-ico { background: #c0392b; }
.endo-txt { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.65; color: #4a5563; }
/* 🔴 只能是「第一个 b」：说明文字里也有 <b>（https / 不接受 这类强调），
   写成 .endo-txt b{display:block} 会把它们全变成独立一行 —— 实测一句话被拆成 5 行。 */
.endo-txt > b:first-child { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 2px; }
.endo-txt code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px;
  background: #f2f4f7; padding: 1px 5px; border-radius: 4px; }
.endo-act { flex: none; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.endo-act .btn { white-space: nowrap; }
.endo-sec { border-top: 1px solid var(--border); padding-top: 12px; }
.endo-sec-h { margin-bottom: 8px; }
.endo-sec-h b { font-size: 13.5px; font-weight: 500; margin-right: 8px; }
.endo-drv { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 6px; background: #fff; }
.endo-drv b { font-size: 12.5px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.endo-drv span { font-size: 11.5px; color: var(--muted); flex: none; }
.endo-drv-empty { font-size: 12.5px; color: #6b7787; background: #f8fafb; border: 1px dashed var(--border);
  border-radius: 8px; padding: 10px 12px; line-height: 1.7; }
.endo-preview { margin: 0 0 12px; border-radius: 10px; overflow: hidden; background: #10161f; }
.endo-preview video { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.endo-preview-cap { padding: 6px 10px; font-size: 11.5px; color: #c7d2de; background: #1b2534; }
@media (max-width: 760px) {
  .endo-row { flex-wrap: wrap; }
  .endo-act { flex-direction: row; width: 100%; }
  .endo-act .btn { flex: 1; }
}

/* 🆕 2026-11-03 「处置」栏：只有收费流水、没有处置单时（E看牙 导入的历史数据都这样），
   把 note 里的「项目 · 数量 · 牙位 · 折扣」拆开显示 —— 原来只有一行「（预付款）实收 62.00」。 */
.tt-paylist { display: flex; flex-direction: column; gap: 6px; }
.tt-payrow { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 8px;
  background: #fafbfc; border: 1px solid #f0f3f6; font-size: 12.5px; }
.tt-payrow-t { flex: none; width: 44px; color: #8d99a8; font-variant-numeric: tabular-nums; }
.tt-payrow-n { flex: 1; min-width: 0; color: #33404f; }
.tt-payrow-n i { display: block; font-style: normal; font-size: 11.5px; color: #8d99a8; margin-top: 2px; }
.tt-payrow-m { flex: none; color: #6b7787; font-size: 12px; white-space: nowrap; }
.tt-payrow-m b { color: #0f6e56; font-weight: 600; margin-left: 8px; font-size: 13px;
  font-variant-numeric: tabular-nums; }
/* 🆕 2026-11-03 那天只有到诊、没有处置也没有收费（导入数据常见）时的占位，
   否则「处置」栏会空一大块，看着像加载失败。 */
.tt-day-none { padding: 10px 2px; font-size: 12.5px; color: #9aa6b5; }

/* ══════════════════════════════════════════════════════════════════════════
   全局底部冲浪条（2026-11-03 船长：每个页面都要看得到）
   · 只有水：两层海浪 + 一片背鳍；不再有左侧文字，右侧只留「已收费/预约」数字
   · 🆕 2026-11-03 船长：「0.5 倍速，在整个网页的下方都呈现，不管一级/二级/三级菜单」
     ⇒ ① 浪速减半（远 22s / 近 11s，原来 11s / 5.5s）
        ② 整条 left:0 横跨窗口（原来从侧栏右侧开始，打开二级菜单时左边空一条白）
   · 水会压在一/二/三级菜单最底部 26px 上 ⇒ 侧栏、二级竖栏都补了底部内边距（见下方 .has-surf 三行）
   ══════════════════════════════════════════════════════════════════════════ */
.surf-dock{position:fixed;left:0;right:0;bottom:0;height:26px;z-index:35;
  pointer-events:none;overflow:hidden;
  /* 🔴 2026-11-03 去掉原来的白色渐隐：水现在横跨整屏，那道白雾会把**深色侧栏的底部**刷成一条奶白，
     侧栏看着像被截断。内容区本来就留了 38px 底部内边距，最后一行不会被水切到，不需要雾。 */
  background:transparent}
.sd-txt{position:absolute;font-size:11px;line-height:14px;color:#5C87A2;z-index:5;
  text-shadow:0 0 4px rgba(255,255,255,.95),0 0 2px rgba(255,255,255,1);
  font-variant-numeric:tabular-nums;letter-spacing:.3px}
.sd-r{right:12px;top:1px}
.sd-w{position:absolute;left:0;width:200%;pointer-events:none}
/* 🆕 2026-11-03 船长：「海浪速度再减半」⇒ 22s→44s / 11s→22s（周期再翻倍） */
.sd-w2{height:18px;bottom:0;z-index:1;animation:sdWave 44s linear infinite}
/* 🔴 近层必须不透明（opacity 1）：半透明会让鲨鱼鳍在水下的那一截透出来，像块方影子 */
.sd-w1{height:13px;bottom:0;z-index:3;animation:sdWave 22s linear infinite}
@keyframes sdWave{from{transform:translateX(0)}to{transform:translateX(-50%)}}
.sd-fin{position:absolute;bottom:2px;width:34px;height:22px;color:#0C7FC2;z-index:2;
  transition:left 1s linear}
.sd-fin svg{display:block;width:34px;height:22px;animation:sdBob 2.8s ease-in-out infinite}
@keyframes sdBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
body.has-surf #main{padding-bottom:38px}
/* 🆕 2026-11-03：水现在横跨整个窗口，会盖住侧栏/二级竖栏最底部 26px；
   给这两列留出同样高度的内边距，保证最后一个菜单项、页脚版本号不被水挡住。 */
/* 🔴 给**侧栏容器**留内边距，而不是给 nav 加：nav 是 flex:1 + 可滚动，
   加在它身上只能把"滚动内容末端"垫高，最后一个菜单项仍会探进水里（实测差 3px）。 */
body.has-surf .sidebar{padding-bottom:26px}
body.has-surf .subrail-in{padding-bottom:44px}
@media (max-width:760px){
  .surf-dock{left:0;bottom:52px}
  body.has-surf #main{padding-bottom:108px}
}

/* ══════════════════════════════════════════════════════════════════════════
   1920×1080 专项优化（2026-11-03 船长四项全选：弹窗窄 / 内容散 / 字小 / 看板列太宽）
   · 全部写在 ≥1600px 里 —— 1440、1366 与手机端一个字都不改
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1600px) {
  /* ① 弹窗：默认 680 → 900（2K 屏上表单不再挤成一条细长的）
     🔴 确认框（modal-confirm）例外：就一句话，撑到 900 反而难看 ⇒ 锁回 520
     🔴 预约表单（modal-appt）再宽一档：项目面板要两栏，900px 时两栏各 400 太窄、右侧会被切 */
  .modal { width: min(900px, 92vw); }
  .modal.modal-confirm, .modal.modal-narrow { width: min(520px, 92vw); }
  .modal.modal-appt { width: min(1120px, 94vw); }
  .modal.modal-set { width: min(1040px, 92vw); }
  .modal.modal-tabset { width: min(920px, 92vw); }

  /* ② 预约表单的「项目」面板：两种模式两套排法
     · 全览＝**多栏流式**：分组按列自上而下流动、自动填空 —— 用 grid 会按行对齐，
       左边「儿牙 17 项」比右边「复查 11 项」高，右边下面就空出一大块（船长截图指的就是这个）
     · 卡片＝左卡片栏 + 右项目清单：卡片按 2 列网格排，最长的分组自己占位，不再被拉成竖条 */
  /* 🔴 只作用于**居中弹窗**：同一个面板在「右侧卡片」里只有 ~480px 宽，两栏会挤成一条，
     而且 max-height 46vh 会把多栏内容顶到横向溢出（横向滚动条就是这么来的） */
  .modal .rt-panel[data-mode="all"] .rt-pbody { column-count: 2; column-gap: 22px;
    max-height: none; overflow: visible; }
  .modal .rt-panel[data-mode="all"] .rt-grp { break-inside: avoid; -webkit-column-break-inside: avoid; }
  .modal .rt-panel[data-mode="card"] .rt-pbody { display: grid; grid-template-columns: 260px minmax(0, 1fr);
    column-gap: 18px; align-content: start; }
  .modal .rt-panel[data-mode="card"] .rt-pg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    align-content: start; padding: 0 14px 0 0; border-bottom: 0; border-right: 1px solid var(--border); }
  .modal .rt-panel[data-mode="card"] .rt-pg a { display: flex; flex-direction: column; align-items: flex-start;
    justify-content: center; gap: 1px; min-height: 54px; padding: 7px 10px; border-radius: 10px;
    font-size: 12.5px; line-height: 1.35; text-align: left; }
  .modal .rt-panel[data-mode="card"] .rt-pg a em { margin-left: 0; font-size: 11px; }

  /* ③ 字太小：表格 / 侧栏 / 统计条各 +1px（每天盯最久的几处），行高跟着松一点 */
  .td-tbl th { font-size: 12.5px; }
  .td-tbl td { font-size: 13.5px; padding-top: 9px; padding-bottom: 9px; }
  .sidebar nav a .tx { font-size: 13.5px; }
  .td-stat .i { font-size: 13.5px; }
}
/* ④ 看板医生列宽上限：JS 在 ≥1600 且单列算出来会超过 460px 时加 .cal-cap（医生少时不再被拉成 600px）
   🔴 必须用 flex:0 0 <宽度>：列默认是 flex:1 1 0，只改 width 会被 flex 拉伸覆盖 */
.cal-scroll.cal-cap .cal-colhead, .cal-scroll.cal-cap .cal-colbody { flex: 0 0 var(--cal-col-w, 460px); min-width: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   预约项目面板：分组拖动排序 + 每组末尾「＋ 增加项目」（2026-11-03 船长）
   · 拖动把手：全览＝组标题（.rt-gt），卡片＝分组卡片（.rt-pg a）
   · 落点高亮用 outline（不占布局，不会把卡片挤动）
   · 只有管理员能看到这些交互（JS 里按 App.has('settings') 决定渲不渲染）
   ══════════════════════════════════════════════════════════════════════════ */
.rt-gt.rt-dragsrc, .rt-pg a.rt-dragsrc { cursor: grab; }
.rt-gt.rt-dragsrc:active, .rt-pg a.rt-dragsrc:active { cursor: grabbing; }
.rt-dragging { opacity: .45; }
.rt-droptarget { outline: 2px dashed var(--primary); outline-offset: 2px; border-radius: 9px; }
.rt-add { display: inline-flex; align-items: center; font-size: 12px; line-height: 1.7;
  padding: 1px 9px; border-radius: 7px; border: 1px dashed #b9d9ef; color: #3d8ec9;
  cursor: pointer; white-space: nowrap; user-select: none; }
.rt-add:hover { border-color: var(--primary); color: var(--primary); background: #f2fbff; }

/* ══════════════════════════════════════════════════════════════════════════
   预约表单 · 已选患者信息卡（2026-11-03 船长：查到患者就默认显示资料，替代「已选」那行字）
   · 两行：姓名/性别年龄/标签/病历号 ｜ 手机/最近就诊/过敏
   · 过敏不是「无」时标橙底，前台一眼能看到
   ══════════════════════════════════════════════════════════════════════════ */
.apf-pat { display: flex; flex-direction: column; gap: 2px; background: #f6fbfe;
  border: 1px solid #d8ecf9; border-radius: 8px; padding: 5px 10px; margin: 2px 0 1px; }
.apf-pat-1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.apf-pat-1 b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.apf-pat-meta { font-size: 11.5px; color: #5b7789; }
.apf-pat-mrn { margin-left: auto; font-size: 11px; color: #8aa3b4; font-variant-numeric: tabular-nums; }
.apf-pat-2 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: #5b7789; }
.apf-pat-2 i { font-style: normal; color: #9fb3c2; }
.apf-pat-al { color: #5b7789; }
.apf-pat-al.on { color: #c2410c; background: #fff1e6; border-radius: 4px; padding: 0 6px; font-weight: 600; }
/* 🆕 2026-11-03 叫号设置里的「下班提醒」时间框：别让它被全局 input{width:100%} 拉满整行 */
.set-time { width: 118px; flex: none; }

/* 🆕 2026-11-03 侧栏首屏骨架：app.js 执行前 #nav 里只放这个，替代原来写死的 emoji 菜单
   （船长报障「刷新时还能看到旧版的彩色图标和文字」—— 就是那段静态占位闪出来的）
   renderNav() 用 nav.innerHTML 整段重写，所以真菜单一出来骨架自动消失，不需要额外清理。 */
.nav-skel { display: flex; flex-direction: column; gap: 12px; padding: 16px 14px; }
.nav-skel i { display: block; height: 12px; border-radius: 6px; background: #d9e3ee;
  animation: navSkel 1.3s ease-in-out infinite; }
.nav-skel i:nth-child(1) { width: 74%; }
.nav-skel i:nth-child(2) { width: 86%; animation-delay: .12s; }
.nav-skel i:nth-child(3) { width: 66%; animation-delay: .24s; }
.nav-skel i:nth-child(4) { width: 80%; animation-delay: .36s; }
.nav-skel i:nth-child(5) { width: 58%; animation-delay: .48s; }
@keyframes navSkel { 0%, 100% { opacity: .34; } 50% { opacity: .82; } }

/* ══ 诊疗记录标准模板（船长 2026-11-07 截图定稿）══ */
.trt-kpis { display: flex; gap: 8px; margin-bottom: 12px; }
.trt-kpi { flex: 1; background: #f7fafd; border: 1px solid #e8eef6; border-radius: 10px; padding: 9px 12px; }
.trt-kk { font-size: 11px; color: #8b98a8; margin-bottom: 3px; }
.trt-kv { font-size: 16px; font-weight: 600; color: #1f2d3d; line-height: 1.2; }
.trt-ks { font-size: 10.5px; color: #a0aab6; margin-top: 2px; }
.trt-acts { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.trt-card { border: 1px solid #e8eef6; border-radius: 10px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.trt-ch { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px;
  background: #f7fafd; border-bottom: 1px solid #eef3f9; }
.trt-cd { font-size: 13px; font-weight: 600; color: #1f2d3d; }
/* 🆕 2026-11-10 船长：日卡片改 4:6 —— 左 40% 预约信息、右 60% 处置信息。
   原来是 `260px 1fr`（1440 视口实测 25% : 75%），左栏只有 260px 会折行。
   🔴 用 fr 不用百分比：百分比叠加 padding/border 会溢出，fr 由网格自己分配剩余宽度。
   🔴 船长 2026-11-10 16:00 补一句「手机端先不改」⇒ 4:6 **只作用于 >760px**；
      760px 及以下保持原来 `260px 1fr`，等专门做移动端那一轮再动。
      （所以基础规则写回原值，宽屏用 min-width 覆盖；改窄屏档时先看这条注释，别顺手把它改没了） */
.trt-cb { display: grid; grid-template-columns: 260px 1fr; }
@media (min-width: 761px) {
  /* 🆕 2026-11-11 左栏改表头三列后 4:6 太挤（医生名折行）⇒ 拉到 4.5:5.5 */
  .trt-cb { grid-template-columns: minmax(0, 4.5fr) minmax(0, 5.5fr); }
}
.trt-cl { border-right: 1px solid #f0f4f9; padding: 12px 14px; min-width: 0; }
.trt-cr { padding: 12px 14px; min-width: 0; }
.trt-ct { font-size: 12px; color: #6b7887; margin-bottom: 6px; }
/* 预约状态胶囊（2026-11-10：每条预约都显示，不只是取消/爽约） */
.trt-st { font-style: normal; font-size: 11px; line-height: 16px; border-radius: 9px; padding: 0 6px;
  margin-left: 5px; white-space: nowrap; vertical-align: 1px; }
.trt-st.ok { color: #1D9E75; background: #E1F5EE; }
.trt-st.off { color: #A32D2D; background: #FCEBEB; }
.trt-st.wait { color: #185FA5; background: #E6F1FB; }
/* 手机端（≤760px）本轮**不动**：4:6 的媒体查询在上面写的是 min-width:761px，
   窄屏自然回到 `260px 1fr` 原样。堆叠方案等专门做移动端那一轮再上。 */
.trt-ev { position: relative; padding: 0 0 14px 16px; }
.trt-ev::before { content: ''; position: absolute; left: 2px; top: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: #2f6fd0; box-shadow: 0 0 0 3px rgba(47, 111, 208, .15); }
.trt-ev::after { content: ''; position: absolute; left: 5px; top: 15px; bottom: 0; width: 1px; background: #eef3f9; }
.trt-ev:last-child::after { display: none; }
.trt-ev.is-tr::before { background: #e08e2a; box-shadow: 0 0 0 3px rgba(224, 142, 42, .15); }
.trt-evt { font-size: 13px; color: #00A0E8; font-weight: 500; }
.trt-evh { font-size: 12.5px; color: #2c3e50; margin-top: 2px; line-height: 1.5; }
.trt-evm { font-size: 11.5px; color: #8b98a8; margin-top: 1px; }
.trt-evs { font-size: 11.5px; color: #1a8a5d; margin-top: 1px; }
.trt-eva { margin-top: 4px; }
.trt-lk { font-size: 11px; color: #185FA5; background: none; border: none; padding: 0 2px; cursor: pointer; text-decoration: underline; }
.trt-lk:hover { color: #0f4880; }
/* 2026-11-10：一天有多张处置单时，点「修改处置」先选哪一张（patients.js 的 App.trtEditDay） */
.trt-pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; margin-bottom: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; }
.trt-pick:hover { border-color: var(--primary); background: var(--primary-soft); }
.trt-pick:last-child { margin-bottom: 0; }
.trt-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.trt-tbl thead th { background: #f7fafd; color: #6b7887; font-weight: 500; text-align: left;
  padding: 6px 8px; border-bottom: 1px solid #eef3f9; font-size: 11.5px; }
.trt-tbl td { padding: 7px 8px; border-bottom: 1px solid #f4f7fa; color: #2c3e50; }
.trt-tdc { color: #185FA5; }
.trt-tdr { text-align: right; font-variant-numeric: tabular-nums; }
.trt-tdn { color: #b0b8c4; text-align: center; padding: 14px 0; }
.trt-tdf { color: #6b7887; font-size: 11.5px; background: #fafcfe; }
.trt-tdf2 { color: #c0392b; font-weight: 600; text-align: right; background: #fafcfe; }

/* ══════════════════════════════════════════════════════════════════════════
   「处置与收费」上下两段（方案A，船长 2026-11-16 选）
   ① 上段 处置项目 = 开了什么（应收）  ② 下段 收费单 = 收了多少（实收）
   🔴 两段用**两道分隔**隔开，不是拆成两张卡片：同一天的开单和收款是同一次就诊的事，
      拆成卡片会让"一天"在视觉上断成两截，对不上号。
   🔴 段内表格不再画外框，只靠表头浅灰底分区 —— 外框一多，右栏 55% 的宽度会被描边吃掉。
   ══════════════════════════════════════════════════════════════════════════ */
.trt-segs { display: flex; flex-direction: column; gap: 10px; }
.trt-seg { border: 1px solid #eef3f9; border-radius: 8px; overflow: hidden; }
.trt-segh { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 5px 9px; background: #f7fafd; border-bottom: 1px solid #eef3f9; }
.trt-segt { font-size: 11.5px; font-weight: 600; color: #33475f; letter-spacing: .2px; }
.trt-segn { font-size: 11.5px; color: #7a8699; font-variant-numeric: tabular-nums; }
.trt-segn b { color: #c0392b; font-weight: 600; }
/* 段内表格：表头已经是灰底，td 最后一行不用再画线，免得跟段边框叠成双线 */
.trt-seg .trt-tbl thead th { background: #fbfdff; }
.trt-seg .trt-tbl tbody tr:last-child td { border-bottom: none; }
/* 「微信扫码+银行卡」这种两种支付方式拼在一起的，比正文窄一号才不折行（折了行整张单会被撑高） */
.trt-tdm { color: #6b7887; font-size: 11px; }
/* 应收≠实收才出现（相等是常态，常挂红字会让真异常淹没在噪音里） */
.trt-diff { font-size: 11.5px; color: #B45309; background: #FFF8E8; border: 1px solid #F6E2B3;
  border-radius: 6px; padding: 4px 9px; font-variant-numeric: tabular-nums; }
.trt-diff b { color: #A32D2D; font-weight: 600; }

/* 预约日志标题按类型着色（对齐 日志正序-预约-20261026.png）*/
.apl-it.k-status .apl-hd b { color: #185FA5; }
.apl-it.k-move .apl-hd b { color: #BA7517; }
.apl-it.k-new .apl-hd b { color: #534AB7; }

/* ══════════════════════════════════════════════════════════════════════════
   预约日志改版（2026-11-07 船长）
   · 配色照预约状态胶囊：蓝 已预约/已挂号｜绿 已确认/已离开/已完成｜橙 已到达/改期
     紫 治疗中/新建｜橙红 已过期｜红 爽约｜灰 待确定/未确认/已取消
   · 时间线正序：第一行是新建预约；左列时间、右列内容
   🔴 别再用 .apl-k：2092 行旧表格样式把它覆盖成橙底胶囊，会让所有标签一个色。
      这里统一用 .aplog-* 前缀，跟老样式彻底隔离。
   ══════════════════════════════════════════════════════════════════════════ */
.aplog { --k:#2F80ED; --kbg:#EFF6FE; --kbd:#9CC7F5; --ktx:#185FA5; }
.aplog.c-blue, .aplog-it.t-blue { --k:#2F80ED; --kbg:#EFF6FE; --kbd:#9CC7F5; --ktx:#185FA5; }
.aplog.c-green, .aplog-it.t-green { --k:#27AE60; --kbg:#EAF8F0; --kbd:#A5DFBB; --ktx:#1D8752; }
.aplog.c-amber, .aplog-it.t-amber { --k:#F2994A; --kbg:#FFF4E8; --kbd:#F6C89A; --ktx:#B96A16; }
.aplog.c-purple, .aplog-it.t-purple { --k:#9B51E0; --kbg:#F6EEFC; --kbd:#D8B4F3; --ktx:#7C3FB0; }
.aplog.c-orange, .aplog-it.t-orange { --k:#F26B4B; --kbg:#FFF0EA; --kbd:#F5B7A5; --ktx:#C24A2C; }
.aplog.c-red, .aplog-it.t-red { --k:#EB5757; --kbg:#FDECEC; --kbd:#F5B5B5; --ktx:#C0392B; }
.aplog.c-gray, .aplog-it.t-gray { --k:#95A5A6; --kbg:#F4F6F8; --kbd:#CFD8DC; --ktx:#6B7887; }
.aplog-hd { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.aplog-hdl { border-left:4px solid var(--k); padding-left:10px; min-width:0; }
.aplog-ttl { margin:0; font-size:15px; font-weight:600; color:#1f2d3d; line-height:1.35; }
.aplog-pat { font-size:11.5px; color:#8b98a8; margin-top:3px; }
.aplog-state { flex:none; padding:0; border:0; background:none; color:var(--ktx);
  font-size:13px; font-weight:700; }
.aplog-mline { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; margin:10px 0 12px;
  font-size:11px; color:#8b98a8; }
.aplog-mv { font-size:12px; font-weight:600; color:var(--ktx); }
.aplog-mt { color:#2c3e50; }
.aplog-msep { color:#cfd8dc; }
.aplog-lh { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px;
  font-size:12px; font-weight:600; color:#1f2d3d; }
.aplog-lh .r { font-size:11px; font-weight:400; color:#8b98a8; }
/* 🔵 2026-11-16 船长定稿：**紧凑表格**（原竖版时间轴中间空白太多）
   一行一条：时间(＋与上一步的间隔) / 状态 / 发生了什么 / 修改人。
   状态仍按状态色上色，重复推进的行标 ×N。 */
.modal.modal-aplog { width:min(980px,95vw); }
.aplog-tbw { max-height:56vh; overflow:auto; border:1px solid #eef2f7; border-radius:10px; }
.aplog-tb { width:100%; border-collapse:collapse; font-size:12.5px; }
.aplog-tb thead th { position:sticky; top:0; z-index:1; background:#f8fafc;
  text-align:left; font-weight:500; font-size:11.5px; color:#8d99a8;
  padding:7px 10px; border-bottom:1px solid #eef2f7; }
.aplog-tb td { padding:6px 10px; border-bottom:1px solid #f5f8fb; vertical-align:middle; }
.aplog-tb tr:last-child td { border-bottom:0; }
.aplog-tb tr:hover td { background:#fbfdff; }
.apl-t { white-space:nowrap; font-variant-numeric:tabular-nums; }
.apl-t b { font-size:12.5px; font-weight:600; color:#33404f; }
/* 🆕 2026-11-17：时间列补上日期（船长「预约日志不显示日期」）——
   日期做浅灰小字、时刻仍加粗，一行读完是「2025-07-21 16:46」，与 E看牙 的「操作时间」同一读法。 */
.apl-t .apl-td { display:inline-block; margin-right:5px; font-size:11.5px; font-weight:500; color:#8b98a8; }
/* 🗑 2026-11-18：时间列下方那行「同分钟 / ＋N 分」已按船长要求整行撤掉，这条样式随之作废 */
.apl-st { font-size:13.5px; font-weight:700; color:var(--ktx); letter-spacing:.2px; }
.apl-s em { display:block; font-style:normal; font-size:11px; color:#9aa6b4; margin-top:1px; }
.apl-n { display:inline-block; margin-left:6px; font-size:10.5px; font-weight:600; color:var(--ktx);
  background:var(--kbg); border:1px solid var(--kbd); border-radius:6px; padding:0 5px; vertical-align:1px; }
.apl-d { color:#6b7887; font-size:11.5px; line-height:1.5; }
.apl-nil { color:#c2cbd6; }
.apl-u { text-align:right; color:#9aa7b6; font-size:11.5px; white-space:nowrap; }
.aplog-lg { display:flex; flex-wrap:wrap; gap:6px 14px; margin-top:10px; font-size:11px; color:#6b7887; }
.aplog-lg i { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; vertical-align:0; }
.aplog-foot { font-size:11px; color:#a0aab6; margin-top:4px; }
@media (max-width:760px) {
  .aplog-tb thead th:nth-child(4), .aplog-tb td.apl-u { display:none; }
  .aplog-tb thead th:nth-child(2), .aplog-tb td.apl-s { width:auto; }
}

/* 2026-11-10 护士不足预警（日看板顶部横幅；警告色统一用琥珀） */
.apt-nwhint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 8px; background: #FAEEDA;
  border: 1px solid #EF9F27; border-radius: 8px; color: #854F0B; font-size: 12.5px; }
.apt-nwhint b { color: #854F0B; }
.apt-nw-rs { flex: 1; min-width: 200px; color: #854F0B; opacity: .9; font-size: 12px; line-height: 1.55; }

/* ══ 病历设置（系统设置 → 📋 病历设置，2026-11-11）══════════════════ */
/* 一行排多个开关；窄屏自动折行 */
.rc-inline { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.rc-inline > label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; }
.rc-inline input[type=checkbox] { width: 15px; height: 15px; flex: none; }
/* 病历字段的「初诊 / 复诊」切换 */
.rc-kinds { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.rc-kinds .muted-line { font-size: 12px; color: var(--muted); }
#rc_tbl td, #rc_tbl th { text-align: center; }
#rc_tbl td:first-child, #rc_tbl th:first-child { text-align: left; }
#rc_tbl input[type=checkbox] { width: 15px; height: 15px; }
/* 病历字段表：窄屏横向滚动，勾选框不挤成乱码 */
.rc-tblwrap { overflow-x: auto; }
.rc-tblwrap table { min-width: 560px; }
/* 🆕 2026-11-11 船长：「牙位的十字线与后面文字重叠，增加一点距离」
   —— 十字横线画满牙位列（92px），紧挨着正文那一格，视觉上像贴在一起。
   只给「牙位列后面紧跟的正文」加左内边距，无牙位的行（.notw）不受影响。 */
.rec-card .eks-tw + .eks-v { padding-left: 24px; }   /* 2026-11-11 船长：再加 16px（原 8px） */
.ref-card .eks-tw + .eks-v { padding-left: 8px; }

/* ══ 新增病历「按今日处置预填」确认卡（2026-11-11）════════════════ */
.tc-list { border:1px solid #eef1f6; border-radius:8px; overflow:hidden; margin-bottom:10px; }
.tc-row { display:flex; align-items:center; gap:8px; padding:7px 10px; border-bottom:1px solid #f2f5f9; font-size:12.5px; }
.tc-row:last-child { border-bottom:0; }
.tc-t { color:var(--primary); width:46px; flex:none; }
.tc-i { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tc-th { background:#E1F5EE; color:#0F6E56; border-radius:4px; padding:0 5px; font-size:11px; white-space:nowrap; }
.tc-a { color:#a2abb8; font-size:12px; white-space:nowrap; }
.tc-footline { display:flex; gap:10px; padding:5px 2px; font-size:12.5px; align-items:flex-start; }
.tc-k { color:var(--muted); width:62px; flex:none; text-align:right; }
.tc-link { color:#0C7FC2; cursor:pointer; margin-left:8px; font-size:12px; }

/* ══ 诊疗记录卡片：两栏右上各一对操作（2026-11-11）══════════════════ */
/* 左栏（预约）顶部右对齐；右栏跟「处置与收费」同一行、靠右 */
.trt-cl > .trt-ops { display: flex; justify-content: flex-end; gap: 12px; margin-bottom: 6px; }
.trt-ct { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trt-ct > .trt-ops { display: flex; gap: 12px; flex: none; }
.trt-ops .trt-lk { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-size: 12.5px; }
.trt-ops .trt-lk:hover { text-decoration: underline; }

/* ══ 诊疗记录左栏：预约表头三列（2026-11-11 方案 B）══════════════════ */
.trt-lhead, .trt-lrow { display: grid; grid-template-columns: 58px minmax(0,1fr) 104px; gap: 2px 8px; align-items: start; }
.trt-lhead { font-size: 11px; color: #a2abb8; padding-bottom: 5px; margin-bottom: 2px;
  border-bottom: 1px solid #eef1f6; }
.trt-lrow { font-size: 12.5px; color: var(--text); padding: 11px 0; border-bottom: 1px dashed #f0f3f8; }
.trt-lrow:last-child { border-bottom: 0; }
.trt-lt { display: flex; flex-direction: column; gap: 3px; }
.trt-lt b { color: var(--primary); font-weight: 600; }
.trt-lt .trt-st { align-self: flex-start; }
/* 多项目垂直排列：每项一行，间距 4px（2026-11-11） */
.trt-lp { min-width: 0; word-break: break-word; display: flex; flex-direction: column; gap: 4px; }
.trt-ld { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trt-ln { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ══ 预约卡片：项目标签行（2026-11-11 重新设计）══════════════════════ */
.apf-itemhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0 8px; border-top: 1px dashed #eef1f6; margin-top: 2px; }
.apf-ih-lb { font-size: 12px; color: var(--muted); flex: none; }
.apf-tags { display: flex; flex-wrap: wrap; gap: 5px; flex: 0 1 auto; min-width: 0; cursor: pointer; }
.apf-tag { background: var(--primary-soft, #e2f3fd); color: #1a6fbf; border-radius: 11px;
  padding: 2px 9px; font-size: 12px; line-height: 18px; }
.apf-tagempty { color: #a2abb8; font-size: 12px; }
.apf-addbtn { flex: none; background: none; border: 1px dashed var(--primary); color: var(--primary);
  border-radius: 12px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.apf-addbtn:hover { background: var(--primary-soft, #e2f3fd); }

/* ══ 预约项目面板：间距松一档 + 限高 + 保存吸底（2026-11-11）════════ */
/* ① 复选框不再挤成一团：行距、内边距、勾选框之间都放开 */
.rt-cbs { gap: 9px 14px; padding-top: 6px; }
.rt-cb { padding: 3px 9px; font-size: 12.5px; }
.rt-panel[data-mode="all"] .rt-cbs { gap: 8px 14px; padding-top: 5px; }
.rt-panel[data-mode="all"] .rt-cb { font-size: 12.5px; padding: 3px 9px; }
.rt-grp { padding: 7px 0; }
/* ② 面板限高，内部滚动 —— 卡片不再越撑越高 */
.rt-panel { max-height: 320px; overflow: hidden; }
.rt-pbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
/* ③ 「取消 / 保存」钉在卡片底部，面板展开多高都看得见 */
.modal-appt .m-foot,
.apt-drawer-wrap .rtcard-f { position: sticky; bottom: 0; background: #fff; z-index: 3;
  border-top: 1px solid #eef1f6; padding-top: 10px; margin-top: 6px; }

/* 🔴 2026-11-11 修：面板限高后 .rt-pbody 没真正收缩 ⇒ 内容溢出压住底部提示条
   （截图里"还没勾项目（必选…"被口外组的「+ 增加项目」盖住一半）。
   flex-basis 从 auto 改成 0，再给它自己一块滚动区。 */
.rt-panel > .rt-pbody { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.rt-panel > .rt-pfoot { flex: none; }
.rt-panel > .rt-phead { flex: none; }

/* ══ 预约卡片两栏：左患者信息 / 右预约项目（2026-11-11 船长定）════════ */
/* 只对**居中弹窗**生效；右侧抽屉仍走单列（300px 放不下两栏） */
.modal-appt .rt-wrap { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 58%);
  gap: 0 16px; align-items: start; }
.modal-appt .rt-form { grid-column: 1; grid-row: 1; }
.modal-appt .apf-itemhead { grid-column: 2; grid-row: 1; align-self: end; }
.modal-appt .rt-panel { grid-column: 2; grid-row: 2; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
/* 左栏字段排密一点，42% 宽度里两列够放 */
.modal-appt .rt-form { gap: 8px 10px; }
.modal-appt .rt-form .rt-f > label { font-size: 11.5px; }
/* 右栏面板至少给到 300px 高，跟左栏视觉齐平 */
.modal-appt .rt-panel { min-height: 300px; }

/* 🔴 2026-11-11 预约弹窗宽度：原来只在 @media(min-width:1600px) 里加宽，
   1098px 的窗口吃不到，两栏一开就只剩 630px ⇒ 每栏都挤。这里提到全局。 */
.modal.modal-appt { width: min(1080px, 94vw); }
/* 两栏比例：左信息 38% / 右项目 62%（项目两列复选框要地方） */
.modal-appt .rt-wrap { grid-template-columns: minmax(0, 38%) minmax(0, 62%); }

/* ══ 预约卡加宽 + 右侧全项目（2026-11-11 船长：左信息多、右项目全量）════ */
.modal.modal-appt { width: min(1280px, 96vw); }
.modal-appt .rt-wrap { grid-template-columns: minmax(0, 32%) minmax(0, 68%); }
/* 右侧三列平铺，不再收缩滚动：全部 38 项一眼看全 */
.modal-appt .rt-cbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 10px; }
.modal-appt .rt-panel { max-height: none; min-height: 0; }
.modal-appt .rt-panel > .rt-pbody { overflow: visible; flex: none; }
/* 左侧患者档案：两列键值对 */
.apf-pat-grid { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 1px 6px;
  font-size: 11px; line-height: 1.9; margin-top: 5px; }
.apf-pat-grid .apf-pk { color: #a2abb8; }
.apf-pat-grid .apf-pv { color: var(--text); word-break: break-all; }
.apf-pat-grid .apf-pv.ok { color: #52a352; }
.apf-pat-grid .apf-pv.bad { color: #c98a2b; font-weight: 500; }
.apf-pat-grid .apf-pv i { color: #b8c2cf; font-style: normal; }

/* 🔴 2026-11-11 卡片加宽后项目全展开 ⇒ 整体超出视口、底部按钮被裁。
   给弹窗一个 90vh 上限，内容区自己滚；按钮条始终在底部。 */
.modal.modal-appt { max-height: 90vh; display: flex; flex-direction: column; }
.modal.modal-appt .rt-wrap { overflow-y: auto; max-height: calc(90vh - 120px); }

/* 🔴 2026-11-11 三列时 38 项仍要滚 ⇒ 改四列，行数从 19 降到 10，全部可见 */
.modal-appt .rt-cbs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 8px; }
.modal-appt .rt-cb { font-size: 12px; padding: 2px 7px; }
.modal-appt .rt-gt { font-size: 11.5px; padding: 2px 0; }
.modal-appt .rt-grp { padding: 5px 0; }

/* 🔴 2026-11-11「＋ 增加项目」从项目网格末格挪到组标题行（每组省一整行，6 组省 144px） */
.rt-gt > .rt-add { margin-left: auto; margin-right: 8px; font-size: 11px; color: var(--primary);
  text-decoration: none; opacity: .8; }
.rt-gt > .rt-add:hover { opacity: 1; text-decoration: underline; }
/* 2026-11-11 六列试过：项目名被截断（「间隙保持器…」），退回四列。38 项在 4 列下需 821px，
   屏幕可视只有 374px ⇒ 面板内部滚动，这是物理限制，不是排版问题。 */

/* 2026-11-11 船长：「试试左右 3:7」 */
.modal-appt .rt-wrap { grid-template-columns: minmax(0, 30%) minmax(0, 70%); }

/* 卡片模式内容很矮，面板别再撑 300px（底部留一大片空白） */
.modal-appt .rt-panel { min-height: 0; }

/* 2026-11-11 船长：「修改成 2/8」 */
.modal-appt .rt-wrap { grid-template-columns: minmax(0, 20%) minmax(0, 80%); }

/* 2:8 时左栏只有 246px，日期/时间两列会挤成「2026-11-1」⇒ 左栏字段改单列 */
.modal-appt .rt-form { grid-template-columns: 1fr; }
.modal-appt .rt-form .rt-f.full { grid-column: 1 / -1; }

/* ══ 2026-11-11 船长：「右侧将所有预约完整展示」══════════════════════
   全览模式（9 组全展开）+ 压缩字号行高，让它塞进一屏。
   卡片高度 94vh；右栏独立高度（align-items:start 后它可比左栏高）。 */
.modal.modal-appt { max-height: 94vh; }
.modal-appt .rt-wrap { align-items: start; max-height: calc(94vh - 120px); }
.modal-appt .rt-panel { max-height: calc(94vh - 150px); }
.modal-appt .rt-pbody { overflow-y: auto; }
/* 全览模式的密度：字号 11、行高 18、组标题 20 */
.modal-appt .rt-cb { font-size: 11px; padding: 0 3px; gap: 3px; line-height: 18px; }
.modal-appt .rt-cb > i { width: 10px; height: 10px; }
.modal-appt .rt-gt { font-size: 10.5px; line-height: 20px; padding: 0; }
.modal-appt .rt-grp { padding: 2px 0; }
.modal-appt .rt-cbs { gap: 0 6px; }

/* 面板撑到视口（全览 9 组内容 1073px，屏幕 813px 放不下，尽量多给可视区） */
.modal-appt .rt-panel { height: calc(94vh - 170px); max-height: none; }
.modal-appt .rt-pbody { flex: 1 1 0; min-height: 0; overflow-y: auto; }

/* 2026-11-11 船长：「整个卡片变宽」⇒ 1280 → 1560（98vw 上限），右侧六列把 9 组压进一屏 */
.modal.modal-appt { width: min(1560px, 98vw); }
.modal-appt .rt-cbs { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ══ 2026-11-11 右栏包一层：标题+面板整体成为一栏，从顶部对齐、面板自然撑满 ══ */
.modal-appt .rt-wrap { grid-template-columns: minmax(0, 20%) minmax(0, 80%); align-items: start; }
.modal-appt .rt-form { grid-column: 1; grid-row: 1; }
.modal-appt .apf-right { grid-column: 2; grid-row: 1; display: flex; flex-direction: column;
  min-height: 0; height: calc(94vh - 170px); }
.modal-appt .apf-right .apf-itemhead { flex: none; align-self: stretch; }
.modal-appt .apf-right .rt-panel { flex: 1 1 0; min-height: 0; margin-top: 4px; }
.modal-appt .apf-right .rt-pbody { flex: 1 1 0; min-height: 0; overflow-y: auto; }

/* ══ 2026-11-11 三栏：周视图 60% / 患者信息 15% / 项目 25% ══════════ */
.modal.modal-appt { width: min(1560px, 98vw); max-height: 92vh; }
.modal-appt .rt-wrap { display: grid; grid-template-columns: 60% 15% 25%; gap: 0; align-items: stretch; }
.modal-appt .apf-week { grid-column: 1; grid-row: 1; border-right: 1px solid #eef1f6; padding: 8px 10px; min-width: 0; }
.modal-appt .rt-form { grid-column: 2; grid-row: 1; padding: 8px 9px; border-right: 1px solid #eef1f6; font-size: 11.5px; }
.modal-appt .apf-right { grid-column: 3; grid-row: 1; padding: 8px 10px; }

/* 周视图 */
.apf-wk-head { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 11.5px; color: #37475a; margin-bottom: 6px; }
.apf-wk-nav { background: none; border: 0; color: var(--primary); cursor: pointer; font-size: 15px; padding: 0 4px; }
.apf-wk-grid { display: grid; grid-template-columns: 34px repeat(7, minmax(0, 1fr)); gap: 0 2px; overflow-y: auto; max-height: calc(92vh - 210px); }
.apf-wk-col { display: flex; flex-direction: column; }
.apf-wk-col.apf-wk-time { color: #b8c2cf; font-size: 9px; }
.apf-wk-hour { height: 26px; line-height: 26px; text-align: right; padding-right: 3px; }
.apf-wk-day { font-size: 9.5px; color: #7a8797; text-align: center; line-height: 1.25; padding-bottom: 3px; }
.apf-wk-day i { font-style: normal; color: #b8c2cf; }
.apf-wk-col.sel .apf-wk-day { color: var(--primary); font-weight: 600; }
.apf-wk-cell { height: 26px; border-top: 1px solid #f4f7fa; cursor: pointer; padding: 0 1px; display: flex; gap: 1px; overflow: hidden; }
.apf-wk-cell:hover { background: #f0f8ff; }
.apf-wk-cell.has { background: #fafcff; }
.apf-wk-blk { flex: 1; min-width: 0; background: #e8f4ff; border-left: 2px solid #4a90d9; border-radius: 2px;
  font-size: 9px; color: #2b6ca3; line-height: 1.15; padding: 1px 2px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; }
.apf-week-load { color: #a2abb8; font-size: 11px; padding: 20px; text-align: center; }

/* 25% 右栏只有 ~370px，6 列会把项目名挤没 ⇒ 回到 2 列 */
.modal-appt .apf-right .rt-cbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
.modal-appt .apf-right .rt-cb { font-size: 11.5px; line-height: 20px; padding: 1px 4px; }

/* ══ 2026-11-11 船长：左侧时间/日期自适应卡片高度 ══════════════════ */
/* 原来 12 行写死 26px（共 312px），卡片 700px ⇒ 下面空 380px。
   改成 12 行均分：卡片多高，行就多高；缩窗口也不溢出。 */
.modal-appt .apf-week { display: flex; flex-direction: column; min-height: 0; }
.modal-appt .apf-wk-grid { flex: 1 1 0; min-height: 0; max-height: none; overflow: hidden; }
.modal-appt .apf-wk-col { height: 100%; min-height: 0; }
.modal-appt .apf-wk-cell { flex: 1 1 0; min-height: 22px; height: auto; }
.modal-appt .apf-wk-hour { flex: 1 1 0; height: auto; display: flex; align-items: center; justify-content: flex-end; }
.modal-appt .apf-wk-day { flex: none; }

/* 中栏只读日期（由周视图点格子决定） */
.apf-dateshow { display: inline-block; padding: 3px 8px; background: #f2f8ff; border: 1px solid #d6e8f7;
  border-radius: 4px; color: #1a6fbf; font-size: 12px; font-weight: 500; }

/* ══ 2026-11-11 周视图：日期表 + 选中色块（船长）══════════════════════ */
/* 日期表（时间上方，独立一行，跟列对齐） */
.apf-wk-days { display: grid; grid-template-columns: 34px repeat(7, minmax(0, 1fr)); gap: 0 2px; margin-bottom: 2px; }
.apf-wk-pad { }
.apf-daybtn { background: none; border: 0; padding: 3px 0; cursor: pointer; border-radius: 4px 4px 0 0;
  display: flex; flex-direction: column; align-items: center; gap: 1px; color: #7a8797; }
.apf-daybtn b { font-size: 11px; font-weight: 600; }
.apf-daybtn i { font-style: normal; font-size: 9.5px; color: #b8c2cf; }
.apf-daybtn:hover { background: #f0f8ff; }
.apf-daybtn.on { background: #e8f4ff; color: var(--primary); }
.apf-daybtn.on i { color: #7aa7cc; }
/* 选中的那个格子 = 实心色块 */
.apf-wk-cell.picked { background: #cfe9ff !important; box-shadow: inset 0 0 0 1.5px #4a90d9; border-radius: 3px; }
.apf-wk-cell.picked.has { background: #bfe0ff !important; }

/* ══ 2026-11-11 中栏加日期选择（月历）══════════════════════════════ */
.modal-appt .rt-wrap { grid-template-columns: 55% 20% 25%; }
.apf-midcal { margin: 6px 0 4px; }
.apf-midcal-h { font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.apf-midcal .apt-cal { transform: scale(.92); transform-origin: top left; width: 108%; }
.apf-midcal .apt-cal-head { font-size: 11px; }

/* 中栏内容（患者卡 + 月历 + 时间/医生/时长/备注）比卡片高 ⇒ 中栏自己滚 */
.modal-appt .rt-form { overflow-y: auto; max-height: calc(92vh - 180px); padding-right: 6px; }
.apf-midcal { border-top: 1px dashed #eef1f6; padding-top: 6px; }

/* ══ 2026-11-11 船长：去掉右上「项目 未选项目 ＋添加项目」那行 + 右下空白 ══ */
/* 全览模式下项目全都平铺着，那行按钮是多余的；腾出的高度给项目列表 */
.modal-appt .apf-itemhead { display: none; }
.modal-appt .apf-right { height: calc(92vh - 148px); padding: 6px 10px 8px; }
.modal-appt .apf-right .rt-panel { flex: 1 1 0; height: 100%; margin-top: 0; min-height: 0; }
.modal-appt .apf-right .rt-pbody { flex: 1 1 0; min-height: 0; overflow-y: auto; }

/* body 还是只给到 374（被 head/foot 挤掉）⇒ 直接定高，把剩余全给列表 */
.modal-appt .apf-right .rt-panel { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.modal-appt .apf-right .rt-pbody { height: auto; max-height: none; min-height: 0; overflow-y: auto; }
/* 底部提示压成一行，别占三行 */
.modal-appt .apf-right .rt-pfoot .muted-line { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══ 2026-11-11 项目改「分组卡片」（船长附图：每组一张圆角卡，标题蓝底 + 折叠 + 加项）══ */
.modal-appt .apf-right .rt-pbody { display: block; }
.modal-appt .apf-right .rt-grp { border: 1px solid #d8e6f4; border-radius: 7px; background: #fbfdff;
  padding: 4px 6px 5px; margin-bottom: 7px; }
.modal-appt .apf-right .rt-grp:last-child { margin-bottom: 0; }
.modal-appt .apf-right .rt-gt { display: flex; align-items: center; gap: 5px; background: #eaf3fc;
  border-radius: 5px; padding: 3px 6px; font-size: 11px; font-weight: 600; color: #3355aa;
  margin-bottom: 3px; cursor: pointer; }
.modal-appt .apf-right .rt-gt > span { font-weight: 400; color: #7a97bd; font-size: 10px; }
.modal-appt .apf-right .rt-gt > .rt-add { margin-left: auto; background: #fff; border: 1px solid #bcd4ea;
  border-radius: 9px; padding: 0 6px; font-size: 9.5px; color: #4a7fae; font-weight: 400; }
.modal-appt .apf-right .rt-gt > .rt-chev { margin-left: 2px; }
.modal-appt .apf-right .rt-cbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 4px; }
.modal-appt .apf-right .rt-cb { font-size: 10.5px; line-height: 17px; padding: 0 2px; }

/* 月历可收起（点「选择预约日期」标题） */
.apf-midcal-h { cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; }
.apf-midcal-h::after { content: '▾'; color: #a2abb8; font-size: 10px; }
.apf-midcal.collapsed .apf-midcal-h::after { content: '▸'; }
.apf-midcal.collapsed #apf_midcal { display: none; }

/* ══ 2026-11-11 船长：点看板空白格 → 右侧滑出「患者+月历」「项目」两块 ══
   看板被挤到 60%，两块共 40%（15% 患者 / 25% 项目）。
   2026-11-13 船长「项目尽量全显示」：40vw → 44vw（470/720 → 500/760），
   右栏项目区由 379px 提到 ~440px，多一列、81 项一屏能看全。
   2026-11-18 船长：「项目有些显示不全」⇒ 44vw/760 → **50vw/860**。
     1280 屏：抽屉 640 ⇒ 项目区 ~410 ⇒ 按下面的动态最小列宽排 3 列，8 个字的
     「全套正畸资料采集」也不再吃省略号；1440 屏 720 ⇒ 4 列。 */
.apt-drawer-wrap.rtform.right .apt-modal { width: 52vw; min-width: 540px; max-width: 880px; }
.apt-drawer-wrap.rtform.right .rt-wrap { display: grid; grid-template-columns: 37.5% 62.5%; gap: 0; align-items: stretch; }
.apt-drawer-wrap.rtform.right .rt-form { grid-column: 1; border-right: 1px solid #eef1f6; overflow-y: auto; }
.apt-drawer-wrap.rtform.right .apf-right { grid-column: 2; padding: 8px 10px; display: flex; flex-direction: column; }
.apt-drawer-wrap.rtform.right .apf-right .rt-panel { flex: 1 1 0; min-height: 0; }
.apt-drawer-wrap.rtform.right .apf-right .rt-pbody { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.apt-drawer-wrap.rtform.right .apf-midcal .apt-cal { transform: scale(.86); transform-origin: top left; width: 116%; }
/* 看板被挤压：抽屉宽度 50vw */
body.apt-form-open .apt-board-wrap,
body.apt-form-open #aptBoard { margin-right: 52vw; transition: margin-right .22s ease; }

/* 🔴 2026-11-11 恢复（上一轮误删）：右侧抽屉打开时看板让位。
   抽屉从 360px 加宽到 40vw ⇒ 让位宽度同步 40vw。
   2026-11-13 抽屉加宽到 44vw；2026-11-18 再宽到 50vw（项目名要放得下）
   ⇒ 让位同步改成 clamp(520px, 50vw, 860px)。 */
#main.apt-mode.rc-open .apt-page { padding-right: clamp(540px, 52vw, 880px); }
@media (max-width: 820px) { #main.apt-mode.rc-open .apt-page { padding-right: 0; } }

/* 抽屉模式也去掉「项目 未选项目 ＋添加项目」那行（全览模式它不干活，白占 30px） */
.apt-drawer-wrap.rtform .apf-itemhead { display: none; }

/* 🆕 2026-11-11 船长：右侧抽屉弹出时，左侧看板的月历栏隐藏（腾地方给医生列） */
#main.apt-mode.rc-open .apt-left { display: none; }
/* 🔴 2026-11-11 实测根因：.apt-left 只是 display:none，grid 的 236px 第一列**仍然占位**，
   于是剩下的 .apt-main 被自动放进了那一列（实测只有 236px 宽），医生列挤成一团、右侧大片空白。
   隐藏左栏的同时必须把布局切成单列，看板才吃满让位后的全部宽度。 */
@media (min-width: 821px) { #main.apt-mode.rc-open .apt-layout { grid-template-columns: minmax(0, 1fr); } }
/* 🔴 别给上面的 padding-right 加 transition：后台标签页里过渡的 currentTime 一直是 0，
   computed padding-right 永远停在 0px ⇒ 让位压根没发生，aptFitCols 量到的是旧宽度。 */


/* ══ 2026-11-11 船长定稿：60% 医生 / 15% 中（上患者 下月历）/ 25% 项目，高度撑满 ══ */
/* 2026-11-13：15fr/25fr → minmax(210px,12fr)/28fr ——
   🔴 必须给表单一个下限：纯 12fr 在 1280 屏只有 169px，患者输入框被压到 90px；
   210px 是「日期/时间/医生/备注 + 月历」都放得下的实测下限。
   1600 屏：表单 210 / 项目 462 ⇒ 4 列，81 项一屏见底。 */
.apt-drawer-wrap.rtform.right .rt-wrap { grid-template-columns: minmax(210px, 12fr) minmax(0, 28fr); }
/* 中栏：flex 纵向，月历用 order 挪到最后当「下半部分」，并撑满剩余高度 */
.apt-drawer-wrap.rtform.right .rt-form { display: flex; flex-direction: column; gap: 5px; }
.apt-drawer-wrap.rtform.right .rt-form > .rt-f { flex: none; }
.apt-drawer-wrap.rtform.right #apf_picked { flex: none; }
.apt-drawer-wrap.rtform.right .apf-midcal { order: 99; flex: 1 1 0; min-height: 0; margin: 4px 0 0;
  border-top: 1px dashed #eef1f6; padding-top: 5px; overflow-y: auto; }
/* 抽屉里月历常驻显示（不受 collapsed 影响） */
.apt-drawer-wrap.rtform.right .apf-midcal.collapsed #apf_midcal { display: block; }
.apt-drawer-wrap.rtform.right .apf-midcal .apf-midcal-h::after { display: none; }
/* 右栏项目：卡片两列，撑满高度 */
.apt-drawer-wrap.rtform.right .apf-right .rt-pbody { display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; align-content: start; }
.apt-drawer-wrap.rtform.right .apf-right .rt-cbs { grid-template-columns: 1fr 1fr; }
.apt-drawer-wrap.rtform.right .apf-right .rt-cb { font-size: 10px; line-height: 17px; }
.apt-drawer-wrap.rtform.right .apf-right .rt-gt { font-size: 10px; padding: 2px 4px; }
/* 顶部工具条和底部提示压到最小 */
.apt-drawer-wrap.rtform.right .apf-right .rt-phead { padding-bottom: 3px; }
.apt-drawer-wrap.rtform.right .apf-right .rt-pfoot { margin-top: 3px; padding-top: 3px; }

/* ══ 2026-11-12 船长选「全部统一」：窄屏下预约表单抽屉铺满全屏、内部改单栏 ══
   🔴 桌面那版 width:40vw + min-width:470px 在 ≤470px 屏上会横向溢出（min-width 压过 max-width），
      必须把 min-width 归零；15fr/25fr 两栏在窄屏会挤成两条细缝 ⇒ 切单栏纵向堆叠、整块 body 滚。 */
@media (max-width: 820px) {
  .apt-drawer-wrap.rtform.right .apt-modal { width: 100vw; min-width: 0; max-width: 100vw; }
  /* 上行按内容（字段＋月历），下行吃掉剩余高度给项目面板；否则 grid 默认把剩余空间均分给两行，
     表现为「月历下面一大片空白 + 项目面板被压成一条」（760/390 实测）。 */
  .apt-drawer-wrap.rtform.right .rt-wrap { grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr); }
  /* 🔴 只切单列不够：桌面版给子元素写死了 grid-column:1 / :2，单列下 :2 会**隐式造出第二列**，
     把左栏挤成 0px（390 实测患者字段被压成竖排）⇒ 必须把两者都收回第 1 列、行号交给自动排。 */
  .apt-drawer-wrap.rtform.right .rt-form,
  .apt-drawer-wrap.rtform.right .apf-right { grid-column: 1; grid-row: auto; }
  .apt-drawer-wrap.rtform.right .rt-form { border-right: 0; overflow: visible; }
  .apt-drawer-wrap.rtform.right .apf-midcal { max-height: 250px; flex: none; }
  .apt-drawer-wrap.rtform.right .apf-right { border-top: 1px solid #eef1f6; padding-top: 8px; min-height: 0; }
  .apt-drawer-wrap.rtform.right .apf-right .rt-panel { max-height: none; }
  /* 2026-11-13：窄屏上面「表单＋月历」auto 高度把项目区压成一条（390 实测只有 84px 可视），
     给项目区一个下限，卡片整体改由 .rtcard-b 滚动（比只露两行项目好得多）。 */
  .apt-drawer-wrap.rtform.right .apf-right { min-height: 340px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   2026-11-12 船长：录音中心（版式一 列表式）+ 顶栏常驻录音状态灯
   🔴 顶栏三段结构不动：状态灯由 public/modules/recording.js 动态插到 #appbarUser 之前。
   🔴 全局 input{width:100%} 会连 checkbox 一起撑开 ⇒ 这里必须显式收回来（踩过 radio）。
   ═══════════════════════════════════════════════════════════════════════ */
.rec-badge { display: flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 8px;
  margin-right: 8px; border: 1px solid #e3e8ef; border-radius: 14px; background: #fff;
  cursor: pointer; font-size: 12px; color: #5b6472; white-space: nowrap; }
.rec-badge .rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #b9c1cc; flex: none; }
.rec-badge.on { border-color: #f3c7c7; background: #fff6f6; color: #a32d2d; }
.rec-badge.on .rec-dot { background: #e24b4a; }
.rec-badge.pause .rec-dot { background: #e0a800; }
/* 2026-11-13 船长：录不起来时顶栏只留一个橘点 —— 不显示文字、不弹提示；点一下静默重试录音 */
.rec-badge.dotonly { width: 20px; padding: 0; border: 0; background: transparent;
  justify-content: center; cursor: pointer; }
.rec-badge.dotonly:hover { background: transparent; }
.rec-badge.dotonly .rec-dot { width: 10px; height: 10px; background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
.rec-badge-t { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.rec-badge-btn { flex: none; border: 0; background: #f1f4f8; color: #3d4756; border-radius: 10px;
  padding: 2px 7px; font-size: 11px; cursor: pointer; }
.rec-badge-btn.ghost { background: transparent; color: #7a8494; }
.rec-page { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 0; }
.rec-page .page-head { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.rec-page .page-head h2 { margin: 0; }
.rec-sub { font-size: 12px; color: #7a8494; }
.rec-stat { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-chip { background: #f4f7fb; border: 1px solid #e8edf4; border-radius: 12px;
  padding: 3px 10px; font-size: 12px; color: #5b6472; }
.rec-chip b { color: #2c3340; font-weight: 500; }
/* 2026-11-13：转写队列被暂停时，在状态条上明确标一下（不然「怎么一直不动」） */
.rec-chip b.rec-warn { color: #a15c00; }
.rec-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: #5b6472; }
.rec-bar label { display: inline-flex; align-items: center; gap: 5px; }
.rec-bar input[type=date] { width: 145px; }
.rec-bar input[type=text], .rec-bar input:not([type]) { width: auto; }
.rec-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid #e8edf4; border-radius: 8px; background: #fafbfd; font-size: 12px; }
.rec-settings.hidden { display: none; }
.rec-settings input[type=checkbox] { flex: none; width: 14px; height: 14px; }
.rec-settings input[type=number] { width: 80px; }
/* 2026-11-13：牙科术语纠正表（一行一条 错词=正确词） */
.rec-fixbox { flex: 1 1 100%; display: flex; flex-direction: column; gap: 4px; }
.rec-fixbox textarea { width: 100%; min-height: 64px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px; line-height: 1.5; resize: vertical; font-family: inherit; }
.rec-hint { font-size: 11px; color: #8a94a3; }
.rec-hint.err { color: #a32d2d; }
.rec-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; flex: 1; min-height: 0; }
.rec-left, .rec-right { display: flex; flex-direction: column; min-height: 0; background: #fff;
  border: 1px solid #e8edf4; border-radius: 10px; overflow: hidden; }
.rec-left-h { padding: 8px 12px; border-bottom: 1px solid #eef1f6; font-size: 13px; font-weight: 500; color: #2c3340; }
.rec-list { flex: 1; min-height: 0; overflow-y: auto; }
.rec-item { padding: 9px 12px; border-bottom: 1px solid #f1f3f7; cursor: pointer; }
.rec-item:hover { background: #f7f9fc; }
.rec-item.sel { background: #eef4fd; box-shadow: inset 3px 0 0 #378add; }
.rec-item-t { font-size: 13px; color: #2c3340; }
.rec-item-s { margin-top: 3px; font-size: 11.5px; color: #7a8494; }
.rec-empty { padding: 22px 12px; text-align: center; font-size: 12px; color: #8a94a3; }
.rec-empty.err { color: #a32d2d; }
.rec-tag { display: inline-block; padding: 1px 6px; border-radius: 8px; background: #eef1f6;
  color: #5b6472; font-size: 11px; }
.rec-tag.ok { background: #e1f5ee; color: #0f6e56; }
.rec-tag.bad { background: #fcebeb; color: #a32d2d; }
.rec-right { padding: 12px; overflow-y: auto; }
.rec-d-head { font-size: 13px; line-height: 1.7; color: #2c3340; }
.rec-audio { width: 100%; height: 38px; margin: 8px 0 12px; }
.rec-tr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 8px;
  border-bottom: 1px solid #eef1f6; font-size: 13px; }
.rec-tr-list { flex: 1; min-height: 90px; overflow-y: auto; margin: 8px 0; }
.rec-tr-row { display: grid; grid-template-columns: 52px 82px minmax(0, 1fr); gap: 6px;
  align-items: start; padding: 6px 0; border-bottom: 1px solid #f4f6f9; }
.rec-tr-time { font-size: 11px; color: #8a94a3; padding-top: 5px; }
.rec-tr-spk { width: 82px; height: 26px; font-size: 11px; }
.rec-tr-txt { width: 100%; min-height: 42px; font-size: 12px; line-height: 1.5; resize: vertical; }
.rec-tr-src { grid-column: 3; font-size: 11px; color: #9aa3b0; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-top: 1px solid #eef1f6; }
.rec-actions .btn.danger { color: #a32d2d; border-color: #f3c7c7; }
.rec-patient { margin-top: 8px; padding: 8px; border: 1px solid #e8edf4; border-radius: 8px; }
.rec-patient.hidden { display: none; }
.rec-patient input { width: 220px; }
.rec-pat-row { padding: 5px 8px; font-size: 12px; cursor: pointer; border-bottom: 1px solid #f1f3f7; }
.rec-pat-row:hover { background: #f7f9fc; }
@media (max-width: 820px) {
  /* 🔴 窄屏不能用 grid + flex:1 挤：容器高度固定时 auto 行会吃掉全部，
     第二行 minmax(0,1fr) 得 0px ⇒ 右栏（播放器/文字）被压成一条（390 实测）。
     改成整页纵向滚动：左栏限高、右栏保底高度，页面由 #main 滚动。 */
  .rec-page { height: auto; min-height: 0; }
  .rec-grid { display: flex; flex-direction: column; flex: none; min-height: 0; gap: 10px; }
  .rec-left { flex: none; max-height: 230px; }
  .rec-list { max-height: 185px; }
  .rec-right { flex: none; min-height: 380px; overflow: visible; }
  .rec-badge-t { max-width: 120px; }
  .rec-badge-btn.ghost { display: none; }
}
@media (max-width: 760px) {
  .rec-badge { margin-right: 4px; padding: 0 5px; }
  .rec-badge-t { max-width: 72px; }
  .rec-tr-row { grid-template-columns: 46px 70px minmax(0, 1fr); }
}



/* ===== 统一上传弹窗（2026-11-13 船长：录音/照片/口扫/CT 统一模板） ===== */
.updlg-kind{display:flex;gap:6px;margin:-4px 0 14px;flex-wrap:wrap}
.updlg-kind button{flex:0 0 auto;padding:5px 16px;border:1px solid #dde3ea;background:#fff;border-radius:999px;font-size:13px;color:#5b6672;cursor:pointer}
.updlg-kind button.on{background:#2563eb;border-color:#2563eb;color:#fff}
.up-req{color:#e24b4a}
.updlg-prog{font-size:12.5px;color:#5b6672;min-height:18px;margin-top:10px;word-break:break-all}
.updlg-jump{border:1px dashed #cfd8e3;border-radius:10px;padding:16px;background:#f8fafc}
.updlg-jump-t{font-size:14px;font-weight:600;margin-bottom:6px}
.updlg-jump-d{font-size:12.5px;color:#6b7684;line-height:1.7;margin-bottom:12px}
.rec-upbtn{margin-left:auto}
.updlg-sum{font-size:12.5px;color:#5b6672;line-height:1.7;min-height:18px}
.up-ok{color:#2f7d4f}
.up-warn{color:#c0392b}

/* ===== 2026-11-13 船长：影像卡片收紧（行间隙减半、下方文字压成两行） ===== */
.img-cell .meta, .img-item .meta { padding: 5px 8px 6px; font-size: 12px; line-height: 1.28; }
.img-cell .meta > div, .img-item .meta > div { margin-top: 0; }
.img-cell .meta .cat, .img-item .meta .cat { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-cell .meta .time.shot, .img-item .meta .time.shot {
  margin-top: 1px; color: #3c4a58; font-weight: 500;
  display: flex; align-items: baseline; gap: 6px; }
.img-cell .meta .img-size, .img-item .meta .img-size { margin-left: 0; font-size: 10.5px; color: #8b98a6; font-weight: 400; }
.img-cell .meta .time.note, .img-item .meta .time.note {
  margin-top: 1px; font-size: 11.5px; color: #7a8794;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-cell .meta .grp-act, .img-item .meta .grp-act { margin-top: 5px; }
.img-grid { gap: 10px; }

/* ===== 2026-11-13 船长：点开图片改白底（原来深色面板，看牙片细节发闷） ===== */
.pv-mask.pv-light { background: #fff; color: #1f2d3d; }
.pv-light .pv-dates { background: #f5f7fa; border: 1px solid #e6ebf2; }
.pv-light .pv-dt-hd { color: #8b98a6; }
.pv-light .pv-dt-all { color: #3c4a58; }
.pv-light .pv-dt-all:hover { background: #eef2f7; }
.pv-light .pv-dt { color: #5b6672; }
.pv-light .pv-dt:hover { background: #eef2f7; }
.pv-light .pv-dt.open { color: #1f2d3d; background: #e3eefc; }
.pv-light .pv-dt b, .pv-light .pv-dt-all b { color: #8b98a6; }
.pv-light .pv-dr:hover { background: #eef2f7; }
.pv-light .pv-dr-t { color: #4a5766; }
.pv-light .pv-dr.on { background: #2563eb; }
.pv-light .pv-dr.on .pv-dr-t { color: #fff; }
.pv-light .pv-dr-p { border-color: #b8c4d2; }
.pv-light .pv-dr-p.picked { background: #2563eb; border-color: #2563eb; }
.pv-light .pv-label { color: #1f2d3d; }
.pv-light .pv-stage { background: #fff; }
.pv-light .pv-strip { background: #f5f7fa; border: 1px solid #e6ebf2; }
.pv-light .pv-th { background: #eef1f5; }
.pv-light .pv-th.on { border-color: #2563eb; }
.pv-light .pv-th.picked { border-color: #2563eb; }
.pv-light .pv-th-p { background: #fff; border-color: #9aa8b8; }
.pv-light .pv-th.picked .pv-th-p { background: #2563eb; border-color: #2563eb; }
.pv-light .pv-cell { background: #f5f7fa; border-color: #e6ebf2; }
.pv-light .pv-cell.on { border-color: #2563eb; }
.pv-light .pv-cell-i { background: rgba(31,45,61,.72); }
.pv-light .pv-bar button { background: #f0f3f8; color: #2b3a4b; border: 1px solid #dde4ed; }
.pv-light .pv-bar button:hover { background: #e6ecf5; }
.pv-light .pv-bar button.on { background: #2563eb; color: #fff; border-color: #2563eb; }
.pv-light .pv-bar .pv-pct, .pv-light .pv-bar .pv-idx, .pv-light .pv-bar .pv-tip { color: #5b6672; }
.pv-light .pv-bar .pv-sl { color: #3c4a58; }
.pv-light .pv-bar .pv-save { background: #eef4ff; color: #2563eb; border-color: #cfe0fa; }
.pv-light .pv-bar .pv-save.dirty { background: #fdf0d8; color: #9a6412; border-color: #f0d9ad; }
.pv-light .pv-bar .pv-cmp { background: #e8f6ee; color: #1d6e5e; border-color: #bfe3d3; }

/* ══ 2026-11-13 船长：预约卡片右侧「预约项目」尽量全显示 ═══════════════
   右栏本身就是 flex 列，这里做三件事：
   ① 面板撑满右栏剩余高度（原来 .rt-panel 写死 max-height:320，下面空一大片）；
   ② 分组改纵向堆叠（原来 .rt-pbody 是 2 列网格，9 组被劈成两半、每组各留空格）；
   ③ 组内改 auto-fill 网格（右栏 440px → 4–5 列），81 个项目一屏基本见底。 */
.apt-drawer-wrap.rtform.right #apf_itemPanel {
  flex: 1 1 0; min-height: 0; max-height: none; margin-top: 4px; }
.apt-drawer-wrap.rtform.right #apf_itemPanel > .rt-pbody {
  display: block; flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden;
  grid-template-columns: none; gap: 0; }
.apt-drawer-wrap.rtform.right #apf_itemPanel .rt-grp { padding: var(--rt-gp, 2px) 0; }
.apt-drawer-wrap.rtform.right #apf_itemPanel .rt-cbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--rt-col, 90px), 1fr));
  gap: var(--rt-gap, 8px) 8px; padding: var(--rt-cpad, 6px) 0; }
.apt-drawer-wrap.rtform.right #apf_itemPanel .rt-cb {
  font-size: 11.5px; line-height: var(--rt-line, 20px); padding: var(--rt-pad, 2px) 7px;
  gap: 4px; border-radius: 6px; }
/* 🆕 2026-11-13 船长「行间距自适应高度」：尺寸全部走变量，由 fitItemSpacing() 按可用高度选档 */
.apt-drawer-wrap.rtform.right #apf_itemPanel .rt-gt {
  font-size: 11px; line-height: var(--rt-gh, 22px); padding: 0 4px; }
.apt-drawer-wrap.rtform.right #apf_itemPanel .rt-pg { gap: 4px; padding-bottom: 5px; }
.apt-drawer-wrap.rtform.right #apf_itemPanel .rt-pg a { font-size: 11.5px; padding: 2px 8px; }
/* 表单让一点高度出来给项目区：行距 6→4 */
.apt-drawer-wrap.rtform.right .rt-form { gap: 4px 10px; }

/* ══ 2026-11-13 船长：备注框默认两行 + 随内容长高 ═════════════════════ */
.rt-f > textarea, .rt-f textarea#apf_notes {
  display: block; width: 100%; box-sizing: border-box;
  min-height: 56px; line-height: 1.5; font-size: 13.5px; padding: 6px 9px;
  resize: none; overflow: hidden; }   /* overflow:hidden ⇒ scrollHeight 才是真实内容高 */

/* ══ 2026-11-14 船长：病历「打印」改成选病历批量打印 ═══════════════════
   弹窗里一行一份：日期 ｜ 类型 ｜ 诊断摘要 ｜ 医生，右上角勾选框。
   🔴 勾选框别再塞进文字行里（104px 那种格子里会被挤成「口…」，11-14 踩过一次）。 */
.rc-pp-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; margin: 8px 0;
  background: #f7f9fb; border-radius: 8px;
}
/* 「全选」两个字不许折行（实测被挤成「全 / 选」两行）；它的 label 也不许被 flex 压窄 */
.rc-pp-bar > label { flex: none; white-space: nowrap; }
.rc-pp-bar #ppCnt { flex: none; white-space: nowrap; }
.rc-pp-list {
  border: 1px solid #eef1f6; border-radius: 9px;
  max-height: 46vh; overflow: auto;
}
.rc-pp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer;
  border-top: 1px solid #f2f5f9; font-size: 12.5px;
}
.rc-pp-row:first-child { border-top: none; }
.rc-pp-row.on { background: #eef6ff; }
.rc-pp-row.rc-pp-cur { background: #fff8e8; }
.rc-pp-row.rc-pp-cur.on { background: #fdf0d5; }
.rc-pp-row .ppPick { flex: none; width: 15px; height: 15px; margin: 0; accent-color: #2563eb; }
.rc-pp-row .rc-pp-d { flex: none; width: 96px; font-weight: 600; color: #33415c; }
.rc-pp-row .rc-pp-k {
  flex: none; font-size: 11px; padding: 1px 7px; border-radius: 10px;
  border: 1px solid #dfe5ee; color: #6b7785; background: #fff;
}
.rc-pp-row .rc-pp-t {
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: #55606d;
}
.rc-pp-row .rc-pp-doc { flex: none; font-size: 11.5px; color: #8a95a3; }

/* ══ 2026-11-15 禁折清单（会员卡设置第九块）═══════════════════════════
   选中＝红底（"禁止"语义），未选＝白底灰字。分类与单项目共用一套 chip，
   这样"已禁"一眼能数出来。 */
.mt-exc { padding: 2px 0; }
.mt-exc-k { font-size: 12px; color: #5f6b7a; font-weight: 600; margin: 10px 0 6px; }
.mt-exc-tip { font-weight: 400; color: #98a2b3; margin-left: 6px; }
.mt-exc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-exc-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 10px; border-radius: 14px; font-size: 12px; line-height: 1.5;
  border: 1px solid #dfe5ee; background: #fff; color: #5a6675;
  cursor: pointer; user-select: none;
}
.mt-exc-chip.on { background: #fdecec; border-color: #f0b4b4; color: #a32d2d; font-weight: 600; }
.mt-exc-chip:disabled { cursor: default; }
.mt-exc-chip a { color: #a32d2d; text-decoration: none; margin-left: 2px; cursor: pointer; }
.mt-exc-none { font-size: 12px; color: #98a2b3; }
.mt-exc-add { display: flex; gap: 8px; margin-top: 10px; max-width: 440px; }
.mt-exc-add input { flex: 1; min-width: 0; }

/* ══ 2026-11-15 券种表单：项目兑换券的「每个绑定项目一行计提」══════════ */
.mc3f-selrow {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; margin-top: 5px;
  border: 1px solid #e8edf4; border-radius: 8px; background: #fbfcfe;
}
.mc3f-selrow .mc3f-selname { flex: 1; min-width: 0; font-size: 12.5px; color: #33415c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc3f-selrow label { flex: none; font-size: 12px; color: #7b8794; }
.mc3f-selrow .mc3f-cb { flex: none; }
.mc3f-selrow a { flex: none; color: #b42318; cursor: pointer; text-decoration: none; }

/* ══ 2026-11-15 会员卡设置：顶部「新建」栏 + 新建弹窗表单 ══════════════ */
.mt-newbar {
  display: flex; align-items: center; gap: 12px;
  margin: 2px 0 10px; flex-wrap: wrap;
}
.mt-newbar .mt-newhint { flex: 1; min-width: 0; font-size: 12px; color: #8a95a3; }
.mt-newform { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 6px; }
.mt-newform .mt-f-full { grid-column: 1 / -1; }
.mt-newform .mt-f { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.mt-newform .mt-f > label { font-size: 12px; color: #5f6b7a; text-align: left; }
.mt-newform .mt-fh { font-size: 11.5px; color: #98a2b3; }

/* ══ 2026-11-15 会员卡设置：照 E看牙 的两个大页签 + 六个子页签 ══════════ */
.mt-tabs2 { display: flex; gap: 4px; border-bottom: 1px solid #e6ebf2; margin: 4px 0 0; }
.mt-tab2 {
  padding: 8px 18px; font-size: 13px; color: #5f6b7a; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.mt-tab2.on { color: #1e6fd9; border-bottom-color: #1e6fd9; font-weight: 600; }
.mt-rtabs {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  background: #f6f8fb; border-radius: 8px; padding: 4px 8px; margin: 12px 0 0;
}
.mt-rtab {
  padding: 5px 12px; font-size: 12.5px; color: #5f6b7a; cursor: pointer;
  border-radius: 6px; white-space: nowrap;
}
.mt-rtab.on { background: #fff; color: #1e6fd9; font-weight: 600; box-shadow: 0 0 0 1px #e2e9f3; }
.mt-rsp { flex: 1; }
.mt-panebox { padding: 2px 2px 8px; }
.mt-pane { padding-top: 4px; }
.mt-h2 {
  font-size: 12.5px; font-weight: 600; color: #33415c;
  border-left: 3px solid #1e6fd9; padding-left: 8px; margin: 16px 0 8px;
}
.mt-pane > .mt-h2:first-child { margin-top: 10px; }
.mt-savebar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #eef1f6; }

/* ══ 2026-11-15 页签版式下的表格控件：选择框被挤成「不 ˅ 0」的修正 ══════
   页签区比原来的卡片窄了一截，.mt-qty 里的 select/input 会被压到只剩一个字。 */
.mt-pane .mt-qty { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
/* 🔴 选择器要写到 td 里：`.mt-pane .mt-tbl td select` 比 `.mt-pane .mt-qty select` 更"具体"，
   写在短的那条上会被压回 64px（实测「不限次」被截成「不」）。 */
.mt-pane .mt-tbl td .mt-qty select { min-width: 84px; }
.mt-pane .mt-tbl td .mt-qty input { width: 54px; min-width: 54px; }
.mt-pane .mt-tbl td select,
.mt-pane .mt-tbl td input.mt-inp { min-width: 64px; }
.mt-pane .mt-tbl td .mt-pick { min-width: 120px; }

/* ══ 2026-11-15 会员卡列表（卡片网格）+ 统一设置弹窗 ═══════════════════ */
.mt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.mt-card { border: 1px solid #e6ebf2; border-radius: 12px; padding: 14px 16px; background: #fff; transition: box-shadow .15s; }
.mt-card:hover { box-shadow: 0 2px 10px rgba(30,111,217,.08); border-color: #cfe0f7; }
.mt-card.off { background: #fafbfd; }
.mt-card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mt-card-nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: #24303f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-card-st { flex: none; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #f1f4f8; color: #7b8794; }
.mt-card-st.on { background: #e8f5ec; color: #2f7d32; }
.mt-card-b { font-size: 12px; color: #6b7785; line-height: 1.9; }
.mt-card-f { display: flex; gap: 8px; margin-top: 10px; }
/* 弹窗自己是一列：标题/tabs 固定，正文滚动，底部按钮永远可见（原来整体滚动，保存键被切在屏幕外） */
.modal.modal-mtedit { width: 1060px; max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.modal-mtedit .mt-ebody { flex: 1; min-height: 0; overflow: auto; padding-right: 4px; }
.modal.modal-mtedit .m-foot { margin-top: 8px; flex: none; }
/* 分类有 50 多个 chip，全铺开会把弹窗撑到两屏；限高滚动，保持能看全 */
.mt-exc-chips { max-height: 92px; overflow: auto; }
.mt-ed-st { font-size: 11px; font-weight: 400; padding: 1px 8px; border-radius: 10px; background: #f1f4f8; color: #7b8794; margin-left: 8px; }
.mt-ed-st.on { background: #e8f5ec; color: #2f7d32; }

/* ══ 2026-11-15 会员卡一屏编辑器（v11，新建与修改同一套）═══════════════ */
.modal.modal-mtedit {
  width: 1180px; max-width: 96vw; max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal.modal-mtedit h3 { flex: none; display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.mc2-h3hint { font-size: 11.5px; font-weight: 400; color: #8a95a3; }
.mc2 {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: minmax(0, 1.82fr) minmax(0, 1fr);
  border: 0.5px solid #eef1f6; border-radius: 10px; overflow: hidden;
}
.mc2-edit { padding: 11px 15px 10px; overflow: auto; min-height: 0; }
.mc2-view { background: #f7f9fb; border-left: 0.5px solid #eef1f6; padding: 11px 13px; overflow: auto; min-height: 0; }
.modal.modal-mtedit .m-foot { flex: none; display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.mc2-foot-hint { flex: 1; font-size: 11.5px; color: #8a95a3; }

/* 缩写那格要给「自动」两个字留出宽度，0.6fr 会被截成「自…」 */
.mc2-basic { display: grid; grid-template-columns: 1.75fr .88fr .56fr .66fr .7fr .74fr; gap: 9px; margin-bottom: 11px; }
.mc2-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mc2-f > span { font-size: 11.5px; color: #5f6b7a; }
.mc2-inp {
  width: 100%; min-width: 0; border: 0.5px solid #dfe5ee; border-radius: 7px;
  padding: 4px 7px; font-size: 12.5px; background: #fff;
}
.mc2-inp:disabled { background: #f6f8fa; color: #8a95a3; }

.mc2-col { border: 0.5px solid #eef1f6; border-radius: 9px; margin-bottom: 8px; }
.mc2-col-h {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 9px; background: #f7f9fb; border-radius: 9px 9px 0 0;
}
.mc2-bar { width: 3px; height: 11px; border-radius: 2px; background: #5F5E5A; flex: none; }
.mc2-bar.red { background: #A32D2D; }
.mc2-col-t { font-size: 12.5px; font-weight: 500; }
.mc2-cnt { font-size: 11px; color: #98a2b3; }
.mc2-col-sum { margin-left: auto; font-size: 11px; color: #A32D2D; }
.mc2-add { font-size: 11px; color: #185FA5; cursor: pointer; }

.mc2-head, .mc2-row { display: grid; align-items: center; gap: 6px; padding: 3px 9px; }
.mc2-head { font-size: 11px; color: #98a2b3; background: #fcfcfd; border-top: 0.5px solid #eef1f6; }
/* 🔴 数量列要能同时放下「不限/限次」下拉与次数输入：84px 会显示成「不 ∨ 0」（实测踩到） */
/* 🆕 2026-11-15 v13 列宽
   项目折扣：包含/不含 | 组或处置 | 项目单价 | 折扣 | 数量 | 计提单价 | ✕
   项目兑换：处置 | 原价 | 兑换次数 | 计提 | ✕
   🔴 改列宽要三处同步（这三条 + 表头 + 行），漏一处就整列错位。 */
.mc2-head-discount, .mc2-row[data-kind="discount"] { grid-template-columns: 74px minmax(0, 1fr) 86px 50px 84px 84px 16px; }
.mc2-head-exchange, .mc2-row[data-kind="exchange"] { grid-template-columns: minmax(0, 1fr) 74px 84px 74px 16px; }
.mc2-head-cash, .mc2-row[data-kind="cash"] { grid-template-columns: minmax(0, 1fr) 46px 90px 70px 16px; }
/* 只读数值格（项目单价 / 计提单价）：不是输入框，但排版与输入框同高 */
.mc2-pv-num { font-size: 12px; text-align: center; color: #33415c; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; line-height: 24px; }
.mc2-pv-num.mc2-h-cb { color: #A32D2D; font-weight: 600; }
.mc2-pv-num.off { color: #b6bec9; font-weight: 400; }
/* 表头里的「0不限」小字：不挤占列宽，又不用悬停才知道 0 是什么意思 */
.mc2-h-x { font-style: normal; font-size: 9.5px; color: #b0bac6; margin-left: 2px; }
/* 🎨 组 vs 单项：颜色区分（船长 2026-11-15 定）——组＝深蓝粗体带 ▣，单项＝常规深灰 */
.mc2-pk-g { color: #1d4ed8; font-weight: 600; }
.mc2-pk-i { color: #3d4b5c; font-weight: 400; }
.mc2-col-sum.mut { color: #98a2b3; }
.mc2-bar.green { background: #15803d; }
.mc2-item-hid { display: none; }
.mc2-row { font-size: 12px; border-top: 0.5px solid #eef1f6; }
.mc2-h-cb { color: #A32D2D; }
.mc2-row .i-cb { border-color: #F09595; color: #A32D2D; }
.mc2-qty { display: flex; gap: 4px; align-items: center; }
.mc2-qty select { width: 58px; flex: none; }
.mc2-qty input { width: 40px; flex: none; }
.mc2-lp { font-size: 11.5px; color: #98a2b3; }
.mc2-none { font-size: 11px; color: #98a2b3; text-align: center; }
.mc2-x { border: none; background: none; color: #b4bcc6; cursor: pointer; font-size: 12px; }
.mc2-x:hover { color: #A32D2D; }
.mc2-empty { padding: 7px 9px; font-size: 11.5px; color: #98a2b3; border-top: 0.5px solid #eef1f6; }
.mc2-more { padding: 3px 9px; font-size: 11px; color: #98a2b3; border-top: 0.5px solid #eef1f6; display: flex; }
.mc2-more a { margin-left: auto; color: #185FA5; cursor: pointer; }

.mc2-sum {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; background: #FCEBEB; border: 0.5px solid #F09595;
  border-radius: 9px; margin-bottom: 8px;
}
.mc2-sum-t { font-size: 12.5px; font-weight: 500; color: #A32D2D; }
.mc2-sum-d { font-size: 11px; color: #A32D2D; }
.mc2-sum-v { font-size: 15px; font-weight: 500; color: #A32D2D; }

.mc2-exc-line { display: flex; align-items: center; gap: 8px; }
.mc2-exc-t { font-size: 12px; color: #33415c; }
.mc2-exc-cnt { font-size: 11px; color: #A32D2D; background: #FCEBEB; border-radius: 8px; padding: 2px 8px; }
.mc2-exc-a { font-size: 11px; color: #185FA5; cursor: pointer; }
.mc2-exc-d { font-size: 11px; color: #98a2b3; }

.mc2-view-h { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.mc2-view-h > span:first-child { font-size: 12px; font-weight: 500; color: #5f6b7a; }
.mc2-pv-tag { font-size: 11px; color: #98a2b3; border: 0.5px solid #e6ebf2; border-radius: 8px; padding: 1px 7px; }
/* 🎨 2026-11-15 船长定色：护航＝橙、洁牙＝蓝、全能＝绿（对着「小鲨鱼会员卡」价目图）。
   卡面底色 / 文字色 / 缩写徽章底色全部取自这三个变量 —— 换色只改这一段。
   ⚠️ 患者页的会员卡卡面是 MP_CT_COLOR（patients.js），改这里要同步改那边。 */
.mc2-card {
  --ct-solid: #2E86D9; --ct-text: #0C447C; --ct-bg: #E6F1FB;
  position: relative; overflow: hidden;
  /* 🆕 2026-11-16 船长：卡面用「A4 吸色」那套浅色渐变（不再是纯色块） */
  background: linear-gradient(150deg, var(--ct-bg), var(--ct-bg2, var(--ct-bg)));
  border-radius: 12px; padding: 12px 13px 13px;
}
/* 🆕 2026-11-16（v9）：卡面改成「浅底 + 右侧 1/3 椭圆弧 + 超大年限字形」
   · ::before 椭圆填充（--ct-solid，10%），可见左边界落在 70% 处
   · ::after  同色圆环线（1px / 22%），同心更大，弧线落在 62% 处
   · .mc2-num 超大字（参考图字形当遮罩），压在椭圆里
   层次：底色 → 椭圆(10%) → 圆环线(22%) → 字形(42%) → 文字
   🔴 之前的「实色卡头」撤掉了：年限差异现在靠右上角的大字形辨认，卡头只留一个缩写色块。 */
.mc2-card::before {
  content: ''; position: absolute; z-index: 0; right: -42%; top: 50%; transform: translateY(-50%);
  width: 70%; aspect-ratio: 1/1; border-radius: 50%; background: var(--ct-solid);
  opacity: .10; pointer-events: none;
}
.mc2-card::after {
  content: ''; position: absolute; z-index: 0; right: -52%; top: 50%; transform: translateY(-50%);
  width: 90%; aspect-ratio: 1/1; border-radius: 50%; border: 1px solid var(--ct-solid);
  opacity: .22; pointer-events: none;
}
.mc2-card-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 0;
  background: none; border-radius: 0; position: relative; z-index: 2; }
.mc2-card-h .mc2-abbr { background: var(--ct-solid); color: #fff;
  width: auto; min-width: 3em; height: 30px; line-height: 30px; border-radius: 9px; font-size: 11.5px; }
.mc2-card-h .mc2-card-nm { color: var(--ct-text); }
/* 卡面大字形：字体缺失时就是个空 <i>，不会留白块 */
.mc2-num {
  position: absolute; z-index: 1; right: 5%; top: 50%; transform: translateY(-50%);
  width: 32%; max-width: 88px; aspect-ratio: 1/1; height: auto;   /* 跟卡宽走；卡面只有 ~85px 高，再大就被底边裁掉 */
  background: var(--ct-solid); opacity: .62;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  pointer-events: none;
}
.mc2-card.ct-escort { --ct-solid: #E08A3C; --ct-text: #7A3E08; --ct-bg: #FDF0E2; }
.mc2-card.ct-clean { --ct-solid: #2E86D9; --ct-text: #0C447C; --ct-bg: #E6F1FB; }
.mc2-card.ct-all { --ct-solid: #4C9E63; --ct-text: #1F5C33; --ct-bg: #E6F4EA; }
/* 🔴 2026-11-15 船长：「预留会员卡标识『护航5』三个字的尺寸」
   ⇒ 固定 = 3 个字宽（3em）＋ 左右内边距 7px，弃掉原来的 24×24 方块：
     方块装不下「护航5」，会折行 / 被挤扁；而且不同缩写长短不一时卡面会左右抖。
   ⚠️ 用 block + line-height 而不是 flex：flex 容器里 text-overflow 不生效（文字会被硬切）。 */
/* ⚠️ 用 block + line-height 而不是 flex：flex 容器里 text-overflow 不生效（文字会被硬切）。
   `.mc-abbr` 与 `.mc2-abbr` 同一条规则 —— 列表卡片用前者（自带 --ct-solid）、
   展示窗口用后者（变量从 .mc2-card 继承）。 */
.mc-abbr, .mc2-abbr {
  width: calc(3em + 14px); height: 24px; flex: none;
  padding: 0 7px; border-radius: 7px;
  background: var(--ct-solid, #2E86D9); color: #fff;
  font-size: 11px; line-height: 24px; text-align: center; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc2-card-nm { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--ct-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc2-card-st { font-size: 11px; color: #7b8794; background: #fff; border-radius: 9px; padding: 2px 8px; }
.mc2-card-st.on { color: #0F6E56; background: #E1F5EE; }
.mc2-card-pr { font-size: 21px; font-weight: 500; color: var(--ct-text); line-height: 1.1; }
.mc2-card-ds { font-size: 11.5px; color: var(--ct-solid); margin-top: 2px; position: relative; z-index: 2;
  max-width: 62%; line-height: 1.45; }   /* 给右侧大字形让出位置：长了就换行，不压到字形上 */
.mc2-pv-grp { margin-top: 9px; }
.mc2-pv-gh { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.mc2-pv-gh b { margin-left: auto; font-size: 11px; font-weight: 400; color: #98a2b3; }
.mc2-pv-tag2 { font-size: 11px; border-radius: 7px; padding: 1px 7px; }
.mc2-pv-tag2.g1 { color: #5F5E5A; background: #F1EFE8; }
.mc2-pv-tag2.g2 { color: #185FA5; background: #E6F1FB; }
.mc2-pv-tag2.g3 { color: #854F0B; background: #FAEEDA; }
.mc2-pv-row { display: flex; font-size: 12px; line-height: 1.75; }
.mc2-pv-row > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc2-pv-row > span:last-child { color: #5f6b7a; }
.mc2-dim, .mc2-dim > span:last-child { color: #98a2b3; }
.mc2-value { margin-top: 10px; background: #fff; border: 0.5px solid #e6ebf2; border-radius: 9px; padding: 9px 10px; }
.mc2-value-h { display: flex; align-items: baseline; gap: 6px; }
.mc2-value-h > span { font-size: 11px; color: #98a2b3; }
.mc2-value-h > b { margin-left: auto; font-size: 17px; font-weight: 500; color: #0C447C; }
.mc2-value-d { font-size: 11px; color: #98a2b3; margin-top: 3px; }
.mc2-value-x { font-size: 11.5px; color: #0F6E56; margin-top: 6px; padding-top: 6px; border-top: 0.5px solid #eef1f6; }
.mc2-value-w { font-size: 11.5px; color: #A32D2D; margin-top: 6px; padding-top: 6px; border-top: 0.5px solid #eef1f6; }

/* ── 价目表选项目：左 57 分类竖排 + 右项目详情（2026-11-16 船长） ── */
.pp2 { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 10px; height: 400px; }
.pp2-l { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid #eef1f6; padding-right: 8px; }
.pp2-kw { flex: none; width: 100%; margin-bottom: 6px; padding: 6px 8px; border: 1px solid #e3e8ef; border-radius: 8px; font-size: 12.5px; }
.pp2-scroll { overflow: auto; min-height: 0; }
.pp2-cat { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 7px;
  font-size: 12.5px; cursor: pointer; color: #3d4b5c; }
.pp2-cat span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp2-cat b { font-weight: 400; font-size: 11px; color: #98a2b3; }
.pp2-cat:hover { background: #eef5fd; }
.pp2-cat.on { background: #e6f1fb; color: #185fa5; font-weight: 600; }
.pp2-cat.on b { color: #3f7fbf; }
.pp2-r { border: 0; }
.pp2-i { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; font-size: 12.5px; cursor: pointer; }
.pp2-i span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp2-i em { font-style: normal; color: #12a150; flex: none; }
.pp2-i .pp2-pick { font-style: normal; flex: none; font-size: 11.5px; color: #185fa5;
  border: 1px solid #cfe0f3; border-radius: 6px; padding: 1px 8px; opacity: 0; transition: .12s; }
.pp2-i:hover { background: #eef5fd; }
.pp2-i:hover .pp2-pick { opacity: 1; }
.pp2-f { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pp2-f .muted-line { margin-right: auto; }
.pp2.sm { height: 340px; }

/* ── 系统设置·处置（价目表）：左大类+57 分类竖排、右项目表（2026-11-16） ── */
.pl2 { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; align-items: start; }
.pl2-l { background: #fff; border-radius: 12px; padding: 10px; box-shadow: 0 1px 3px rgba(16,30,54,.06);
  display: flex; flex-direction: column; max-height: 620px; }
.pl2-sel { width: 100%; flex: none; margin-bottom: 8px; padding: 6px 8px; border: 1px solid #e3e8ef; border-radius: 8px; font-size: 12.5px; }
.pl2-scroll { overflow: auto; min-height: 0; flex: 1; }
.pl2-cat { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 7px; font-size: 12.5px;
  color: #3d4b5c; cursor: pointer; user-select: none; }
.pl2-cat span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl2-cat b { font-weight: 400; font-size: 11px; color: #98a2b3; }
.pl2-cat:hover { background: #eef5fd; }
.pl2-cat.on { background: #e6f1fb; color: #185fa5; font-weight: 600; }
.pl2-cat.on b { color: #3f7fbf; }
.pl2-cat.can-drop { outline: 1px dashed #9fc2e8; outline-offset: -2px; }
.pl2-cat.drop-on { background: #d7e9ff; box-shadow: inset 0 0 0 2px #2563eb; }
.pl2-hint { font-size: 11px; color: #98a2b3; padding: 6px 2px 0; }
.pl2-r { min-width: 0; }

/* ── 处置收费弹窗：固定高度（2026-11-16 船长）──
   原来高度由内容决定：只加一行时左列表被压成 3 行高、加满才撑开，窗口窄时更扁。
   现在整窗固定 80vh（屏高 88vh 上限），左树与右主区内部各自滚动。 */
.modal:has(.ttf-wrap) { height: 80vh; max-height: 88vh; display: flex; flex-direction: column; }
.modal:has(.ttf-wrap) .ttf-wrap { flex: 1; min-height: 0; }
.modal:has(.ttf-wrap) .ttf-tree { max-height: none; height: 100%; }
.modal:has(.ttf-wrap) .ttf-main { min-height: 0; overflow: auto; }
.modal:has(.ttf-wrap) .ttf-main .tt-edit { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.modal:has(.ttf-wrap) .ttf-main #ttRows { flex: 1; min-height: 0; overflow: auto; }

/* 处置弹窗里的左树：装不下「分类+项目」两栏 ⇒ 加宽，并把分类列收窄（2026-11-16） */
.modal:has(.ttf-wrap) .ttf-tree { width: clamp(360px, 34vw, 430px); }
.modal:has(.ttf-wrap) .ttf-tree .pp2 { grid-template-columns: 134px minmax(0, 1fr); height: 100%; gap: 6px; }
.modal:has(.ttf-wrap) .ttf-tree .pp2-cat { padding: 5px 6px; font-size: 12px; }
.modal:has(.ttf-wrap) .ttf-tree .pp2-i { padding: 5px 6px; font-size: 12px; gap: 6px; }
.modal:has(.ttf-wrap) .ttf-tree .pp2-i .pp2-pick { display: none; }

/* 卡券区抢走太多高度 ⇒ 限高；6 列后每行更矮，放到 224px 能露 2.5 行（2026-11-16） */
.modal:has(.ttf-wrap) .tt-cp-grid { max-height: 224px; }
.modal:has(.ttf-wrap) .tt-edit { min-height: 176px; }

/* ── 顶栏账号区：头像 + 昵称 + 岗位（2026-11-16 船长） ── */
#appbarUser { display: flex; align-items: center; gap: 8px; }
#appbarUser .me-av { flex: none; display: inline-flex; }
#appbarUser .me-av .avt { border-radius: 50%; background: var(--primary-soft, #e6f1fb); color: var(--primary, #1a7f6e);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; overflow: hidden; }
#appbarUser .me-av .avt img { width: 100%; height: 100%; object-fit: cover; }
.um-head { display: flex; align-items: center; gap: 10px; }
.um-head .um-av .avt { border-radius: 50%; background: var(--primary-soft, #e6f1fb); color: var(--primary, #1a7f6e);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; overflow: hidden; }
.um-real { font-size: 11.5px; color: #7b8794; margin-top: 3px; }

/* ── 项目兑换行的「或」组：多选项目排成小标签，可换行（2026-11-16） ── */
.mt-pick.mc2-pick-alt { white-space: normal; height: auto; min-height: 30px; line-height: 1.8; text-align: left;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; overflow: hidden; }
.mc2-pick-alt .mc2-alt { display: inline-block; background: #eef5fd; color: #1d4ed8; border-radius: 5px;
  padding: 0 5px; margin: 1px 0; font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc2-pick-alt .mc2-or { font-style: normal; color: #98a2b3; font-size: 10.5px; margin-right: 4px; }

/* ── 系统设置·处置：左栏分类（默认 57 个全列 + 搜索 + 铅笔改名，2026-11-16） ── */
.pl2-l { max-height: calc(100vh - 200px); min-height: 540px; }
.pl2-cap { display: flex; align-items: baseline; gap: 6px; padding: 2px 2px 6px; }
.pl2-cap b { font-size: 12.5px; color: #3d4b5c; }
.pl2-cap span { font-size: 11px; color: #98a2b3; }
.pl2-cat { padding: 5px 8px; }
.pl2-cat .pl2-pen { flex: none; font-style: normal; font-size: 12px; color: #8a95a3;
  padding: 0 3px; border-radius: 4px; opacity: .85; transition: .12s; }
.pl2-cat:hover .pl2-pen { opacity: 1; }
.pl2-cat .pl2-pen:hover { background: #dbeafe; color: #1d4ed8; }
.pl2-cat.on .pl2-pen { opacity: .75; }
.pl2-none { padding: 8px 9px; font-size: 11.5px; color: #98a2b3; }

/* ── 底部鲨鱼：轻微上下浮动（2026-11-16）──
   水平位移是按时间算的真实进度（9~18 点走完全程），但一小时才走 1/9 屏 ⇒ 光看水平方向像没动。
   加一个 3.4s 的上下浮动，让人一眼看出"在游"，同时不改变任何位置计算。 */
@keyframes sdBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
.sd-fin { animation: sdBob 3.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .sd-fin { animation: none; } }

/* ── 会员卡「选券种」面板：左券类型+券种、右详情（2026-11-16，与选处置同版式） ── */
.mkp.mkp-s { height: min(46vh, 380px); }
.mct-d { padding: 14px 16px; }
.mct-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mct-h b { font-size: 14.5px; color: #22303f; }
.mct-kv { display: flex; gap: 10px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed #eef1f6; }
.mct-kv span { width: 62px; flex: none; color: #8b95a3; }
.mct-kv b { font-weight: 500; color: #2f3a48; }
.mct-sec { margin: 14px 0 4px; font-size: 12px; color: #8b95a3; }
.mct-item { display: flex; gap: 10px; padding: 5px 0; font-size: 12.5px; color: #2f3a48; }
.mct-item span { flex: 1; min-width: 0; }
.mct-item em { font-style: normal; color: #12a150; }
.mct-note { font-size: 12px; color: #7b8794; line-height: 1.75; background: #f7f9fc;
  border-radius: 8px; padding: 8px 10px; margin-top: 6px; }

/* ── 系统设置·处置：行上下移动（拖动/↑↓，自动保存）（2026-11-16） ── */
.pl-mv { width: 52px; white-space: nowrap; user-select: none; }
.pl-grip { font-style: normal; color: #b6c0cc; cursor: grab; letter-spacing: -2px;
  display: inline-block; padding: 0 2px; }
.pl-grip:active { cursor: grabbing; }
.pl-row:hover .pl-grip { color: #7b8794; }
.pl-mvb { display: inline-block; width: 15px; text-align: center; font-weight: 400;
  font-size: 12px; color: #b6c0cc; cursor: pointer; border-radius: 3px; margin-left: 1px; }
.pl-row:hover .pl-mvb { color: #5a6675; }
.pl-mvb:hover { background: #e6f1fb; color: #185fa5; }
.pl-row.drop-before td { box-shadow: inset 0 2px 0 #2563eb; }
.pl-row.drop-after td { box-shadow: inset 0 -2px 0 #2563eb; }
.pl-row.dragging { opacity: .55; }

/* ── 处置弹窗·右栏卡券：两列小叠卡（2026-11-16 船长）──
   一叠＝一个券种，右上角显示还剩几张；用一张 -1，用完变灰沉底（不再显示已用的）。 */
.tt-cp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 8px; padding: 8px;
  overflow: auto; flex: 1; min-height: 0; align-content: start; }
.tcg { position: relative; border: 1px solid #d6ecdf; border-radius: 8px; background: #fafffc; padding: 5px 6px 6px;
  box-shadow: 2px 2px 0 0 #fff, 2px 2px 0 1px #cfe6d8, 4px 4px 0 0 #fff, 4px 4px 0 1px #dfeae4; }
.tcg.mc { border-color: #dbe6f5; background: #fbfdff;
  box-shadow: 2px 2px 0 0 #fff, 2px 2px 0 1px #d3e0f0, 4px 4px 0 0 #fff, 4px 4px 0 1px #e2eaf6; }
.tcg.dim { opacity: .72; box-shadow: none; background: #f7f8fa; border-color: #e6e9ee; }
.tcg-q { position: absolute; right: 5px; top: 4px; font-size: 10px; font-weight: 700; color: #fff;
  background: #12a150; border-radius: 99px; padding: 0 5px; line-height: 15px; }
.tcg-q.blue { background: #2563eb; }
.tcg-q.orange { background: #e08a1e; }
.tcg-q.gray { background: #b6c0cc; }
.tcg-n { font-size: 11.5px; font-weight: 600; padding-right: 28px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcg-u { font-size: 9.5px; color: #6b7684; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcg-d { font-size: 9px; color: #98a2b3; margin-top: 1px; white-space: nowrap; }
.tcg-b { width: 100%; margin-top: 4px; border: 1px solid #bfe6d2; background: #fff; color: #147a52;
  border-radius: 5px; font-size: 10px; padding: 2px 0; cursor: pointer; }
.tcg-b.off { border-color: #e3e8ef; color: #9aa4b1; background: #f6f7f9; cursor: default; }
.tcg-b:hover:not(.off) { background: #eef8f2; }
.tt-hide-btns { display: none; }

/* 🆕 2026-11-16 船长：「修改处置 → 当日所有处置在一页合集」
   弹窗比普通 modal 宽（要放得下 项目/单价/数量/小计 四列），主体自己滚。 */
.modal.tde-modal{width:min(1120px,95vw);max-height:92vh;display:flex;flex-direction:column}
.tde-wrap{display:flex;flex-direction:column;min-height:0}
.tde-top{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;padding-bottom:8px;border-bottom:1px solid #eef2f7}
.tde-top h3{margin:0;font-size:15px}
.tde-cnt{font-size:11.5px;color:#8d99a8}
.tde-body{overflow:auto;padding:10px 2px 6px;min-height:0}
.tde-sec{border:1px solid #e8edf3;border-radius:10px;margin-bottom:10px;background:#fff;overflow:hidden}
.tde-h{display:flex;align-items:center;gap:9px;padding:7px 11px;background:#f7f9fc;border-bottom:1px solid #eef2f7;font-size:12.5px}
.tde-h .tde-time{color:#0b6fb8;font-variant-numeric:tabular-nums}
.tde-h .tde-dr{color:#33404f}
.tde-h .tde-vt{font-style:normal;color:#7b8794;font-size:11.5px;background:#eef2f7;border-radius:6px;padding:1px 7px}
.tde-h .tde-sum{margin-left:auto;font-style:normal;font-weight:600;color:#c0392b;font-variant-numeric:tabular-nums}
.tde-h .tde-full{font-size:11.5px;color:#0b6fb8;background:none;border:0;cursor:pointer;padding:0 2px}
.tde-h .tde-full:hover{text-decoration:underline}
.tde-tb{width:100%;border-collapse:collapse;font-size:12.5px}
.tde-tb th{text-align:left;font-weight:500;font-size:11.5px;color:#8d99a8;padding:5px 8px;border-bottom:1px solid #f1f4f8}
.tde-tb td{padding:3px 8px;border-bottom:1px solid #f6f8fb}
.tde-tb tr:last-child td{border-bottom:0}
.tde-i{width:100%;border:1px solid #eef2f7;border-radius:6px;padding:4px 6px;font-size:12.5px;background:#fcfdfe}
.tde-i:hover{border-color:#d7e2ee;background:#fff}
.tde-i:focus{outline:none;border-color:#7cc0f0;background:#fff;box-shadow:0 0 0 2px rgba(0,160,232,.12)}
.tde-i.num{text-align:right;font-variant-numeric:tabular-nums}
.tde-sub{text-align:right;font-variant-numeric:tabular-nums;color:#33404f}
.tde-del{border:0;background:none;color:#c9d2dd;font-size:15px;line-height:1;cursor:pointer;padding:2px 4px}
.tde-del:hover{color:#d94a4a}
.tde-plus{display:flex;align-items:center;gap:10px;padding:5px 11px 8px}
.tde-add{border:1px dashed #cfd9e6;background:#fbfcfe;color:#0b6fb8;border-radius:7px;font-size:11.5px;padding:3px 10px;cursor:pointer}
.tde-add:hover{background:#f2f8ff;border-color:#8dc4ea}
.tde-note{font-size:11px;color:#9aa7b6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tde-foot{display:flex;align-items:center;gap:12px;padding-top:9px;border-top:1px solid #eef2f7}
.tde-foot b{font-size:15px;color:#c0392b;font-variant-numeric:tabular-nums}
.tde-hint{margin-right:auto;font-size:11px;color:#9aa7b6}
@media (max-width:820px){
  .modal.tde-modal{width:96vw;max-height:94vh}
  .tde-hint{display:none}
  .tde-tb th:nth-child(1),.tde-tb td:nth-child(1){display:none}
}

/* ══════════════════════════════════════════════════════════════════════════
   🆕 2026-11-16 船长（前台账号）：诊疗记录页「收欠费」/「查看病历」两个弹窗
   · 收欠费（.modal-collect / .tt-cd）：跨天欠费清单，一行一单，右侧收款
   · 查看病历（.modal-recview / .rv-readonly）：复用病历卡片，只读
   ══════════════════════════════════════════════════════════════════════════ */
.modal.modal-collect { width: min(820px, 96vw); }
.tt-cd { border: 1px solid #eef2f7; border-radius: 10px; overflow: hidden; margin: 8px 0 4px; }
.tt-cd-h, .tt-cd-r { display: grid; align-items: center; gap: 10px; padding: 7px 12px;
  grid-template-columns: 118px minmax(0, 1fr) 88px 88px 96px 76px; font-size: 12.5px; }
.tt-cd-h { background: #f6f9fc; color: #8d99a8; font-size: 11.5px; border-bottom: 1px solid #eef2f7; }
.tt-cd-r { border-bottom: 1px solid #f6f8fb; }
.tt-cd-r:last-child { border-bottom: 0; }
.tt-cd-r:hover { background: #fbfdff; }
.tt-cd-t { color: #55616f; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tt-cd-n { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tt-cd-n b { font-weight: 500; color: #33404f; }
.tt-cd-n i { font-style: normal; font-size: 11.5px; color: #8d99a8;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-cd-d { color: #c0392b; font-weight: 600; font-variant-numeric: tabular-nums; }
.tt-cd-h > span:nth-child(3), .tt-cd-h > span:nth-child(4),
.tt-cd-h > span:nth-child(5), .tt-cd-h > span:nth-child(6) { text-align: right; }
.tt-cd-r > span:nth-child(3), .tt-cd-r > span:nth-child(4) {
  text-align: right; color: #55616f; font-variant-numeric: tabular-nums; }
.tt-cd-r > span:nth-child(6) { text-align: right; }

.modal.modal-recview { width: min(1000px, 96vw); }
/* 只读查阅区：卡片自带「相关影像」块，前台没有 imageRead（缩略图会 403）⇒ 整块藏掉，只留文字 */
.rv-readonly { max-height: 62vh; overflow: auto; padding-right: 4px; }
/* 🔴 选择器必须带 `.rec-card`：卡片自己的 `.rec-card.ek-official .eks-ph{display:grid}`
   （三档权重）比 `.rv-readonly .eks-ph`（两档）高 ⇒ 原来那句被压住，影像空块照样露出来（实测）。 */
.rv-readonly .rec-card .eks-ph { display: none; }
@media (max-width: 820px) {
  .modal.modal-collect { width: 96vw; }
  /* 窄屏只留「欠费 + 收款」，应收/已收两列让位（收款弹窗里仍能看到明细） */
  .tt-cd-h, .tt-cd-r { grid-template-columns: 96px minmax(0, 1fr) 84px 70px; padding: 7px 9px; }
  .tt-cd-h > span:nth-child(3), .tt-cd-r > span:nth-child(3),
  .tt-cd-h > span:nth-child(4), .tt-cd-r > span:nth-child(4) { display: none; }
  .modal.modal-recview { width: 96vw; }
  .rv-readonly { max-height: 68vh; }
}

/* ═══ 收银对账 / 交账（2026-11-18 船长）═══ */
.cs-wrap { display: flex; flex-direction: column; gap: 10px; }
.cs-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-bar .cs-lab { font-size: 12.5px; color: var(--muted); }
.cs-bar .cs-note { font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.cs-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cs-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.cs-card span { display: block; font-size: 12px; color: var(--muted); }
.cs-card b { display: block; font-size: 17px; font-weight: 600; color: #1f2d3d; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cs-card i { display: block; font-style: normal; font-size: 11px; color: #95a1b0; margin-top: 2px; }
.cs-listwrap { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
.cs-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.cs-list thead th { position: sticky; top: 0; z-index: 1; background: #fafcfe; color: #5b6775;
  font-weight: 600; font-size: 12.5px; text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.cs-list tbody td { padding: 8px 10px; border-bottom: 1px solid #f2f5f9; }
.cs-list td.num, .cs-list th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-list td.cs-item { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3d4855; }
.cs-list tr.un { background: #fffaf0; }
.cs-list .cs-none { text-align: center; color: var(--muted); padding: 22px 0; }
.cs-ok { color: #15803d; font-size: 12px; }
.cs-un { color: #b45309; font-size: 12px; }
.cs-diff { color: #b42318; font-weight: 600; }
.cs-badge { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: #f2f5f9; color: #5b6775; }
.cs-badge.wait { background: #fff5e5; color: #b45309; }
.cs-badge.ok { background: #e7f6ec; color: #15803d; }
.cs-badge.bad { background: #fdecec; color: #b42318; }
.cs-alert { background: #f2f7ff; border: 1px solid #dce8fa; color: #2f5d9a; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; }
.cs-alert.warn { background: #fff7e8; border-color: #f5e3b3; color: #7a5b12; }
.cs-alert.ok { background: #eef8f1; border-color: #cfe9d8; color: #15803d; }
.cs-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px;
  background: #fbfcfe; border: 1px solid var(--border); border-radius: 10px; }
.cs-foot .cs-lab { font-size: 12.5px; color: var(--muted); }
.cs-foot .cs-sp { flex: 1; }
.cs-hint { font-size: 12px; color: var(--muted); }
.cs-hint b { color: #b45309; }
@media (max-width: 1000px) { .cs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ═══ 本机浏览器采集控制页（2026-11-18）═══ */
.bt-wrap { display: flex; flex-direction: column; gap: 12px; }
.bt-cmd { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bt-cmd code { background: #f2f5f9; border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px;
  font-size: 12px; color: #33404f; flex: 1; min-width: 320px; overflow-x: auto; white-space: nowrap; }
.bt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bt-dot { width: 9px; height: 9px; border-radius: 50%; background: #c3ccd7; flex: none; }
.bt-dot.ok { background: #15803d; box-shadow: 0 0 0 3px rgba(21,128,61,.12); }
.bt-dot.wait { background: #b45309; box-shadow: 0 0 0 3px rgba(180,83,9,.12); }
.bt-dot.off { background: #c3ccd7; }
.bt-head b { font-size: 13px; }
.bt-head .cs-sp { flex: 1; }
.bt-kv { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 6px 10px; font-size: 12.5px; margin-top: 10px; }
.bt-kv span { color: var(--muted); }
.bt-kv b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-mods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bt-mod { font-size: 11.5px; background: #eef6ff; color: #2f5d9a; border-radius: 6px; padding: 3px 8px; }
.bt-mod i { font-style: normal; color: #6b849f; margin-left: 4px; }
.bt-logs { max-height: 300px; overflow: auto; font-size: 12px; }
.bt-log { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #f0f3f7; }
.bt-log i { font-style: normal; color: #9aa6b4; flex: none; width: 62px; }
.bt-log.ok span { color: #15803d; }
.bt-log.err span { color: #b42318; }
.bt-log.step span { color: #5b6775; }
