/* ==========================================================================
   口腔AI副驾 · 经营赋能系统 —— 前端样式
   --------------------------------------------------------------------------
   设计约束（都是被现场逼出来的）：
     1. 老板端首屏必须"10 秒看懂"——大数字 + 红黄绿，不要图表堆砌；
     2. 员工端必须"单手可用"——打卡按钮足够大、在拇指区，不要小图标；
     3. 红黄绿用中国口腔行业习惯：绿=达标、黄=预警、红=不达标。
        不用红/绿来表示"好/坏"以外的语义，避免歧义。
     4. 浅色主题：门诊场景多为诊室白光环境，深色界面在强光下反光看不清。
   ========================================================================== */

:root {
  /* —— 基础色板（沿用原名，全站自动受益） —— */
  --c-bg: #f4f7fb;
  --c-surface: #ffffff;
  --c-border: #e6ebf2;
  --c-border-strong: #d4dae3;
  --c-text: #0f1b2d;
  --c-text-sub: #5b6779;
  --c-text-mute: #8593a6;

  /* 品牌蓝梯度（在 #1a6dff 基础上补完，保留主色不变） */
  --c-brand: #1a6dff;
  --c-brand-2: #2f6bff;
  --c-brand-deep: #1943b8;
  --c-brand-grad: linear-gradient(135deg, #2f6bff, #1a6dff);
  --c-brand-soft: #eaf1ff;
  --c-brand-soft-2: #dbe6ff;

  /* 语义色（中国口腔习惯：绿=达标 / 黄=预警 / 红=不达标） */
  --c-green: #15a462;
  --c-green-soft: #e7f7ee;
  --c-green-deep: #0f7d4b;
  --c-yellow: #d98b00;
  --c-yellow-soft: #fff4e0;
  --c-yellow-deep: #a86900;
  --c-red: #e0443a;
  --c-red-soft: #fdeceb;
  --c-red-deep: #b32d25;

  --c-gray: #8a95a6;
  --c-gray-soft: #f0f2f5;

  /* 圆角梯度 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* 分层阴影 */
  --shadow-xs: 0 1px 2px rgba(15, 27, 45, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 27, 45, 0.06), 0 4px 10px rgba(15, 27, 45, 0.04);
  --shadow-md: 0 6px 16px rgba(15, 27, 45, 0.08);
  --shadow-lg: 0 14px 36px rgba(15, 27, 45, 0.12);
  --shadow-brand: 0 8px 20px rgba(26, 109, 255, 0.30);
  /* 旧名保留，供既有规则引用 */
  --shadow: var(--shadow-md);

  /* 8pt 间距体系 */
  --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;

  /* 动效 */
  --t-fast: 140ms;
  --t: 220ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------- 布局 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 56px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: 16px; }
.brand small { font-weight: 400; color: var(--c-text-mute); font-size: 12px; }

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav button {
  border: none;
  background: transparent;
  color: var(--c-text-sub);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.nav button:hover { background: var(--c-gray-soft); color: var(--c-text); }
.nav button.active { background: var(--c-brand-soft); color: var(--c-brand); font-weight: 600; }

.topbar .spacer { flex: 1; }
.who { color: var(--c-text-sub); font-size: 13px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px; }
.wrap-narrow { max-width: 560px; margin: 0 auto; padding: 16px; }

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
}
.card-title .sub { font-weight: 400; color: var(--c-text-mute); font-size: 12px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ 大数字盘 */
.kpi-row { display: flex; flex-wrap: wrap; gap: 16px; }
.kpi {
  flex: 1 1 180px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-gray);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.kpi.green { border-left-color: var(--c-green); }
.kpi.yellow { border-left-color: var(--c-yellow); }
.kpi.red { border-left-color: var(--c-red); }
.kpi.gray { border-left-color: var(--c-gray); }
.kpi .label { color: var(--c-text-sub); font-size: 13px; }
.kpi .value { font-size: 30px; font-weight: 700; line-height: 1.2; margin: 4px 0 2px; }
.kpi .value.green { color: var(--c-green); }
.kpi .value.yellow { color: var(--c-yellow); }
.kpi .value.red { color: var(--c-red); }
.kpi .hint { color: var(--c-text-mute); font-size: 12px; }

/* ---------------------------------------------------------------- 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}
.tag.green { background: var(--c-green-soft); color: var(--c-green); }
.tag.yellow { background: var(--c-yellow-soft); color: var(--c-yellow); }
.tag.red { background: var(--c-red-soft); color: var(--c-red); }
.tag.gray { background: var(--c-gray-soft); color: var(--c-gray); }
.tag.brand { background: var(--c-brand-soft); color: var(--c-brand); }

/* ---------------------------------------------------------------- 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left;
  color: var(--c-text-sub);
  font-weight: 500;
  padding: 9px 10px;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
table.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--c-border); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td.num { font-variant-numeric: tabular-nums; }
.issue { color: var(--c-text-sub); font-size: 12px; }

/* --------------------------------------------------------------- 按钮 */
.btn {
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 14px;
}
.btn:hover { border-color: var(--c-brand); color: var(--c-brand); }
.btn.primary { background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.btn.primary:hover { background: #0f5be0; color: #fff; }
.btn.big { width: 100%; padding: 15px; font-size: 16px; font-weight: 600; border-radius: 10px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* --------------------------------------------------------------- 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; color: var(--c-text-sub); font-size: 13px; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--c-brand); }

/* --------------------------------------------------------- 员工任务卡 */
.task {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.task.done { background: var(--c-green-soft); border-color: #c9ebd9; }
.task-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.task-name { font-weight: 600; font-size: 15px; flex: 1; }
.task-meta { color: var(--c-text-sub); font-size: 12px; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.task-std {
  background: var(--c-gray-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--c-text-sub);
  font-size: 12px;
  margin-bottom: 10px;
}

.progress-line { height: 8px; background: var(--c-gray-soft); border-radius: 999px; overflow: hidden; }
.progress-line > i { display: block; height: 100%; background: var(--c-green); border-radius: 999px; }

/* --------------------------------------------------------------- 提示条 */
.alert { border-radius: var(--radius-sm); padding: 10px 13px; font-size: 13px; margin-bottom: 14px; }
.alert.warn { background: var(--c-yellow-soft); color: #8a5a00; }
.alert.error { background: var(--c-red-soft); color: var(--c-red); }
.alert.info { background: var(--c-brand-soft); color: #1552bd; }
.alert.ok { background: var(--c-green-soft); color: var(--c-green); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: #1b2434;
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}

.muted { color: var(--c-text-mute); font-size: 13px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mb0 { margin-bottom: 0; }

/* 免责声明：等级≠晋升，必须显式可见 */
.disclaimer {
  color: var(--c-text-mute);
  font-size: 12px;
  border-top: 1px dashed var(--c-border);
  padding-top: 10px;
  margin-top: 12px;
}

/* ==========================================================================
   v2.4 组件层 —— 视图注册表重建后引入
   --------------------------------------------------------------------------
   这一批类都是"页面结构件"（导航分组、标签页、工具条、模态、键值、空态、
   骨架屏）。单独列在这里是因为它们此前完全不存在：
   代码里写了 class 但样式表没有对应规则，浏览器不会报错，
   只会安静地不加样式——在老板机上看起来就是"这一版没做完"。
   ========================================================================== */

/* ------------------------------------------------------ 顶栏补充：分组导航 */
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 14px; }
.nav-group { display: flex; gap: 4px; }
.nav-sep { width: 1px; height: 20px; background: var(--c-border); margin: 0 8px; }
.grow { flex: 1; }

/* ------------------------------------------------------------- 分段控件 */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--c-gray-soft);
  border-radius: var(--radius-sm);
}
.seg button {
  border: none;
  background: transparent;
  color: var(--c-text-sub);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.seg button:hover { color: var(--c-text); }
.seg button.active {
  background: var(--c-surface);
  color: var(--c-brand);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------- 标签页 */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}
.tabs button {
  border: none;
  background: transparent;
  color: var(--c-text-sub);
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--c-text); }
.tabs button.active {
  color: var(--c-brand);
  border-bottom-color: var(--c-brand);
  font-weight: 600;
}

/* --------------------------------------------------------------- 工具条 */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.toolbar-card { padding: 12px 16px; }
/* 空标题工具条：去掉标题栏底部留白，让按钮与卡片上沿对齐 */
.toolbar-card .card-title { margin-bottom: 0; }
.tb-item { display: flex; align-items: center; gap: 6px; }
.tb-item label { color: var(--c-text-sub); font-size: 13px; white-space: nowrap; }
.tb-item select,
.tb-item input {
  padding: 7px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
}
.tb-sp { flex: 1; }
.tb-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-text-sub);
  font-size: 13px;
}
.tc-pick { cursor: pointer; }

/* ----------------------------------------------------------- 表单补充 */
.form { margin-bottom: 4px; }
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  resize: vertical;
}
.field textarea:focus { outline: none; border-color: var(--c-brand); }
.field-inline label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.field-inline input[type='checkbox'] { width: auto; }
.req { color: var(--c-red); }
.hint { color: var(--c-text-mute); font-size: 12px; margin-top: 5px; }

/* ------------------------------------------------ 企微接入配置（机构级） */
.intg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 14px 0; }
.intg-channel { border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); padding: 14px; }
.intg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.intg-title { font-weight: 600; font-size: 15px; color: var(--c-text); display: flex; align-items: center; gap: 8px; }
.intg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.intg-channel .field { margin-bottom: 10px; }
.intg-channel .field input { padding: 8px 10px; font-size: 13px; }
.intg-channel .inline-field { grid-column: 1 / -1; }
.intg-meta { font-size: 12px; margin: 4px 0 10px; }
.intg-actions { display: flex; gap: 8px; margin-top: 4px; }
.intg-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--c-border); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-text-sub); cursor: pointer; }
.chk input[type='checkbox'] { width: auto; }
@media (max-width: 560px) {
  .intg-fields { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------- 模态 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  background: rgba(16, 30, 54, 0.45);
  overflow: auto;
}
.modal {
  width: 100%;
  max-width: 520px;
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal.wide { max-width: 860px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--c-border);
  font-size: 15px;
  font-weight: 700;
}
.modal-x {
  border: none;
  background: transparent;
  color: var(--c-text-mute);
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
}
.modal-x:hover { color: var(--c-text); }
.modal-body { padding: 18px 20px; max-height: 64vh; overflow: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--c-border);
}

/* -------------------------------------------- 键值 / 空态 / 骨架屏 / JSON */
.kv { display: grid; gap: 10px 20px; }
.kv-1 { grid-template-columns: 1fr; }
.kv-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .kv-2, .kv-3, .kv-4 { grid-template-columns: 1fr; }
}
.kv-item { min-width: 0; }
.kv-k { color: var(--c-text-mute); font-size: 12px; }
.kv-v { font-size: 13px; word-break: break-word; }

.empty { padding: 26px 16px; text-align: center; }
.empty-t { color: var(--c-text-sub); font-size: 14px; font-weight: 600; }
.empty-h { color: var(--c-text-mute); font-size: 12px; margin-top: 6px; }

.skeleton {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 4px;
  color: var(--c-text-mute);
  font-size: 13px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-brand);
  animation: ob-blink 1s infinite ease-in-out;
}
.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes ob-blink {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.json { margin-top: 10px; }
.json summary { cursor: pointer; color: var(--c-brand); font-size: 13px; }
.json pre {
  margin: 8px 0 0;
  padding: 12px 14px;
  max-height: 420px;
  overflow: auto;
  background: var(--c-gray-soft);
  color: var(--c-text);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { font-size: 13px; }
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
}
.ct-sm { color: var(--c-text-mute); font-size: 12px; margin: 10px 0 4px; }
.tight td, .tight th { padding: 7px 8px; }
.mb8 { margin-bottom: 8px; }

/* 自适应渲染产生的子卡片：与主卡片视觉上分级，避免"卡片套卡片"看起来一样重 */
.card.nested {
  padding: 14px;
  margin-bottom: 12px;
  background: var(--c-bg);
  box-shadow: none;
}
.card.nested .card-title { font-size: 13px; margin-bottom: 10px; }

/* 小号按钮：表格行内操作专用 */
.btn.xs { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ------------------------------------------------------- 登录页：快速登录 */
.quick-logins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 700px) { .quick-logins { grid-template-columns: 1fr; } }
.quick-login {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
}
.quick-login:hover { border-color: var(--c-brand); }
.quick-login b { font-size: 14px; }
.ql-who { color: var(--c-brand); font-size: 12px; }
.ql-desc { color: var(--c-text-mute); font-size: 12px; line-height: 1.45; }

/* ==========================================================================
   v2 质感升级层（2026-09-17 · 纯 CSS 增强，可整体删除回退）
   --------------------------------------------------------------------------
   仅升级现有组件观感：更大圆角、分层阴影、hover 浮起、聚焦环、过渡动效。
   不改变任何 HTML 结构 / JS 逻辑；所有类名沿用现网，自动受益。
   ========================================================================== */

/* 全局滚动条（浅色诊室友好） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 999px; border: 2px solid var(--c-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-mute); }

/* 顶栏：轻微投影 + 略增高 */
.topbar { height: 60px; box-shadow: var(--shadow-sm); }
.brand { font-size: 16px; }
.nav button { transition: all var(--t-fast); }
.nav button.active { box-shadow: inset 0 -2px 0 var(--c-brand); }

/* 卡片：更圆 + 悬停浮起 */
.card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title { font-size: 16px; }
.card.nested { background: var(--c-bg); border: 1px solid var(--c-border); box-shadow: none; }
.card.nested:hover { box-shadow: none; }

/* KPI 大数字盘：悬停浮起 */
.kpi {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi .value { font-size: 32px; }

/* 按钮：微交互 + 聚焦环 */
.btn { font-weight: 500; transition: all var(--t-fast); }
.btn:hover { box-shadow: var(--shadow-xs); }
.btn.primary { box-shadow: var(--shadow-xs); }
.btn.primary:hover { box-shadow: var(--shadow-brand); transform: translateY(-1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-brand-soft); }
.btn.big { border-radius: var(--radius-md); }

/* 标签：更精致 */
.tag { font-weight: 500; padding: 3px 10px; }

/* 表格：行悬停 */
table.tbl tbody tr { transition: background var(--t-fast); }
table.tbl tbody tr:hover { background: var(--c-gray-soft); }
table.tbl th { font-weight: 600; }
table.tbl td { padding: 13px 10px; }

/* 任务卡：悬停浮起（员工端单手） */
.task { transition: all var(--t); }
.task:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* 进度条略增粗 */
.progress-line { height: 9px; }

/* 分段 / 标签页 / 工具条：过渡 + 更大圆角 */
.seg button { transition: all var(--t-fast); }
.tabs button { transition: all var(--t-fast); }
.toolbar { margin-bottom: var(--s5); }
.toolbar-card { border-radius: var(--radius-lg); }

/* 表单：聚焦环 */
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px var(--c-brand-soft);
}

/* 模态：更大圆角 + 更强投影 */
.modal { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* 提示条：图标与文字对齐 */
.alert { display: flex; gap: 8px; align-items: flex-start; }

/* 快速登录卡：悬停浮起 */
.quick-login { transition: all var(--t-fast); }
.quick-login:hover { box-shadow: var(--shadow-xs); transform: translateY(-1px); }

/* ==========================================================================
   v3 结构层（2026-09-17 · 顶栏导航 → 左侧导航栏 + 看板强化）
   --------------------------------------------------------------------------
   与 v2 层的区别：v2 只动"观感"（颜色/圆角/阴影/hover），所以静态截图里
   几乎看不出来。v3 动的是"形态"——导航从顶栏横排改为左侧纵排、内容区
   重新分区、KPI 数字放大。形态变化是肉眼可辨的，这类改动才叫"界面变了"。

   纯 CSS、可整段删除回退；不改任何类名契约（#nav / data-nav / .kpi 结构均不变）。
   ========================================================================== */

/* ---------------------------------------------------------------- 应用外壳 */
.shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}
.shell-body { flex: 1 1 auto; min-width: 0; }

/* 内容区：左侧让出导航后，左右留白给足，行宽不失控 */
.shell-body .wrap { max-width: 1240px; padding: 24px 28px 56px; }

/* ---------------------------------------------------------------- 左侧导航 */
.rail {
  flex: 0 0 224px;
  width: 224px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  z-index: 20;
}

/* 品牌区：纵向两块（主名 + 副名），不再是基线横排 */
.rail .brand {
  display: block;
  padding: 18px 16px 15px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  border-bottom: 1px solid var(--c-border);
}
.rail .brand small { display: block; margin-top: 1px; font-size: 12px; font-weight: 400; }

/* 导航：纵向分组，可滚动；这是根治"逐字竖排折行"的地方 */
.rail .nav {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 10px 10px 16px;
  overflow-y: auto;
  overflow-x: hidden;
}
.rail .nav-group { display: flex; flex-direction: column; gap: 2px; }
.rail .nav-group-title {
  padding: 8px 10px 6px;
  color: var(--c-text-mute);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.rail .nav-sep { width: auto; height: 1px; margin: 10px 6px; background: var(--c-border); }

/* 导航项：整行可点、图标 + 文字分离、绝不折行 */
.rail .nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  text-align: left;
  border-radius: var(--radius-sm);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
}
.rail .nav button .ico { flex: 0 0 18px; text-align: center; font-size: 15px; line-height: 1; }
.rail .nav button .txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rail .nav button:hover { background: var(--c-gray-soft); color: var(--c-text); }
/* 覆盖 v2 给顶栏写的下划线（纵向导航用不上，留着会变成一条悬空的蓝线） */
.rail .nav button.active { box-shadow: none; }

/* 底栏：当前账号 + 退出 */
.rail-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--c-border);
}
.rail-foot .who { flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 1.4; }
.rail-foot .btn { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; }

/* ------------------------------------------------------- 窄屏（≤900px）降级
   手机/小平板上左侧栏太占宽（224px 等于半个屏），会挤压内容。
   降级为"顶部一条横向可滚动的导航条"：仍是纵向排版以外的形态，
   但保证了菜单项单行不折行，且手指可横滑 —— 比原来的逐字竖排好得多。 */
@media (max-width: 900px) {
  .shell { display: block; }
  .rail {
    position: sticky;
    top: 0;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
  }
  .rail .brand {
    flex: 0 0 auto;
    padding: 10px 0;
    border-bottom: none;
    font-size: 14px;
    white-space: nowrap;
  }
  .rail .brand small { display: none; }
  .rail .nav {
    flex-direction: row;
    gap: 4px;
    padding: 8px 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .rail .nav-group { flex-direction: row; gap: 4px; }
  .rail .nav-group-title { display: none; }
  .rail .nav-sep { width: 1px; height: 18px; margin: 0 5px; flex: 0 0 auto; }
  .rail .nav button { width: auto; padding: 7px 12px; flex: 0 0 auto; }
  .rail .nav button .ico { flex: 0 0 auto; }
  .rail-foot { flex: 0 0 auto; padding: 8px 0; border-top: none; }
  .rail-foot .who { display: none; }
  .shell-body .wrap { padding: 16px 14px 40px; }
}

/* ------------------------------------------------------------- 看板 KPI 强化
   老板首屏只有 10 秒注意力：数字要够大、颜色要够肯定。 */

/* 补齐缺失的颜色变体 —— 接口会返回 brand/gray，但样式表里从来没有这两个类，
   结果是"营收目标""门诊量目标"这类卡片左侧一直在用灰色边，
   看起来像"数据缺失"，与真实语义相反。 */
.kpi.brand { border-left-color: var(--c-brand); }
.kpi .value.brand { color: var(--c-brand); }
.kpi .value.gray { color: var(--c-text-sub); }

.kpi-row { gap: 14px; }
.kpi { padding: 17px 19px; border-left-width: 5px; }
.kpi .value {
  font-size: 34px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi .label { font-size: 13px; }
.kpi .hint { font-size: 12px; line-height: 1.5; }

/* 页面标题：左侧导航已经承担了"我在哪"，标题就用来强化当前页 */
.page-title { font-size: 22px; letter-spacing: -0.01em; }

/* ==========================================================================
   v4 驾驶舱层（2026-09-17 · 老板经营看板完整重构）
   纯 CSS、可整段删除回退；类名均为本页新引入（.ai-report / .plan-row），
   不改动 .kpi / .card / .alert 等既有契约，仅做增强。
   ========================================================================== */

/* KPI 脚注：把「目标 + 状态」做成左右两栏的 foot，贴近设计稿大数字盘 */
.kpi .hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--c-text-mute);
  margin-top: 6px;
}
.kpi .hint span:last-child { color: var(--c-text-sub); text-align: right; }
.kpi .value small { font-size: 18px; font-weight: 600; margin-left: 2px; color: var(--c-text-sub); }

/* 顶部汇总条：把经营首屏一句话结论顶在最上，老板 10 秒看懂 */
.dash-summary { margin-bottom: 16px; }
.dash-summary .alert { font-size: 13.5px; line-height: 1.6; }
.dash-summary .alert b { font-weight: 700; }

/* AI 经营周报 hero：渐变品牌底 + AI 火花角标，是驾驶舱的视觉焦点 */
.ai-report {
  background: linear-gradient(135deg, #f4f8ff, #eef3ff);
  border: 1px solid var(--c-brand-soft);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-top: 24px;
}
.ai-report h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.ai-report h3 .spark {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--c-brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}
.ai-report p { margin: 0 0 8px; font-size: 14px; color: var(--c-text-sub); line-height: 1.75; }
.ai-report p.muted { color: var(--c-text-mute); }
.ai-report ul { margin: 8px 0 0; padding-left: 18px; }
.ai-report li { font-size: 13.5px; color: var(--c-text-sub); margin-bottom: 6px; line-height: 1.65; }
.ai-report li b { color: var(--c-text); }
.ai-report .task-std {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--c-text-sub);
  white-space: pre-wrap;
}
.ai-report .meta { margin-top: 12px; font-size: 12px; color: var(--c-text-mute); }
.ai-report .ar-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.ai-report .ct-sm { font-size: 12.5px; font-weight: 600; color: var(--c-text); margin: 12px 0 2px; }

/* 执行计划 · 进行中：紧凑行卡，左侧状态图标 + 进度条 */
.plan-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--c-border);
}
.plan-row:last-child { border-bottom: none; }
.plan-ic {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex: 0 0 auto;
}
.plan-ic.run { background: var(--c-green-soft); color: var(--c-green); }
.plan-ic.pause { background: var(--c-yellow-soft); color: var(--c-yellow); }
.plan-ic.draft { background: var(--c-gray-soft); color: var(--c-gray); }
.plan-main { flex: 1; min-width: 0; }
.plan-name { font-weight: 600; font-size: 14.5px; color: var(--c-text); }
.plan-meta { font-size: 12.5px; color: var(--c-text-mute); margin-top: 2px; }
.plan-tag { flex: 0 0 auto; }

/* KPI 行在壳体内撑满；窄壳时自然换行 */
.shell-body .kpi-row { width: 100%; }

/* ==========================================================================
   v5 排版与响应式层（2026-09-17 · 修"版面混乱"的三类成因）
   --------------------------------------------------------------------------
   与前面几层的分工：v2 管观感、v3 管形态、v4 管驾驶舱。v5 只做三件事，
   纯 CSS、可整段删除回退：

     1. 旧 DOM 兜底 —— 浏览器若仍攥着改版前的 index.html，新样式不得打散旧结构。
     2. 问副驾改版 —— 发问条 / 知识检索 / 会话行，替掉"通栏按钮 + 内联布局"。
     3. 响应式规范 —— 宽表格、卡片内距、窄屏下的行内换行。

   共同的动机：把"布局"从内联样式和默认值里收回到样式表。此前这一页的
   错位与间距不均，几乎都来自两个默认值 —— 按钮复用了登录页的 width:100%、
   段落带着 UA 默认的 margin-bottom。
   ========================================================================== */

/* ------------------------------------------- 1. 旧顶栏 DOM 兜底（安全网）
   背景：v3 把导航从"顶栏横排"改成了"左侧纵排"。它的规则
   （.rail .nav{flex-direction:column}、.rail .nav-group{...} 等）**一律以 .rail 为前提**。
   旧版 index.html 把导航放在 <header class="topbar"> 里，导航不在 .rail 内，
   所以拿不到任何一条 v3 导航规则 —— 会退化成改版前那一版的横排顶栏，
   而不是被竖排、向下溢出、盖住正文。

   这个 scoping 是刻意的，也是这次"版面混乱"的样式侧解法：
   规则只作用于"新结构里存在的容器"，于是同一份 CSS 面对新旧两种 DOM
   都能渲染出可用的界面。反过来说，若有人日后把 .rail 从这些选择器里去掉，
   旧 DOM + 新样式就会立刻重新炸掉 —— 改这里时请保留前缀。

   唯一仍需单独处理的是旧顶栏写死的 height:60px：菜单横向折行后总高会略超它，
   固定高度会把第二行裁掉。让它按内容长高即可（旧 DOM 下只表现为"顶栏略高"）。 */
.topbar { height: auto; min-height: 56px; }

/* 卡片内最后一个元素的底边距会与卡片自身 padding 叠加，看上去"下面空一块" */
.card > *:last-child { margin-bottom: 0; }
/* 任务/结果卡排在容器末尾时同理：列表尾部那 12px 是"看不见的留白" */
.task:last-child { margin-bottom: 0; }

/* ------------------------------------------------- 2. 问副驾：发问条 / 检索 / 会话 */

/* 发问条：说明文字吃掉剩余宽度，发送键固定在右侧、只占自身宽度。
   此前 发送 用的是 .btn.big —— 那是给登录页整块 CTA 写的 width:100%，
   搬到卡片里就成了一条通栏蓝条：既压过标题的层级，也把这一页的节奏拉散。 */
.composer {
  display: flex;
  align-items: center;
  gap: 12px;
}
.composer .hint { flex: 1 1 auto; min-width: 0; margin: 0; }
.composer .btn { flex: 0 0 auto; min-width: 92px; }

/* 知识检索行：输入框伸缩，按钮不参与伸缩。
   此前靠 <div class="tb-item" style="flex:1"> + 内联 width:100% 实现 ——
   布局一旦写进内联样式，窄屏要调整就得回头改 JS。 */
.search-row { display: flex; align-items: center; gap: 10px; }
.search-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
}
.search-row input:focus { outline: none; border-color: var(--c-brand); }
.search-row .btn { flex: 0 0 auto; }

/* 会话行：标题吃掉剩余宽度并以省略号收尾，时间与操作固定宽度。
   此前标题和时间靠 .tb-sp 撑开，窄屏时标题先换行、按钮再掉到第二行。 */
.sess-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--c-border);
}
.sess-row:last-child { border-bottom: none; }
.sess-row .sess-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.sess-row .sess-time { flex: 0 0 auto; color: var(--c-text-mute); font-size: 12px; }
.sess-row .sess-ops { flex: 0 0 auto; display: flex; gap: 6px; }

/* 副驾的回答：独立的引用块，与用户提问在视觉上分层。
   刻意用 overflow-wrap 而不是 .task-std 的 word-break:break-all ——
   后者会把英文词与数字从中间切断（CBCT 断成 C/BCT、98.5% 断成 98/.5%）。 */
.reply-box {
  background: var(--c-gray-soft);
  border-left: 3px solid var(--c-brand);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--c-text);
  overflow-wrap: break-word;
}

/* 会话往来：我 / 副驾 用底色与缩进区分，比两段同色文字好扫 */
.msg {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--c-gray-soft);
}
.msg.me { background: var(--c-brand-soft); margin-right: 36px; }
.msg.ai { margin-left: 36px; }
.msg:last-child { margin-bottom: 0; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-who { font-weight: 600; font-size: 13px; color: var(--c-text); }
.msg-body { font-size: 14px; line-height: 1.7; overflow-wrap: break-word; }

/* ------------------------------------------------- 3. 响应式与间距规范 */

/* 宽表格在窄屏必然超出卡片宽度：不压缩列、不换行，改为卡片内横向滚动。
   用 :has() 精准命中"含表格的卡片"，避免给几十处 C.table() 调用点
   各加一层 wrapper（改动面大且容易漏）。不支持 :has() 的旧浏览器
   行为与改动前一致，属可接受的降级。 */
.card:has(table.tbl) { overflow-x: auto; }

@media (max-width: 900px) {
  /* 小屏统一降一档内距：卡片 18px 的留白在手机上会把内容挤窄 */
  .card { padding: 14px; }
  /* 发问条在窄屏改为两行：说明在上、按钮整行，保证触控目标够大 */
  .composer { flex-wrap: wrap; }
  .composer .hint { flex: 1 1 100%; }
  .composer .btn { flex: 1 1 100%; width: 100%; min-width: 0; margin-top: 2px; }
}

@media (max-width: 600px) {
  .sess-row { flex-wrap: wrap; }
  .sess-row .sess-title { flex: 1 1 100%; white-space: normal; }
  /* 第二行改成"时间靠左、操作靠右"：两端撑开比两个元素挤在右侧好扫 */
  .sess-row .sess-time { margin-left: 0; }
  .sess-row .sess-ops { margin-left: auto; }
  .search-row .btn { flex: 0 0 auto; }
  /* 手机上一屏本就窄，气泡左右缩进改由底色区分，把宽度还给文字 */
  .msg.me { margin-right: 0; }
  .msg.ai { margin-left: 0; }
}
