/* ============================================================
   上岸小助手 · 设计系统
   语言：澄明上岸 · 晨曦海岸（Linear / Apple HIG 极简质感重制）
   关键词：Clarity / Shoreline / Focus / Elevation / Premium
   原则：
   · 纯净透亮：告别泛黄泥泞纸感，拥抱晨曦瓷白与深邃星海
   · 上岸意象：深邃蔚蓝为魂，沉稳专注，代表跨越重洋终获上岸
   · 微妙层级：精细 1px 发丝边线 + 多阶漫反射投影，营造悬浮质感
   · 顺滑交互：触觉级按压反馈（scale 0.985）与微升过渡
   ============================================================ */
/* ---------- 设计 token：浅色 ----------
   2026 焕新升级：晨曦海岸（Dawn Shore）
   纯净瓷白底色 + 多层呼吸质感 + 活力蔚蓝主色 + 清晰四级掌握度
   ------------------------------------------------------------------ */
:root {
  color-scheme: light;
  /* ================= 设计系统 token（新一代：澄明上岸 · 晨曦海岸） ================= */
  --ds-bg: #f8fafc; 
  --ds-surface-1: #ffffff; --ds-surface-2: #f1f5f9; --ds-surface-3: #ffffff; 
  --ds-line: rgba(15, 23, 42, 0.08); --ds-line-2: rgba(15, 23, 42, 0.16);
  --ds-text-1: #0f172a; --ds-text-2: #334155; --ds-text-3: #64748b;
  --ds-accent: #2563eb; --ds-accent-strong: #1d4ed8; --ds-accent-soft: rgba(37, 99, 235, 0.08);
  --ds-accent-line: rgba(37, 99, 235, 0.28); --ds-on-accent: #ffffff;   
  --ds-sh-1: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --ds-sh-2: 0 10px 25px -5px rgba(15, 23, 42, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
  --ds-sh-3: 0 25px 50px -12px rgba(15, 23, 42, 0.16);
  --ds-r-1: 8px; --ds-r-2: 12px; --ds-r-3: 16px; --ds-r-4: 22px; --ds-texture-size: 24px 24px;
  --ds-texture: radial-gradient(circle, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  --ds-wash: radial-gradient(1200px 520px at 50% -40px, rgba(37, 99, 235, 0.05), transparent 75%);
  /* 背景与表面 —— 瓷白净面 + 细柔分层 */
  --canvas:      var(--ds-bg);
  --paper:       var(--ds-surface-1);
  --paper-2:     var(--ds-surface-2);
  --paper-3:     var(--ds-surface-3);
  --line:        var(--ds-line);
  --line-2:      var(--ds-line-2);
  /* 文字 */
  --ink:         var(--ds-text-1);
  --ink-2:       var(--ds-text-2);
  --ink-3:       var(--ds-text-3);
  /* 主色：晨曦蔚蓝，带来明晰思维与积极行动感 */
  --brand:       var(--ds-accent);
  --brand-600:   var(--ds-accent-strong);
  --brand-50:    var(--ds-accent-soft);
  --brand-line:  var(--ds-accent-line);
  --brand-wash:  var(--ds-accent-soft);
  /* 状态层：hover/pressed/focus 统一叠一层主题色半透明 */
  --state-hover: var(--ds-accent-soft);
  --state-press: var(--ds-accent-soft);
  --on-brand:    var(--ds-on-accent);
  /* 压在语义色实底上的文字色 */
  --on-fill:     var(--ds-on-accent);
  /* 掌握度四级语义色——优雅活泼且具备无障碍高对比度 */
  --m0: #f43f5e;   /* 未掌握 - Rose */
  --m1: #f59e0b;   /* 模糊 - Amber */
  --m2: #10b981;   /* 基本掌握 - Emerald */
  --m3: #059669;   /* 已掌握 - Forest */
  --mark: #8b5cf6; /* 标记待复查 - Violet */
  --danger: var(--m0-ink);
  --warn: var(--m1-ink);
  --ok: var(--m3-ink);
  /* 圆角阶梯：6 / 8 / 12 / 16 / 22 */
  --r-xs: 6px;
  --r-sm: var(--ds-r-1); --r-md: var(--ds-r-2); --r-lg: var(--ds-r-3); --r-xl: var(--ds-r-4); --r-pill: 999px;
  /* 浮起层级：精细漫反射柔光投影 */
  --sh-1: var(--ds-sh-1);
  --sh-2: var(--ds-sh-2);
  --sh-3: var(--ds-sh-3);
  /* scrim：遮罩层 */
  --scrim: rgba(15, 23, 42, 0.40);
  --fs-11: 12px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px;
  /* --fs-11 为兼容别名，等同 --fs-12（均为 12px）；勿调回 11px（中文 11px 不达 P3 §7.1） */
  --fs-15: 15px; --fs-16: 16px; --fs-18: 18px;  --fs-30: 30px;
  /* ---- 旧名兼容：指向上面的新 token ---- */
  --bg:          var(--canvas);
  --bg-2:        var(--paper-2);
  --surface:     var(--paper);
  --surface-2:   var(--paper-2);
  --surface-3:   var(--paper-3);
  --border:      var(--line);
  --border-2:    var(--line-2);
  /* 文字 */
  --text:        var(--ink);
  --text-1:      var(--ink);
  --text-2:      var(--ink-2);
  --text-3:      var(--ink-3);
  /* 强调色 */
  --accent:      var(--brand);
  --accent-2:    var(--brand-600);
  --accent-soft: var(--brand-wash);
  --accent-line: var(--brand-line);
  --accent-ring: rgba(37, 99, 235, 0.24);
  --accent-ink:  var(--on-brand);
  /* 语义色 */
  --green: var(--ok);
  --red:   var(--danger);
  /* 阴影 */
  --shadow-xs: var(--sh-1);
  --shadow-sm: var(--sh-1);
  --shadow-lg: var(--sh-3);
  /* ---------- 动效 token ---------- */
  --ring: 0 0 0 3px var(--accent-ring);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std:    cubic-bezier(0.2, 0, 0, 1);
  --dur-press: 100ms;
  --dur-1:     180ms;
  --dur-2:     260ms;
  --dur-3:     360ms;
  --dur-modal: 420ms;
  --dur-spin:  700ms;
  --ease: var(--ease-std);
  --fast: var(--dur-1);
  --base: var(--dur-2);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Roboto", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* ---- 语义色 ink/wash/line 三档 ---- */
  --m0-ink:#e11d48; --m0-wash:rgba(244,63,94,.09); --m0-line:rgba(244,63,94,.28);
  --m1-ink:#d97706; --m1-wash:rgba(245,158,11,.09); --m1-line:rgba(245,158,11,.28);
  --m2-ink:#059669; --m2-wash:rgba(16,185,129,.09); --m2-line:rgba(16,185,129,.28);
  --m3-ink:#047857; --m3-wash:rgba(5,150,105,.09); --m3-line:rgba(5,150,105,.28);
  --mark-ink:#7c3aed; --mark-wash:rgba(139,92,246,.09); --mark-line:rgba(139,92,246,.28);
  /* 老师讲法：琥珀暖棕 */
  --teach:#b45309; --teach-ink:#92400e;  
  /* 考点 chip */
  --node-ink:#b45309; --node-wash:rgba(245,158,11,.12); --node-line:rgba(245,158,11,.28);
  --ok-fill:var(--m3); --ok-wash:var(--m3-wash); --ok-line:var(--m3-line);       
  --lh-title:1.35;   --lh-read:1.8;
  --nav-w:224px;  --read-max:640px; --read-max-2:720px;
  --dur-quick:120ms;
}
/* ---------- 设计 token：暗色 ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  /* ================= 设计系统 token · 深色（深邃星海 · 璀璨蔚蓝） ================= */
  --ds-bg: #090d16; 
  --ds-surface-1: #0f172a; --ds-surface-2: #172033; --ds-surface-3: #1e293b; 
  --ds-line: rgba(255, 255, 255, 0.08); --ds-line-2: rgba(255, 255, 255, 0.16);
  --ds-text-1: #f8fafc; --ds-text-2: #94a3b8; --ds-text-3: #64748b;
  --ds-accent: #38bdf8; --ds-accent-strong: #7dd3fc; --ds-accent-soft: rgba(56, 189, 248, 0.12);
  --ds-accent-line: rgba(56, 189, 248, 0.38); --ds-on-accent: #082f49;   
  --ds-sh-1: 0 1px 3px rgba(0, 0, 0, 0.35);
  --ds-sh-2: 0 12px 28px -6px rgba(0, 0, 0, 0.55);
  --ds-sh-3: 0 24px 60px -12px rgba(0, 0, 0, 0.80);
  --ds-texture: radial-gradient(circle, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  --ds-wash: radial-gradient(1200px 520px at 50% -40px, rgba(56, 189, 248, 0.06), transparent 75%);
  /* 暗色色板：夜色地平线 */
  --canvas:      var(--ds-bg);
  --paper:       var(--ds-surface-1);
  --paper-2:     var(--ds-surface-2);
  --paper-3:     var(--ds-surface-3);
  --line:        var(--ds-line);
  --line-2:      var(--ds-line-2);
  --ink:         var(--ds-text-1);
  --ink-2:       var(--ds-text-2);
  --ink-3:       var(--ds-text-3);
  --brand:       var(--ds-accent);
  --brand-600:   var(--ds-accent-strong);
  --brand-50:    var(--ds-accent-soft);
  --brand-line:  var(--ds-accent-line);
  --brand-wash:  var(--ds-accent-soft);
  --state-hover: var(--ds-accent-soft);
  --state-press: var(--ds-accent-soft);
  --on-brand:    var(--ds-on-accent);
  --on-fill:     var(--ds-on-accent);
  --m0: #f87171;  --m1: #fbbf24;  --m2: #34d399;  --m3: #10b981;  --mark: #a78bfa;
  --danger: var(--m0-ink);
  --warn: var(--m1-ink);
  --ok: var(--m3-ink);
  /* 浮起层级（暗）：微光漫射阴影 */
  --sh-1: var(--ds-sh-1);
  --sh-2: var(--ds-sh-2);
  --sh-3: var(--ds-sh-3);
  --scrim: rgba(0, 0, 0, .65);
  --m0-ink:#fca5a5; --m0-wash:rgba(248,113,113,.14); --m0-line:rgba(248,113,113,.36);
  --m1-ink:#fde68a; --m1-wash:rgba(251,191,36,.14); --m1-line:rgba(251,191,36,.36);
  --m2-ink:#6ee7b7; --m2-wash:rgba(52,211,153,.14); --m2-line:rgba(52,211,153,.36);
  --m3-ink:#34d399; --m3-wash:rgba(16,185,129,.14); --m3-line:rgba(16,185,129,.36);
  --mark-ink:#c4b5fd; --mark-wash:rgba(167,139,250,.14); --mark-line:rgba(167,139,250,.36);
  --teach:#fb923c; --teach-ink:#fdba74;  
  --node-ink:#f59e0b; --node-wash:rgba(245,158,11,.14); --node-line:rgba(245,158,11,.36);
  --ring:0 0 0 3px var(--ds-accent-soft); --accent-ring:var(--ds-accent-line);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* button/input 的 UA 默认色（buttontext/fieldtext）不受页面主题控制：
   没声明 color-scheme 时 Chromium 按浅色给黑字，暗色主题下会「黑字压暗底」隐形
   （如首页「今日建议」卡片的科目标题）。这里统一恢复继承，让文字跟随主题 token。 */
button { font-family: inherit; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; color: inherit; }
/* ---------- 滚动条 ---------- */
::-webkit-scrollbar-thumb {
  background: var(--border-2); border-radius: var(--r-sm);
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }
:focus-visible { outline: none; box-shadow: var(--ring); }
/* 粘性页头 / 底部操作条是浮在内容上的：键盘 Tab 到被它们盖住的元素时，
   浏览器把元素滚进视口，焦点却仍有一半压在浮层底下。
   scroll-margin 让滚动落点自动预留出那两块高度。
   用 :where() 把特异性压到 0 —— 任何组件自己写的 scroll-margin 都能盖过这条默认值。 */
:where(a, button, input, select, textarea, [tabindex]) {
  scroll-margin-top: calc(var(--sticky-top, 0px) + 8px);
}
/* 底部预留只给真的有底部浮层的页面（训练中心的操作条 / 挂了底部 tab 的页面），
   不全局铺 —— 否则 map.html 这类锚点跳转的落点会无端抬高 60px。 */
.train :where(a, button, input, select, textarea, [tabindex]),
.has-tabbar :where(a, button, input, select, textarea, [tabindex]) {
  scroll-margin-bottom: calc(var(--sticky-bottom, 0px) + 60px + env(safe-area-inset-bottom));
}
/* 底部同样要为 tab 多留一个高度；断点原因同上（宽屏下 tab 不显示就不该留空） */
@media (max-width: 900px) {
  .has-tabbar { --sticky-bottom: 52px; }
}
/* ============================================================
   Layout
   ============================================================ */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 248px; flex: 0 0 248px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 0 4px; margin-bottom: 12px; }
.brand-logo {
  width: 28px; height: 28px; border-radius: var(--r-md); flex: 0 0 28px;
  background: var(--surface-3); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
}
/* 用真实 App 图标时去掉底色 */
img.brand-logo { background: none; border: none; border-radius: var(--r-md); }
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: .2px; color: var(--text); }
.brand-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; letter-spacing: .1px; }
/* ---------- 分组标题 ---------- */
.nav-label {
  font-size: 12px; font-weight: 500; color: var(--text-3);
  letter-spacing: .6px; text-transform: uppercase;
  padding: 12px 8px 6px;
}
/* ============================================================
   Buttons
   ============================================================ */
.btn {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: var(--r-sm);
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: all var(--fast) var(--ease);
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(0.985); }
/* Primary：晨曦蔚蓝 + 纯白文字 + 柔光阴影 */
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover {
  background: var(--accent-2); border-color: var(--accent-2); color: #ffffff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}
.btn-block { width: 100%; }
.btn-sm svg { width: 13px; height: 13px; flex-basis: 13px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--red); border-color: transparent; background: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); border-color: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* 主题切换 */
.theme-toggle {
  width: 30px; height: 30px; flex: 0 0 30px; padding: 0;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
/* ============================================================
   Sidebar — 会话列表
   ============================================================ */
.conv-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.conv-item {
  padding: 7px 8px; border-radius: var(--r-sm);
  cursor: pointer; margin-bottom: 1px; position: relative;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.conv-item:hover { background: var(--surface-2); }
/* 克制选中态：浅底 + 深字 + 极细强调线，不用蓝底白字 */
.conv-item.active .conv-title { color: var(--text); font-weight: 500; }
.conv-item.active::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 2px; height: 16px; border-radius: 0 2px 2px 0; background: var(--accent);
}
.conv-title {
  font-size: 13px; line-height: 1.4; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-item:hover .conv-title { color: var(--text); }
.conv-meta { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.conv-del {
  opacity: 0; border: none; background: none; color: var(--text-3);
  padding: 2px; font-size: 13px; line-height: 1;
  transition: opacity var(--fast) var(--ease), color var(--fast) var(--ease);
}
.conv-item:hover .conv-del { opacity: 1; }
.conv-del:hover { color: var(--red); }
/* ============================================================
   Sidebar — 底部
   ============================================================ */
.sidebar-foot { padding: 8px; border-top: 1px solid var(--border); }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  margin-bottom: 4px; font-size: 12px; color: var(--text-2);
  border-radius: var(--r-sm); word-break: break-all;
}
.avatar {
  width: 24px; height: 24px; border-radius: var(--r-sm); flex: 0 0 24px;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.nav-badge {
  margin-left: auto; font-size: 10px; padding: 1px 5px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border);
}
.nav-item:hover .nav-badge { color: var(--text-2); }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px; margin-bottom: 1px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 13px; color: var(--text-2); text-decoration: none; background: transparent;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--text-3); }
.nav-item:hover svg { color: var(--text-2); }
.nav-item .dot {
  margin-left: auto; font-size: 12px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink);
  padding: 0 5px; border-radius: var(--r-pill); min-width: 18px; text-align: center;
}
.nav-sep { height: 1px; background: var(--border); margin: 6px 4px; }
/* ============================================================
   Topbar（轻量顶栏）
   ============================================================ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 52px; flex: 0 0 52px;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 8px;
}
.topbar h1 {
  font-size: 14px; margin: 0; font-weight: 600; letter-spacing: .1px;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .spacer { flex: 1; }
.topbar select {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 4px 8px; background: var(--surface); color: var(--text-2);
  font-size: 12px; max-width: 180px; cursor: pointer;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.topbar select:hover { border-color: var(--border-2); color: var(--text); }
/* 全站模型选择器（对话/知识地图/训练中心三页共用，限流时可现场换模型） */
.model-select {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 4px 8px; background: var(--surface); color: var(--text-2);
  font-size: 12px; max-width: 180px; cursor: pointer;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.model-select:hover { border-color: var(--border-2); color: var(--text); }
/* 命令面板入口按钮 */
.search-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 10px; margin-left: 4px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-3); font-size: 12px;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.search-btn:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--text-2); }
.search-btn svg { width: 13px; height: 13px; }
kbd {
  font-family: var(--mono); font-size: 10px; line-height: 1;
  padding: 3px 5px; border: 1px solid var(--border); border-radius: var(--r-xs);
  background: var(--surface-2); color: var(--text-3);
}
/* ============================================================
   Chat
   ============================================================ */
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 0 12px; }
.chat-wrap { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.msg.user { flex-direction: row-reverse; }
/* 助手：去卡片化，纯文本排版；用户：克制的浅色容器 */
.bubble {
  border-radius: var(--r-lg); padding: 0;
  font-size: 15px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
  background: transparent; border: 1px solid transparent;
  color: var(--text);
}
.msg.user .bubble {
  background: var(--surface-2); border-color: var(--border);
  padding: 12px 16px; color: var(--text);
}
/* 随问附上的题图（错题本→AI 提问的图形推理原图）：贴在用户气泡文字上方。
   白底衬底与 .q-fig 同理——图推线条细，透出气泡底色会看不清。 */
.msg-fig {
  display: block; max-width: min(340px, 100%); height: auto;
  margin: 0 0 10px; padding: 6px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--ds-surface-1);
}
.msg-meta {
  font-size: 12px; color: var(--text-3); margin-top: 8px;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.msg.user .msg-meta { justify-content: flex-end; }
.tag {
  display: inline-flex; align-items: center; padding: 2px 7px;
  border-radius: var(--r-sm);
  background: var(--paper-3); color: var(--ink-2);
  font-size: 12px; font-weight: 500; border: 1px solid var(--line);
}
.tag.gray  { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.tag.amber { background: var(--m1-wash); color: var(--m1-ink); border-color: var(--m1-line); }
/* markdown 渲染块 */
.bubble .md-h { font-weight: 600; margin: 16px 0 6px; font-size: 15px; color: var(--text); }
.bubble .md-li { padding-left: 12px; }
.bubble .md-hr { height: 1px; background: var(--border); margin: 16px 0; border: none; }
.bubble code {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: var(--r-xs); font-size: 13px; font-family: var(--mono);
  color: var(--text);
}
.msg.user .bubble code { background: var(--surface-3); }
.kb-hit {
  margin-top: 16px; border-top: 1px solid var(--border);
  padding-top: 12px; font-size: 13px; color: var(--text-2); line-height: 1.7;
}
.kb-hit b { font-weight: 600; color: var(--text); }
.kb-hit ul { margin: 6px 0 0; padding-left: 18px; }
.kb-hit li { margin-bottom: 3px; }
.waiting { color: var(--text-3); font-size: 13px; }
@keyframes caretBlink { to { visibility: hidden; } }
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span {
  width: 5px; height: 5px; background: var(--text-3);
  border-radius: 50%; animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }
/* ============================================================
   Composer
   ============================================================ */
.composer {
  flex: 0 0 auto; background: var(--bg);
  padding: 8px 0 16px;
}
.composer-inner { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.composer-box {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--base) var(--ease), box-shadow var(--base) var(--ease);
}
.composer textarea {
  width: 100%; border: none; outline: none; resize: none;
  max-height: 168px; line-height: 1.7;
  background: transparent; color: var(--text); font-size: 15px;
}
.composer textarea::placeholder { color: var(--text-3); }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.hint { font-size: 12px; color: var(--text-3); flex: 1; }
/* 语音按钮：录音中仅用细边框 + 红字，不做大面积色块 */
.btn-mic.recording {
  color: var(--red); border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, transparent);
}
.btn-mic.recording:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
/* 快捷问题 */
.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-sm); padding: 5px 10px; font-size: 12px; color: var(--text-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              border-color var(--fast) var(--ease);
}
.chip:hover { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); }
/* 错误条 */
.err-bar {
  margin-bottom: 8px; padding: 8px 12px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--danger) 7%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent);
  color: var(--red); font-size: 12.5px; line-height: 1.65;
}
/* ============================================================
   Command Palette
   ============================================================ */
.cmdk-mask {
  position: fixed; inset: 0; z-index: 200;
  background: var(--scrim);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh;
}
.cmdk {
  width: 560px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmdk-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.cmdk-input-row svg { width: 15px; height: 15px; color: var(--text-3); flex: 0 0 15px; }
.cmdk-input-row input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 14px; min-width: 0;
}
.cmdk-input-row input::placeholder { color: var(--text-3); }
.cmdk-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.cmdk-group {
  font-size: 12px; font-weight: 500; color: var(--text-3);
  padding: 8px 8px 4px; letter-spacing: .4px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border-radius: var(--r-sm);
  background: transparent; border: none; color: var(--text-2);
  font-size: 13px; text-align: left;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.cmdk-item svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--text-3); }
.cmdk-item .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .sub { font-size: 12px; color: var(--text-3); flex: 0 0 auto; }
.cmdk-item.sel { background: var(--surface-2); color: var(--text); }
.cmdk-item.sel svg { color: var(--text-2); }
.cmdk-empty { padding: 28px 12px; text-align: center; color: var(--text-3); font-size: 13px; }
.cmdk-foot {
  padding: 8px 14px; border-top: 1px solid var(--border);
  background: var(--surface-2); display: flex; gap: 14px;
  font-size: 12px; color: var(--text-3);
}
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }
/* ============================================================
   Auth / 备份
   （授权相关样式统一见文件末尾「授权」区块，此处旧副本已删除）
   ============================================================ */
.row-2 { display: flex; gap: 8px; }
.row-2 .field { flex: 1; }
.row-2 .btn { flex: 0 0 auto; align-self: flex-end; margin-bottom: 12px; height: 36px; }
/* ============================================================
   Admin
   ============================================================ */
.admin { min-height: 100vh; }
.admin-head {
  background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px; height: 52px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 5;
}
/* ============ 训练中心：一套左导航 + 单视图 ============
   之前 10 个面板平铺在一条长长的滚动里，首屏是 5 个下拉框，
   学习入口被埋在「管理后台」后面。改成导航切换视图后，
   每一屏只回答一件事，常用的三个入口落在首屏。
   ============================================================ */
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--nav-w); z-index: 6;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
}
.rail-head {
  height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-bottom: 1px solid var(--border);
}
.rail-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.rail-brand-t { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.rail-brand-t b { font-size: 13px; font-weight: 600; }
.rail-brand-t small { font-size: 12px; color: var(--text-3); }
.rail-home {
  width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-2);
  transition: all var(--dur-1) var(--ease);
}
.rail-home:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.rail-home svg { width: 15px; height: 15px; }
.rail-scroll { flex: 1; overflow-y: auto; padding: 12px 10px; }
.rail-label {
  font-size: 12px; color: var(--text-3); padding: 12px 8px 6px; letter-spacing: .5px;
}
.rail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 2px; border-radius: var(--r-md);
  font-size: 13px; color: var(--text-2); text-decoration: none; cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.rail-item svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--text-3); transition: color var(--fast) var(--ease); }
.rail-item:hover { background: var(--surface-2); color: var(--text); }
.rail-item:hover svg { color: var(--text-2); }
.rail-dot {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
  background: var(--red); color: var(--on-fill); font-size: 12px; font-style: normal;
  border-radius: var(--r-sm); font-variant-numeric: tabular-nums;
}
/* inline-grid 会盖掉 hidden 属性默认的 display:none，不写这条红点会常驻 */
.rail-dot[hidden] { display: none; }
.rail-foot {
  flex: 0 0 auto; padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
/* --sticky-top = 粘性页头 .train-head 的实测高度（1200px 宽下 104px）。
   下面 .exam-head 要粘在它下面，键盘 scroll-margin 也要按它预留高度，
   两个用途共用这一个值，改页头高度时改这里就行。 */
.train {
  margin-left: var(--nav-w); min-height: 100vh;
  display: flex; flex-direction: column;
  --sticky-top: 92px;
}
.train-head {
  position: sticky; top: 0; z-index: 4;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 18px 28px 16px; display: flex; align-items: flex-end; gap: 12px;
}
.train-head h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.2px; }
.train-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.th-user { font-size: 12px; color: var(--text-3); margin-left: auto; padding-bottom: 3px; }
.view { display: none; }
.view.on { display: block; animation: viewIn var(--dur-3) var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
/* ---------- 今日三件事 ---------- */
.tasks {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 22px;
}
.task {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: var(--shadow-xs); color: inherit;
  transition: all var(--dur-1) var(--ease);
}
.task:hover { border-color: var(--brand-line); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.task:active { transform: translateY(0) scale(.99); }
.tk-ico {
  width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center;
  border-radius: var(--r-md); background: var(--surface-2); font-size: 16px;
  transition: all var(--dur-1) var(--ease);
}
.task:hover .tk-ico { background: var(--accent-soft); color: var(--brand); }
.tk-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tk-main small { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.tk-go { font-size: 12px; color: var(--text-3); flex: 0 0 auto; transition: color var(--fast) var(--ease); }
.task:hover .tk-go { color: var(--brand); }
/* 训练中心任务行是四张卡（多一张「图形推理 1000 题」直达）：
   桌面四列，中屏两列，窄屏一列。首页 .tasks 仍是三列，不受影响 */
.tasks-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1180px) { .tasks-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tasks-4 { grid-template-columns: 1fr; } }
/* ---------- 开关（不用文字表达状态） ---------- */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-track {
  width: 34px; height: 20px; border-radius: var(--r-pill); background: var(--surface-3);
  border: 1px solid var(--border-2); position: relative; flex: 0 0 34px;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.sw-dot {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-xs);
  transition: transform var(--dur-2) var(--ease-spring);
}
.switch input:focus-visible + .sw-track { box-shadow: var(--ring); }
.sw-txt { font-size: 12px; color: var(--text-2); }
/* ---------- 手机端：左导航收起，底部 tab 接管 ---------- */
@media (max-width: 860px) {
  .rail { display: none; }
  /* 窄屏 .train-head 的 padding 收成 16/14，实测高度掉到 88px，粘性偏移要跟着改 */
  .train { margin-left: 0; --sticky-top: 88px; }
  .train-head { padding: 16px 16px 14px; }
  .train-body { padding: 16px 16px 96px; }
  .tasks { grid-template-columns: 1fr; }
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-xs);
  transition: all var(--dur-1) var(--ease);
}
.card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.card .k { font-size: 12px; color: var(--text-3); }
.card .d { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 16px;
  /* clip 和 hidden 一样裁掉溢出圆角的部分，但不生成滚动容器，
     所以 .ex-bar 的 position:sticky 能挂到真正的滚动容器（视口）上，
     而不是被锁死在这个自己不滚动的 .panel 里（那样 sticky 等于没写）。
     不认 clip 的老浏览器退回 hidden：圆角照样裁，只是 sticky 依旧失效，不会破版。 */
  overflow: hidden;
  overflow: clip;
  box-shadow: var(--shadow-xs);
}
.panel-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface-2);
}
.panel-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 4px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: var(--text-3); font-weight: 500; background: var(--surface-2); letter-spacing: .4px; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; transition: background var(--fast) var(--ease); }
tr.clickable:hover { background: var(--surface-2); }
td .cell-title { font-weight: 500; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 5px 8px; background: var(--surface); color: var(--text); font-size: 12px;
  transition: border-color var(--fast) var(--ease);
}
.filters select:hover, .filters input:hover { border-color: var(--border-2); }
.filters select:focus, .filters input:focus { border-color: var(--accent-line); box-shadow: var(--ring); }
.empty { padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.transcript { padding: 12px 16px; }
.transcript .turn { margin-bottom: 12px; }
.transcript .who { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.transcript .txt {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 12px; font-size: 13px;
  line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.transcript .turn.me .txt { background: var(--accent-soft); border-color: var(--accent-line); }
.mistake-item { border-bottom: 1px solid var(--border); padding: 12px 16px; }
.mistake-item:last-child { border-bottom: none; }
.mistake-q { font-size: 13px; line-height: 1.65; }
.mistake-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.mistake-row b { color: var(--text-3); font-weight: 400; }
.ans-wrong { color: var(--red); }
.ans-right { color: var(--green); }
.mistake-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
/* 错题 → AI 追问：一枚紧凑小标识，挂在操作行里，不动讲解区的排版与字号 */
.mist-ai, .mist-copy {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; line-height: 1.5; cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.mist-ai .ico { font-size: 12px; }
.mist-ai:hover, .mist-copy:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
}
.mist-ai:active { transform: scale(.97); }
/* 打包中：只换文案与描边，不改尺寸，避免操作行跳动 */
.mist-ai.is-busy {
  color: var(--text-3); background: var(--surface-2); border-color: var(--border);
  cursor: progress; opacity: .85;
}
/* 失败态：按钮变「重试」，描边转警示色，旁边露出「复制题目」兜底 */
.mist-ai.is-err {
  color: var(--m1-ink); background: var(--m1-wash); border-color: var(--m1-line);
}
.mist-copy {
  border-style: dashed; border-color: var(--border-2);
  background: transparent; color: var(--text-2);
}
.mist-copy:hover { color: var(--text-1); background: var(--surface-2); border-color: var(--border-2); }
.badge { padding: 2px 7px; border-radius: var(--r-sm); font-size: 12px; border: 1px solid; font-weight: 500; }
.badge.m0 { background: color-mix(in srgb, var(--danger) 7%, transparent); color: var(--red);   border-color: color-mix(in srgb, var(--danger) 24%, transparent); }
.badge.m1 { background: var(--m1-wash); color: var(--m1-ink); border-color: var(--m1-line); }
.badge.m2 { background: var(--m2-wash); color: var(--m2-ink); border-color: var(--m2-line); }
.badge.m3 { background: var(--m3-wash); color: var(--m3-ink); border-color: var(--m3-line); }
/* ============================================================
   选择题：可点选项 + 判定 + 动作条
   ============================================================ */
.opt-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 12px 14px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: all var(--fast) var(--ease);
}
.opt:hover { background: var(--surface-2); border-color: var(--brand-line); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.opt .k {
  flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  font-family: var(--mono);
  background: var(--surface-2);
  transition: all var(--fast) var(--ease);
}
.opt:hover .k { border-color: var(--brand); color: var(--brand); }
.opt .v { flex: 1; font-size: 14.5px; line-height: 1.6; }
.opt .mark { flex: 0 0 auto; font-size: 13px; font-weight: 700; margin-top: 2px; }
.opt .mark.ok { color: var(--green); }
.opt .mark.no { color: var(--red); }
/* 作答后：整体锁定，清晰优雅的反馈状态 */
.opt.right .k { background: var(--ok-fill); border-color: var(--ok-fill); color: #ffffff; }
.opt.wrong .k { border-color: var(--danger); background: var(--danger); color: #ffffff; }
.opt.chosen, .opt.right, .opt.wrong, .opt.dim { cursor: default; transform: none; box-shadow: none; }
.verdict {
  margin-top: 8px; font-size: 12.5px; color: var(--text-2);
  padding-left: 2px;
}
.verdict.ok { color: var(--green); }
.verdict.no { color: var(--red); }
.act-row { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
/* ============================================================
   Codex 式首页
   ============================================================ */
.home-hi {
  margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.2px;
  color: var(--text);
}
.home-sub { margin: 0 0 8px; font-size: 13.5px; color: var(--text-3); line-height: 1.7; }
/* 首屏状态胶囊：日期与「今天练了多少」——打开就知道今天动没动 */
.hh-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.hh-pill {
  font-size: var(--fs-12); color: var(--text-2); padding: 4px 11px;
  border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface);
}
.hh-pill.line { border-color: var(--brand-line); background: var(--brand-wash); color: var(--brand); }
.hh-pill .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.home-sec {
  font-size: 12px; font-weight: 500; color: var(--text-3);
  letter-spacing: .6px; text-transform: uppercase;
  padding: 20px 0 6px; border-top: 1px solid var(--border); margin-top: 20px;
}
.home-list { display: flex; flex-direction: column; gap: 1px; }
.home-item {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; border-radius: var(--r-sm);
  background: transparent; text-align: left;
  transition: background var(--fast) var(--ease);
}
.home-item:hover { background: var(--surface-2); }
.home-item .t {
  flex: 1; min-width: 0; font-size: 13.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-item .m { flex: 0 0 auto; font-size: 11.5px; color: var(--text-3); }
.home-empty { padding: 14px 10px; font-size: 13px; color: var(--text-3); }
/* ============================================================
   UI 组件：确认框 / 科目选择器
   （替代会阻塞渲染进程的原生 confirm / prompt）
   ============================================================ */
.ui-msg {
  font-size: 13.5px; line-height: 1.75; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.subject-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 8px;
}
.subject-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text-2);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease);
}
.subject-card:hover {
  background: var(--surface-2); border-color: var(--accent-line); color: var(--text);
}
.subject-card .ico { font-size: 16px; line-height: 1; }
.subject-card .d {
  font-size: 12px; color: var(--text-3); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.subject-card.random { border-style: dashed; }
.subject-card.random:hover { border-style: solid; }
/* ============================================================
   知识地图（改版后主区为填空记忆卡 .cl-*，见文件末尾）
   本区仅剩：.map 单列容器 + 首页仪表盘共用的 .ring-txt
   ============================================================ */
/* 三栏 grid（树 / 主区 / 右栏）已废：改版后主区只剩一张居中卡片列。
   保留 .map 作页面最外层单列容器；若新 DOM 直接把 .cl-stage 挂到
   .admin 下，本规则闲置无害。二选一，勿嵌套（避免双重 padding）。 */
.map {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 96px;
}
/* .ring-txt 三连：首页仪表盘 .ds-right 也在用（chat.js 预估分环），
   不属旧地图，保留。 */
.ring-txt { display: flex; flex-direction: column; }
.ring-txt b { font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.ring-txt span { font-size: 12px; color: var(--text-3); }
/* ============================================================
   Toast / Modal / Spinner
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--text); color: var(--bg);
  padding: 8px 16px; border-radius: var(--r-md); font-size: 13px;
  z-index: 999; opacity: 0;
  pointer-events: none; box-shadow: var(--shadow-lg);
}
.modal-mask {
  position: fixed; inset: 0; background: var(--scrim);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); width: 720px; max-width: 100%;
  max-height: 84vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }
.spinner {
  width: 14px; height: 14px; border: 2px solid var(--border-2);
  border-top-color: var(--text-2); border-radius: 50%;
  animation: spin var(--dur-spin) linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg) } }
/* dark：chat.js:570 传了 'dark'，但这里此前没有规则接住——
   深色卡片（AI 气泡）上的 spinner 沿用浅色描边，几乎看不见。
   sm：行内小号（与文字基线对齐）。--canv 这个令牌并不存在，用 --canvas。 */
.spinner.dark { border-color: rgba(255, 255, 255, .25); border-top-color: var(--canvas); }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }
/* ============================================================
   Responsive
   ============================================================ */
/* ---------- 手机端外壳：抽屉 + 底部导航 ---------- */
.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none; padding: 0;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-1); cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.menu-btn:active { transform: scale(.92); }
.menu-btn svg { width: 17px; height: 17px; }
.nav-backdrop {
  display: none; position: fixed; inset: 0; z-index: 40;
  background: var(--scrim); opacity: 0;
  /* 关键：窄屏媒体查询会把 display 改成 block，此时必须靠 pointer-events 让位，
     否则这层透明遮罩以默认 auto 铺满整屏，页面所有按钮和画布都点不到。 */
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out);
}
.nav-backdrop.show { opacity: 1; pointer-events: auto; }
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 6px; color: var(--text-3); text-decoration: none;
  transition: transform var(--dur-press) var(--ease-out);
}
.tab-item:active { transform: scale(.92); }
.tab-item svg { width: 19px; height: 19px; }
.tab-item span { font-size: 10.5px; }
.tab-item.on { color: var(--accent); }
@media (max-width: 900px) {
  /* 侧栏不再是「直接藏掉」——那样手机上根本没有入口，改成抽屉 */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px; max-width: 82vw;
    z-index: 45; transform: translateX(-100%);
    transition: transform var(--dur-2) var(--ease-out);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .nav-backdrop { display: block; }
  .nav-backdrop.show { pointer-events: auto; }
  .menu-btn { display: flex; }
  .tabbar { display: flex; }
  .chat-wrap, .composer-inner { padding: 0 14px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .topbar h1 { font-size: 14px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar select { max-width: 110px; }
  .search-btn .txt, .search-btn kbd { display: none; }
  .composer { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .chat-scroll { padding-bottom: 8px; }
}
@media (max-width: 560px) {
  #modeTag, #intentTag { display: none; }
  .topbar select { max-width: 88px; font-size: 12px; }
  .composer-actions .hint { display: none; }
  .msg .bubble { font-size: 14px; }
}
/* 有底部导航的页面要给内容留位置，否则最后一屏被压住 */
@media (max-width: 900px) {
  .has-tabbar .admin-body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* 后台的筛选器一排在手机上放不下，换行而不是横向溢出 */
  .panel-head { flex-wrap: wrap; gap: 8px; }
  .panel-head .filters { flex-wrap: wrap; gap: 6px; width: 100%; }
  .panel-head .filters select,
  .panel-head .filters input { max-width: 100%; }
  /* 对话记录表格在窄屏横滚，别把整页撑宽 */
  .panel-body table { display: block; overflow-x: auto; white-space: nowrap; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 触摸目标至少 36px，否则手指点不准 */
  .btn-sm { min-height: 34px; padding: 6px 12px; }
  .admin-head { flex-wrap: wrap; gap: 8px; }
  .q-opt { min-height: 40px; }
  /* 必须写成 .ex-sheet .ex-dot：裸 .ex-dot 和后面「限时模考」里的 .ex-dot
     特异性一样 (0,1,0)，但那条写在文件更后面，会赢，这条就永远不生效
     —— 实测 ≤900px 时格子仍是 26px。加一层 .ex-sheet 才压得住。 */
  .ex-sheet .ex-dot { width: 32px; height: 32px; font-size: 12px; }
}
@media (max-width: 420px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .wk-grid { grid-template-columns: repeat(3, 1fr); }
  .exam-clock { font-size: 17px; }
}
/* ============================================================
   动效系统 · Apple 风格
   ============================================================
   三件事构成 Apple 的手感：
     1. 按压即回弹（scale）——点下去要立刻看到东西「陷」进去
     2. 统一的 180ms 反馈时长——全应用一个节奏才是同一个产品
     3. 退场比进场快——离开不用留恋
   这一块统一接管常见交互元素的过渡属性，省得逐个改写已有的 23 处声明。
   ============================================================ */
.btn, .btn-primary, .btn-sm, .btn-block,
.nav-item, .chip,
.opt, .subject-card, .conv-item, .cmdk-item,
.theme-toggle, .tag, .act-row button {
  transition-property: background-color, border-color, color, box-shadow, opacity, transform;
  transition-duration: var(--dur-1);
  transition-timing-function: var(--ease-std);
}
/* 按压：位移感来自「陷进去」，所以要用 scale 而不是变灰 */
.btn:active, .btn-sm:active, .act-row button:active { transform: scale(.97); }
.btn-primary:active { transform: scale(.965); }
.chip:active { transform: scale(.96); }
.opt:active:not(.done) { transform: scale(.985); }
.conv-item:active { transform: scale(.985); }
.subject-card:active { transform: scale(.975); }
.theme-toggle:active { transform: scale(.92); }
/* 按下瞬间几乎不需要延迟，回弹才要慢慢收 */
.btn:active, .nav-item:active,
.opt:active, .chip:active, .conv-item:active,
.subject-card:active, .theme-toggle:active, .act-row button:active {
  transition-duration: var(--dur-press);
}
/* 发送等主动作：按下同时轻微上浮影，强化「已触发」 */
.btn-primary { transform: translateZ(0); }
/* 焦点环回补：全局 :focus-visible 的 ring 是 (0,1,0)，下面几条规则的
   box-shadow 特异性更高（或在后面出现），把焦点环吞了——键盘用户 Tab 到
   这些按钮上看不到任何焦点指示。这里显式补回，不改 outline 视觉。 */
.task:focus-visible,
.rail-item.on:focus-visible,
.btn-primary:focus-visible,
.btn-primary:hover:focus-visible { box-shadow: var(--ring); }
/* ---------- 入场 / 退场 ----------
   Apple 很少让整块 UI 一起淡入，它让元素有先有后（几十毫秒的错峰），
   眼睛就会读出「这些内容是从下面推上来的」而不是「整页换了一张图」。
*/
@keyframes rise-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes sheet-in {
  from { opacity: 0; transform: scale(.96) translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes sheet-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: scale(.98); }
}
/* 对话气泡：只有新增的那条会带 .enter（见 chat.js 的 shownMsgs） */
.msg.enter { animation: rise-in var(--dur-2) var(--ease-out) both; }
/* 模态 / 命令面板：Apple 的 sheet 并不只是淡入，它从略小的尺寸弹到位 */
.modal-mask  { animation: fade-in var(--dur-2) var(--ease-out) both; }
.modal, .ui-modal {
  animation: sheet-in var(--dur-modal) var(--ease-spring) both;
}
.cmdk-mask { animation: fade-in var(--dur-2) var(--ease-out) both; }
.cmdk { animation: sheet-in var(--dur-3) var(--ease-spring) both; }
/* 命令列表逐条落位，搜索时也不会显得整块在闪 */
.cmdk-list { animation: fade-in var(--dur-2) var(--ease-out) both; animation-delay: 40ms; }
/* Toast：从底部滑入，进退差异化——进场 260ms / 退场 180ms，退场更快（见文件末尾 v32 层） */
/* 搜索/筛选类面板展开 */
.subject-grid > .subject-card:nth-child(n+1):nth-child(-n+4) { animation-delay: 40ms; }
.subject-grid > .subject-card:nth-child(n+5):nth-child(-n+8) { animation-delay: 80ms; }
.subject-grid > .subject-card:nth-child(n+9) { animation-delay: 120ms; }
/* ---------- 减弱动态效果 ----------
   系统里开了「减弱动态效果」就必须尊重。
   但不该一刀切把所有过渡都干掉：颜色和透明度的变化不会引起不适，
   真正需要消除的是位移、缩放、旋转这类会动到前庭的。
   所以位移类动画直接 animation:none，透明度留给上面的通用规则压到极短。
*/
/* 判分揭晓：勾/叉弹出来，结论条随后浮上，不要一次性全糊上来 */
@keyframes mark-pop {
  0%   { opacity: 0; transform: scale(.4); }
  55%  { opacity: 1; transform: scale(1.18); }
  100% { opacity: 1; transform: scale(1); }
}
/* 未选中的干扰项慢慢淡下去，视线自然被正确答案带走 */
/* ---------- 深浅色切换 ----------
   只在切换发生的那 260ms 内挂上（JS 加 .theme-anim），
   让整屏颜色一起流过去；常驻会让每一帧都背着一个全选择器过渡。
*/
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition-property: background-color, border-color, color, fill, stroke, box-shadow !important;
  transition-duration: var(--dur-2) !important;
  transition-timing-function: var(--ease-std) !important;
  transition-delay: 0s !important;
}
/* 开了「减弱动态效果」的用户切深浅色时，上面那条 !important 会盖过 reduce 块的
   * 通配规则（特异性 .theme-anim * = (0,1,0) + !important），整屏仍跑满 300ms。
   这里在同一媒体查询内再压一次：换色过渡直接归零，颜色仍是瞬间切换。 */
@media (prefers-reduced-motion: reduce) {
  .theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
    transition: none !important;
  }
}
/* ---------- 顶部进度条 ----------
   不确定时长的等待用它。做成顶部 2px 细条， indeterminate 来回扫：
   既不会遮住内容，又能在余光里持续提示「还在忙」。
*/
.top-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 2000;
  overflow: hidden; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-2) var(--ease-out);
}
.top-progress.on { opacity: 1; }
.top-progress .tp-bar {
  position: absolute; top: 0; left: 0; height: 100%; width: 38%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transform: translateX(-100%);
}
/* 只动 transform：动 width 会让这条 2px 细条每帧都触发布局（旧写法在 1.15s 内
   改了 3 次宽度）。改走 translateX + scaleX，缩放从左侧原点起，视觉基本一致。 */
.top-progress .tp-bar { transform-origin: left center; }
.top-progress.on .tp-bar {
  animation: tp-sweep 1.15s var(--ease-std) infinite;
}
@keyframes tp-sweep {
  0%   { transform: translateX(-120%) scaleX(.85); }
  50%  { transform: translateX(100%) scaleX(1.2); }
  100% { transform: translateX(320%) scaleX(.85); }
}
/* ============================================================
   首页仪表盘
   ============================================================ */
.dash-skel {
  display: flex; align-items: center; gap: 10px; padding: 28px;
  justify-content: center; color: var(--text-3); font-size: 13px;
}
.dash-card {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 16px;
}
.dash-score { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ds-label { font-size: 12px; color: var(--text-2); }
.ds-num { font-size: 34px; font-weight: 500; line-height: 1.15; margin: 2px 0; font-variant-numeric: tabular-nums; }
.ds-max { font-size: 15px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.ds-sub { font-size: 12px; color: var(--text-2); }
.ds-sub b { color: var(--accent); font-weight: 500; }
/* 左栏原本没有任何规则：「距离 70 分还差 XX 分」变长时会把右侧 68px 的环挤出去 */
.ds-left { flex: 1; min-width: 0; }
.ds-right { position: relative; width: 68px; height: 68px; flex: 0 0 68px; }
.ds-ring { width: 68px; height: 68px; transform: rotate(-90deg); }
/* 基础样式缺失会出大事故：SVG <circle> 默认 fill:black，
   不显式置 none 会把预估分环渲染成一整块黑色实心圆。 */
.ds-ring circle { fill: none; stroke-width: 8; }
.ds-ring .ring-bg { stroke: var(--surface-3); }
.ds-ring .ring-fg { stroke-linecap: round; }
.ds-ring .ring-fg { transition: stroke-dashoffset var(--dur-modal) var(--ease-out); }
.ds-right .ring-txt {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-2);
}
/* 仪表盘空态：无数据时给一段说明，不再渲染 0% 环与空条带 */
.dash-empty { padding: 6px 2px 2px; }
.dash-empty .de-t { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.dash-empty .de-d { font-size: 12.5px; color: var(--text-3); line-height: 1.85; }
.dash-sec { font-size: 12px; color: var(--text-3); margin: 18px 0 8px; }
.dash-bars { display: flex; flex-direction: column; gap: 6px; }
.dash-bar {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; width: 100%; text-align: left;
  transition: background-color var(--dur-1) var(--ease-std), transform var(--dur-press) var(--ease-std);
}
.dash-bar:active { transform: scale(.99); }
.dash-bar:hover { background: var(--surface-2); }
.db-name { flex: 0 0 108px; font-size: 12.5px; color: var(--text); }
.db-track { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.db-track i { display: block; width: 100%; height: 100%; background: var(--accent); border-radius: var(--r-pill);
  clip-path: inset(0 calc(100% - var(--pw, 0%)) 0 0); transition: clip-path var(--dur-3) var(--ease-out); }
/* 掌握度语义色：同一根色带贯穿首页条带、地图节点、错题标签，
   看到赤色就知道这是当前最该补的一科，不必读百分比。 */
.db-track i.m0 { background: var(--m0); }
.db-track i.m1 { background: var(--m1); }
.db-track i.m2 { background: var(--m2); }
.db-track i.m3 { background: var(--m3); }
.m-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: var(--fs-12); color: var(--text-3); }
.m-legend span { display: inline-flex; align-items: center; gap: 5px; }
.m-legend i { width: 8px; height: 8px; border-radius: var(--r-xs); display: inline-block; }
.m-legend i.m0 { background: var(--m0); }
.m-legend i.m1 { background: var(--m1); }
.m-legend i.m2 { background: var(--m2); }
.m-legend i.m3 { background: var(--m3); }
.ds-note { font-style: normal; color: var(--text-3); font-size: var(--fs-12); margin-left: 6px; }
.db-val { flex: 0 0 40px; text-align: right; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dash-advices { display: flex; flex-direction: column; gap: 8px; }
.dash-advice {
  display: block; text-align: left; padding: 10px 12px; color: var(--text);
  border: 1px solid var(--border); border-left: 2px solid var(--accent);
  border-radius: var(--r-md); background: var(--surface); cursor: pointer; width: 100%;
  transition: background-color var(--dur-1) var(--ease-std), transform var(--dur-press) var(--ease-std);
}
.dash-advice:active { transform: scale(.99); }
.dash-advice:hover { background: var(--surface-2); }
.da-k {
  display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-2); border: 1px solid var(--accent-line);
}
.da-k.good { background: var(--m3-wash); color: var(--m3-ink); border-color: var(--m3-line); }
.da-t { display: block; font-size: 13px; margin-top: 5px; }
.da-d { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.dash-week { margin-top: 4px; }
.dw-sec { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.dw-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dw-grid > div {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: 10px; text-align: center;
}
.dw-grid b { display: block; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dw-grid span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.dw-note { font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
/* ---------- 学习周报 ---------- */
.wk-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.wk-grid > div {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: 10px 6px; text-align: center;
}
.wk-grid b { display: block; font-size: 19px; font-weight: 500; font-variant-numeric: tabular-nums; }
.wk-grid span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.wk-chart {
  display: flex; align-items: flex-end; gap: 6px; height: 110px;
  margin-top: 16px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.wk-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.wk-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.wk-bar i {
  display: block; width: 60%; max-width: 22px; background: var(--accent);
  border-radius: var(--r-pill) 3px 0 0; min-height: 2px;
  transition: height var(--dur-3) var(--ease-out);
}
.wk-col span { font-size: 10px; color: var(--text-3); margin-top: 5px; }
.wk-note {
  font-size: 12.5px; color: var(--text-2); line-height: 1.7;
  margin-top: 12px; padding: 10px 12px;
  background: var(--surface-2); border-radius: var(--r-md);
}
/* ---------- 真题练习 ---------- */
.rv-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
/* ---------- 限时模考 ---------- */
/* 跳过答题卡：键盘用户不必 Tab 过 75 个格子才够到题面。
   用 sr-only 的裁切法藏起来，不能写 display:none —— 那样永远 Tab 不到。
   获焦后回到正常流里，显示在题头上方。 */
.skip-link {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
  position: static; display: inline-block;
  width: auto; height: auto; margin: 0 0 10px; padding: 8px 14px;
  overflow: visible; clip-path: none; white-space: normal;
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-1);
  font-size: 13px; text-decoration: none; box-shadow: var(--shadow-lg);
}
/* 75 题的卷子一往下滚，倒计时就消失在视口上方了——考场上这是硬伤，
   所以让题头跟着粘在 .train-head 下面（偏移取 --sticky-top）。
   左右负外边距把底色铺满 .panel-body 的 padding，否则两侧各留 16px 的缝，
   滚动的题干会从缝里穿过去。 */
.exam-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky; top: var(--sticky-top, 0px); z-index: 3;
  margin: 0 -16px 10px; padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.exam-clock {
  font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums;
  padding: 2px 10px; border-radius: var(--r-sm); background: var(--surface-2);
  letter-spacing: .5px;
}
.exam-clock.urgent { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, var(--surface)); }
.exam-subj {
  margin-left: auto; font-size: 12px; color: var(--text-3);
  padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2);
}
/* 操作条：上一题/下一题/交卷固定在题目下方右侧，右下角是翻页的自然落点 */
.ex-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 12px 0 10px; border-top: 1px solid var(--border);
  /* sticky 生效后题干会从操作条后面滚过去，渐变里那截 transparent 会把字透出来，
     所以底色必须实色；原来「融进纸面」的分隔交给顶边线承担。 */
  position: sticky; bottom: 0; z-index: 2;
  background: var(--surface);
}
/* 有底部 tab 时操作条让开 tab 的高度（实测 52px），否则翻页按钮被压在 tab 底下点不到。
   必须一起写 ≤900px：ui.js 挂 tab 时只看页面没看宽度，宽屏下 .tabbar 是 display:none，
   但 .has-tabbar 类照样在 —— 不限定断点的话，宽屏会白留 52px 的空隙。 */
@media (max-width: 900px) {
  .has-tabbar .ex-bar { bottom: calc(52px + env(safe-area-inset-bottom)); }
}
.ex-bar-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ex-bar .btn[disabled] { opacity: .42; cursor: not-allowed; }
/* 交卷后的错题回顾：默认收起（点按钮展开），进去就自动展开 */
.ex-review { display: none; margin-top: 18px; }
.ex-review.open { display: block; animation: rise-in var(--dur-3) var(--ease-spring) both; }
.wr-head { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }
.wr-group { margin-bottom: 18px; }
.wr-grp-h {
  font-size: 12.5px; font-weight: 600; color: var(--text-1);
  padding: 6px 0; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.wr-noexp { color: var(--text-3); font-size: 12.5px; }
.ex-review .q-item { margin-bottom: 10px; }
.ex-review .q-opt { cursor: default; }
.ex-sheet {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.ex-dot {
  position: relative;
  width: 26px; height: 26px; border-radius: var(--r-sm); font-size: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-3);
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-1) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.ex-dot:active { transform: scale(.94); }
/* 已答：底色实测只有 1.5:1（明色）/ 1.5:1（暗色）的对比度，色弱用户基本看不见，
   再叠一条实心底杠当形状线索 —— 颜色通道留着做冗余，形状通道才是主标识。 */
.ex-dot.done {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-color: var(--accent-line); color: var(--text-1);
}
.ex-dot.done::before {
  content: ''; position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px;
  border-radius: var(--r-pill); background: var(--accent);
}
/* 当前题改用内描边：box-shadow 让给全局 :focus-visible 的焦点环。
   原来这里写 box-shadow，特异性 (0,2,0) 高于 :focus-visible 的 (0,1,0)，
   Tab 到当前题时焦点环会被整条吃掉。改成 outline 后两者可以同时显示：
   内层 outline = 当前题，外层 box-shadow 光环 = 键盘焦点。 */
.ex-dot.cur {
  border-color: var(--accent);
  outline: 2px solid var(--accent); outline-offset: -2px;
}
.exam-report { text-align: center; padding: 6px 0; animation: rise-in var(--dur-3) var(--ease-spring) both; }
.er-score b { display: block; font-size: 40px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* 紧贴数字的百分号：旧写法是「正确率 %」，% 隔一个空格读起来像标签的一部分 */
.er-score .pct {
  display: block; font-size: 22px; font-weight: 600; color: var(--text-2);
  margin-top: -6px;
}
.er-score span { font-size: 12px; color: var(--text-3); }
/* 时间到：报告最上方一行醒目提示（规范 2.3 步骤 8：时间到在结果页首行） */
.er-auto {
  margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r-md);
  background: var(--m1-wash); color: var(--m1-ink);
  font-size: 13px; font-weight: 600; text-align: center;
}
/* 未作答提示：从主统计行拆出的独立小字，不再和统计挤在一行里被淹没 */
.er-note {
  margin: -8px 0 16px; font-size: 12px; color: var(--text-3); text-align: center;
}
.er-meta { font-size: 12.5px; color: var(--text-2); margin: 6px 0 16px; }
/* 面板说明行：模考组卷结构（.ex-hint）与练习模式（.qm-hint）各一行，
   放在控件行下方。类名必须分开——测试与样式都按「第一个 .ex-hint」定位模考那行 */
.ex-hint, .qm-hint {
  margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--text-3);
}
/* 题量不足 / 组不出卷的阻断卡片 */
.exam-block {
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.eb-head { font-size: 14px; font-weight: 600; color: var(--text-1); }
.eb-head b { color: var(--brand); }
.eb-rows { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 4px; }
.ex-lack {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-radius: var(--r-sm);
  background: var(--paper); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2);
}
.ex-lack b { color: var(--m1-ink); font-weight: 600; }
.ex-lack.ex-lack-bad b { color: var(--m0-ink); }
.ex-rows { text-align: left; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ex-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.ex-row > span:first-child { width: 88px; flex: none; }
.ex-track { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.ex-track i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-xs); }
.ex-val { width: 44px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.quiz-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); }
/* ============================================================
   竞品参考 · 做题界面卡片流（2026-10-13）
   类名契约 = admin.js 模板实际输出（与视觉规范 §4 对齐）
   ============================================================ */
/* 题型标签：题号行里的「单选题 / 多选题」，复用旧 .q-tag 观感 */
.q-type {
  display: inline-block; font-size: 11px; font-weight: 500; padding: 1px 6px;
  border-radius: var(--r-xs); background: var(--surface-2); color: var(--text-3);
}
/* 题号行后缀：/ 总数 · 科目 · 考点 */
.q-no-sub { font-weight: 400; color: var(--text-3); }
/* 判分结果条：两列（正确答案 / 你的答案），浅灰底 */
.q-resultbar {
  display: flex; gap: 16px; margin-top: 10px; padding: 10px 16px;
  border-radius: var(--r-md); background: var(--paper-2);
}
.q-resultbar > div { flex: 1; text-align: center; }
.q-resultbar .lab { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.q-resultbar .v { display: block; font-size: 13px; font-weight: 600; }
.q-resultbar .v.ok { color: var(--m3-ink); }
.q-resultbar .v.bad { color: var(--m0-ink); }
/* 统计三格：用时 / 今日正确率 / 我的题型正确率；上缘细线，放题卡内 */
.q-stats {
  display: flex; margin-top: 10px; border-top: 1px solid var(--border);
}
.q-stats > div { flex: 1; padding: 8px 4px; text-align: center; }
.q-stats > div + div { border-left: 1px solid var(--border); }
.q-stats .num {
  display: block; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.q-stats .lab { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.q-stats .num.t-blue { color: var(--brand); }
.q-stats .num.t-green { color: var(--m3-ink); }
.q-stats .num.t-red { color: var(--m0-ink); }
/* 分区标题：竞品「蓝色圆点 + 文字」——解析 / 举一反三 / 考点 / 来源 */
.sec-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-1);
  margin: 18px 0 8px;
}
.sec-h::before {
  content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
}
.q-hint { font-size: 12px; color: var(--text-3); }
/* 材料卡：常驻 + 可折叠 */
.q-mat.collapsed .q-mat-body { display: none; }
.q-mat-h {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--text-3); text-align: left;
}
.q-mat-h::after { content: '▾'; margin-left: auto; font-size: 10px; }
.q-mat.collapsed .q-mat-h::after { content: '▸'; }
.q-mat-t { flex: none; }
/* 考点 chip：橙，与掌握度语义色 m1 明确分开 */
.q-nodes { display: flex; flex-wrap: wrap; gap: 6px; }
.q-node {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--node-wash); color: var(--node-ink);
  border: 1px solid var(--node-line);
  font-size: 12px; text-decoration: none;
  transition: background var(--dur-1) var(--ease-out);
}
.q-node:hover { background: var(--surface-3); }
.q-node-more { color: var(--node-ink); font-size: 12px; align-self: center; }
.q-src { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
/* 举一反三 / AI 诊断卡片 */
.jy-card {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--brand-50); border: 1px solid var(--brand-line);
}
.jy-card .txt { flex: 1; min-width: 180px; font-size: 13px; color: var(--text-2); }
.ai-card {
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--brand-50); border: 1px solid var(--brand-line);
}
.ai-card.ai-loading { opacity: .7; }
.ai-card-head { display: flex; align-items: center; gap: 8px; }
.ai-badge {
  flex: none; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: var(--brand); color: var(--on-brand);
  font-size: 12px; font-weight: 600;
}
.ai-body { font-size: 13px; line-height: 1.7; color: var(--text-2); margin-top: 8px; }
.ai-card-tip { margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.ai-card-tip .brief { display: inline; }
.ai-card-tip .full { display: none; }
.ai-card-tip.open .brief { display: none; }
.ai-card-tip.open .full { display: inline; }
.ai-card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-chip {
  padding: 4px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--brand-line); background: var(--paper);
  font-size: 12px; color: var(--text-2);
}
.ai-chip:hover { background: var(--surface-3); }
.ai-err { font-size: 12px; color: var(--danger); margin-top: 6px; }
.quiz-from { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
/* 练习页左下悬浮答题卡胶囊（模考保留常驻 .ex-sheet，不用它） */
.sheet-fab {
  position: sticky; bottom: 20px; margin-left: -8px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--paper); border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  font-size: 13px; font-weight: 600; color: var(--brand);
}
.sheet-pop-mask {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--scrim);
}
.sheet-pop {
  width: 560px; max-width: calc(100vw - 32px); max-height: 80vh; overflow: auto;
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-lg);
}
.sheet-pop-h { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.sp-sub { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.sheet-pop-f { margin-top: 12px; text-align: right; }
.quiz-prog {
  height: 6px; border-radius: var(--r-pill); background: var(--surface-2);
  overflow: hidden; margin-bottom: 8px;
}
.quiz-prog i {
  display: block; width: 100%; height: 100%; background: var(--accent); border-radius: var(--r-xs);
  clip-path: inset(0 calc(100% - var(--pw, 0%)) 0 0); transition: clip-path var(--dur-3) var(--ease-out);
}
.quiz-stat { font-size: 12.5px; color: var(--text-2); }
.quiz-stat b { font-variant-numeric: tabular-nums; color: var(--text-1); }
.quiz-src { color: var(--text-3); }
/* ============================================================
   练习模式（2026-10-14）：即时练习 / 刷题 / 背题
   ============================================================ */
/* 面板头部三段单选组。原生 input 用 1px 裁切法藏掉（不能 display:none——
   那样键盘 Tab 永远摸不到，radiogroup 的左右键也就失灵），样式全部挂在
   :checked + span 上，焦点环走 :focus-visible + span。 */
.quiz-modes {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.quiz-modes .qm { position: relative; display: inline-flex; }
.quiz-modes .qm input {
  position: absolute; width: 1px; height: 1px; opacity: 0;
  margin: 0; pointer-events: none;
}
.quiz-modes .qm span {
  display: inline-block; padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.quiz-modes .qm:hover span { color: var(--text-1); }
.quiz-modes .qm input:checked + span {
  background: var(--paper); color: var(--brand); font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.quiz-modes .qm input:focus-visible + span {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
/* 题头进度行里的模式徽标：复用考点橙 chip，一屏多题滚下去也记得自己在哪种模式 */
.q-mode-badge {
  display: inline-block; padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--node-wash); color: var(--node-ink); border: 1px solid var(--node-line);
  font-size: 11.5px; font-weight: 600;
}
/* 刷题模式吸底交卷条。和左下 .sheet-fab 同排：fab 靠左、dock 靠右，
   max-width 给 fab 留出占位，窄屏（<720px）dock 整宽上移避开 fab，
   两个按钮都不会被对方盖住。 */
.quiz-dock {
  position: sticky; bottom: 20px; z-index: 40;
  margin-left: auto; margin-top: 14px;
  width: max-content; max-width: calc(100% - 150px);
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 14px;
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--r-pill); box-shadow: var(--shadow-sm);
}
.quiz-dock .qd-hint {
  font-size: 12px; color: var(--text-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .quiz-dock { bottom: 64px; left: 8px; right: 8px; margin-left: 0; width: auto; max-width: none; }
  .quiz-dock .qd-hint { white-space: normal; }
}
/* 刷题模式交卷后仍未作答的题：虚线框标签，和「漏渲染」区分开 */
.q-blank {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border: 1px dashed var(--border-2); border-radius: var(--r-sm);
  color: var(--text-3); font-size: 11.5px;
}
/* 答题卡浮层里的「已选未交卷」：描边 + 浅底，和 .done 的实心底杠区分 */
.ex-dot.sel {
  border-color: var(--accent); color: var(--text-1);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
/* ============================================================
   资料分析双栏做题（左材料 / 右题目列表）—— 复刻参考版式：
   编号加粗 + 题型小签 + 图标行，选项为「字母 + 文字」整行、无圆形徽标。
   布局由 JS 按内容高度决定（data-layout）：
     stack —— 材料+题目在一屏内放得下 → 单列全宽（参考图那张长表就是放不下的情形）
     split —— 放不下 → 左右分栏，材料吸顶不随题目滚动消失
   测量统一在全宽（stack）下进行，避免两种布局互相影响判断。
   ============================================================ */
.quiz-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);      /* 默认 stack：单列全宽 */
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
/* 分栏态：左材料 40% / 右题目 60% */
.quiz-split[data-layout="split"] {
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
}
/* 材料里有远超栏宽的宽图（表格截图，naturalWidth 可达显示宽的 4 倍）时，
   材料栏自动加宽到 55%：表格文字从原尺寸的 ~25% 放大到 ~40%，
   再看不清还有点击放大兜底（.chart-zoom-mask） */
.quiz-split[data-layout="split"][data-matwide="1"] {
  grid-template-columns: minmax(0, 55%) minmax(0, 1fr);
}
/* 左栏材料：分栏时吸顶 + 独立滚动，题目滚到哪材料都在眼前 */
.qs-mat {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--paper-2);
  min-width: 0;
}
.quiz-split[data-layout="split"] .qs-mat {
  position: sticky; top: 12px; align-self: start;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  border-bottom: none;
  border-right: 1px solid var(--border);
  /* 底部留白：左下角悬浮答题卡（sticky bottom）会压住材料末尾，
     留出它的高度，材料才能整段滚完 */
  padding-bottom: 72px;
}
.qs-mat-label {
  display: inline-block; padding: 2px 9px; margin-bottom: 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-line);
  font-size: 11.5px; font-weight: 600;
}
/* 材料正文：参考版式为两端对齐、行距宽松、段间留白，无首行缩进 */
.qs-mat-body { font-size: 15px; line-height: 1.9; color: var(--text-1); text-align: justify; }
.qs-mat-body p { margin: 0 0 10px; }
.qs-mat-body p:last-child { margin-bottom: 0; }
.qs-mat .q-chart { max-width: 100%; }
/* 右栏题目列表 */
.qs-list { padding: 6px 20px 14px; min-width: 0; }
.qs-q { padding: 14px 0 16px; border-bottom: 1px dashed var(--border); }
.qs-q:last-child { border-bottom: none; }
/* 题头行：编号（加粗）+ 题型小签 + 右侧工具图标 */
.qs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.qs-no { font-size: 15px; font-weight: 600; color: var(--text-1); font-variant-numeric: tabular-nums; }
.qs-type {
  padding: 1px 7px; border-radius: var(--r-sm);
  border: 1px solid var(--border); color: var(--text-3);
  font-size: 11.5px; line-height: 1.5;
}
.qs-tools { margin-left: auto; display: flex; gap: 2px; }
.qs-tool {
  border: none; background: none; cursor: pointer;
  padding: 4px 6px; border-radius: var(--r-sm);
  color: var(--text-3); font-size: 13px; line-height: 1;
  transition: color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.qs-tool:hover { color: var(--text-1); background: var(--surface-2); }
.qs-tool.on { color: var(--mark); }
.qs-stem { font-size: 15.5px; line-height: 1.75; color: var(--text-1); margin-bottom: 6px; }
/* 选项：字母 + 文字整行，字母列对齐（悬挂缩进），无圆形徽标 */
.qs-opts { display: flex; flex-direction: column; }
.qs-opt {
  display: flex; align-items: baseline; gap: 10px;
  width: 100%; padding: 7px 8px; margin: 0 -8px;
  border: none; background: none; cursor: pointer; text-align: left;
  font-size: 15px; line-height: 1.6; color: var(--text-1);
  border-radius: var(--r-sm);
  transition: background var(--dur-1) var(--ease-out);
}
.qs-opt .k {
  flex: 0 0 1.6em; font-weight: 500; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.qs-opt:hover { background: var(--surface-2); }
.qs-opt.picked .k { color: var(--brand); font-weight: 600; }
.qs-opt.picked { color: var(--brand); }
/* 判分态：对 = 绿 + ✓，错 = 红 + ✗，其余淡出 */
.qs-opt.right { color: var(--m3); font-weight: 500; }
.qs-opt.right .k { color: var(--m3); font-weight: 600; }
.qs-opt.wrong { color: var(--m0); }
.qs-opt.wrong .k { color: var(--m0); font-weight: 600; }
.qs-opt.dim { color: var(--text-3); }
.qs-opt .mk { margin-left: auto; font-weight: 600; }
.qs-opt.right .mk, .qs-opt.wrong .mk { color: inherit; }
/* 判分后的小区块：结果条 + 解析（复用既有组件类名） */
.qs-foot { margin-top: 10px; }
.qs-foot .q-exp { font-size: 13.5px; }
/* 窄屏：无论内容多长都单列堆叠（分栏在窄屏里两边都看不全），材料不再吸顶 */
@media (max-width: 900px) {
  .quiz-split[data-layout="split"] { grid-template-columns: minmax(0, 1fr); }
  .quiz-split[data-layout="split"] .qs-mat {
    position: static; max-height: none; overflow: visible;
    border-right: none; border-bottom: 1px solid var(--border);
  }
}
/* 材料图表点击放大：全屏浮层按原始比例展示（上限 96vw/92vh，不出滚动条）。
   宽高都交由 max 约束，原始宽高比由浏览器保持——不会拉伸变形或裁切 */
.chart-zoom-mask {
  position: fixed; inset: 0; z-index: 90;
  background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.chart-zoom-mask .chart-zoom-img {
  max-width: min(1400px, 96vw);
  max-height: 92vh;
  width: auto; height: auto;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  background: var(--paper);
  cursor: zoom-out;
}
.q-item {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); padding: 14px 16px; margin-bottom: 10px;
}
.q-item.q-ok { border-color: var(--ok-line); }
.q-item.q-bad { border-color: var(--m0-line); }
.q-mat {
  margin-bottom: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 15px; line-height: 1.8; color: var(--text-2);
  max-width: var(--read-max-2);
}
.q-mat b {
  display: block; font-size: 12px; color: var(--text-3);
  margin-bottom: 4px; font-weight: 500;
}
/* 资料分析题内嵌的原图表（来自原卷 PDF 的 base64 大图）：
   大图直接贴在材料下方、随材料同宽，不做小图/缩略图让用户手动打开 */
.q-chart {
  display: block; width: 100%; max-width: 680px; height: auto;
  margin: 8px auto 4px; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--ds-surface-1); box-sizing: border-box;
  /* 可点击放大的提示：宽高比由 width:100% + height:auto 保持，不裁切不拉伸 */
  cursor: zoom-in;
}
/* 图形推理题图（裁剪自《章晓铭图推1000题》讲义原页）：
   题干的九宫图/立体图与 ABCD 选项都在这一张图里，贴在题干正下方、选项正上方。
   图形细节比图表更密（细线、小黑白块），所以限宽比 .q-chart 略宽、并保留白底衬底，
   点击同样走 openChartZoom 放大浮层看原图（200 DPI 裁剪）。 */
.q-fig {
  display: block; width: 100%; max-width: 720px; height: auto;
  margin: 8px auto 4px; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--ds-surface-1); box-sizing: border-box;
  cursor: zoom-in;
}
/* 题图加载失败时由 alt 文字兜底说明，无需额外占位样式 */
/* 题面是产品里唯一的长时间读物：提案给到 15.5px / 1.78。
   之前 14px/1.75 是照后台表格的行文习惯定的，刷题时每一行都要回读两遍。 */
.q-stem { font-size: var(--fs-16); line-height: var(--lh-read); color: var(--text-1);
  margin-bottom: 16px; max-width: var(--read-max); }
.q-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: var(--r-xs);
  font-size: 12px; background: var(--surface-2); color: var(--text-3);
}
.q-opts { display: flex; flex-direction: column; gap: 6px; }
.q-opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  padding: 12px 16px; border: 1px solid transparent; border-radius: var(--r-md);
  min-height: 48px; background: var(--paper); color: var(--ink);
  font-size: 14.5px; line-height: 1.65; cursor: pointer;
  transition: background var(--dur-1) var(--ease-out),
              transform var(--dur-press) var(--ease-out);
}
/* 圆形字母徽标：判分色的唯一载体。
   竞品语言的核心——颜色收敛在徽标上，行不再铺 wash 底：扫视时「哪个选项对」一眼就定。 */
.q-opt b, .q-opt .k {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%;                            /* 方 → 圆 */
  border: 1.5px solid var(--line-2); background: var(--paper); color: var(--text-2);
  font-family: var(--font); font-size: 13px; font-weight: 600;   /* 弃 mono，圆徽标用正文字体 */
  transition: background var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.q-opt span { flex: 1; }
/* 判分图标槽位：判分前就占位，避免勾叉出现时文字横向跳动 */
.q-opt .mk { flex: none; width: 16px; height: 16px; display: grid; place-items: center; }
/* hover / 按下：整行浅灰，徽标不动 */
.q-opt:hover { background: var(--paper-2); }
.q-opt:active { transform: scale(.995); }
/* 判分前选中：徽标变蓝，行加淡 wash 提示（判分后行会回到白底） */
.q-opt.picked { border-color: transparent; background: var(--brand-wash); }
.q-opt.picked .k { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
/* 判分后：颜色只在徽标，行回白底（覆盖旧的整行 wash + 彩边规则） */
.q-opt.right, .q-opt.wrong { cursor: default; background: var(--paper); }
.q-opt.right:hover, .q-opt.wrong:hover { background: var(--paper); }
.q-opt.right .k { background: var(--m3); color: var(--on-fill); border-color: var(--m3); }
.q-opt.wrong .k { background: var(--m0); color: var(--on-fill); border-color: var(--m0); }
/* 判分后的正确/错选行：文字色加重一档作为次要线索 —— 状态不只靠颜色区分（色弱冗余） */
.q-opt.right span { color: var(--m3-ink); font-weight: 500; }
.q-opt.wrong span { color: var(--m0-ink); font-weight: 500; }
/* 旧规则已删除：.q-opt 的 1px 描边块、.picked/.right/.wrong 的整行 wash 与彩边、.q-opt.dim */
.q-submit { margin-top: 8px; }
.q-result { margin-top: 10px; font-size: 13px; font-weight: 500; }
.q-result.ok { color: var(--ok); }
.q-result.bad { color: var(--danger); }
.q-exp {
  margin-top: 8px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 15px; line-height: 1.75; color: var(--text-2);
  animation: fade-in var(--dur-2) var(--ease-out) both;
}
/* ---------- 老师讲法解析（无原卷解析时的替代品） ----------
   和普通解析的区别：左侧一条橄榄色竖线 + 各段带小标题，
   让人一眼看出这是「按讲义推的」而不是卷子原始答案，不至于拿它当标准答案背。
   ----------------------------------------------------------- */
.q-teach {
  background: var(--paper-2); border-left: 2px dashed var(--teach);
  border-radius: var(--r-sm); padding: 10px 12px; margin-top: 8px;
  font-size: 15px; line-height: 1.8; color: var(--text-2);
}
.q-teach > div { margin-top: 6px; }
.q-teach > div:first-child { margin-top: 0; }
.q-teach b { color: var(--text); font-weight: 600; margin-right: 8px; font-size: 12px; }
.qt-where { font-size: 12px; color: var(--text-2); }
.qt-seq b.on { color: var(--teach-ink); }
.qt-seq { color: var(--text-3); }
.qt-tips {
  margin: 0; padding: 0; list-style: none;
  border-top: 1px solid var(--line); padding-top: 6px;
}
.qt-tips li { position: relative; padding-left: 12px; margin-top: 2px; color: var(--text); }
.qt-tips li::before {
  content: ''; position: absolute; left: 2px; top: 8px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.qt-land { border-top: 1px solid var(--line); padding-top: 6px; }
.q-meta {
  margin-top: 8px; font-size: 11.5px; color: var(--text-3);
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.q-link { color: var(--accent); text-decoration: none; }
.q-link:hover { text-decoration: underline; }
.quiz-sum {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-size: 13px; color: var(--text-1);
  animation: rise-in var(--dur-3) var(--ease-spring) both;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .msg.enter, .msg.enter .bubble,
  .subject-grid > .subject-card,
  .cl-card.enter, .cl-blank.no,
  .modal, .ui-modal, .cmdk, .cmdk-list {
    animation: none !important;
    transform: none !important;
  }
}
/* ============================================================
   B6 配套样式（题号行 / 标记待复查 / 右滑侧面板）
   由主理人先落地 CSS，实现侧的 DOM 与逻辑交由前端补齐，避免两边改同一文件冲突。
   侧面板 .map-panel/.mp-head 保留：知识地图改版后的目录抽屉 .cl-drawer
   复用这套右滑机制（见文件末尾 .cl-* 区）。
   ============================================================ */
/* ---------- 题号行 ----------
   模考一屏一题时，「这是第几题 / 属于哪一节」不再靠顶部小字回看，
   直接跟在题面上方——翻页后视线落点不变。 */
.q-no {
  font-size: var(--fs-12); color: var(--ink-3); margin-bottom: 8px;
  font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px;
}
.q-no b { color: var(--ink-2); font-weight: 600; }
/* ---------- 标记待复查 ----------
   形状（书签角）先于颜色：色觉障碍用户不看颜色也能认出被标记的题。 */
.q-flag {
  margin-left: auto; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-3); font-size: var(--fs-12); padding: 2px 9px;
  border-radius: var(--r-pill); cursor: pointer;
  transition: all var(--dur-1) var(--ease-out);
}
.q-flag:hover { border-color: var(--mark-line); color: var(--mark-ink); }
.q-flag.on {
  background: var(--mark-wash); color: var(--mark-ink); border-color: var(--mark-line);
  font-weight: 500;
}
.q-flag.on::before { content: '🔖'; margin-right: 4px; }
/* 答题卡上的待复查格：右上角切一个三角，不靠颜色辨识 */
.ex-dot.flag, .cell.flag { position: relative; }
.ex-dot.flag::after, .cell.flag::after {
  content: ''; position: absolute; top: 0; right: 0;
  border-width: 0 6px 6px 0; border-style: solid;
  border-color: transparent var(--mark) transparent transparent;
}
/* ---------- 右滑侧面板 ----------
   改版前：窄屏「学习概览」临时面板（配套入口 .map-ovbtn 与粘性子头
   .map-subhead 已随旧三栏布局一并删除）。
   改版后：目录抽屉 .cl-drawer 复用这套右滑机制。 */
.map-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 288px; z-index: 20;
  background: var(--paper); border-left: 1px solid var(--line);
  box-shadow: var(--sh-3); padding: 16px; overflow-y: auto;
  transform: translateX(100%); transition: transform var(--dur-3) var(--ease-out);
}
.map-panel.on { transform: none; }
.map-panel h4 { margin: 0 0 12px; font-size: var(--fs-13); font-weight: 600; }
/* ============================================================
   知识地图改版 · 填空记忆卡（.cl-*）
   规范：设计提案/知识地图-填空卡片改版规范.md §5（唯一实施合同）
   原则：
   · 双主题全部走 :root / [data-theme="dark"] 既有 token，不新增 token
   · 动效走 --ease-spring / --ease-out 与 --dur-* 阶梯（规范写 320/240ms，
     按阶梯取最近的 --dur-2 260ms / --dur-1 180ms）
   · prefers-reduced-motion 由全局规则 + 上方显式清单（.cl-card.enter /
     .cl-blank.no）共同接管，禁 !important
   · .cl-drawer 与 .map-panel 同挂时本区规则写在更后，覆盖其
     宽度/z-index/曲线，右滑机制不变
   ============================================================ */
/* ---------- 布局：居中卡片列 ---------- */
.cl-stage {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 96px; /* 底部留白给 .cl-sheet */
}
/* ---------- 顶栏：[☰ 目录]  [已掌握 x/y]  [🔊 朗读] ---------- */
.cl-topbar {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; margin-bottom: 16px;
}
.cl-count {
  margin-left: auto;
  font-size: var(--fs-13); color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cl-count b { color: var(--ink); font-weight: 600; }
/* 36px 命中区的图标按钮（朗读 🔊 / ⏹，播放中 .on） */
.cl-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink-2); cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out),
              background var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out),
              color var(--dur-1) var(--ease-out);
}
.cl-iconbtn:hover { background: var(--paper-2); color: var(--ink); }
.cl-iconbtn:active { transform: scale(.92); }
.cl-iconbtn.on { color: var(--brand); border-color: var(--brand-line); background: var(--brand-wash); }
/* ---------- 按钮：primary「下一个 →」/ ghost「隐藏关键词」 ---------- */
.cl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 9px 16px; font-size: var(--fs-13); font-weight: 500; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: transform var(--dur-press) var(--ease-out),
              background var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out),
              color var(--dur-1) var(--ease-out);
}
.cl-btn:active { transform: scale(.96); }
.cl-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.cl-btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.cl-btn.ghost { background: var(--paper-3); border-color: var(--paper-3); color: var(--ink-2); }
.cl-btn.ghost:hover { background: var(--paper-2); border-color: var(--line); color: var(--ink); }
.cl-btn.sm { padding: 6px 12px; font-size: var(--fs-12); }
.cl-btn:disabled { opacity: .45; cursor: not-allowed; }
.cl-btn:disabled:active { transform: none; }
/* ---------- 卡片：--paper + --r-lg + --shadow-sm + 1px --line ---------- */
.cl-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
/* 切卡：横向滑入（规范 240ms，取阶梯 --dur-1） */
.cl-card.enter { animation: cl-card-in var(--dur-1) var(--ease-out) both; }
.cl-title {
  margin: 0 0 4px;
  font-size: var(--fs-15); font-weight: 600; color: var(--ink);
  line-height: var(--lh-title);
}
.cl-title .cl-subj { color: var(--ink-3); font-weight: 500; }
.cl-deckline {
  margin: 0 0 18px;
  font-size: var(--fs-12); color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
/* ---------- 陈述句 + 挖空 ---------- */
.cl-items { display: flex; flex-direction: column; gap: 14px; }
.cl-item {
  display: flex; align-items: baseline; gap: 10px;
  font-size: var(--fs-15); line-height: 2; color: var(--ink);
}
.cl-item .cl-no {
  flex: none; min-width: 1.5em;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.cl-item .cl-sent { flex: 1; min-width: 0; }
/* 空：inline 按钮，四态全部 class 切换，无 !important */
.cl-blank {
  display: inline-block;
  min-width: 3.5em; height: 1.6em;
  margin: 0 2px; padding: 0 6px;
  border: none; border-bottom: 1.5px solid var(--line-2);
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  background: transparent;
  font: inherit; color: var(--ink); text-align: center; line-height: 1.6;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out),
              color var(--dur-1) var(--ease-out);
}
.cl-blank:not(.ok):hover { border-bottom-color: var(--ink-3); }
/* 激活：2px 品牌色下划线 + --brand-wash 浅底（词库已升起） */
.cl-blank.on {
  border-bottom: 2px solid var(--brand);
  background: var(--brand-wash);
}
/* 填对：品牌色字 + 2px 品牌色下划线；答过不能改 */
.cl-blank.ok {
  border-bottom: 2px solid var(--brand);
  color: var(--brand); font-weight: 600;
  cursor: default;
}
/* 错误：--m0 边 + 200ms 抖动，落回激活态 */
.cl-blank.no {
  border-bottom: 2px solid var(--m0);
  color: var(--m0);
  animation: cl-shake var(--dur-1) var(--ease-std) both;
}
/* ---------- 词库面板 .cl-sheet（底部升起） ---------- */
/* scrim 与 sheet 都是 body 直接子元素、各带自己的 z-index（40 < 50）。
   千万不要把 scrim 挪进 .cl-sheet 里——那样它会在 sheet 的层叠上下文内
   以「定位元素压静态内容」的姿态盖住整个词库，鼠标点不到任何关键词。 */
.cl-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: var(--scrim);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out);
}
.cl-scrim.show { opacity: 1; pointer-events: auto; }
.cl-sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 50;
  width: min(760px, 100%);
  transform: translate(-50%, 100%);
  background: var(--paper);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg);
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  transition: transform var(--dur-2) var(--ease-spring);
}
.cl-sheet.show { transform: translate(-50%, 0); }
.cl-sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cl-sheet-t { font-size: var(--fs-14); font-weight: 600; color: var(--ink); }
/* 「忘记了」：文字按钮 + 💡 */
.cl-forgot {
  margin-left: auto; flex: none;
  border: none; background: none; cursor: pointer;
  padding: 4px 8px; border-radius: var(--r-sm);
  font-size: var(--fs-13); color: var(--ink-2);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.cl-forgot:hover { background: var(--paper-3); color: var(--ink); }
/* 关键词已隐藏：sheet 收起为一条提示（点空白处重新显示） */
.cl-bankhidden {
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--paper-3); color: var(--ink-3);
  font-size: var(--fs-13); text-align: center;
}
/* 同一根提示条也挂在卡片操作区下方当常驻状态条（p 自带 1em 边距，在这里会脱节） */
#bankHiddenBar { margin: 0; }
/* chips：--paper-3 底 / pill / 14px / --ink；hover --line 边；press scale(.96) */
.cl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-chip {
  border: 1px solid transparent;
  background: var(--paper-3); color: var(--ink);
  font-size: var(--fs-14); line-height: 1.4;
  padding: 6px 14px; border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out),
              border-color var(--dur-1) var(--ease-out),
              background var(--dur-1) var(--ease-out);
}
.cl-chip:hover { border-color: var(--line); }
.cl-chip:active { transform: scale(.96); }
/* ---------- 操作区：[隐藏关键词]  [下一个 →] ---------- */
.cl-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 20px; flex-wrap: wrap;
}
/* ---------- 掌握条：--m3-wash 底 + --m3 字 ---------- */
.cl-mastered {
  margin-top: 16px; padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--m3-wash); color: var(--m3);
  font-size: var(--fs-13); font-weight: 500;
  animation: rise-in var(--dur-2) var(--ease-out) both;
}
/* ---------- 组完成面板 ---------- */
.cl-deckdone {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 44px 24px; text-align: center;
  animation: rise-in var(--dur-2) var(--ease-out) both;
}
.cl-deckdone .cl-done-ico {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--m3-wash); color: var(--m3);
  font-size: var(--fs-30); line-height: 1;
}
.cl-deckdone .cl-done-t { margin: 0 0 6px; font-size: var(--fs-16); font-weight: 600; color: var(--ink); }
.cl-deckdone .cl-done-m { margin: 0 0 22px; font-size: var(--fs-13); color: var(--ink-3); }
.cl-deckdone .cl-actions { margin-top: 0; }
/* ---------- 目录抽屉 .cl-drawer：复用 .map-panel 右滑机制 ---------- */
.cl-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 45;
  width: 320px; max-width: 86vw;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: var(--sh-3);
  padding: 16px; overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--dur-2) var(--ease-spring);
}
.cl-drawer.on { transform: none; }
.cl-drawer select {
  width: 100%;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 7px 8px; margin-bottom: 14px;
  background: var(--paper); color: var(--ink);
  font-size: var(--fs-13); cursor: pointer;
}
.cl-dsec { margin-bottom: 14px; }
.cl-dsec-t {
  margin: 0 0 6px;
  font-size: var(--fs-12); font-weight: 500; color: var(--ink-3);
  letter-spacing: .6px;
}
/* 组行：组名 / 已掌握 x/y / 4px 进度条（.cl-cards 为其兄弟节点，勿嵌套按钮） */
.cl-deck {
  display: flex; flex-direction: column; gap: 6px; width: 100%;
  padding: 8px; border: none; border-radius: var(--r-sm);
  background: transparent; text-align: left; cursor: pointer;
  transition: background var(--dur-1) var(--ease-out);
}
.cl-deck:hover { background: var(--paper-2); }
.cl-deck.open { background: var(--paper-3); }
.cl-deck-top { display: flex; align-items: center; gap: 8px; width: 100%; }
.cl-deck-name {
  flex: 1; min-width: 0; font-size: var(--fs-13); font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cl-deck-num { flex: none; font-size: var(--fs-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cl-bar { height: 4px; border-radius: var(--r-pill); background: var(--paper-3); overflow: hidden; }
.cl-bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--brand); }
/* 卡行：lv 点 / 标题 / ✓ / 到期徽标 */
.cl-cards { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px; }
.cl-cardrow {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px 6px 16px;
  border: none; border-radius: var(--r-sm);
  background: transparent; text-align: left; cursor: pointer;
  font-size: var(--fs-13); color: var(--ink-2);
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.cl-cardrow:hover { background: var(--paper-2); color: var(--ink); }
.cl-cardrow.cur { background: var(--brand-wash); color: var(--brand); font-weight: 500; }
.cl-cardrow-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-cardrow .cl-ck { flex: none; color: var(--m3); font-size: var(--fs-12); }
.cl-cardrow .cl-due {
  flex: none; padding: 0 5px; border-radius: var(--r-xs);
  font-size: var(--fs-12); line-height: 15px;
  color: var(--m1-ink); background: var(--m1-wash); border: 1px solid var(--m1-line);
}
/* lv 点：7px 圆点，颜色由内联 style 给（LEVELS[lv].color，同旧 tree-dot 口径） */
.cl-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; display: inline-block; }
/* 词库面板内层：只承担 focus 管理（tabindex=-1 的编程焦点），视觉由 .cl-sheet 给 */
.cl-sheet-inner:focus { outline: none; }
/* 目录抽屉头部：标题 + 继续学习 + 关闭，一行排开 */
.cl-drawer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cl-drawer-head h4 { margin: 0; font-size: var(--fs-14); font-weight: 600; color: var(--ink); }
.cl-drawer-body { margin-top: 4px; }
/* 填空结果播报（role=status）：视觉隐藏但不能 display:none——那样读屏也捕获不到 */
.cl-live {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}
/* 加载态 / 空态 / 降级提示：都借用 .home-empty 文案体，这里只补容器与留白 */
.cl-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 48px 0; color: var(--ink-3); font-size: var(--fs-13);
}
.cl-empty { margin: 32px 0; text-align: center; }
.cl-degrade {
  margin: 32px 0; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper-2); text-align: center;
}
.cl-degrade-t { margin: 0 0 6px; font-size: var(--fs-14); font-weight: 600; color: var(--ink); }
.cl-degrade-msg { margin: 0; }
/* ---------- keyframes ---------- */
@keyframes cl-card-in {
  from { opacity: 0; transform: translate3d(18px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes cl-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  50%      { transform: translateX(3px); }
  75%      { transform: translateX(-2px); }
}
/* ============ 授权：设备解锁遮罩 + 授权设置面板 ============ */
.auth-mask {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 18, 14, .5);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.auth-mask[hidden] { display: none; }
.auth-card {
  width: min(360px, 90vw); padding: 22px 22px 20px;
  background: var(--paper, #fff); border: 1px solid var(--line, #E2DED4);
  border-radius: 14px; box-shadow: 0 14px 44px rgba(0, 0, 0, .28);
  color: var(--ink, #1B1914);
}
.auth-card h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.auth-card p.sub { margin: 0 0 16px; font-size: 13px; color: var(--ink-3, #66625A); line-height: 1.6; }
.auth-card .pin-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 16px;
  letter-spacing: 6px; text-align: center;
  border: 1px solid var(--line, #E2DED4); border-radius: 9px;
  background: var(--paper-2, #F8F7F2); color: var(--ink, #1B1914); margin-bottom: 12px;
}
.auth-card .pin-input:focus { outline: none; border-color: var(--brand, #2C5B86); }
.auth-card .row-2 { display: flex; gap: 10px; }
.auth-card .row-2 .btn { flex: 1; }
/* 授权设置面板里的角色选择 */
.auth-roles { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.auth-role-chip {
  flex: 1 1 30%; padding: 9px 10px; border: 1px solid var(--line, #E2DED4);
  border-radius: 9px; font-size: 12px; cursor: pointer; text-align: center;
  color: var(--ink-2, #575248); user-select: none;
}
.auth-role-chip small { display: block; color: var(--ink-3, #66625A); font-size: 11px; margin-top: 2px; }
.auth-role-chip.on { border-color: var(--brand, #2C5B86); background: var(--brand-wash, rgba(44,91,134,.08)); color: var(--ink, #1B1914); }
.auth-status { font-size: 12px; color: var(--ink-3, #66625A); margin: 6px 0 12px; line-height: 1.6; }
.auth-title { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink, #1B1914); }
.auth-sub { margin: 0 0 16px; font-size: 13px; color: var(--ink-3, #66625A); line-height: 1.6; }
.auth-status.err { color: var(--red, #C0392B); }
.auth-card .pin-row { display: flex; gap: 10px; align-items: stretch; }
.auth-card .pin-row .pin-input { flex: 1; margin-bottom: 0; }
.auth-card .pin-row .btn { flex: 0 0 auto; }
/* ============================================================
   每日学习规划（plan.html + 首页「学习规划」入口卡）
   视觉语言对齐 .task / .dash-card：暖纸面 + 1px 边框 + r-lg 圆角 + 极轻阴影，
   不加大渐变。所有颜色走 token，深浅主题通用。
   ============================================================ */
/* ---------- 首页入口卡片 ---------- */
.plan-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  cursor: pointer; background: var(--surface); border: 1px solid var(--brand-line);
  border-radius: var(--r-lg); padding: 14px 16px; margin: 0 0 22px; color: inherit;
  box-shadow: var(--shadow-xs); transition: all var(--dur-1) var(--ease); }
.plan-card:hover { background: var(--surface-2); }
.plan-card:active { transform: scale(.99); }
.plan-card:focus-visible { box-shadow: var(--ring); }
.pc-ico { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  border-radius: var(--r-md); background: var(--accent-soft); font-size: 16px; }
.pc-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 3px; }
.pc-main b { font-size: 13px; font-weight: 600; }
.pc-main small { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.pc-go { font-size: 12px; color: var(--text-3); flex: 0 0 auto; transition: color var(--fast) var(--ease); }
.plan-card:hover .pc-go { color: var(--brand); }
/* ---------- plan.html 页面 ---------- */
.plan-scroll { flex: 1; overflow-y: auto; }
.plan-wrap { max-width: 860px; margin: 0 auto; padding: 24px 28px 48px; }
.plan-back { font-size: 12.5px; color: var(--text-3); text-decoration: none; }
.plan-back:hover { color: var(--brand); }
.plan-h1 { font-size: 20px; font-weight: 600; margin: 10px 0 6px; color: var(--text-1); }
.plan-meta { font-size: 12.5px; color: var(--text-3); line-height: 1.7; margin: 0 0 16px; }
.plan-phase { background: var(--surface); border: 1px solid var(--brand-line);
  border-radius: var(--r-lg); padding: 14px 16px; margin: 0 0 22px; box-shadow: var(--shadow-xs); }
.plan-phase .pp-k { font-size: 11.5px; color: var(--brand); font-weight: 600; letter-spacing: .02em; }
.plan-phase .pp-t { font-size: 15px; font-weight: 600; margin: 4px 0 2px; color: var(--text-1); }
.plan-phase .pp-d { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.plan-sec { font-size: 12px; color: var(--text-3); margin: 22px 0 10px; }
.plan-today, .plan-tbl-wrap { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 4px 6px; }
/* 8 列成绩表在窄屏横滚，别把整页撑宽 */
.plan-tbl-wrap { overflow-x: auto; }
/* 工作日上午/下午轮换说明两行（表下方） */
.plan-rotate { font-size: 12px; color: var(--text-3); line-height: 1.7; padding: 8px 12px 10px; }
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.plan-pcard { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 16px; }
.plan-pcard.on { border-color: var(--brand-line); }
.plan-pcard .pp-tag { font-size: 11px; color: var(--brand); font-weight: 600; }
.plan-pcard h4 { font-size: 14px; margin: 6px 0 2px; color: var(--text-1); }
.plan-pcard .pp-range { font-size: 12px; color: var(--text-3); }
.plan-pcard .pp-focus { font-size: 12.5px; color: var(--text-2); margin: 8px 0 6px; line-height: 1.6; }
.plan-pcard ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.8; }
.plan-tabs { display: flex; gap: 6px; margin: 0 0 10px; }
.plan-tab { padding: 6px 14px; font-size: 12.5px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); border-radius: var(--r-pill); cursor: pointer;
  transition: all var(--dur-1) var(--ease); }
.plan-tab.on { background: var(--accent); border-color: var(--accent); color: var(--on-brand); }
.plan-tab:focus-visible { box-shadow: var(--ring); }
.plan-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.plan-tbl th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--text-3);
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.plan-tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-1);
  line-height: 1.6; vertical-align: top; }
.plan-tbl tr:last-child td { border-bottom: none; }
.plan-tbl input { width: 100%; min-width: 56px; background: transparent; border: 1px solid transparent;
  border-radius: var(--r-sm); color: inherit; font-size: 12.5px; padding: 4px 6px; }
.plan-tbl input:hover, .plan-tbl input:focus { border-color: var(--border-2); background: var(--surface-2); outline: none; }
.plan-tbl .tbl-del { font-size: 11.5px; color: var(--text-3); background: none; border: none; cursor: pointer; padding: 2px 6px; }
.plan-tbl .tbl-del:hover { color: var(--danger); }
.ck-row { display: flex; align-items: flex-start; gap: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 14px; cursor: pointer; }
.ck-row + .ck-row { margin-top: 8px; }
.ck-row input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; }
/* 打卡行 / 入口卡内的标题+小字两行堆叠（对齐 .tk-main 的既有写法） */
.ck-row .ck-main, .plan-link .pl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ck-row .ck-t { font-size: 13px; font-weight: 600; color: var(--text-1); }
.ck-row .ck-s { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.ck-row.done .ck-t { color: var(--text-3); text-decoration: line-through; }
.ck-prog { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 12.5px; color: var(--text-3); }
.ck-prog .bar { flex: 1; max-width: 220px; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.ck-prog .bar i { display: block; width: 100%; height: 100%; background: var(--accent); border-radius: var(--r-pill);
  clip-path: inset(0 calc(100% - var(--pw, 0%)) 0 0); transition: clip-path var(--dur-2) var(--ease-std); }
.plan-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.plan-link { display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 13px 15px;
  text-decoration: none; color: inherit; transition: all var(--dur-1) var(--ease); }
.plan-link:hover { border-color: var(--brand-line); }
.plan-link .pl-t { font-size: 13px; font-weight: 600; color: var(--text-1); }
.plan-link .pl-d { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.plan-link .pl-go { margin-left: auto; font-size: 12px; color: var(--text-3); }
.plan-link:hover .pl-go { color: var(--brand); }
.plan-details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 12px 16px; margin-top: 12px; }
.plan-details summary { font-size: 13px; font-weight: 600; color: var(--text-1); cursor: pointer; }
.plan-details .pd-body { margin-top: 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.8; }
.plan-details ul { margin: 6px 0 0; padding-left: 18px; }
.plan-details .pd-body p { margin: 8px 0; }
.plan-details .pd-body .plan-tbl-wrap { margin: 8px 0; }
.plan-empty { font-size: 12.5px; color: var(--text-3); padding: 10px 2px; }
/* plan.html 侧栏当前项（与 index.html 的 .nav-item 同语言；on 态加文字层级不只靠颜色） */
.nav-item.on { background: var(--accent-soft); color: var(--text); }
@media (max-width: 860px) {
  .plan-grid, .plan-links { grid-template-columns: 1fr; }
  .plan-wrap { padding: 18px 16px 40px; }
}
@media (max-width: 560px) {
  .plan-tbl { font-size: 12px; }
  .plan-tbl th, .plan-tbl td { padding: 8px 8px; }
  .plan-h1 { font-size: 18px; }
}
/* 有底部 tab 的页面给内容留位置（tab 仅在 ≤900px 显示，与 .admin-body 同规矩） */
@media (max-width: 900px) {
  .has-tabbar .plan-wrap { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
/* ============================================================
   手写批注（题目级）—— assets/annotate.js
   题号行注入「✏ 手写」按钮；点击后在题目上铺一层 canvas 圈画。
   独立模块：不改任何现有规则，仅追加。
   ============================================================ */
/* 覆盖层的定位祖先（.q-item 原本无定位声明，纯新增） */
.q-item { position: relative; }
/* 题号行里的手写按钮：仿 .q-flag 的小胶囊，不抢「标记待复查」的位置 */
.ann-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-3); font-size: var(--fs-12); padding: 2px 9px 2px 6px;
  border-radius: var(--r-pill); cursor: pointer; line-height: 1.5;
  transition: all var(--dur-1) var(--ease-out);
}
.ann-btn svg { width: 12px; height: 12px; }
.ann-btn:hover { border-color: var(--brand-line); color: var(--brand); }
.ann-btn.on { background: var(--accent-soft); border-color: var(--brand-line); color: var(--brand); }
.ann-btn:focus-visible { box-shadow: var(--ring); }
/* 批注层：铺满题卡，编辑态接受指针事件，展示态让点击穿透过题目 */
.ann-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: none; z-index: 3; pointer-events: none;
}
.ann-layer[style*="pointer-events: auto"] { cursor: crosshair; }
/* 浮动小工具条：右上角，不挡题目主体 */
.ann-bar {
  position: absolute; top: 6px; right: 8px; z-index: 4;
  display: none; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 4px 6px; max-width: calc(100% - 16px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.12));
}
.ab-group { display: flex; align-items: center; gap: 2px; }
.ab-sep { width: 1px; height: 16px; background: var(--border); margin: 0 2px; }
.ab-btn {
  width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--text-2); transition: all var(--dur-1) var(--ease);
}
.ab-btn svg { width: 14px; height: 14px; }
.ab-btn:hover { background: var(--surface-2); color: var(--text-1); }
.ab-btn.on { background: var(--accent-soft); color: var(--brand); }
.ab-btn.ab-done:hover { color: var(--ok-ink, var(--m3-ink)); }
.ab-btn:focus-visible { box-shadow: var(--ring); }
.ab-dot {
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid var(--border); background: transparent; transition: all var(--dur-1) var(--ease);
}
.ab-dot i { display: block; width: 100%; height: 100%; border-radius: 50%; }
.ab-dot.on { border-color: var(--brand); transform: scale(1.1); }
.ab-size {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1px solid var(--border-2); background: var(--surface-2);
  display: grid; place-items: center; transition: all var(--dur-1) var(--ease);
}
.ab-size i { display: block; border-radius: 50%; background: var(--text-1); }
.ab-size.on { border-color: var(--brand); background: var(--accent-soft); }
.ab-size:focus-visible { box-shadow: var(--ring); }
/* 手写模式下的题卡：给出可书写的视觉暗示（不改变尺寸与排版） */
.q-item:has(> .ann-layer[style*="pointer-events: auto"]) { border-color: var(--brand-line); }
@media (max-width: 560px) {
  .ann-btn span { display: none; }        /* 窄屏只留图标 */
  .ann-btn { padding: 2px 6px; }
  .ann-bar { top: 4px; right: 4px; }
}
/* ============================================================
   iPad / 触摸设备适配（PWA 独立运行 · 加到末尾，不改动既有规则）
   - safe-area：配合 viewport-fit=cover，避开刘海/圆角/Home 指示条
   - 触摸目标 ≥ 44px，去掉 hover 依赖、补 active 反馈
   - 横竖屏：竖屏(≤900)走既有移动布局；横屏大平板收窄侧栏留白
   ============================================================ */
/* 安全区：桌面/独立窗口下的顶栏、输入区、底部栏（env 在非 cover 浏览器为 0，无副作用） */
.topbar {
  min-height: calc(52px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
}
.composer {
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.sidebar-foot {
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.rail-foot {
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
/* 触摸设备：放大点按目标，去掉悬停依赖 */
@media (hover: none) and (pointer: coarse) {
  .nav-item { min-height: 44px; padding: 10px 10px; }
  .btn { min-height: 40px; }
  .topbar select, .model-select { min-height: 36px; }
  .search-btn { height: 36px; }
  .tabbar .tab { min-height: 44px; }
  /* 触屏无 hover：恢复中性态，避免「卡住」的高亮 */
  .nav-item:hover { background: transparent; color: var(--text-2); }
  .model-select:hover, .topbar select:hover { border-color: var(--border); color: var(--text-2); }
  .ann-btn:hover { background: transparent; color: var(--brand); border-color: var(--border); }
  .ann-btn.on { background: var(--accent-soft); border-color: var(--brand-line); color: var(--brand); }
  /* 长按不误选文字、去掉点按高亮闪烁 */
  .nav-item, .btn, .tab, .search-btn, .chip, .ab-btn {
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  /* 触屏下的按下反馈 */
  .btn:active, .nav-item:active, .tab:active { transform: scale(.97); }
}
/* 横屏大平板（iPad Air 5 横屏 1194×834）：保持桌面双栏，收窄侧栏留白 */
@media (min-width: 900px) and (max-width: 1180px) {
  .sidebar { width: 224px; }
  .rail { width: 224px; }
}
/* 竖屏 iPad（834×1194）已是 ≤900 移动布局：确保顶栏避开灵动/状态区 */
@media (max-width: 900px) {
  .topbar { min-height: calc(52px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
}
/* ============================================================
   Apple Pencil 误触全选抑制（pen-guard.js 配合）
   - 仅在 <html class="pen-input"> 存在时生效（= Pencil 交互窗口内）
   - 手指(touch)/鼠标(mouse) 选择完全不受影响：它们不会加这个类
   - 可编辑区（input/textarea/contenteditable）白名单放行
   ============================================================ */
html.pen-input, html.pen-input body { -webkit-touch-callout: none; }
html.pen-input * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
html.pen-input input,
html.pen-input textarea,
html.pen-input [contenteditable]:not([contenteditable="false"]) {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
/* ============================================================
   合规免责标注 + 首页今日推荐（文档「合规与风险提醒」/「智能诊断首页」）
   ============================================================ */
.ds-disclaimer {
  margin-top: 4px; font-size: 11px; color: var(--text-3);
  letter-spacing: .1px;
}
.dash-foot-note {
  margin-top: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-3); font-size: 11px; line-height: 1.6;
}
/* 字号调节（文档 P2-11）：只放大阅读区，不动布局结构与控件尺寸 */
html[data-fs="lg"] .q-stem { font-size: 18px; }
html[data-fs="lg"] .q-opt { font-size: 16px; }
html[data-fs="lg"] .qs-foot .q-exp { font-size: 15px; }
html[data-fs="xl"] .q-stem { font-size: 20px; }
html[data-fs="xl"] .q-opt { font-size: 17.5px; }
html[data-fs="xl"] .qs-foot .q-exp { font-size: 16.5px; }
/* 连续打卡（文档 P2-14「进度与激励」） */
.ck-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 6px 0 2px; font-size: 12px; color: var(--text-3);
}
.ck-meta b { color: var(--text); font-size: 13px; }
.ck-fire { color: var(--warn, #B4690E); font-size: 12px; }
.ck-streak { display: flex; gap: 3px; margin-left: auto; }
.ck-streak > i {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--surface-3); border: 1px solid var(--border);
}
/* CR-17：形状即状态——part 半格填充（左 half 琥珀）、full 实心绿，
   不再只靠底色区分（琥珀/绿恰是红绿色盲最难分辨的一对） */
.ck-streak > i.part {
  background: linear-gradient(90deg, var(--m1, #D98324) 50%, transparent 50%);
  border-color: var(--m1, #D98324);
}
.ck-streak > i.full { background: var(--m3, #3E9B57); border-color: var(--m3, #3E9B57); }
/* 首页「今日推荐练习」：直接给出今天该做的题，而不是空白首页 */
.dash-today {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; width: 100%; text-align: left;
}
.dash-today:hover { border-color: var(--brand-line); background: var(--accent-soft); }
.dash-today .dt-ico { font-size: 16px; flex: 0 0 auto; }
.dash-today .dt-main { flex: 1; min-width: 0; }
.dash-today .dt-t { font-size: 13px; font-weight: 600; color: var(--text); }
.dash-today .dt-d { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.dash-today .dt-go { flex: 0 0 auto; font-size: 12px; color: var(--brand); }
/* ============================================================
   学习规划 ↔ 今日训练 共用题单（plan-tasks.js）
   ============================================================ */
.pt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md);
  margin-bottom: 8px; background: var(--surface);
}
.pt-row.done { opacity: .72; }
.pt-main { flex: 1; min-width: 0; }
.pt-t { font-size: 13px; font-weight: 600; color: var(--text); }
.pt-d { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pt-bar {
  display: block; height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--surface-3); margin-top: 6px;
}
/* 进度条填充：由内联 style="--pw:N%" 驱动，clip-path 内联裁剪 —— 走合成层，不触发重排，
   且不像 scaleX 那样把圆角压成尖角（--pw 是百分比，见 chat.js:690 / admin.js:3173 / plan.js:483）。 */
.pt-bar > i { display: block; width: 100%; height: 100%; background: var(--brand); border-radius: 3px;
  clip-path: inset(0 calc(100% - var(--pw, 0%)) 0 0); transition: clip-path var(--dur-2) var(--ease-std); }
.pt-ops { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.plan-sub { font-size: 12px; color: var(--text-3); }
.pt-row.done .pt-bar > i { background: var(--m3, #3E9B57); }
/* ============================================================
   P2-11 材料吸顶（轻量版：不做左右分屏）
   长材料展开后，材料入口要一直够得着：往下读选项时随时能收回去。
   两条一起上——吸纳顶（sticky）负责「入口跟着走」，限高滚动负责
   「材料再长也不把题干/选项挤到屏幕外」，和练习题双栏材料的 .qs-mat
   用的是同一套手法（sticky + max-height + overflow-y）。
   ============================================================ */
.q-mat-h {
  /* sticky 的参照是最近的祖先滚动容器（这里是视口：父级 .panel 用
     overflow: clip，不生成滚动容器，正好让 sticky 挂到视口上——
     见 .panel 处注释）。祖先若改成 overflow:hidden/auto，这里会失效。 */
  position: sticky;
  top: var(--sticky-top, 104px);
  z-index: 3;
  /* 背景要铺满整个材料卡宽度：sticky 浮起来后正文从它两侧滚过去，
     只给按钮自身上色会露出两条没有底色的窄缝。负外边距把底色铺到
     .q-mat 的内边距区（10px 12px），再用同样的正值把内容推回原位。 */
  margin: -10px -12px 0;
  padding: 10px 12px 8px;
  background: var(--surface-2);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  box-shadow: 0 1px 0 var(--border);
}
/* 折叠态没有正文要跨越，按钮就待在原地，别留一块多余的底板 */
.q-mat.collapsed .q-mat-h { position: static; margin: 0; padding: 0; background: none; box-shadow: none; }
/* 展开后的正文限量高 + 内部滚动：材料再长，题干和选项也不会被推走 */
.q-mat:not(.collapsed) .q-mat-body {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}
/* ============================================================
   P0-5 模考报告「与上次对比」
   ============================================================ */
.er-compare {
  margin: -8px 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: center;
}
.er-compare-first {
  font-size: 12px; color: var(--text-3);
  background: none; border-style: dashed; border-color: var(--border-2);
}
.er-cmp-line { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.er-cmp-tip { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.er-cmp-tip.up { color: var(--m3-ink); }
.er-cmp-tip.down { color: var(--m0-ink); }
.er-cmp-tip.flat { color: var(--text-2); }
.er-cmp-prev { font-size: 12px; color: var(--text-3); }
.er-cmp-subjs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
}
.er-cmp-subj { font-size: 12px; color: var(--text-2); }
.er-cmp-subj i { font-style: normal; font-variant-numeric: tabular-nums; }
.er-cmp-subj i.up { color: var(--m3-ink); }
.er-cmp-subj i.down { color: var(--m0-ink); }
/* ============================================================
   P0-4 错题错因：分布统计 + 行内下拉
   ============================================================ */
.cause-stat {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cs-lab { font-size: 12px; color: var(--text-3); margin-right: 2px; }
.cs-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-size: 12px;
}
.cs-chip i { font-style: normal; font-weight: 600; color: var(--m0-ink); font-variant-numeric: tabular-nums; }
.cs-chip.cs-none { color: var(--text-3); border-style: dashed; }
.cs-chip.cs-none i { color: var(--text-3); font-weight: 400; }
/* 200 条显示上限提示条：错因分布上方置顶，信息型（不是错误） */
.mistake-cap-note {
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font-size: 12.5px; line-height: 1.6;
}
.mistake-cap-note b { color: var(--text-1); font-variant-numeric: tabular-nums; }
/* 行内错因下拉：比同行的按钮矮一号，视觉上是标签而不是操作按钮 */
select.m-cause {
  padding: 3px 6px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 12px; cursor: pointer; max-width: 120px;
}
select.m-cause:hover { border-color: var(--border-2); color: var(--text-1); }
select.m-cause:focus { border-color: var(--accent-line); box-shadow: var(--ring); outline: none; }
/* ============================ 申论素材 / 规范词助手 ============================ */
#shenlunRoot { max-width: 880px; margin: 0 auto; }
.sl-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.sl-body { min-height: 320px; }
.sl-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sl-counter { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.sl-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-1);
  padding: 18px 20px; margin-bottom: 12px;
}
.sl-code { display: inline-block; font-size: 12px; font-weight: 700; color: var(--on-brand); background: var(--brand); border-radius: var(--r-xs); padding: 2px 8px; margin-bottom: 8px; }
.sl-term { font-size: 18px; font-weight: 700; color: var(--text-1); line-height: 1.5; margin-bottom: 14px; }
.sl-row { display: flex; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--border); }
.sl-row:first-of-type { border-top: none; }
.sl-k { flex: 0 0 76px; color: var(--text-3); font-size: 13px; padding-top: 1px; }
.sl-v { flex: 1; color: var(--text-1); font-size: 14px; line-height: 1.7; }
.sl-warn { color: var(--m0-ink); }
.sl-ok { color: var(--m3-ink); }
.sl-input { width: 100%; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-1); font-size: 14px;
  resize: vertical; font-family: inherit;
  transition: border-color var(--dur-1) var(--ease-std), box-shadow var(--dur-1) var(--ease-std); }
.sl-input:focus { border-color: var(--accent-line); box-shadow: var(--ring); outline: none; }
.sl-prac-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.sl-modes { display: flex; gap: 6px; }
.sl-mode.active { background: var(--brand-wash); border-color: var(--brand-line); color: var(--brand); }
.sl-weak { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.sl-stat { font-size: 12px; color: var(--text-3); margin-left: auto; }
.sl-prac-ops { display: flex; gap: 8px; margin-top: 10px; }
.sl-prompt-label { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.sl-prompt { font-size: 15px; color: var(--text-1); background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; line-height: 1.7; }
.sl-answer { margin-top: 14px; }
.sl-selfrate { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.sl-rate.ok { background: var(--m3-ink); border-color: var(--m3-ink); color: var(--on-fill); }
.sl-rate.bad { background: var(--m0-ink); border-color: var(--m0-ink); color: var(--on-fill); }
.sl-grade { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.sl-group { margin-bottom: 16px; }
.sl-group-h { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.sl-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sl-term-chip, .sl-doc-chip {
  padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-1); font-size: 13px; cursor: pointer;
  transition: all var(--dur-1) var(--ease-std);
}
.sl-term-chip:hover, .sl-doc-chip:hover { border-color: var(--brand-line); color: var(--brand); background: var(--brand-wash); }
/* ---------- 申论页 tab 条 ----------
   之前 .sl-tabs / .sl-tab / .sl-body 三个 class 在 CSS 里完全没有规则：
   tab 只是裸 <button>，切页时零转场（内容瞬间替换，没有视觉连续性）。
   这里补齐观感 + 按压反馈；.sl-body 的入场动画利用了 innerHTML 重挂载会
   重启 animation 的特性，不需要改 JS 逻辑。 */
.sl-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sl-tab {
  padding: 6px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 13px; cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-std),
    border-color var(--dur-1) var(--ease-std), color var(--dur-1) var(--ease-std),
    transform var(--dur-press) var(--ease-std);
}
.sl-tab:hover { border-color: var(--brand); color: var(--text-1); }
.sl-tab:active { transform: scale(.96); }
.sl-tab.active { background: var(--brand-wash); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.sl-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .sl-body { animation: none; }
  .sl-tab:active { transform: none; }
}
.sl-note { font-size: 13px; color: var(--text-2); background: var(--brand-wash); border: 1px solid var(--brand-line);
  border-radius: var(--r-sm); padding: 10px 14px; line-height: 1.7; margin-bottom: 14px; }
.sl-list { display: flex; flex-direction: column; gap: 6px; }
.sl-essay { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface); }
.sl-essay-kind { flex: 0 0 56px; font-size: 12px; color: var(--brand); font-weight: 700; }
.sl-essay-title { flex: 1; color: var(--text-1); font-size: 14px; }
.sl-essay-page { flex: 0 0 auto; font-size: 12px; color: var(--text-3); }
.sl-essay { cursor: pointer; transition: border-color var(--dur-1) var(--ease-std), background var(--dur-1) var(--ease-std), transform var(--dur-press) var(--ease-std); }
.sl-essay:hover { border-color: var(--brand); background: var(--brand-wash); }
.sl-essay:active { transform: translateY(1px); }
#slEssayDetail .sl-card p { margin: 0 0 12px; line-height: 1.9; font-size: 15px; color: var(--text-1);
  text-indent: 2em; text-align: justify; }
#slEssayDetail .sl-card p:last-child { margin-bottom: 0; }
#slEssayDetail .sl-card .sl-term { text-indent: 0; margin-bottom: 14px; }
/* ---- 主观题（申论）练习卡 ---- */
.q-subj { margin-top: 10px; }
.q-subj-hint { font-size: 13px; color: var(--text-2); background: var(--brand-wash);
  border: 1px solid var(--brand-line); border-radius: var(--r-sm); padding: 8px 12px;
  line-height: 1.7; margin-bottom: 10px; }
.q-subj-input { width: 100%; box-sizing: border-box; font: inherit; color: var(--text-1);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 12px; line-height: 1.8; resize: vertical; min-height: 130px;
  transition: border-color var(--dur-1) var(--ease-std), box-shadow var(--dur-1) var(--ease-std); }
.q-subj-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.q-subj-ops { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; align-items: center; }
.q-subj-ans { border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); padding: 10px 14px; margin-bottom: 10px; }
.q-subj-t { font-size: 12px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.q-subj-body { font-size: 14px; line-height: 1.9; color: var(--text-1); white-space: pre-wrap; }
.q-subj-rate { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
/* ---- 申论自动评分面板 ---- */
.q-grade { border: 1px solid var(--brand-line); background: var(--brand-wash);
  border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 10px; }
.q-grade-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.q-grade-score { font-size: 22px; font-weight: 800; color: var(--brand); }
.q-grade-score i { font-style: normal; font-size: 12px; color: var(--text-3); font-weight: 400; }
.q-grade-pct { font-size: 13px; color: var(--text-2); font-weight: 700; }
.q-grade-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.q-grade-k { flex: 0 0 76px; font-size: 12px; color: var(--text-2); }
.q-grade-bar { flex: 1 1 auto; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 60px; }
.q-grade-bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.q-grade-v { flex: 0 0 44px; text-align: right; font-size: 12px; font-weight: 700; color: var(--text-1); }
.q-grade-note { flex: 0 0 auto; font-size: 11px; color: var(--text-3); }
.q-grade-kws { margin-top: 8px; font-size: 12px; line-height: 2; word-break: break-all; }
.q-grade-hit { color: var(--ok); margin-right: 12px; }
.q-grade-miss { color: var(--danger); }
.q-grade-comment { margin-top: 8px; font-size: 13px; line-height: 1.7; color: var(--text-2); }
/* ---- 题目总览目录（sheet 浮层内） ---- */
.toc-body { max-height: 62vh; overflow: auto; padding: 0 16px; }
.toc-group { margin-bottom: 14px; }
.toc-group-h { font-size: 13px; font-weight: 700; color: var(--brand);
  padding: 6px 2px; border-bottom: 1px solid var(--brand-line); margin-bottom: 6px; }
.toc-row { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  padding: 8px 12px; margin-bottom: 6px; cursor: pointer; transition: border-color var(--dur-1) var(--ease-std), background var(--dur-1) var(--ease-std); }
.toc-row:hover { border-color: var(--brand); background: var(--brand-wash); }
.toc-meta { font-size: 12px; color: var(--text-3); }
.toc-stem { font-size: 14px; color: var(--text-1); line-height: 1.6; }
/* 与 875 行完全对齐。之前这里（后出现的那条）把字号抬到 14px、左右留白去掉了，
   两条规则值不一致、谁生效取决于位置——875 行那条才是唯一规范。 */
/* ==================== 申论 AI 批改 / AI 答疑（2026-10-21 新增） ====================
 * 只追加 .sl-ai- 前缀，不改动任何既有 token 与组件规则。 */
.sl-ai-wrap { display: flex; flex-direction: column; gap: 10px; }
.sl-ai-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sl-ai-sel { flex: 1; min-width: 260px; max-width: 640px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm, 8px);
  background: var(--surface); color: var(--text); font-size: 13px; }
.sl-ai-in { flex: 1; min-width: 220px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--r-sm, 8px);
  background: var(--surface); color: var(--text); font-size: 13px; }
.sl-ai-ta { width: 100%; padding: 10px; font-size: 13px; line-height: 1.7; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--r-sm, 8px);
  background: var(--surface); color: var(--text); }
.sl-ai-hint { font-size: 11px; color: var(--text-3); }
.sl-ai-meta { padding: 10px; border: 1px solid var(--border); border-radius: var(--r-sm, 8px);
  background: var(--surface-2, var(--surface)); font-size: 13px; }
.sl-ai-meta > div + div { margin-top: 6px; }
.sl-ai-stem { color: var(--text-2); line-height: 1.6; }
.sl-ai-req { color: var(--text-2); }
.sl-ai-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: 11px;
  border-radius: 999px; vertical-align: middle; }
.sl-ai-badge.ok { color: var(--on-brand); background: var(--brand); }
.sl-ai-badge.warn { color: var(--text-2); background: var(--surface-3); border: 1px solid var(--border); }
.sl-ai-grade { border: 1px solid var(--border); border-radius: var(--r-md, 12px);
  background: var(--surface); padding: 12px; }
.sl-ai-score { font-size: 15px; margin-bottom: 6px; }
.sl-ai-score b { font-size: 26px; color: var(--brand); margin-right: 2px; }
.sl-ai-note { font-size: 11px; color: var(--text-3); margin-bottom: 8px; }
.sl-ai-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0 10px; }
.sl-ai-tab th, .sl-ai-tab td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.sl-ai-tab th { background: var(--surface-2, var(--surface)); font-weight: 600; }
.sl-ai-tab tr.sl-ai-ok td:nth-child(2) { color: var(--m3); font-weight: 600; }
.sl-ai-tab tr.sl-ai-part td:nth-child(2) { color: var(--m1); font-weight: 600; }
.sl-ai-tab tr.sl-ai-miss td:nth-child(2) { color: var(--m0); font-weight: 600; }
.sl-ai-sec { margin-top: 10px; font-size: 13px; }
.sl-ai-sec > b { display: block; margin-bottom: 4px; }
.sl-ai-sec ul { margin: 0; padding-left: 18px; }
.sl-ai-sec li { margin: 2px 0; line-height: 1.6; }
.sl-ai-model { padding: 10px; line-height: 1.8; white-space: pre-wrap;
  border: 1px dashed var(--border); border-radius: var(--r-sm, 8px); background: var(--surface-2, var(--surface)); }
.sl-ai-raw { padding: 8px; font-size: 11px; white-space: pre-wrap; word-break: break-all;
  border: 1px solid var(--border); border-radius: var(--r-sm, 8px); background: var(--surface-2, var(--surface)); }
.sl-ai-bubble { max-width: 86%; padding: 8px 12px; margin: 6px 0; font-size: 13px; line-height: 1.75;
  border-radius: var(--r-md, 12px); }
.sl-ai-bubble.user { margin-left: auto; color: var(--on-brand); background: var(--brand); }
.sl-ai-bubble.ai { border: 1px solid var(--border); background: var(--surface); }
.sl-ai-cites { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
.sl-ai-cite { padding: 1px 8px; font-size: 10.5px; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2, var(--surface)); }
.sl-ai-cite.none { color: var(--text-3); border-style: dashed; }
.sl-ai-his { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-2); }
.sl-ai-his li { margin: 3px 0; }
.sl-ai-link { color: var(--brand); cursor: pointer; text-decoration: underline; }
.model-host { display: flex; justify-content: flex-end; padding: 0 16px 6px; }
/* ---------- 申论批改 · 语音输入（2026-10-21） ---------- */
.sl-ai-ansbar { display: flex; align-items: stretch; gap: 8px; }
.sl-ai-ansbar .sl-ai-ta { flex: 1; min-width: 0; }
.sl-ai-voice { margin: 6px 0 2px; font-size: 12px; color: var(--text-2); line-height: 1.6; }
.sl-ai-voice b { color: var(--text); font-variant-numeric: tabular-nums; }
.sl-ai-voice-hint { color: var(--text-3); }
.sl-ai-voice.err { color: var(--m0); }
.sl-ai-voice.busy { color: var(--text-3); }
.sl-ai-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--m0); margin-right: 6px; vertical-align: 1px; animation: slAiPulse 1.1s ease-in-out infinite; }
.sl-ai-warn { font-weight: 700; }
@keyframes slAiPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .sl-ai-dot { animation: none; } }
/* 窄屏（iPad 竖屏/手机）：麦克风按钮挪到作答框下方占整行，避免挤压 */
@media (max-width: 560px) {
  .sl-ai-ansbar { flex-direction: column; }
  .sl-ai-mic { width: 100%; min-height: 48px; flex-direction: row; }
}
/* ===== 语音按钮精修（Phase 3，2026-10-21）=====
 * 根因：.sl-ai-ansbar 是 align-items:stretch，.sl-ai-mic 只写 min-height
 * 没写 align-self → 按钮被拉成 ~60×220 的竖向细条（这才是「突兀」的来源）。
 * 方案：还原成 36×36 右上角标（与作答框同族圆角/边框/底色），热区 44×44。
 * 约束：只追加 .sl-ai- 前缀；不新增 token；::before 专用于热区，
 *       ::after 专用于脉冲环（避免与 :focus-visible 的 box-shadow 打架）。 */
.sl-ai-ansbar { position: relative; }
.sl-ai-ansbar .sl-ai-ta { padding-right: 48px; }   /* 文字不钻到按钮下 */
.sl-ai-mic {
  position: absolute; top: 8px; right: 10px;
  flex: 0 0 auto; width: 36px; height: 36px; min-height: 0; padding: 0;
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 0; font-size: 13px; line-height: 1; user-select: none;
  border: 1px solid var(--border); border-radius: var(--r-sm, 8px);
  background: var(--surface); color: var(--text-3); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) var(--ease-std), color var(--dur-1) var(--ease-std),
    border-color var(--dur-1) var(--ease-std), transform var(--dur-press) var(--ease-std);
}
/* 热区扩到 44×44，视觉尺寸不变 */
.sl-ai-mic::before { content: ''; position: absolute; inset: -4px; }
.sl-ai-mic-ico { font-size: 18px; line-height: 1; }
/* 桌面端文案进读屏（paint() 仍会切 innerHTML，不影响读屏） */
.sl-ai-mic-txt {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.sl-ai-mic:hover { border-color: var(--brand); color: var(--brand); }
.sl-ai-mic:active { transform: scale(.94); }
/* 录音按钮的焦点环用 outline 而不是 box-shadow：box-shadow 要留给 .rec 的脉冲环
   （::after 伪元素），两者共用会互相覆盖。
   注意这里不能写 var(--ring, var(--brand))——--ring 是一个 box-shadow 值
   （"0 0 0 3px …"），塞进 outline 的颜色位会让整条声明失效，焦点环永远不出现。 */
.sl-ai-mic:focus-visible { outline: 2px solid var(--brand) !important; outline-offset: 2px; }
/* 录音中：实底赤 + 图标换停止方块（形状线索，不只靠颜色） */
.sl-ai-mic.rec { border-color: var(--m0); background: var(--m0); color: var(--on-fill, #fff); }
.sl-ai-mic.rec .sl-ai-mic-ico { font-size: 0; }
.sl-ai-mic.rec .sl-ai-mic-ico::after { content: '■'; font-size: 13px; line-height: 1; }
/* 低幅脉冲环：放在 ::after，不占用 :focus-visible 的 box-shadow */
.sl-ai-mic.rec::after {
  content: ''; position: absolute; inset: -3px; border-radius: inherit;
  border: 2px solid var(--m0); opacity: .5; pointer-events: none;
  animation: slAiMicRing 1.6s ease-out infinite;
}
@keyframes slAiMicRing {
  0%   { opacity: .55; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.35); }
  100% { opacity: 0;   transform: scale(1.35); }
}
.sl-ai-mic.busy { opacity: .7; cursor: progress; }
.sl-ai-mic.off { opacity: .45; cursor: not-allowed; }
.sl-ai-mic.off:hover { border-color: var(--border); color: var(--text-3); }
/* 状态行：间距与圆点对齐两处收敛；整行不染红（红点已作形状线索） */
.sl-ai-voice { margin: 8px 0 2px; }
.sl-ai-voice .sl-ai-dot { vertical-align: 0; }
.sl-ai-voice-retry {
  margin-left: 8px; padding: 0 6px; font-size: 12px; line-height: 1.6;
  color: var(--brand); background: none; border: 0; cursor: pointer;
  text-decoration: underline;
}
@media (prefers-reduced-motion: reduce) {
  .sl-ai-mic.rec::after { animation: none; opacity: .5; }
}
/* 窄屏（≤600px）：作答框下方整行按钮（iPad 竖屏 768px 仍侧置） */
@media (max-width: 600px) {
  .sl-ai-ansbar .sl-ai-ta { padding-right: 10px; }
  .sl-ai-mic {
    position: static; width: 100%; height: 48px; min-height: 48px;
    flex-direction: row; gap: 8px; padding: 0 14px; font-size: 13px;
    justify-content: flex-start; background: var(--surface-2, var(--surface));
    margin-top: 8px;
  }
  .sl-ai-mic::before { inset: 0; }
  .sl-ai-mic-txt {
    position: static; width: auto; height: auto; margin: 0; padding: 0;
    border: 0; overflow: visible; clip-path: none; white-space: normal;
  }
  .sl-ai-mic.rec .sl-ai-mic-ico::after { font-size: 16px; }
  .sl-ai-mic.rec::after { inset: 0; }
}
/* ============================================================
   统一空态 / 加载态 / 错误态
   ============================================================ */
/* 三种子状态靠语义 class 区分，不动 DOM 结构：
   加载 = 转圈 + 中性色，错误 = 赤色 + ⚠ 前缀（形状线索，不只靠颜色）。 */
.empty.is-loading { color: var(--text-2); }
.empty.is-loading::before {
  content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px;
  vertical-align: -2px; border: 2px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin var(--dur-spin) linear infinite;
}
.empty.is-error { color: var(--m0); }
.empty.is-error::before { content: '⚠ '; }
/* ============================================================
   按压反馈补齐
   ============================================================ */
/* 这些元素此前只有 :hover，点下去没有任何位移反馈，触屏上尤其像「没点到」。
   .plan-link / .q-flag 本身用了 transition: all，已含 transform，只补 :active。 */
.ck-row:active, .toc-row:active, .sl-term-chip:active, .sl-doc-chip:active,
.nav-item:active, .rail-item:active, .plan-link:active, .q-flag:active { transform: scale(.97); }
/* 剩下几个此前既没有 :active 也没有 transform 过渡，一并补最短档（--dur-press = 100ms） */
.rail-item { transition: background-color var(--dur-1) var(--ease-std), color var(--dur-1) var(--ease-std), transform var(--dur-press) var(--ease-std); }
.ck-row, .sl-term-chip, .sl-doc-chip { transition: transform var(--dur-press) var(--ease-std); }
.toc-row { transition: border-color var(--dur-1) var(--ease-std), background var(--dur-1) var(--ease-std), transform var(--dur-press) var(--ease-std); }
@media (prefers-reduced-motion: reduce) {
  .empty.is-loading::before { animation: none; opacity: .6; }
  .ck-row:active, .toc-row:active, .sl-term-chip:active, .sl-doc-chip:active,
  .nav-item:active, .rail-item:active, .plan-link:active, .q-flag:active { transform: none; }
}
/* ===== Material 3 state layer 工具类（2026 重构阶段 A）=====
 * 用法：给可交互容器加 class="sl-state"。交互反馈 = 原表面 + 主题色透明叠加，
 * 叠在 ::before 上只动 opacity，不触发重排；圆角继承自容器。 */
.sl-state { position: relative; }
.sl-state::before { content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--state-hover); opacity: 0;
  transition: opacity var(--dur-quick) var(--ease-std); pointer-events: none; }
.sl-state:hover::before { opacity: 1; }
.sl-state:active::before { background: var(--state-press); opacity: 1; transition-duration: var(--dur-press); }
@media (prefers-reduced-motion: reduce) { .sl-state::before { transition: none; } }
/* ===== 三栏工作区（2026 重构阶段 B）=====
   左导航 .rail（可折成 64px 图标栏）+ 中栏 .train + 右栏 AI 面板。
   状态全部落在 <html> 的类上（ws-rail-mini / ws-agent-on / ws-exam），
   由 assets/workspace.js 管理并持久化到 shangan-layout-v1。
   宽度切换是离散布局变化，不做动画（遵守 transform/opacity-only 约定）。 */
:root { --agent-w: clamp(288px, 24vw, 340px); }
.agent-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: var(--agent-w); z-index: 6;
  display: none; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border);
}
.ws-agent-on .agent-panel { display: flex; }
.ws-agent-on .train { margin-right: var(--agent-w); }
.ap-head {
  height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; border-bottom: 1px solid var(--border);
}
.ap-head b { font-size: 13px; font-weight: 600; }
.ap-tag {
  font-size: 11px; color: var(--text-3);
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 1px 8px;
}
.ap-body { flex: 1; overflow-y: auto; padding: 18px 16px; }
.ap-empty {
  margin: 48px auto 0; max-width: 240px; text-align: center;
  color: var(--text-2); font-size: 13px; line-height: 1.8;
}
.ap-empty-ico { font-size: 26px; margin-bottom: 10px; }
.ap-empty p { margin: 0 0 14px; }
.ap-empty .btn { display: inline-flex; }
/* 折叠钮：与 .rail-home 同规格的 28px 图标钮 */
.rail-fold, .ap-fold {
  width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-2);
  background: transparent; cursor: pointer; padding: 0;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.rail-fold:hover, .ap-fold:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.rail-fold svg, .ap-fold svg { width: 15px; height: 15px; transition: transform var(--dur-1) var(--ease); }
/* 左导航折起后箭头反向，提示再点展开 */
.ws-rail-mini .rail-fold svg { transform: rotate(180deg); }
/* ---- 左导航 64px 图标栏 ---- */
.ws-rail-mini .rail { width: 64px; }
.ws-rail-mini .train { margin-left: 64px; }
.ws-rail-mini .rail-head { padding: 0 10px; gap: 6px; justify-content: center; }
.ws-rail-mini .rail-brand, .ws-rail-mini .rail-home { display: none; }
.ws-rail-mini .rail-label,
.ws-rail-mini .rail-item span,
.ws-rail-mini .rail-foot .tag { display: none; }
.ws-rail-mini .rail-scroll { padding: 12px 8px; }
.ws-rail-mini .rail-item { justify-content: center; padding: 9px 0; }
.ws-rail-mini .rail-item.on { box-shadow: none; }
.ws-rail-mini .rail-foot { justify-content: center; padding: 10px 8px; }
/* ---- 模考全宽：右栏强制收起（会话态，用户偏好不受影响）---- */
.ws-exam .agent-panel { display: none !important; }
.ws-exam .train { margin-right: 0; }
/* .btn 的 display:inline-flex 会盖掉 hidden 属性，必须写明 */
.ws-exam #btnAgentOpen, #btnAgentOpen[hidden] { display: none; }
/* ---- 窄屏：面板不存在（底部 tab 接管导航）---- */
@media (max-width: 860px) {
  .agent-panel { display: none !important; }
  .ws-agent-on .train { margin-right: 0; }
  #btnAgentOpen { display: none !important; }
}
/* ============================================================
   Material 3 / Google 视觉重制（material-ui 分支 · 2026-10-24）
   目标：越接近 Google（Material 3 / Material You）越好。
   手段：① 上面的 token 已整体换成 Google 色板（浅/深两套）；
        ② 这里只补「形状语言」：pill 按钮、全圆导航项、M3 开关、
           elevation 卡片、圆形头像、细滚动条、全圆输入框。
   纪律：只动视觉，不动布局与业务结构；全部引用既有 token。
   ============================================================ */
/* ---------- Roboto：Material 官方西文字体，离线内置（可变字重 100–900）。
   latin 子集；中日韩按 --font 字栈回落苹方/鸿蒙/思源（Material 对 CJK 的官方建议）。 ---------- */
@font-face {
  font-family: 'Roboto'; font-style: normal; font-weight: 100 900; font-stretch: 100%;
  font-display: swap;
  src: url('fonts/roboto-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
/* ---------- 按钮：M3 全圆（pill）形状 ---------- */
.btn { border-radius: var(--r-pill); padding-left: 18px; padding-right: 18px; }
.btn-sm { border-radius: var(--r-pill); padding-left: 12px; padding-right: 12px; }
.btn-primary { box-shadow: var(--sh-1); }
.btn-primary:hover { box-shadow: var(--sh-2); }
/* M3 text button 用主色表达可点 */
.btn-ghost { color: var(--accent); }
.btn-ghost:hover { color: var(--accent-2); }
.theme-toggle { border-radius: var(--r-pill); }
.search-btn { border-radius: var(--r-pill); }
.cl-btn { border-radius: var(--r-pill); }
.ab-btn { border-radius: var(--r-pill); }
/* ---------- 导航：M3 navigation pill（选中 = secondary-container 药丸，不再用左侧指示条） ---------- */
.nav-item, .conv-item, .rail-item { border-radius: var(--r-pill); }
.nav-item.active {
  background: var(--brand-50); border-color: transparent;
  color: var(--brand-600); font-weight: 500;
}
.conv-item.active { background: var(--brand-50); border-color: transparent; }
.conv-item.active::before { display: none; }
.rail-item.on {
  background: var(--brand-50); color: var(--brand-600); font-weight: 500;
  box-shadow: none;
}
.rail-item.on svg { color: var(--brand-600); }
.tab-item.on span { font-weight: 500; }
/* ---------- 卡片：M3 elevated（阴影分层，不用边框描边） ---------- */
.card { border-color: transparent; box-shadow: var(--sh-1); }
.panel { border-color: transparent; box-shadow: var(--sh-1); }
.cl-card { border-color: transparent; }
.ai-card { border-color: transparent; box-shadow: var(--sh-1); }
.auth-card { border-radius: var(--r-xl); border-color: transparent; }
/* ---------- 输入：大圆角输入框 ---------- */
/* 2026-10-24 验收修复：全圆（999px）在两行高的输入容器上底角曲率过大（有效半径 63px），
   贴边的操作按钮视觉上压穿弯曲边框；多行输入容器改用 Gemini 实际使用的大圆角（28px）。 */
/* 操作行按钮高度统一：发送（btn-primary）与其余按钮（btn-sm，窄屏被媒体查询抬到 34px）
   三套高度并存导致挤压观感，统一为 34px 最小高度 */
.composer-actions .btn { min-height: 34px; }
/* ---------- chips / badges：全圆 ---------- */
.chip { border-radius: var(--r-pill); }
.cl-chip { border-radius: var(--r-pill); }
.badge { border-radius: var(--r-pill); }
/* ---------- 头像：圆形（Google 账户风格） ---------- */
.avatar, .msg-avatar { border-radius: 50%; }
/* ---------- 开关：M3 规格（52×32 轨道，未选 16px 拇指 / 选中 24px 拇指） ---------- */
.sw-track {
  width: 52px; height: 32px; flex: 0 0 52px;
  border: 2px solid var(--line-2); background: var(--surface-3);
  border-radius: var(--r-pill);
}
/* 圆点必须真的从左侧滑到右侧：旧值 left:12 + translateX(4) 让「关」和「开」都挤在
   轨道中间，两者几乎重合，看上去像一个坏掉的开关。轨道内宽 48（52 - 2×2 边框），
   未选 16px 盘左内缩 6，选中 24px 盘右内缩 4。 */
.sw-dot {
  width: 16px; height: 16px; top: 6px; left: 4px; border-radius: 50%;
  background: var(--text-3); box-shadow: none;
  transition: transform var(--dur-2) var(--ease-spring),
              width var(--dur-2) var(--ease-spring), height var(--dur-2) var(--ease-spring),
              top var(--dur-2) var(--ease-spring), background var(--dur-1) var(--ease);
}
.switch input:checked + .sw-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .sw-track .sw-dot {
  width: 24px; height: 24px; top: 4px; background: var(--on-brand);
  transform: translateX(16px);
}
/* ---------- 顶栏标题：M3 top app bar 的字阶 ---------- */
.admin-head .title { font-size: var(--fs-18); font-weight: 500; }
/* ---------- 滚动条：细一档，全圆 ---------- */
::-webkit-scrollbar-thumb { border-width: 2px; border-radius: var(--r-pill); }
/* ---------- 选区：Google 蓝淡底 ---------- */
::selection { background: var(--brand-50); }
/* ---------- 用户消息气泡：Gemini 的 primary-container 药丸 ---------- */
.msg.user .bubble {
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  border-color: transparent;
}
/* ---------- M3 下拉的小圆角（4px） ---------- */
.topbar select, .model-select, .cl-drawer select { border-radius: var(--r-xs); }
/* ---------- 主题切换：View Transitions 整页淡切（2026-10-24 性能修复）
   theme.js 走 document.startViewTransition：淡切由合成器（GPU）完成，
   主线程不再给每个元素挂颜色过渡。旧 .theme-anim 路径仅作不支持 VT 的兜底。 */
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: .18s;
  animation-timing-function: cubic-bezier(.2, 0, 0, 1);
}
/* ---------- 窄屏溢出修复（2026-10-24 UI 审计）
   plan.js 的「今日安排」表（plan.html）是唯一没包 .plan-tbl-wrap 的表格：
   390px 宽下右溢 14px 且没有滚动容器。给卡片本体开横向滚动，其余表格走 .plan-tbl-wrap 的既有规则。 */
.plan-today { overflow-x: auto; }
/* ---------- Material Symbols 内联图标（assets/msi.js） ---------- */
.msi { display: inline-block; vertical-align: -0.15em; flex: none; }
/* KPI 统计卡的圆形图标章（M3 circular icon container） */
.card-ico {
  width: 30px; height: 30px; margin-bottom: 8px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--brand-600);
}
/* ============ 知识世界地图 · 会发光的备考地形图（2026-10-25 重设计） ============
/* 地图专用 token（仅 .wm- 选择器引用；--ds-glow-* 同理）。值与原硬编码一致，只换成引用。 */
:root {
  --ds-map-m-ink: #e9efff;
  --ds-map-m-dim: #93a3c6;
  --ds-map-m-faint: #7d8dae;
  --ds-map-m-ct-face: rgba(30,44,74,.72);
  --ds-map-m-ct-face2: rgba(46,66,104,.94);
  --ds-map-m-ct-edge: rgba(150,185,255,.28);
  --ds-map-m-ct-glow: rgba(90,140,235,.45);
  --ds-map-m-dot-off: rgba(150,172,210,.42);
  --ds-map-m-fog: rgba(160,185,225,.20);
  --ds-map-m-hud: rgba(10,16,28,.66);
  --ds-map-m-hud-edge: rgba(150,180,240,.16);
  --ds-map-wm-canvas-background: rgba(66,112,192,.20);
  --ds-map-wm-canvas-background-2: rgba(34,158,150,.14);
  --ds-map-wm-canvas-background-3: #070b13;
  --ds-map-wm-canvas-background-4: #080e1a;
  --ds-map-wm-canvas-background-5: #060a12;
  --ds-map-wm-cont-fill-fill: rgba(120,170,255,.22);
  --ds-map-elev-fill: rgba(120,170,255,.22);
  --ds-map-elev-fill-2: #ffffff;
  --ds-map-wm-cont-lit-stroke: #63e6a8;
  --ds-glow-wm-cont-lit: drop-shadow(0 0 7px var(--ring-hi, #63e6a8));
  --ds-map-has-color: #63e6a8;
  --ds-map-r0-stroke: rgba(140,160,200,.42);
  --ds-map-r1-stroke: #ff6b6b;
  --ds-map-r2-stroke: #ffb24d;
  --ds-map-r3-stroke: #5fe0a0;
  --ds-glow-wm-node: 0 0 12px 3px var(--dot-glow, rgba(120,180,255,.55));
  --ds-map-mod-background: #dce9ff;
  --ds-glow-mod: 0 0 14px 4px var(--ct-glow, rgba(120,170,255,.5));
  --ds-map-mod-background-2: #9cc0ff;
  --ds-glow-mod-x: 0 0 10px 2px var(--dot-glow, rgba(120,180,255,.45));
  --ds-map-lv0-background: rgba(150,172,210,.34);
  --ds-map-lv1-background: #8fb0e6;
  --ds-glow-lv1: 0 0 8px 1px rgba(143,176,230,.35);
  --ds-map-lv2-background: #a9c8ff;
  --ds-glow-lv2: 0 0 11px 2px rgba(169,200,255,.45);
  --ds-map-lv3-background: #cfe4ff;
  --ds-glow-lv3: 0 0 14px 3px rgba(207,228,255,.60);
  --ds-map-lv4-background: #ffffff;
  --ds-glow-lv4: 0 0 18px 5px rgba(120,255,200,.75), 0 0 34px 10px rgba(90,230,180,.35);
  --ds-map-lv3-color: #c8d8f5;
  --ds-map-lv4-color: #d8ffe9;
  --ds-map-practiced-background: #bcd2ff;
  --ds-glow-practiced: 0 0 9px 2px rgba(160,190,255,.55);
  --ds-map-practiced-border: rgba(255,190,120,.75);
  --ds-glow-wm-tip: 0 8px 26px -12px rgba(0,0,0,.6);
  --ds-glow-wm-legend-body: 0 16px 40px -20px rgba(0,0,0,.7);
  --ds-map-wm-progress-bar-background: rgba(140,170,225,.14);
  --ds-map-wm-progress-bar-background-2: #4f8cff;
  --ds-map-wm-progress-bar-background-3: #63e6a8;
  --ds-glow-wm-progress-bar: 0 0 10px rgba(99,230,168,.55);
  --ds-map-wm-scrim-background: rgba(3,6,12,.42);
  --ds-glow-wm-sheet: 0 -18px 50px -24px rgba(0,0,0,.75);
  --ds-map-wm-chip-background: rgba(140,175,255,.10);
  --ds-map-ct-tint: rgba(120,170,255,.26);
  --ds-map-ct-hi: rgba(170,205,255,.60);
  --ds-map-ring-hi: #7fb2ff;
  --ds-map-ct-tint-2: rgba(196,140,255,.24);
  --ds-map-ct-hi-2: rgba(214,175,255,.58);
  --ds-map-ring-hi-2: #c9a4ff;
  --ds-map-ct-tint-3: rgba(255,180,120,.22);
  --ds-map-ct-hi-3: rgba(255,205,160,.56);
  --ds-map-ring-hi-3: #ffbe8a;
  --ds-map-ct-tint-4: rgba(120,230,200,.22);
  --ds-map-ct-hi-4: rgba(160,240,215,.56);
  --ds-map-ring-hi-4: #63e6a8;
  --ds-map-ct-tint-5: rgba(150,220,140,.22);
  --ds-map-ct-hi-5: rgba(185,235,175,.56);
  --ds-map-ring-hi-5: #9ce39a;
  --ds-map-ct-tint-6: rgba(255,140,140,.20);
  --ds-map-ct-hi-6: rgba(255,180,180,.54);
  --ds-map-ring-hi-6: #ff9d9d;
  --ds-map-ct-tint-7: rgba(110,225,225,.22);
  --ds-map-ct-hi-7: rgba(155,240,240,.56);
  --ds-map-ring-hi-7: #6fe3e3;
}
html[data-theme="light"] {
  --ds-map-m-ct-face2-lt: rgba(255,253,246,.96);
  --ds-map-m-ink-lt: #24221d;
  --ds-map-m-dim-lt: #5f5a4e;
  --ds-map-m-faint-lt: #6a6252;
  --ds-map-m-ct-face-lt: rgba(255,252,244,.92);
  --ds-map-m-ct-edge-lt: rgba(112,96,70,.46);
  --ds-map-m-ct-glow-lt: rgba(180,150,90,.30);
  --ds-map-m-dot-off-lt: rgba(120,110,90,.50);
  --ds-map-m-fog-lt: rgba(150,135,105,.18);
  --ds-map-m-hud-lt: rgba(255,253,247,.86);
  --ds-map-m-hud-edge-lt: rgba(120,105,80,.20);
  --ds-map-wm-canvas-background-lt: rgba(198,168,110,.20);
  --ds-map-wm-canvas-background-2-lt: rgba(126,170,150,.16);
  --ds-map-wm-canvas-background-3-lt: #f8f3e7;
  --ds-map-wm-canvas-background-4-lt: #f2ebdb;
  --ds-map-wm-canvas-background-5-lt: #ede5d3;
  --ds-map-r0-stroke-lt: rgba(110,98,76,.30);
  --ds-map-mod-background-lt: #3d3a2e;
  --ds-glow-mod-lt: 0 0 12px 3px var(--ct-glow, rgba(120,100,60,.35));
  --ds-map-lv1-background-lt: #6f8fd6;
  --ds-map-lv2-background-lt: #4f74c8;
  --ds-map-lv3-background-lt: #2f5bb0;
  --ds-map-lv4-background-lt: #0d8a63;
  --ds-glow-lv4-lt: 0 0 14px 3px rgba(13,138,99,.55), 0 0 26px 8px rgba(13,138,99,.22);
  --ds-map-lv3-color-lt: #4a4a3f;
  --ds-map-lv4-color-lt: #14503a;
  --ds-map-wm-sheet-background-lt: rgba(255,253,247,.96);
  --ds-map-ct-tint-lt: rgba(64,124,226,.34);
  --ds-map-ring-hi-lt: #2f6fd0;
  --ds-map-ct-tint-2-lt: rgba(146,86,216,.32);
  --ds-map-ring-hi-2-lt: #7f4ecd;
  --ds-map-ct-tint-3-lt: rgba(214,134,62,.34);
  --ds-map-ring-hi-3-lt: #c4762c;
  --ds-map-ct-tint-4-lt: rgba(56,182,152,.34);
  --ds-map-ring-hi-4-lt: #1f9678;
  --ds-map-ct-tint-5-lt: rgba(104,174,94,.34);
  --ds-map-ring-hi-5-lt: #4a8f3c;
  --ds-map-ct-tint-6-lt: rgba(214,84,84,.32);
  --ds-map-ring-hi-6-lt: #c04a4a;
  --ds-map-ct-tint-7-lt: rgba(50,182,188,.34);
  --ds-map-ring-hi-7-lt: #1a8f96;
}
/* ============ 知识世界地图 · 会发光的备考地形图（2026-10-25 重设计） ============
   html.wm-on 时显示世界地图（.wm-main），深链（?subj= / #cards）时 map.js 接管。
   视觉编码：掌握度=亮度与高度，练习量=道路粗细，正确率=道路冷暖（红→橙→绿）。
   Chrome 极简：左上标题 / 右上可收起图例 / 底部极细总进度线。 */
html.wm-on .cl-stage { display: none; }
html:not(.wm-on) .wm-main { display: none; }
html.wm-on .wm-link-world { display: none; }
/* .admin 是普通块容器，.wm-main 的 flex:1 不生效且画布会塔缩成 0 高——强制纵向 flex */
html.wm-on .admin { display: flex; flex-direction: column; height: 100vh; min-height: 0; }
html.wm-on .admin-head { flex: none; }
.wm-main { flex: 1; min-height: 0; display: flex; }
/* 地图专用色板：深色为夜景地形图，浅色为纸质地形图，两套都是地形而非白底卡片 */
.wm-canvas {--m-ink: var(--ds-map-m-ink); --m-dim: var(--ds-map-m-dim); --m-faint: var(--ds-map-m-faint); --m-ct-face: var(--ds-map-m-ct-face); --m-ct-face2: var(--ds-map-m-ct-face2); --m-ct-edge: var(--ds-map-m-ct-edge); --m-ct-glow: var(--ds-map-m-ct-glow); --m-dot-off: var(--ds-map-m-dot-off); --m-fog: var(--ds-map-m-fog); --m-hud: var(--ds-map-m-hud); --m-hud-edge: var(--ds-map-m-hud-edge); 
  position: relative;  flex: 1;  min-width: 0;  overflow: hidden;  touch-action: none; 
  cursor: grab;  outline: none;  user-select: none;  color: var(--m-ink); background: radial-gradient(1150px 680px at 20% 16%, var(--ds-map-wm-canvas-background), transparent 62%),
    radial-gradient(980px 620px at 80% 84%, var(--ds-map-wm-canvas-background-2), transparent 60%),
    linear-gradient(180deg, var(--ds-map-wm-canvas-background-3) 0%, var(--ds-map-wm-canvas-background-4) 55%, var(--ds-map-wm-canvas-background-5) 100%)}
html[data-theme="light"] .wm-canvas {--m-ct-face2: var(--ds-map-m-ct-face2-lt); --m-ink: var(--ds-map-m-ink-lt); --m-dim: var(--ds-map-m-dim-lt); --m-faint: var(--ds-map-m-faint-lt); --m-ct-face: var(--ds-map-m-ct-face-lt); --m-ct-edge: var(--ds-map-m-ct-edge-lt); --m-ct-glow: var(--ds-map-m-ct-glow-lt); --m-dot-off: var(--ds-map-m-dot-off-lt); --m-fog: var(--ds-map-m-fog-lt); --m-hud: var(--ds-map-m-hud-lt); --m-hud-edge: var(--ds-map-m-hud-edge-lt); background: radial-gradient(1100px 660px at 22% 18%, var(--ds-map-wm-canvas-background-lt), transparent 62%),
    radial-gradient(940px 600px at 78% 84%, var(--ds-map-wm-canvas-background-2-lt), transparent 60%),
    linear-gradient(180deg, var(--ds-map-wm-canvas-background-3-lt) 0%, var(--ds-map-wm-canvas-background-4-lt) 60%, var(--ds-map-wm-canvas-background-5-lt) 100%)}
.wm-canvas.grabbing { cursor: grabbing; }
.wm-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
/* 纹理层：等高线 + 星尘 / 纸纹，随镜头轻微视差（只改 transform，GPU 合成） */
.wm-sky {
  position: absolute;         inset: -8%;         pointer-events: none;         will-change: transform;        
  opacity: .55;        
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1000' viewBox='0 0 1400 1000'%3E%3Cg fill='none' stroke='%238CB4FF' stroke-width='1'%3E%3Cpath d='M-40 742C210 690 348 806 604 762S1018 656 1440 726' opacity='.20'/%3E%3Cpath d='M-40 812C220 764 372 872 636 830S1030 736 1440 796' opacity='.16'/%3E%3Cpath d='M-40 892C240 852 396 944 664 906S1052 826 1440 876' opacity='.13'/%3E%3Cpath d='M-40 300C196 250 356 366 616 322S1032 214 1440 286' opacity='.17'/%3E%3Cpath d='M-40 220C186 176 344 282 608 240S1036 138 1440 206' opacity='.13'/%3E%3Cpath d='M120 -40C168 234 96 428 168 672S232 894 200 1040' opacity='.12'/%3E%3Cpath d='M420 -40C470 226 398 420 468 664S534 886 502 1040' opacity='.10'/%3E%3Cpath d='M980 -40C1024 230 954 424 1022 668S1088 888 1056 1040' opacity='.12'/%3E%3Cpath d='M1240 -40C1288 226 1216 420 1286 664S1352 886 1320 1040' opacity='.10'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(1.3px 1.3px at 13% 26%, rgba(200,222,255,.55), transparent 100%),
    radial-gradient(1.1px 1.1px at 37% 71%, rgba(200,222,255,.42), transparent 100%),
    radial-gradient(1.2px 1.2px at 62% 32%, rgba(200,222,255,.40), transparent 100%),
    radial-gradient(1.1px 1.1px at 84% 62%, rgba(200,222,255,.36), transparent 100%),
    radial-gradient(1px 1px at 52% 88%, rgba(200,222,255,.30), transparent 100%);        
  background-size: 1400px 1000px, auto, auto, auto, auto, auto;        
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat}
html[data-theme="light"] .wm-sky {
  opacity: .55;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1000' viewBox='0 0 1400 1000'%3E%3Cg fill='none' stroke='%23A08C60' stroke-width='1'%3E%3Cpath d='M-40 742C210 690 348 806 604 762S1018 656 1440 726' opacity='.26'/%3E%3Cpath d='M-40 812C220 764 372 872 636 830S1030 736 1440 796' opacity='.20'/%3E%3Cpath d='M-40 892C240 852 396 944 664 906S1052 826 1440 876' opacity='.16'/%3E%3Cpath d='M-40 300C196 250 356 366 616 322S1032 214 1440 286' opacity='.22'/%3E%3Cpath d='M-40 220C186 176 344 282 608 240S1036 138 1440 206' opacity='.16'/%3E%3Cpath d='M120 -40C168 234 96 428 168 672S232 894 200 1040' opacity='.15'/%3E%3Cpath d='M420 -40C470 226 398 420 468 664S534 886 502 1040' opacity='.12'/%3E%3Cpath d='M980 -40C1024 230 954 424 1022 668S1088 888 1056 1040' opacity='.15'/%3E%3Cpath d='M1240 -40C1288 226 1216 420 1286 664S1352 886 1320 1040' opacity='.12'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 1400px 1000px;
  background-repeat: repeat;
}
.wm-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.wm-canvas.zooming .wm-layer { transition: transform .22s cubic-bezier(.22,.61,.36,1); }
.wm-board { position: absolute; left: 0; top: 0; }
/* ---------- 一级：科目大陆（SVG 有机地形块，海岸线点亮 = 掌握度） ---------- */
.wm-cont {
  position: absolute; width: 470px; height: 340px; padding: 0;
  border: none; background: none; cursor: pointer; color: var(--m-ink); font: inherit; text-align: center;
  transition: transform .3s cubic-bezier(.22,.61,.36,1), filter .3s ease;
  will-change: transform; overflow: visible;
}
.wm-cont:hover, .wm-cont:focus-visible { transform: translateY(-3px) scale(1.025); outline: none; filter: brightness(1.12); }
.wm-cont:active { transform: translateY(-1px) scale(1.01); }
/* 顶层微亮，形成“海拔”渐变感 */
.wm-cont-name { font-size: 23px; font-weight: 600; letter-spacing: .5px; text-shadow: 0 0 22px var(--m-ct-glow); }
.wm-cont-meta { font-size: 13.5px; color: var(--m-dim); }
.wm-cont-prog { margin-top: 4px; font-size: 12.5px; color: var(--m-faint); letter-spacing: .2px; }
.wm-cont-prog.has {color: var(--ring-hi, var(--ds-map-has-color))}
.wm-cont-go { margin-top: 5px; font-size: 12.5px; color: var(--m-dim); opacity: 0; transition: opacity .22s ease; }
.wm-cont:hover .wm-cont-go, .wm-cont:focus-visible .wm-cont-go { opacity: 1; }
/* 科目内：模块脊线 + 刻线（非缩放描边，屏幕上保持可读） */
.wm-road.spine { stroke: var(--m-ct-edge); stroke-width: 1.6; opacity: .6; stroke-dasharray: 3 4; }
.wm-edges .wm-road { vector-effect: non-scaling-stroke; }
/* ---------- 二级：科目内部知识河网（道路 + 星点） ---------- */
.wm-edges { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.wm-road { fill: none; stroke-linecap: round; opacity: .82; vector-effect: non-scaling-stroke; }
.wm-road.r0 {stroke: var(--ds-map-r0-stroke)}   /* 未练：淡青灰 */
.wm-road.r1 {stroke: var(--ds-map-r1-stroke)}                   /* 正确率低：冷红 */
.wm-road.r2 {stroke: var(--ds-map-r2-stroke)}                   /* 中等：橙 */
.wm-road.r3 {stroke: var(--ds-map-r3-stroke)}                   /* 熟练：绿 */
html[data-theme="light"] .wm-road.r0 {stroke: var(--ds-map-r0-stroke-lt)}
.wm-road.glow { filter: drop-shadow(0 0 5px currentColor); }
/* 星点：几何符号（圆点/环/波纹），不用字面图标 */
.wm-node {
  position: absolute; display: flex; align-items: center; gap: .55em;
  padding: .18em .55em; border: none; background: transparent;
  color: var(--m-dim); font: inherit; cursor: pointer; white-space: nowrap;
  /* 标签反向缩放：屏幕字号恒在 12-13px，地图缩小时仍可读 */
  font-size: calc(12.5px / var(--wm-k, 1));
  max-width: 13em; overflow: hidden; text-overflow: ellipsis;
  border-radius: 999px; transform: translateY(-50%);
  transition: transform .2s cubic-bezier(.22,.61,.36,1), color .2s ease;
  will-change: transform;
}
.wm-node > i { position: relative; border-radius: 50%;
  width: clamp(8px, calc(10px / var(--wm-k, 1)), 40px); height: clamp(8px, calc(10px / var(--wm-k, 1)), 40px);
  flex: 0 0 clamp(8px, calc(10px / var(--wm-k, 1)), 40px);
  background: var(--m-dot-off); box-shadow: 0 0 0 0 transparent; transition: box-shadow .22s ease, background .22s ease; }
.wm-node:hover { transform: translateY(calc(-50% - 2px)); color: var(--m-ink); }
.wm-node:hover > i {box-shadow: var(--ds-glow-wm-node)}
.wm-node:focus-visible { outline: none; color: var(--m-ink); box-shadow: 0 0 0 2px var(--brand); }
.wm-node.mod { font-size: calc(14.5px / var(--wm-k, 1)); font-weight: 600; color: var(--m-ink); }
html[data-theme="light"] .wm-node.mod > i {background: var(--ds-map-mod-background-lt); box-shadow: var(--ds-glow-mod-lt)}
.wm-node.mod > i { width: clamp(10px, calc(13px / var(--wm-k, 1)), 46px);  height: clamp(10px, calc(13px / var(--wm-k, 1)), 46px);  flex-basis: clamp(10px, calc(13px / var(--wm-k, 1)), 46px); background: var(--dot-mod, var(--ds-map-mod-background-2)); box-shadow: var(--ds-glow-mod-x)}
/* 掌握度 = 亮度与高度（lv0-4 递亮；lv4 发光；lv0/1 笼罩淡雾） */
.wm-node.lv0 > i {background: var(--ds-map-lv0-background)}
.wm-node.lv1 > i {background: var(--ds-map-lv1-background); box-shadow: var(--ds-glow-lv1)}
.wm-node.lv2 > i {background: var(--ds-map-lv2-background); box-shadow: var(--ds-glow-lv2)}
.wm-node.lv3 > i {background: var(--ds-map-lv3-background); box-shadow: var(--ds-glow-lv3)}
.wm-node.lv4 > i {background: var(--ds-map-lv4-background); box-shadow: var(--ds-glow-lv4)}
.wm-node.lv1, .wm-node.lv2 { color: var(--m-dim); }
.wm-node.lv3 {color: var(--ds-map-lv3-color)}
.wm-node.lv4 {color: var(--ds-map-lv4-color)}
html[data-theme="light"] .wm-node.lv1 > i {background: var(--ds-map-lv1-background-lt)}
html[data-theme="light"] .wm-node.lv2 > i {background: var(--ds-map-lv2-background-lt)}
html[data-theme="light"] .wm-node.lv3 > i {background: var(--ds-map-lv3-background-lt)}
html[data-theme="light"] .wm-node.lv4 > i {background: var(--ds-map-lv4-background-lt); box-shadow: var(--ds-glow-lv4-lt)}
html[data-theme="light"] .wm-node.lv3 {color: var(--ds-map-lv3-color-lt)}
html[data-theme="light"] .wm-node.lv4 {color: var(--ds-map-lv4-color-lt)}
/* 薄弱节点（未开始/初学）笼罩淡雾 */
.wm-node.lv0 { opacity: .62; }
.wm-node.mod.lv0 { opacity: .9; }
.wm-node.mod.lv0 > i::after { opacity: .5; }
.wm-node.lv0 > i::after, .wm-node.lv1 > i::after {
  content: ''; position: absolute; inset: -9px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--m-fog), transparent 72%); pointer-events: none;
}
/* 截断溢出到「填空卡」的子知识点：小环标记 */
.wm-node.practiced > i {background: var(--ds-map-practiced-background); box-shadow: var(--ds-glow-practiced)}
.wm-node.practiced > i::before {
  content: '';  position: absolute;  inset: -4px;  border-radius: 50%; border: 1px solid var(--ds-map-practiced-border);  pointer-events: none}
.wm-node.trunc > i::before {
  content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1px dashed var(--m-faint);
}
.wm-node > em { font-style: normal; font-size: .78em; color: var(--m-faint); }
.wm-canvas.wm-far .wm-node > span, .wm-canvas.wm-far .wm-node > em { opacity: 0; }
.wm-node > span, .wm-node > em { transition: opacity .2s ease; }
/* 悬停说明块（跟随指针的小玻璃片，不是居中遮挡层） */
.wm-tip {
  position: absolute;  z-index: 30;  max-width: 280px;  pointer-events: none; 
  padding: 9px 12px;  border-radius: 12px;  font-size: 12px;  line-height: 1.6; 
  background: var(--m-hud);  border: 1px solid var(--m-hud-edge);  color: var(--m-ink); 
  backdrop-filter: blur(10px); box-shadow: var(--ds-glow-wm-tip); 
  opacity: 0;  transform: translateY(-4px);  transition: opacity .16s ease, transform .16s ease}
.wm-tip.on { opacity: 1; transform: none; }
.wm-tip b { font-weight: 600; }
.wm-tip .wm-tip-row { color: var(--m-dim); }
/* ---------- Chrome：标题 / 图例 / 缩放 / 进度线 ---------- */
.wm-hud { position: absolute; left: 20px; top: 16px; z-index: 20; pointer-events: none; }
.wm-title-main { font-size: 15px; font-weight: 600; letter-spacing: 2px; color: var(--m-ink); opacity: .92; }
.wm-title-sub { margin-top: 3px; font-size: 11.5px; color: var(--m-dim); letter-spacing: .2px; }
.wm-back {
  margin-top: 10px; height: 28px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: var(--m-hud); border: 1px solid var(--m-hud-edge); color: var(--m-dim);
  backdrop-filter: blur(10px); font: inherit; font-size: 11.5px; pointer-events: auto;
  transition: color .18s ease, border-color .18s ease;
}
.wm-back:hover { color: var(--m-ink); border-color: var(--m-ct-edge); }
.wm-back[hidden] { display: none; }
.wm-hud { pointer-events: none; }
.wm-hud .wm-back { pointer-events: auto; }
.wm-legend { position: absolute; right: 18px; top: 16px; z-index: 22; text-align: right; }
.wm-legend-btn {
  height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: var(--m-hud); border: 1px solid var(--m-hud-edge); color: var(--m-dim);
  backdrop-filter: blur(10px); font: inherit; font-size: 12px;
  transition: color .2s ease, border-color .2s ease;
}
.wm-legend-btn:hover, .wm-legend-btn[aria-expanded="true"] { color: var(--m-ink); border-color: var(--m-ct-edge); }
.wm-legend-body {
  margin-top: 8px;  width: 252px;  text-align: left;  padding: 12px 14px;  border-radius: 14px; 
  background: var(--m-hud);  border: 1px solid var(--m-hud-edge);  backdrop-filter: blur(12px); 
  font-size: 11.5px;  line-height: 1.9;  color: var(--m-dim); box-shadow: var(--ds-glow-wm-legend-body); 
  animation: wm-fade .18s ease}
.wm-legend-body[hidden] { display: none; }
.wm-legend-body b { color: var(--m-ink); font-weight: 600; }
.wm-lg-row { display: flex; align-items: center; gap: 8px; }
.wm-lg-bar { height: 3px; border-radius: 2px; flex: 0 0 34px; }
.wm-lg-lv { display: flex; gap: 5px; align-items: center; }
.wm-lg-lv i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.wm-zbar { position: absolute; right: 18px; bottom: 42px; z-index: 20; display: flex; flex-direction: column; gap: 8px; }
.wm-fab {
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
  border-radius: 10px; background: var(--m-hud); border: 1px solid var(--m-hud-edge); color: var(--m-dim);
  backdrop-filter: blur(10px); transition: color .18s ease, transform .18s ease;
}
.wm-fab:hover { color: var(--m-ink); transform: translateY(-1px); }
.wm-fab:active { transform: none; }
.wm-fab:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--brand); }
/* 底部极细总进度线 */
.wm-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; pointer-events: none; }
.wm-progress-bar { height: 2px; background: var(--ds-map-wm-progress-bar-background)}
.wm-progress-bar > i { display: block;  height: 100%;  width: 0; background: linear-gradient(90deg, var(--ds-map-wm-progress-bar-background-2), var(--ds-map-wm-progress-bar-background-3)); box-shadow: var(--ds-glow-wm-progress-bar);  transition: width .5s cubic-bezier(.22,.61,.36,1)}
.wm-progress-txt { position: absolute; right: 14px; bottom: 7px; font-size: 10.5px; color: var(--m-faint); letter-spacing: .3px; }
/* 空态：轻量文字，不遮挡大陆（只在真的没有数据时显示） */
.wm-empty { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%); z-index: 8;
  text-align: center; padding: 0; background: none; border: none; box-shadow: none; display: block; }
.wm-empty[hidden] { display: none; }
.wm-empty p { margin: 0 0 6px; font-size: 13px; color: var(--m-dim); }
.wm-empty .wm-empty-sub { font-size: 11.5px; color: var(--m-faint); }
.wm-empty a { color: var(--m-ink); font-size: 12.5px; text-decoration: none; border-bottom: 1px solid var(--m-ct-edge); }
/* ---------- 节点详情层（底部升起，深色玻璃） ---------- */
.wm-scrim { position: fixed;  inset: 0;  z-index: 80; background: var(--ds-map-wm-scrim-background);  animation: wm-fade .18s ease}
.wm-sheet {
  position: fixed;  left: 50%;  bottom: 0;  transform: translateX(-50%);  z-index: 81; 
  width: min(680px, calc(100vw - 32px));  max-height: 62vh;  overflow: auto; 
  padding: 20px 22px calc(20px + env(safe-area-inset-bottom)); 
  border-radius: 20px 20px 0 0; 
  background: var(--m-hud);  border: 1px solid var(--m-hud-edge);  backdrop-filter: blur(16px); 
  color: var(--m-ink); box-shadow: var(--ds-glow-wm-sheet); 
  animation: wm-up .26s cubic-bezier(.22,.61,.36,1)}
html[data-theme="light"] .wm-sheet {background: var(--ds-map-wm-sheet-background-lt)}
@keyframes wm-fade { from { opacity: 0; } }
@keyframes wm-up { from { transform: translate(-50%, 44px); opacity: 0; } }
.wm-sheet-t { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.wm-sheet-stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 10px; font-size: 11.5px; color: var(--m-dim); }
.wm-sheet-stats b { color: var(--m-ink); font-weight: 600; }
.wm-sheet-b { font-size: 13px; line-height: 1.7; color: var(--m-dim); margin: 0 0 12px; white-space: pre-wrap; }
.wm-sheet-kids { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.wm-chip { padding: 3px 9px;  border-radius: 999px; background: var(--ds-map-wm-chip-background);  border: 1px solid var(--m-hud-edge);  font-size: 11.5px;  color: var(--m-dim)}
.wm-chip.more { opacity: .7; }
.wm-sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wm-sheet-actions .btn { border-radius: 999px; }
/* ---------- 镜头过渡：进入俯冲 / 返回拉升（只动 transform+opacity） ---------- */
.wm-board.dive-out { animation: wm-dive-out .24s ease forwards; }
.wm-board.rise-in { animation: wm-rise-in .34s cubic-bezier(.22,.61,.36,1); }
.wm-board.pull-out { animation: wm-pull-out .22s ease forwards; }
.wm-board.float-in { animation: wm-float-in .38s cubic-bezier(.22,.61,.36,1); }
@keyframes wm-dive-out { to { opacity: 0; transform: scale(1.07); } }
@keyframes wm-rise-in { from { opacity: 0; transform: scale(.92); } }
@keyframes wm-pull-out { to { opacity: 0; transform: scale(.94); } }
@keyframes wm-float-in { from { opacity: 0; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .wm-board.dive-out, .wm-board.rise-in, .wm-board.pull-out, .wm-board.float-in { animation: none; }
  .wm-canvas.zooming .wm-layer { transition: none; }
}
/* 窄屏：标题与图例收敛，避免与地图内容抢位 */
@media (max-width: 640px) {
  .wm-hud { left: 14px; top: 12px; }
  .wm-title-main { font-size: 13.5px; letter-spacing: 1px; }
  .wm-legend { right: 12px; top: 12px; }
  .wm-legend-body { width: min(252px, calc(100vw - 24px)); }
  .wm-zbar { right: 12px; bottom: 38px; }
}
/* ---- 科目色相：大陆辉光与掌握环的高亮色 ---- */
.wm-a-brand {--ct-tint: var(--ds-map-ct-tint); --ct-hi: var(--ds-map-ct-hi); --ring-hi: var(--ds-map-ring-hi)}
.wm-a-mark  {--ct-tint: var(--ds-map-ct-tint-2); --ct-hi: var(--ds-map-ct-hi-2); --ring-hi: var(--ds-map-ring-hi-2)}
.wm-a-m1    {--ct-tint: var(--ds-map-ct-tint-3); --ct-hi: var(--ds-map-ct-hi-3); --ring-hi: var(--ds-map-ring-hi-3)}
.wm-a-m2    {--ct-tint: var(--ds-map-ct-tint-4); --ct-hi: var(--ds-map-ct-hi-4); --ring-hi: var(--ds-map-ring-hi-4)}
.wm-a-m3    {--ct-tint: var(--ds-map-ct-tint-5); --ct-hi: var(--ds-map-ct-hi-5); --ring-hi: var(--ds-map-ring-hi-5)}
.wm-a-m0    {--ct-tint: var(--ds-map-ct-tint-6); --ct-hi: var(--ds-map-ct-hi-6); --ring-hi: var(--ds-map-ring-hi-6)}
.wm-a-teal  {--ct-tint: var(--ds-map-ct-tint-7); --ct-hi: var(--ds-map-ct-hi-7); --ring-hi: var(--ds-map-ring-hi-7)}
html[data-theme="light"] .wm-a-brand {--ct-tint: var(--ds-map-ct-tint-lt); --ring-hi: var(--ds-map-ring-hi-lt)}
html[data-theme="light"] .wm-a-mark  {--ct-tint: var(--ds-map-ct-tint-2-lt); --ring-hi: var(--ds-map-ring-hi-2-lt)}
html[data-theme="light"] .wm-a-m1    {--ct-tint: var(--ds-map-ct-tint-3-lt); --ring-hi: var(--ds-map-ring-hi-3-lt)}
html[data-theme="light"] .wm-a-m2    {--ct-tint: var(--ds-map-ct-tint-4-lt); --ring-hi: var(--ds-map-ring-hi-4-lt)}
html[data-theme="light"] .wm-a-m3    {--ct-tint: var(--ds-map-ct-tint-5-lt); --ring-hi: var(--ds-map-ring-hi-5-lt)}
html[data-theme="light"] .wm-a-m0    {--ct-tint: var(--ds-map-ct-tint-6-lt); --ring-hi: var(--ds-map-ring-hi-6-lt)}
html[data-theme="light"] .wm-a-teal  {--ct-tint: var(--ds-map-ct-tint-7-lt); --ring-hi: var(--ds-map-ring-hi-7-lt)}

/* ===== 设计系统落地层（2026-10-25）—— 唯一来源是上面的 --ds-* token =====
   只做三件事：底与纸面接上 token、加一层静态等高线纹理、把浮起限定在 sh-1/sh-2。
   非地图页不得新增发光与动画；渐变只保留下面这一层底纹 wash。 */
html, body {
  background-color: var(--ds-bg);
  background-image: var(--ds-texture), var(--ds-wash);
  background-size: var(--ds-texture-size), 100% 100%;
  background-repeat: repeat, no-repeat;
  background-attachment: fixed, fixed;
}
.card, .panel, .box, .sheet, .dialog, .modal { border-color: var(--ds-line); }
.num, .stat, .kpi, .metric, td, th { font-variant-numeric: tabular-nums; }
tr:nth-child(even) > td { background: transparent; }
/* 响应式与可达性补丁：窄屏不允许标题与正文被截断（沿用原字重与颜色） */
@media (max-width: 520px) {
  .topbar h1 { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
  .topbar h1, .topbar .muted, .topbar span { overflow-wrap: anywhere; }
}
/* ===== 页面级对齐（2026-10-25）：按样张把六页落到同一套语言。
   所有规则只调形状、层级与字号，不改信息结构与交互。 ===== */
/* 对话页：单列 880；助手回答不套大气泡，只有知识卡成面 */
.chat-wrap, .composer-inner { max-width: 880px; }
.msg.assistant .bubble { background: transparent; border-color: transparent; box-shadow: none; padding: 0; max-width: 100%; }
@media (min-width: 1100px) {
  /* 训练中心：四张等高统计卡（仍可自动折行，不再高度参差） */
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; }
  /* 申论：正文阅读宽度 916（右侧 460 轨道需改结构，本轮不启用） */
  body:has(.sl-tabs) .chat-wrap { max-width: 1000px; }
  .sl-card, .sl-body { max-width: 916px; }
}
/* 掌握度 / 进度：统一 5px 细条 */
.pt-bar { height: 5px; }
/* 计划：今天只描边不填色、条目等高、状态文字做成 chip */
.plan-today { background: transparent; border: 1px solid var(--ds-accent-line); }
.ck-row { min-height: 58px; align-items: center; }
.ck-row .ck-s { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--ds-accent-soft); color: var(--text-2); font-size: 11.5px; }
/* 手写板选项：悬停/选中用同一主色，不再另起一套蓝 */
.opt:hover { background: var(--ds-accent-soft); border-color: var(--ds-accent-line); }
.opt.sel, .opt.on, .opt.active { background: var(--ds-accent-soft); border-color: var(--ds-accent); }
/* 申论：重点句淡底 + 下边线；总分 34px */
.sl-card .sl-term { background: var(--ds-accent-soft); border-bottom: 2px solid var(--ds-accent-line); }

/* 申论：916 阅读/作答列 + 460 控制轨（仅桌面宽度；窄屏仍为单列） */
@media (min-width: 1100px) {
  body:has(.sl-tabs) .chat-wrap { max-width: none; }
  body:has(.sl-tabs) .sl-body { max-width: none; display: grid; grid-template-columns: minmax(0, 916px) 460px; gap: 16px; align-items: start; }
  body:has(.sl-tabs) .sl-body > .sl-side { grid-column: 2; }
  body:has(.sl-tabs) .sl-body > .sl-card { grid-column: 1; min-width: 0; }
  body:has(.sl-tabs) .sl-side .sl-nav { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 0; }
  body:has(.sl-tabs) .sl-side .sl-counter { font-size: 34px; font-weight: 600; letter-spacing: -1px; text-align: center; line-height: 1.1; padding: 6px 0; }
  body:has(.sl-tabs) .sl-side .btn { width: 100%; }
  body:has(.sl-tabs) .sl-ai-grade { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 16px; align-items: start; }
  body:has(.sl-tabs) .sl-ai-grade > .sl-ai-score { grid-column: 2; }
  body:has(.sl-tabs) .sl-ai-grade > .sl-ai-note { grid-column: 2; }
  body:has(.sl-tabs) .sl-ai-grade > *:not(.sl-ai-score):not(.sl-ai-note) { grid-column: 1; }
  body:has(.sl-tabs) .sl-ai-score { font-size: 34px; font-weight: 600; letter-spacing: -.5px; }
}

/* 申论：解锁内层 880 容器，让 916+460 网格真正生效 */
@media (min-width: 1100px) {
  body:has(.sl-tabs) #shenlunRoot { max-width: none; }
}

/* 浅色下 amber 标记文字压深到 ≥4.5:1（仅在纸感底上） */
html[data-theme="light"] .tag.amber { color: #8a4b00; }
/* 浅色下激活标签文字用主色深阶，保证 ≥4.5:1 */
html[data-theme="light"] .sl-tab.active { color: var(--brand-600); }

/* ---------- 底部浮层下拉收起把手（.cl-sheet / .wm-sheet 共用） ---------- */
.cl-grab, .wm-grab {
  width: 44px; height: 4px; border-radius: 2px;
  margin: 2px auto 12px; background: var(--line-2);
  cursor: grab; touch-action: none; flex: none;
}
.cl-grab:active, .wm-grab:active { cursor: grabbing; }
.cl-grab:focus-visible, .wm-grab:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 4px; }
.cl-sheet.dragging, .wm-sheet.dragging { transition: none !important; animation: none !important; user-select: none; }


/* ============================================================
   上岸小助手 · 排版重制 · v30（2026-10-30）
   目标：Vercel / Linear 级间距、字型层级与视觉质感
   原则：
   · 全部追加覆盖——不改历史规则，只在文件末尾胜出
   · 只动视觉（spacing / type / shadow），不改布局逻辑
   · 深浅双主题全部引用既有 token，不新增 token
   ============================================================ */

/* ============================================================
   §1  全局字型基线
   ============================================================ */
html, body {
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

/* ============================================================
   §2  侧边栏（sidebar）— 更有存在感的品牌区
   ============================================================ */
.sidebar {
  width: 260px;
  flex: 0 0 260px;
}
.sidebar-head {
  padding: 20px 14px 14px;
}
.brand {
  gap: 10px;
  padding: 0 2px;
  margin-bottom: 16px;
}
.brand-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--r-lg);
}
.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.1px;
}
.brand-sub {
  font-size: 11.5px;
  margin-top: 2px;
}
/* 新建对话：贯通全宽 */
#btnNew {
  width: calc(100% - 4px);
  margin: 0 2px 2px;
  padding: 9px 0;
  font-size: 13.5px;
  min-height: 38px;
}
.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 18px 10px 5px;
}
.nav-item {
  padding: 9px 12px;
  font-size: 13.5px;
  gap: 10px;
  min-height: 38px;
}
.nav-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.conv-list { padding: 4px 10px 10px; }
.conv-item { padding: 8px 10px; }
.conv-title { font-size: 13.5px; line-height: 1.45; }
.sidebar-foot { padding: 10px 10px; }
.user-chip { padding: 8px 10px; font-size: 12.5px; gap: 10px; }
.avatar { width: 28px; height: 28px; flex: 0 0 28px; font-size: 13px; }

/* ============================================================
   §3  顶部栏（topbar）— 更有分量
   ============================================================ */
.topbar {
  height: 56px;
  flex: 0 0 56px;
  padding: 0 20px;
  gap: 10px;
  min-height: calc(56px + env(safe-area-inset-top));
}
.topbar h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.1px;
  max-width: 280px;
}
.search-btn { height: 34px; padding: 0 12px; font-size: 12.5px; }

/* ============================================================
   §4  聊天区（chat）— 最优阅读宽度 + 呼吸感
   ============================================================ */
.chat-scroll { padding: 32px 0 16px; }
.chat-wrap { max-width: 740px; padding: 0 28px; }
.bubble { font-size: 15.5px; line-height: 1.82; }
.msg.user .bubble {
  padding: 14px 20px;
  border-radius: var(--r-xl);
  font-size: 15px;
}
.bubble .md-h {
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 8px;
  letter-spacing: -0.1px;
}
.bubble .md-h:first-child { margin-top: 0; }
.bubble .md-gap { height: 10px; }

/* ============================================================
   §5  输入框（composer）— 悬浮质感
   ============================================================ */
.composer { padding: 10px 0 20px; }
.composer-inner { max-width: 740px; padding: 0 28px; }
.composer-box {
  padding: 14px 16px 12px 20px;
  border-radius: 28px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
}
[data-theme="dark"] .composer-box {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.28), 0 1px 4px rgba(0, 0, 0, 0.18);
}
.composer textarea { font-size: 15.5px; line-height: 1.7; max-height: 200px; }
.composer-actions { margin-top: 10px; gap: 6px; }
.quick-chips { gap: 7px; margin-bottom: 10px; }
.chip { padding: 6px 13px; font-size: 12.5px; }

/* ============================================================
   §6  首页欢迎区（home）— 大气开局
   ============================================================ */
.home { padding: 12px 0 28px; max-width: 640px; }
.home-hi {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  line-height: 1.3;
}
.home-sub { font-size: 14px; line-height: 1.75; margin-bottom: 10px; }
.hh-pills { gap: 7px; margin-bottom: 20px; }
.hh-pill { font-size: 12.5px; padding: 5px 13px; }
.home-sec {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 24px 0 8px;
  margin-top: 16px;
}
.home-item { padding: 9px 10px; border-radius: var(--r-pill); }
.home-item .t { font-size: 14px; }

/* ============================================================
   §7  训练中心（admin / train）— 卡片有层次
   ============================================================ */
.admin-head { height: 56px; }
.rail-head { height: 60px; flex: 0 0 60px; padding: 0 16px; }
.rail-scroll { padding: 14px 12px; }
.rail-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 14px 10px 5px;
}
.rail-item {
  padding: 9px 12px;
  font-size: 13.5px;
  gap: 10px;
  min-height: 40px;
  margin-bottom: 2px;
}
.rail-item svg { width: 16px; height: 16px; flex: 0 0 16px; }
.rail-foot { padding: 12px 16px; }
.train-head { padding: 22px 32px 18px; }
.train-head h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.train-head p { font-size: 13.5px; margin-top: 5px; }
.train-body { padding: 28px 32px 96px; max-width: 1080px; }
/* 今日三件事卡片 */
.tasks { gap: 16px; margin: 20px 0 28px; }
.task { padding: 18px 18px; gap: 14px; }
.tk-ico { width: 42px; height: 42px; flex: 0 0 42px; font-size: 18px; border-radius: var(--r-lg); }
.tk-main b { font-size: 14px; font-weight: 700; }
.tk-main small { font-size: 12.5px; margin-top: 4px; line-height: 1.55; }
/* 统计卡 */
.cards { gap: 16px; margin-bottom: 24px; }
.card { padding: 18px 18px; }
.card .k { font-size: 12px; letter-spacing: 0.2px; }
.card .v { font-size: 28px; font-weight: 700; letter-spacing: -0.8px; margin-top: 5px; }
.card .d { font-size: 12px; margin-top: 5px; }
/* 面板头部 */
.panel-head { padding: 14px 18px; }
.panel-head h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.05px; }
.panel-body.pad { padding: 18px; }

/* ============================================================
   §8  仪表盘（dashboard）— 数字更突出
   ============================================================ */
.dash-card { padding: 20px; border-radius: var(--r-xl); }
.ds-num { font-size: 38px; font-weight: 600; letter-spacing: -1px; margin: 3px 0; }
.ds-label { font-size: 12.5px; }
.ds-sub { font-size: 12.5px; }
.dash-sec {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  margin: 20px 0 10px;
}
.dash-bars { gap: 8px; }
.dash-bar { padding: 9px 12px; gap: 12px; }
.db-name { flex: 0 0 116px; font-size: 13px; }
.db-track { height: 7px; }
.db-val { font-size: 12.5px; }

/* ============================================================
   §9  做题区（quiz）— 阅读更舒适
   ============================================================ */
.q-stem { font-size: 16px; line-height: 1.85; margin-bottom: 18px; }
.q-opts { gap: 8px; }
.q-opt {
  padding: 13px 18px;
  min-height: 52px;
  font-size: 15px;
  line-height: 1.65;
  border-radius: var(--r-lg);
}
.q-opt b, .q-opt .k { width: 28px; height: 28px; font-size: 13.5px; }
/* 聊天页老版选项 */
.opt { padding: 13px 16px; gap: 13px; }
.opt .k { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; font-size: 12.5px; }
.opt .v { font-size: 15px; line-height: 1.65; }

/* ============================================================
   §10  科目选择卡
   ============================================================ */
.subject-grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); }
.subject-card { padding: 14px 14px; gap: 6px; }
.subject-card .ico { font-size: 18px; }
.subject-card .n { font-size: 13.5px; font-weight: 600; }
.subject-card .d { font-size: 12px; line-height: 1.6; }

/* ============================================================
   §11  模态 & Toast
   ============================================================ */
.modal { border-radius: var(--r-xl); }
.modal-head { padding: 16px 20px; }
.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; }
.toast { padding: 10px 20px; border-radius: var(--r-xl); font-size: 13.5px; }

/* ============================================================
   §12  命令面板（cmdk）
   ============================================================ */
.cmdk { border-radius: var(--r-xl); }
.cmdk-input-row { padding: 14px 16px; }
.cmdk-input-row input { font-size: 15px; }
.cmdk-item { padding: 9px 10px; font-size: 13.5px; border-radius: var(--r-pill); }

/* ============================================================
   §13  按钮（btn）— 更饱满的点击目标
   ============================================================ */
.btn { padding: 8px 20px; font-size: 13.5px; }
.btn svg { width: 15px; height: 15px; flex: 0 0 15px; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }

/* ============================================================
   §14  知识填空卡（cl）
   ============================================================ */
.cl-card { padding: 28px; border-radius: var(--r-xl); }
.cl-title { font-size: 16px; font-weight: 700; letter-spacing: -0.1px; }
.cl-item { font-size: 15.5px; line-height: 2.05; }
.cl-items { gap: 18px; }

/* ============================================================
   §15  学习规划
   ============================================================ */
.plan-h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.plan-wrap { padding: 28px 32px 56px; }

/* ============================================================
   §16  分区标题（sec-h）
   ============================================================ */
.sec-h { font-size: 13.5px; font-weight: 700; margin: 20px 0 10px; gap: 9px; }
.sec-h::before { width: 9px; height: 9px; }

/* ============================================================
   §17  AI 内联卡
   ============================================================ */
.ai-card { padding: 14px 16px; border-radius: var(--r-lg); }
.ai-body { font-size: 13.5px; line-height: 1.75; margin-top: 10px; }

/* ============================================================
   §18  打卡行
   ============================================================ */
.ck-row { padding: 13px 16px; border-radius: var(--r-lg); gap: 12px; }
.ck-row .ck-t { font-size: 13.5px; }
.ck-row .ck-s { font-size: 12.5px; line-height: 1.55; }

/* ============================================================
   §19  滚动条：更细更透
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--r-pill); border: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============================================================
   §20  响应式同步
   ============================================================ */
@media (max-width: 900px) {
  .sidebar { width: 280px; }
  .topbar {
    height: 52px;
    flex: 0 0 52px;
    padding: 0 14px;
    min-height: calc(52px + env(safe-area-inset-top));
  }
  .topbar h1 { font-size: 15px; }
  .chat-wrap,
  .composer-inner { padding: 0 16px; max-width: 100%; }
  .home-hi { font-size: 22px; }
  .train-head { padding: 18px 18px 16px; }
  .train-body { padding: 18px 18px 96px; }
  .tasks { gap: 12px; }
  .task { padding: 14px 16px; }
}

@media (max-width: 560px) {
  .home-hi { font-size: 20px; }
  .bubble { font-size: 14.5px; }
  .msg.user .bubble { font-size: 14.5px; }
  .q-stem { font-size: 15px; }
}

@media (min-width: 900px) and (max-width: 1180px) {
  .sidebar { width: 240px; }
  .rail { width: 224px; }
  .train-body { padding: 24px 24px 80px; }
}
/* ============================================================
   End of v30 排版重制
   ============================================================ */

/* ===== 做题 / 模考态出口（2026-11 导航修复）=====
   做题区原来只有进度与统计，没有出口；一屏一题时用户找不到「怎么退出」。
   进度条保持整行，统计与「退出练习」并排，出口固定贴右。
   ============================================================ */
.quiz-bar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quiz-bar-row .quiz-stat { flex: 1 1 auto; min-width: 0; }
.quiz-bar-row .quiz-exit { margin-left: auto; flex: 0 0 auto; }
.exam-head .exam-exit { margin-left: auto; flex: 0 0 auto; }
.topbar .dt-back { margin-left: 4px; }
@media (max-width: 560px) {
  .quiz-bar-row .quiz-exit { margin-left: 0; }
}

/* ============================================================
   上岸小助手 · 打磨层 v32（2026-11-06）
   来源：polish-visual（视觉排版审查 A1–A12）+ polish-motion（动效审查 B1–B11）
   策略：全部追加覆盖——不删除/改写任何历史基础声明，只在文件末尾靠后定义胜出；
        整批改动可一处审阅、一处回滚。v30 层（:3807-4180）与其响应式同步保持原样，
        窄屏媒体查询因此仍有覆盖目标。
   纪律：只引用既有 token，不新增任何 token（无 --sp-*）；不改 HTML / JS / DOM。
   就地处理（仅 4 类，已在上文完成）：删除 cmdkIn 死代码与 .toast 重复 transition、
        修正 4 处注释数值/文字、--fs-11 兼容别名注释、2 处 --fs-11 引用归位。
   ============================================================ */

/* ============================================================
   §A  视觉排版（polish-visual）
   ============================================================ */

/* A1 [P0] 页头高度与吸顶偏移脱节。
   v30 把 .train-head 抬到 padding:22px 32px 18px + h1 22px/700 + p 13.5px/margin-top:5px，
   叠加 body line-height:1.65（:3821），实测约 104px；而 --sticky-top 仍是 92px。
   .train-head 是 sticky top:0 / z-index:4，.exam-head 用 top:var(--sticky-top) / z-index:3，
   滚动时题头顶部约 12px 被页头盖住。
   :214 的 scroll-margin-top 用 calc(var(--sticky-top, 0px) + 8px)，变量由 .train 提供时自动受益；
   :2729 的 .q-mat-h 原写 var(--sticky-top, 92px)，其硬编码 fallback 已按 team-lead 补正 3 就地对齐为 104px。 */
.train { --sticky-top: 104px; }
@media (max-width: 900px) {
  /* 与 v30 §20 的 900px 断点对齐（历史 860px 层的 .train-head padding 已被 v30 覆盖）。
     该断点只把 .train-head 的 padding 从 22/18 收到 18/16（−6px），h1 仍是 22px，
     故窄屏页头实测 98.6px（不是 86px）；这里取 99px 与实测对齐，避免题头被盖约 12px。 */
  .train { --sticky-top: 99px; }
}
/* A1 补充：页头被撑高的真正来源是右侧操作组 —— .th-user「数据存本机」在窄宽度下
   被 flex 压成竖排（实测 901px 时 w=22/h=99px，把页头撑到 140px；900px 时 h=59.4px
   撑到 98.6px），副标题也会跟着折行。让标题块可收缩、右侧组不收缩且单行，
   页头高度就稳定为桌面 104.6px / 窄屏 98.6px，与 --sticky-top 严格对应。 */
.train-head .th-title { min-width: 0; }
.train-head p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.train-head > div:last-child { flex: 0 0 auto; }
.train-head > div:last-child > * { flex: 0 0 auto; white-space: nowrap; }

/* A2 [P0] v30 已把 .panel-body.pad 抬到 18px（:4030），exam-head 负 margin 必须严格相等
   才能把底色铺满容器 padding；原 :1403 仍是 16px。不改布局方式（依赖 .panel{overflow:clip} + sticky）。 */
.exam-head { margin: 0 -18px 10px; padding: 10px 18px; }

/* A3 [P0] .exam-subj 与 :4186 .exam-exit 同挂 margin-left:auto 会平分剩余空间，
   把 quiz-stat / exam-subj / exam-exit 扯散、退出按钮不再贴右。保留 exam-exit 的 auto，gap:12px 不动。 */
.exam-head .exam-subj { margin-left: 0; }

/* A4 [P1] 题头两枚胶囊圆角/padding 统一；字号保留（20px / 12px 是刻意的信息层级）。 */
.exam-clock, .exam-subj { border-radius: var(--r-pill); padding: 2px 10px; }

/* A5 [P1] 题号行 chip 四套规格并存（行高 17/18/24/24px、中文 11px 违规）→ 统一 12px/1.5/2px 8px/pill。
   .q-no 的 gap:8px 保持；.ann-btn 内含 12px svg，2px 8px 不裁切；.q-flag 点击区不明显缩小（原 2px 9px）。 */
.q-type, .q-mode-badge, .q-flag, .ann-btn {
  font-size: 12px; line-height: 1.5; padding: 2px 8px; border-radius: var(--r-pill);
}
@media (max-width: 560px) {
  /* 窄屏 :2572 只留图标，沿用其收窄值，避免被上面的统一 padding 抬宽 */
  .ann-btn { padding: 2px 6px; }
}

/* A6 [P1] 三栏工作区左右面板头不等高：v30 的 .rail-head 是 60px/16px（:3990），
   右栏 .ap-head 仍是 56px/14px（:3167）、.ap-tag 11px。mini 折叠态 :3197 保持不动。 */
.ap-head { height: 60px; flex: 0 0 60px; padding: 0 16px; }
.ap-tag { font-size: 12px; }

/* A7 [P1] .th-user 的 margin-left:auto 落在内层内联 flex（宽度由内容决定，admin.html:97-101），
   auto 基本失效；外层两个子元素间也没有 auto。把整个右侧操作组推到外层最右，并清掉 .th-user。
   不改 HTML 内联 style；ws-agent-on 下 .train 的 margin-right（:3165）不受影响。 */
.train-head > div:last-child { margin-left: auto; }
.th-user { margin-left: 0; padding-bottom: 0; }

/* A8 [P2] 首页 .plan-card 仍是 14/16 + 22px（:2405），与 v30 的 .tasks/.task（16/28、18px）不齐；
   .home max-width:640 在 740 宽的 .chat-wrap 内左对齐、右缘差 44px → 居中。
   只改 padding / 间距 / 居中，不动任何字号；.tasks/.task 被 admin.html 复用，本条不动。 */
.plan-card { padding: 18px; margin: 0 0 28px; }
.home { margin-left: auto; margin-right: auto; }

/* A9 [P2] 页头标题字阶统一到 16px/600（.train-head h1 / .plan-h1 的 22px/700 保持主标题档）。 */
.topbar h1, .admin-head .title { font-size: var(--fs-16); font-weight: 600; }
@media (max-width: 900px) {
  /* 窄屏沿用 v30 :4156 的 15px，避免被上面的全局 16px 抬大 */
  .topbar h1 { font-size: 15px; }
}

/* A10 [P2] --fs-11/--fs-12 同值（12px）：定义保留并加兼容别名注释、2 处引用归位——均在上文就地处理。 */
/* A12 [P2] :674 / :1104 / :2052-2053 注释数值漂移——均在上文就地修正。 */

/* A11 [P2] 暗色下页头毛玻璃糊内容：按《视觉风格-落地方案-P3》§5.3 原样补齐。
   页头改实底 + 去 backdrop-filter；3 个遮罩只去 backdrop-filter（底色本就是实色 --scrim）。
   .tabbar 按 §5.3 注释「移动端遗留，可不动」，本轮不动。 */
[data-theme="dark"] .topbar,
[data-theme="dark"] .train-head,
[data-theme="dark"] .admin-head {
  background: var(--canvas) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
[data-theme="dark"] .modal-mask,
[data-theme="dark"] .cmdk-mask,
[data-theme="dark"] .auth-mask {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ============================================================
   §B  动效与过渡（polish-motion）
   ============================================================ */

/* B1 [P0] 4 档节奏统一（全局一处生效全库）。
   :102 --ease-spring 与 :103 --ease-out 原本完全相同（cubic-bezier(.16,1,.3,1)，
   前段猛冲末段极缓，是 360ms 档拖沓的根因）→ 换真·decelerate 并让 spring 收敛到同一曲线。
   --dur-3 360→300、--dur-modal 420→对齐 300、--dur-quick 120→对齐 --dur-press 100。
   保持不变：--dur-press:100 / --dur-1:180 / --dur-2:260 / --ease-std / --ease / --fast /
   --base / --dur-spin:700（theme.js:49 的 260ms、:1210 的 260ms、map.js:431 的 220ms+180ms
   shake 均为硬配对，改任一侧会截断主题过渡或让 shake 不重播）。
   语义：即时 100｜快 180｜常规 260｜慢 300｜循环 700ms 及 1~1.6s 独立不占档。
   例外核实：:132 [data-theme="dark"] 块内并未重定义 --ease-out / --ease-spring / --dur-3
   等动效 token（只有 --ring / --accent-ring），故末尾 :root 覆盖块特异性相同、位置在后，
   暗色下同样生效——正是统一全库节奏的目的。 */
:root {
  --dur-3:       300ms;
  --dur-modal:   var(--dur-3);
  --dur-quick:   var(--dur-press);
  --ease-out:    cubic-bezier(0, 0, .2, 1);
  --ease-spring: var(--ease-out);
}

/* B3 [P0] 申论 tab 切换零转场：shenlun.js:355 只首次创建 .sl-body 一个节点，
   之后 7 个 tab 全是 body.innerHTML 改写子节点，容器本身从不替换 → 挂在容器上的
   animation 永不重启，both 还让容器常驻终态。改挂到直接子节点（每次重写都创建新节点）。
   不改任何 JS / DOM。 */
.sl-body { animation: none; }
.sl-body > * { animation: fade-in 180ms var(--ease-out) both; }

/* B4 [P1] 判分揭晓去回弹、压缩四段错峰（原最晚 160+260=420ms → 现 80+180=260ms）。
   不动 chat.js:816-818 的 judgedShown 只播一次闸门。 */
@keyframes mark-pop {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: none; }
}
.opt-list.reveal .mark    { animation: mark-pop 180ms var(--ease-out) both; }
.opt-list.reveal .mark.ok { animation-delay: 40ms; }
.opt-list.reveal .verdict { animation: fade-in 180ms var(--ease-out) both; animation-delay: 80ms; }
.opt-list.reveal .opt.dim { animation: fade-in 180ms var(--ease-out) both; }

/* B5 [P1] 父子元素动画叠加：父只 opacity、子不叠、去位移与错峰。
   不动 chat.js:791/867 的 fresh 闸门（流式全量 innerHTML 重建时只让新增消息播动画）。 */
.msg.enter .bubble { animation: none; }
.modal-mask, .cmdk-mask { animation: fade-in 180ms var(--ease-out) both; }
.modal, .ui-modal, .cmdk { animation: sheet-in 260ms var(--ease-out) both; }
.view.on { animation: fade-in 260ms var(--ease-out) both; }
.subject-grid > .subject-card { animation: fade-in 180ms var(--ease-out) both; animation-delay: 0ms; }
/* :1182/:1183 的 nth-child 双伪类特异性 (0,4,0) 高于上面 (0,2,0)，
   单靠 animation-delay:0ms 去不掉错峰；精确镜像原 3 条选择器（同特异性、位置在后）兜底。 */
.subject-grid > .subject-card:nth-child(n+1):nth-child(-n+4),
.subject-grid > .subject-card:nth-child(n+5):nth-child(-n+8),
.subject-grid > .subject-card:nth-child(n+9) { animation-delay: 0ms; }

/* B6 [P1] .cmdk 的 cmdkIn 死代码与 @keyframes cmdkIn 已就地删除；:979 .toast 重复 transition 已就地删除。
   transition 取目标状态时长：进场 260ms（.show）/ 退场 180ms（基础态），退场比进场快
   （用户已决定关闭，不该等更久）。 */
.toast {
  transform: translateX(-50%) translate3d(0, 8px, 0);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translate3d(0, 0, 0);
  transition-duration: 260ms;
}

/* B7 [P1] 高频交互只动 transform/opacity。
   .sw-dot 原 :3292-3294 同时过渡 transform/width/height/top/background（4 个 layout 属性）。 */
.sw-dot {
  transition: transform var(--dur-2) var(--ease-out), background var(--dur-1) var(--ease-std);
}
/* 全库 17 处 transition: all 逐条收敛为具体属性列表（只写 transition-property 长属性，
   duration / timing 沿用各自既有值，不重复声明、不破坏 :1128 的按压 100ms 与主题过渡）。
   依据（选择器 → 该规则 :hover / :active / 状态类实际变化的属性）：
    1 .btn                  bg/border/box-shadow(hover) + transform(active) + opacity(disabled) + color
    2 .rail-home            bg/color/border(hover)
    3 .task                 border/transform/box-shadow(hover) + bg
    4 .tk-ico               bg/color(父 hover)
    5 .card                 border/box-shadow(hover) + bg
    6 .opt                  bg/border/transform/box-shadow(hover) + color + opacity(.dim)
    7 .opt .k               border/color(hover) + bg(判分态)
    8 .q-flag               border/color(hover) + bg(.on) + transform(active)
    9 .plan-card            bg(hover)/transform(active)/box-shadow(focus) + border/color
   10 .plan-tab            bg/border/color(.on)/box-shadow(focus)/transform
   11 .plan-link           border(hover)/transform(active) + bg/color/box-shadow
   12 .ann-btn             border/color/bg(hover,.on)/box-shadow(focus)/transform
   13 .ab-btn              bg/color(hover,.on)/box-shadow(focus)/transform
   14 .ab-dot              border/transform(.on) + bg/box-shadow
   15 .ab-size             border/bg(.on)/box-shadow(focus)/transform
   16 .sl-tab              border/color(hover)/bg(.active)/transform(active)/box-shadow
   17 .sl-term-chip,.sl-doc-chip  border/color/bg(hover)/transform(active)/box-shadow */
.btn { transition-property: background-color, border-color, color, box-shadow, transform, opacity; }
.rail-home { transition-property: background-color, border-color, color; }
.task { transition-property: background-color, border-color, box-shadow, transform; }
.tk-ico { transition-property: background-color, color; }
.card { transition-property: background-color, border-color, box-shadow; }
.opt .k { transition-property: background-color, border-color, color; }
.q-flag { transition-property: background-color, border-color, color, box-shadow, transform, opacity; }
.plan-card { transition-property: background-color, border-color, color, box-shadow, transform; }
.plan-tab { transition-property: background-color, border-color, color, box-shadow, transform; }
.plan-link { transition-property: background-color, border-color, color, box-shadow, transform; }
.ann-btn { transition-property: background-color, border-color, color, box-shadow, transform; }
.ab-btn { transition-property: background-color, border-color, color, box-shadow, transform; }
.ab-dot { transition-property: background-color, border-color, box-shadow, transform; }
.ab-size { transition-property: background-color, border-color, box-shadow, transform; }
.sl-tab { transition-property: background-color, border-color, color, box-shadow, transform; }
.sl-term-chip, .sl-doc-chip { transition-property: background-color, border-color, color, box-shadow, transform; }
/* .wm-progress-bar > i（:3658）的 clip-path 方案已跳过——worldmap.js:538 用内联
   style="width:N%" 驱动，页面没有 --pw 变量，改成 width:100%+clip-path(var(--pw)) 会让进度条恒为 0%。
   .wk-bar i（:1356）的 height 由 JS 内联写入，纯 CSS 无法改 scaleY，需 JS 配合，本轮不做。 */

/* B8 [P1] class 切换面板：进场 260ms / 退场 180ms。
   状态类按 CSS 选择器与 JS 核实：.cl-sheet/.cl-scrim/.nav-backdrop 用 .show，
   .cl-drawer/.map-panel 用 .on，.sidebar 用 .open（map.js:571/575/587/591、700/705/731/732）。
   重写简写时明确 transition-property（避免只写 duration 触发 transition-property:all 默认值）；
   :not(状态类) 把隐藏态（=退场目标）压到 180ms，激活态保持 260ms。
   :3804 .cl-sheet.dragging/.wm-sheet.dragging 的 transition:none!important 不受影响。 */
.cl-sheet, .cl-drawer, .map-panel, .sidebar { transition: transform var(--dur-2) var(--ease-out); }
.cl-scrim, .nav-backdrop { transition: opacity var(--dur-2) var(--ease-out); }
.cl-sheet:not(.show), .cl-scrim:not(.show), .cl-drawer:not(.on),
.map-panel:not(.on), .sidebar:not(.open), .nav-backdrop:not(.show) { transition-duration: var(--dur-1); }

/* B9 [P1] 失败态零反馈：display:none → block 时 animation 正常播放，无需改 JS。
   :focus-visible 焦点环保持即时出现，不加任何 duration/delay。 */
.err-bar, .q-result { animation: fade-in 180ms var(--ease-out) both; }

/* B10 [P2] worldmap 只做幅度 / 曲线，时长一律不动。
   镜头四态 scale(1.07)/(.92)/(.94)/(1.06) 偏大 → 收敛到 scale(.98)~scale(1)；
   wm-up 位移 44px → 16px；硬编码 cubic-bezier(.22,.61,.36,1) → var(--ease-out)。
   :3500 的 220<240 配对（worldmap.js:169 setTimeout 240）与 :3698-3701 的 reduced 双保险守卫均不动；
   :3658 因内联 width 驱动（见 B7 说明）本条整体不动。 */
@keyframes wm-dive-out { to   { opacity: 0; transform: scale(1); } }
@keyframes wm-rise-in  { from { opacity: 0; transform: scale(.98); } }
@keyframes wm-pull-out { to   { opacity: 0; transform: scale(.98); } }
@keyframes wm-float-in { from { opacity: 0; transform: scale(1); } }
@keyframes wm-up       { from { transform: translate(-50%, 16px); opacity: 0; } }
.wm-board.dive-out, .wm-board.rise-in, .wm-board.pull-out, .wm-board.float-in,
.wm-sheet { animation-timing-function: var(--ease-out); }
.wm-cont, .wm-cont-lit, .wm-node { transition-timing-function: var(--ease-out); }

/* ============================================================
   §C  减弱动态效果（B2 + B3 + B9 合并，避免多个同条件 media 块）
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  /* B2：全局 reduce 把 infinite 压成「1 次 + .01ms」，tp-bar 无 fill-mode 会回落到
     translateX(-100%)（屏幕外）；ui.js:183-192 的 progressStart/End 保证 .on 不常驻，
     故只在 .on 期间给静态可见态。下列选择器均已在库核实存在：
     .top-progress.on .tp-bar / .spinner / .empty.is-loading::before /
     .streaming-cursor::after / .typing span / .sl-ai-dot。 */
  .top-progress.on .tp-bar { animation: none; transform: translateX(-10%); }
  .spinner, .empty.is-loading::before,
  .streaming-cursor::after, .typing span, .sl-ai-dot { animation: none; opacity: 1; }
  /* B3 / B9：入场与失败态淡入在 reduce 下取消（保留 :1990-1996 显式清单、:2883、:3095 专项处理）。 */
  .sl-body > * { animation: none; }
  .err-bar, .q-result { animation: none; }
}

/* ============================================================
   End of v32 打磨层
   ============================================================ */

/* ============================================================
   折叠态左导航（64px 图标轨）视觉收敛 · 用户截图反馈
   量化复现（1280×860，html.ws-rail-mini）：
     .rail-item 47×40 + border-radius:999px → 大药丸把 16px 图标整个包住；
     .rail-dot 继承 margin-left:auto，flex 行里只剩 svg + 角标，
     图标中心被挤到 x=16（栏中心 32）、红块中心 x=45 且 21×18 与图标几乎等大，
     两者分列两侧、都不居中 → 就是截图里「红色圆点 + 图标偏左」的观感。
   收敛为：图标严格居中 + 32px 柔和圆底 + 右上角 15px 小角标（带底色描边）。
   纯 CSS，不改 DOM / JS / 类名；仅作用于折叠态，展开态完全不受影响。
   ============================================================ */
.ws-rail-mini .rail-item {
  position: relative;
  border-radius: var(--r-md);
}
/* 选中态不再用整块药丸铺底，改为图标背后一枚 32px 柔和圆 */
.ws-rail-mini .rail-item.on { background: transparent; }
.ws-rail-mini .rail-item.on::before {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 32px; height: 32px;
  transform: translate(-50%, -50%);
  border-radius: var(--r-pill);
  background: var(--brand-50);
  z-index: 0; pointer-events: none;
}
.ws-rail-mini .rail-item > svg { position: relative; z-index: 1; }
/* 角标：从「行尾大红块」改为「图标右上角小胶囊」；描一圈底色避免与圆底糊在一起 */
.ws-rail-mini .rail-dot {
  position: absolute; left: 50%; top: 50%;
  transform: translate(4px, -17px);
  margin-left: 0;
  min-width: 15px; height: 15px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1; letter-spacing: 0;
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 2px var(--surface);
  z-index: 2;
}
/* 基础 .rail-dot[hidden] 特异性同为 (0,2,0)，必须显式兜住，
   否则上面这条会把「无待办」时隐藏的角标重新显示出来 */
.ws-rail-mini .rail-dot[hidden] { display: none; }
/* 顶部折叠钮：平时不描边，hover 才浮现底色；:focus-visible 焦点环保留（无障碍） */
.ws-rail-mini .rail-fold {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-color: transparent; border-radius: var(--r-pill);
}
.ws-rail-mini .rail-fold:hover { border-color: transparent; }
/* 分组标签：隐藏文字，只留一条居中的细分隔线，恢复「训练 / 数据」的分组感；
   第一条紧邻 rail-head 的 border-bottom，重复，故不显示 */
.ws-rail-mini .rail-label:first-child { display: none; }
.ws-rail-mini .rail-label {
  display: block;
  height: 1px; padding: 0; margin: 8px 12px;
  font-size: 0; color: transparent; overflow: hidden;
  background: var(--border); border-radius: 1px;
}

/* ============================================================
   会话删除（单条快捷键 + 一键全部删除）· 追加覆盖层
   纪律：全部追加在文件末尾，不改写任何历史声明；只引用既有 token，不硬编码色值。
   ============================================================ */

/* 「会话」标签行：左侧标题 + 右侧快捷键提示与「清空全部」入口 */
.conv-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.conv-tools { display: inline-flex; align-items: center; gap: 8px; }
.conv-kbd-hint { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* 醒目但非实心：红字 + 淡红描边 + hover 淡底；圆角 / 时长沿用既有 token */

/* 键盘 / 触屏焦点也让单条删除按钮显形（:326-331 历史规则只在 hover 显形） */
.conv-item:focus-within .conv-del,
.conv-item:focus-visible .conv-del { opacity: 1; }

/* 窄屏（沿用 860px 断点）：收起快捷键提示，保留按钮，标签行不被挤破 */
@media (max-width: 860px) {
  .conv-kbd-hint { display: none; }
}

/* ============================================================ */
/* ============================================================
   对话区 v2 视觉层（chat-test 沙盒移植）· 追加覆盖层
   纪律：只在文件末尾追加，不改写任何历史声明——沿用本项目
   「后定义胜出」的覆盖惯例。只引用既有 token；新增值统一用
   --ct-* 前缀，并在 [data-theme="dark"] 里给出暗色版。
   无任何外部 url()，字体继续走系统栈。
   ============================================================ */

:root {
  /* 用户气泡：直接吃品牌色实底 + on-brand 前景（与 .btn-primary 同一套对比关系） */
  --ct-user-bubble-bg: var(--brand);
  --ct-user-bubble-fg: var(--on-brand);
  --ct-user-code-bg: rgba(255, 255, 255, .20);
  --ct-user-code-line: rgba(255, 255, 255, .30);
  /* 折叠面板 / 工具状态卡 */
  --ct-panel-bg: color-mix(in srgb, var(--surface-2) 55%, transparent);
  --ct-panel-line: var(--border);
  --ct-tool-bg: color-mix(in srgb, var(--surface-2) 45%, transparent);
  --ct-tool-run-wash: var(--brand-50);
  --ct-tool-run-line: var(--brand-line);
  /* 「已完成」徽标前景：亮色下 --m2-ink 只有 3.27:1，换更深的 --m3-ink（实测 ≈4.9:1）。
     暗色沿用原先已过标的 --m2-ink，不动。 */
  --ct-badge-done-ink: var(--m3-ink);
  /* 表格：表头不靠对比度抢焦点。
     表头与数据行的区分已由「字重 + 1.5px 品牌色下边框」承担，
     底色只需一层轻量色阶：表头底 vs 数据行底 ≈1.7:1，斑马纹 ≈1.3:1。
     （WCAG 1.4.11 的 3:1 针对「识别所必需的 UI 组件边界」，此处不适用。） */
  --ct-table-head-bg: #bcc6d6;
  --ct-table-head-fg: #0f172a;
  --ct-table-stripe: #dbe2e9;
  --ct-table-line: var(--border);
  --ct-scroll-shadow: 0 6px 20px rgba(15, 23, 42, .16);
}

[data-theme="dark"] {
  --ct-user-bubble-bg: var(--brand);
  --ct-user-bubble-fg: var(--on-brand);
  --ct-user-code-bg: rgba(8, 47, 73, .18);
  --ct-user-code-line: rgba(8, 47, 73, .30);
  --ct-panel-bg: color-mix(in srgb, var(--surface-2) 72%, transparent);
  --ct-panel-line: var(--line-2);
  --ct-tool-bg: color-mix(in srgb, var(--surface-2) 62%, transparent);
  --ct-tool-run-wash: var(--brand-50);
  --ct-tool-run-line: var(--brand-line);
  --ct-badge-done-ink: var(--m2-ink);
  --ct-table-head-bg: #303f54;
  --ct-table-head-fg: #ffffff;
  --ct-table-stripe: #1f2c3f;
  --ct-table-line: var(--line-2);
  --ct-scroll-shadow: 0 6px 22px rgba(0, 0, 0, .58);
}

/* ---------- 1. 消息布局：is-user 右对齐气泡 / is-assistant 整宽无底色 ---------- */
.msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 26px;
}
.msg.is-user { align-items: flex-end; }
.msg-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.msg.is-user .msg-body {
  width: auto;
  max-width: 80%;
  align-items: flex-end;
}
.msg.is-assistant .bubble {
  width: 100%;
  max-width: 100%;
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.msg.is-user .bubble {
  max-width: 100%;
  padding: 11px 15px;
  border-radius: 18px;
  border-bottom-right-radius: 6px;
  border-color: transparent;
  background: var(--ct-user-bubble-bg);
  color: var(--ct-user-bubble-fg);
  box-shadow: var(--sh-1);
  font-size: 15px;
  line-height: 1.7;
}
.msg.is-user .bubble code {
  background: var(--ct-user-code-bg);
  border-color: var(--ct-user-code-line);
  color: inherit;
}
.msg-meta {
  font-size: 12px;
  gap: 8px;
  margin-top: 9px;
  color: var(--text-3);
}
.msg.is-user .msg-meta { justify-content: flex-end; }

/* ---------- 2. Markdown：多级列表 ---------- */
.bubble .md-list {
  margin: 10px 0;
  padding-left: 1.55em;
}
.bubble ul.md-list { list-style: disc; }
.bubble ul.md-list ul.md-list { list-style: circle; }
.bubble ul.md-list ul.md-list ul.md-list { list-style: square; }
.bubble ol.md-list { list-style: decimal; }
.bubble ol.md-list ol.md-list { list-style: lower-alpha; }
.bubble ol.md-list ol.md-list ol.md-list { list-style: lower-roman; }
.bubble li.md-li {
  padding-left: 2px;
  margin: 4px 0;
  line-height: 1.75;
}
.bubble li.md-li::marker {
  color: var(--brand);
  font-weight: 650;
}
.bubble li.md-li > .md-list { margin: 4px 0 2px; }

/* ---------- 3. Markdown：GFM 表格（横向滚动 / 粘性表头 / 斑马纹） ---------- */
.bubble .md-table {
  margin: 14px 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ct-table-line);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.bubble .md-table table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 13.5px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}
.bubble .md-table th,
.bubble .md-table td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--ct-table-line);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}
.bubble .md-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--ct-table-head-bg);
  color: var(--ct-table-head-fg);
  font-weight: 650;
  white-space: nowrap;
}
.bubble .md-table thead tr:last-child th {
  border-bottom: 1.5px solid var(--brand-line);
}
.bubble .md-table tbody tr:nth-child(even) { background: var(--ct-table-stripe); }
.bubble .md-table tbody tr:last-child td { border-bottom: none; }
.bubble .md-table td[style*="text-align:right"],
.bubble .md-table th[style*="text-align:right"] { font-variant-numeric: tabular-nums; }

/* ---------- 4. 折叠解析面板（默认收起） ---------- */
.ct-panel {
  margin: 0 0 14px;
  border: 1px solid var(--ct-panel-line);
  border-radius: var(--r-md);
  background: var(--ct-panel-bg);
  overflow: hidden;
}
.ct-panel > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.ct-panel > summary::-webkit-details-marker { display: none; }
.ct-panel-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.ct-panel-trigger:hover { background: var(--state-hover); color: var(--text); }
.ct-panel[open] > .ct-panel-trigger { color: var(--text); }
.ct-panel[open] .ct-chevron { transform: rotate(180deg); }
.ct-panel-title { min-width: 0; }
.ct-brain {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--brand);
}
.ct-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-left: auto;
  opacity: .7;
  transition: transform var(--dur-1) var(--ease);
}
.ct-panel-body {
  padding: 0 12px 12px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
}
.ct-panel-body .md-h { color: var(--text-2); font-size: 14px; margin: 12px 0 6px; }
.ct-panel-body .md-h:first-child { margin-top: 0; }
.ct-panel-body code { font-size: 12.5px; }

/* ---------- 5. 工具状态卡（真实阶段可视化） ---------- */
.ct-tools {
  margin: 0 0 14px;
  border: 1px solid var(--ct-panel-line);
  border-radius: var(--r-md);
  background: var(--ct-tool-bg);
  overflow: hidden;
}
.ct-tools > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.ct-tools > summary::-webkit-details-marker { display: none; }
.ct-tools-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  transition: background-color var(--dur-1) var(--ease);
}
.ct-tools-summary:hover { background: var(--state-hover); }
.ct-tools[open] > .ct-tools-summary { border-bottom: 1px solid var(--ct-panel-line); }
.ct-tools[open] .ct-chevron { transform: rotate(180deg); }
.ct-tools-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 12px 10px;
}
.ct-tool-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.ct-tool-name { font-weight: 600; color: var(--text); }
.ct-tool-detail {
  /* --text-3 在暗色下只有 3.72:1（12px 小字不合规），统一提到 --text-2 */
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-tool-loader {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--brand);
  animation: ct-spin .9s linear infinite;
}
@keyframes ct-spin { to { transform: rotate(360deg); } }
.ct-tool[data-state="done"] .ct-tool-loader,
.ct-tool[data-state="pending"] .ct-tool-loader { display: none; }
.ct-tool-dot {
  display: none;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
}
.ct-tool[data-state="done"] .ct-tool-dot {
  display: inline-flex;
  background: var(--m2-wash);
  border: 1px solid var(--m2-line);
  color: var(--m2-ink);
}
.ct-tool[data-state="done"] .ct-tool-dot::after { content: '✓'; font-weight: 700; }
.ct-tool[data-state="pending"] .ct-tool-dot {
  display: inline-flex;
  border: 1px solid var(--border);
}
.ct-badge {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
}
.ct-badge[data-tone="running"] {
  color: var(--brand);
  background: var(--ct-tool-run-wash);
  border-color: var(--ct-tool-run-line);
}
.ct-badge[data-tone="done"] {
  color: var(--ct-badge-done-ink);
  background: var(--m2-wash);
  border-color: var(--m2-line);
}
/* shimmer：只给「进行中」的徽标，纯 CSS 渐变滑过，无外部资源 */
.ct-badge[data-tone="running"] {
  position: relative;
  overflow: hidden;
}
.ct-badge[data-tone="running"]::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent,
    color-mix(in srgb, var(--brand) 22%, transparent), transparent);
  animation: ct-shimmer 1.6s infinite;
}
@keyframes ct-shimmer { 100% { transform: translateX(100%); } }
.ct-shimmer { position: relative; overflow: hidden; }

/* ---------- 6. 流式光标 / 打字点 ---------- */
.streaming-cursor::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -.16em;
  border-radius: 1px;
  background: var(--brand);
  animation: ct-blink 1s steps(2, start) infinite;
}
@keyframes ct-blink { 50% { opacity: 0; } }
.typing span { background: var(--text-3); }

/* ---------- 7. 输入区：自增高 + focus ring ---------- */
.composer { position: relative; }
.composer textarea {
  min-height: 64px;
  max-height: 192px;
  overflow-y: auto;
  resize: none;
}
.composer-box {
  border-radius: 18px;
  transition: border-color var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}
.composer-box:focus-within {
  border-color: var(--brand-line);
  box-shadow: 0 4px 20px rgba(37, 99, 235, .12), 0 0 0 3px var(--accent-ring);
}
[data-theme="dark"] .composer-box:focus-within {
  box-shadow: 0 4px 20px rgba(0, 0, 0, .5), 0 0 0 3px var(--accent-ring);
}

/* ---------- 8. 「回到底部」浮动按钮 ---------- */
/* 定位在右下角，不再水平居中：居中的 36px 按钮会正压表格/正文中间行。
   配合 .chat-scroll 底部 56px 留白（见本层末尾），保证不遮挡末条内容。 */
.ct-scroll-btn {
  position: absolute;
  /* 对齐输入区右缘而不是贴视口右缘：.composer 是整宽（1280 视口下 1020px），
     而 .composer-inner 只有 max-width:800px 居中，贴视口右缘会让按钮离内容区
     约 80px、看起来孤立在空白里。800px 需与 .composer-inner 的 max-width 同步。 */
  right: max(24px, calc((100% - 800px) / 2 + 24px));
  left: auto;
  bottom: 100%;
  z-index: 8;
  transform: none;
  margin-bottom: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--ct-scroll-shadow);
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease);
}
.ct-scroll-btn[hidden] { display: none; }
.ct-scroll-btn:hover { background: var(--surface-2); color: var(--text); }
.ct-scroll-btn:active { transform: scale(.96); }
.ct-scroll-btn svg { width: 16px; height: 16px; }

/* 滚动区底部留白：右下角按钮占 10px 间距 + 36px 高度，留 56px 保证
   「末条消息 / 表格末行」不会被按钮压住（原 16px 不够）。
   注：更早处的 @media 里有 .chat-scroll{padding-bottom:8px}，同权重下
   本条位置更靠后，因此对所有断点生效。 */
.chat-scroll { padding-bottom: 72px; }

/* ---------- 9. 选项：四态（chosen / right / wrong / dim） ---------- */
.opt-list { gap: 10px; margin-top: 16px; }
.opt {
  border-radius: var(--r-md);
  transition-property: background-color, border-color, color, box-shadow, transform, opacity;
}
.opt.chosen { border-color: var(--brand-line); background: var(--brand-50); }
.opt.chosen .k { border-color: var(--brand); color: var(--brand); background: var(--surface); }
.opt.right { border-color: var(--ok-line); background: var(--ok-wash); }
.opt.wrong { border-color: var(--m0-line); background: var(--m0-wash); }
.opt.dim { opacity: .5; }
.opt .mark.ok,
.opt .mark.no { font-size: 14px; }

/* ---------- 10. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ct-tool-loader { animation: none; opacity: .85; }
  .ct-badge[data-tone="running"]::after { animation: none; display: none; }
  .ct-chevron { transition: none; }
  .msg.enter,
  .msg.enter .bubble { animation: none; }
  .streaming-cursor::after { animation: none; opacity: 1; }
}

/* ---------- 11. ≤900px：底部 tabbar 不再盖住 composer ---------- */
/* `.tabbar` 是 position:fixed 且高 52px（见 :1029），压在 `.main` 之上。
   历史规则在 :1062 给 `.composer` 加 padding-bottom 想让开它，但被 :3938
   同权重的 `.composer{padding:10px 0 20px}` 覆盖；而即便保住 padding，
   800×600 这类 `.main` 已被压满的视口里，padding 只会让 composer 更高、
   发送按钮依然溢出到 tabbar 之下（实测仍被盖 17px、点不到）。
   正确做法与其它页面一致：给容器预留 tabbar 高度（参考 :1073 的
   `.has-tabbar .admin-body`、:2504 的 `.has-tabbar .plan-wrap`）。 */
@media (max-width: 900px) {
  .has-tabbar .main { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
}

/* ---------- 12. 随问附图预览条（粘贴 / 拖入 / 选文件共用） ---------- */
.fig-preview {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
}
.fig-preview[hidden] { display: none; }
.fig-preview img {
  flex: 0 0 auto; width: 56px; height: 56px;
  object-fit: contain; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: #fff;
}
.fig-preview-name {
  flex: 1; min-width: 0; font-size: 12px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fig-preview-remove {
  flex: 0 0 auto; width: 26px; height: 26px;
  border: 1px solid var(--border); border-radius: 50%;
  background: transparent; color: var(--text-2);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.fig-preview-remove:hover { background: var(--surface-2); color: var(--text); }
[data-theme="dark"] .fig-preview { background: var(--surface-2); }
/* 气泡内的题图：始终给白底，避免深色气泡把图推线条吃掉；
   明确 max-width 防止 v2 的 flex 列布局把图片压成 0 宽。 */
.msg.is-user .bubble .msg-fig {
  display: block; width: auto; max-width: min(340px, 100%);
  height: auto; margin: 0 0 10px; padding: 6px;
  background: #fff; border-color: var(--ct-user-code-line);
}
