/* 公考得分最大化 · 本地网页样式
   版式：一张干净的"答题卷"——浅灰底、白色卷面、墨蓝强调色；行测用墨蓝、申论用公文红区分科目。
   正文 17px、行高 1.85，公式统一由 KaTeX 排版；卡片只用在需要单独成块的地方。
   配色：图表分类色、顺序色、状态色取自已校验的参考调色板（浅色 / 深色各一套）；
   界面色与图表色分开定义，图表代码只引用角色变量。 */

:root {
  color-scheme: light;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Microsoft YaHei", monospace;
  --radius: 14px;
  --radius-sm: 10px;

  --page: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e7eaf0;
  --ink: #161a22;
  --ink-2: #454d5c;
  --muted: #7a8293;
  --grid: #e3e6ec;
  --axis: #c3c9d4;
  --border: rgba(22, 32, 56, 0.09);
  --border-strong: rgba(22, 32, 56, 0.17);
  --accent: #2456cf;
  --accent-ink: #ffffff;
  --accent-soft: #edf2fd;
  --accent-line: #a6bff4;
  --xc: #2456cf;
  --xc-soft: #edf2fd;
  --sl: #c43d2a;
  --sl-soft: #fcefeb;
  --bb: #0d7a5f;
  --bb-soft: #e6f4ee;
  --rc: #dfe4ec;
  --rc-shown: #fff6d6;
  --deemph: #cbd0d8;
  --on-strong: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-lg: 0 2px 6px rgba(16, 24, 40, .06), 0 14px 36px rgba(16, 24, 40, .09);

  /* 状态色（固定，不随主题；总是配图标与文字） */
  --good: #0ca30c; --good-text: #006300; --good-soft: #e9f6e9;
  --warn: #fab219; --warn-text: #7a5200; --warn-soft: #fff6e0;
  --serious: #ec835a;
  --bad: #d03b3b; --bad-text: #a32525; --bad-soft: #fcecec;

  /* 分类色（固定顺序）与填充上的文字墨色 */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --s1-ink: #fff; --s2-ink: #fff; --s3-ink: #0b0b0b; --s4-ink: #0b0b0b; --s5-ink: #0b0b0b; --s6-ink: #fff; --s7-ink: #fff; --s8-ink: #fff;
  /* 顺序色（蓝，浅→深） */
  --q1: #cde2fb; --q2: #b7d3f6; --q3: #9ec5f4; --q4: #86b6ef; --q5: #6da7ec; --q6: #3987e5; --q7: #2a78d6; --q8: #1c5cab; --q9: #104281;
  /* 序数色（5 级，浅端仍 ≥2:1） */
  --o1: #86b6ef; --o2: #5598e7; --o3: #2a78d6; --o4: #1c5cab; --o5: #104281;
  --o1-ink: #0b0b0b; --o2-ink: #0b0b0b; --o3-ink: #fff; --o4-ink: #fff; --o5-ink: #fff;
  /* 笔记：钢笔与荧光笔颜色（荧光笔以半透明叠在文字上） */
  --ink-ink: #1d1d1b; --ink-red: #d4251c; --ink-blue: #1d5fd1; --ink-green: #12813b;
  --hl-yellow: #ffd200; --hl-green: #5fd068; --hl-pink: #ff7fb6; --hl-blue: #6fb3ff; --hl-alpha: .4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e1015; --surface: #171a21; --surface-2: #1e222b; --surface-3: #272c37;
    --ink: #e8ebf1; --ink-2: #b4bbc9; --muted: #8790a2; --grid: #272c37; --axis: #3b4251;
    --border: rgba(255, 255, 255, 0.08); --border-strong: rgba(255, 255, 255, 0.16);
    --accent: #7ea3ff; --accent-ink: #0b1020; --accent-soft: #1b2441; --accent-line: #3d5db3;
    --xc: #7ea3ff; --xc-soft: #1b2441; --sl: #ff8f78; --sl-soft: #381e19;
    --bb: #5fd4ad; --bb-soft: #11281f; --rc: #2e3542; --rc-shown: #2a2614;
    --deemph: #404756; --on-strong: #0b0b0b; --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 14px 36px rgba(0, 0, 0, .45);
    --good-text: #3fc23f; --good-soft: #142614; --warn-text: #f5c454; --warn-soft: #2a2212; --bad-text: #ef7a7a; --bad-soft: #2d1616;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --s1-ink: #fff; --s2-ink: #fff; --s3-ink: #0b0b0b; --s4-ink: #0b0b0b; --s5-ink: #0b0b0b; --s6-ink: #fff; --s7-ink: #0b0b0b; --s8-ink: #0b0b0b;
    --q1: #0d366b; --q2: #104281; --q3: #184f95; --q4: #1c5cab; --q5: #256abf; --q6: #2a78d6; --q7: #3987e5; --q8: #6da7ec; --q9: #9ec5f4;
    --o1: #184f95; --o2: #256abf; --o3: #3987e5; --o4: #6da7ec; --o5: #9ec5f4;
    --o1-ink: #fff; --o2-ink: #fff; --o3-ink: #0b0b0b; --o4-ink: #0b0b0b; --o5-ink: #0b0b0b;
    --ink-ink: #f2f1ee; --ink-red: #ff6b61; --ink-blue: #74b0ff; --ink-green: #5dd37a;
    --hl-yellow: #f5cc00; --hl-green: #3fb950; --hl-pink: #e86aa3; --hl-blue: #4b9cf0; --hl-alpha: .42;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e1015; --surface: #171a21; --surface-2: #1e222b; --surface-3: #272c37;
  --ink: #e8ebf1; --ink-2: #b4bbc9; --muted: #8790a2; --grid: #272c37; --axis: #3b4251;
  --border: rgba(255, 255, 255, 0.08); --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #7ea3ff; --accent-ink: #0b1020; --accent-soft: #1b2441; --accent-line: #3d5db3;
  --xc: #7ea3ff; --xc-soft: #1b2441; --sl: #ff8f78; --sl-soft: #381e19;
  --bb: #5fd4ad; --bb-soft: #11281f; --rc: #2e3542; --rc-shown: #2a2614;
  --deemph: #404756; --on-strong: #0b0b0b; --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 14px 36px rgba(0, 0, 0, .45);
  --good-text: #3fc23f; --good-soft: #142614; --warn-text: #f5c454; --warn-soft: #2a2212; --bad-text: #ef7a7a; --bad-soft: #2d1616;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --s1-ink: #fff; --s2-ink: #fff; --s3-ink: #0b0b0b; --s4-ink: #0b0b0b; --s5-ink: #0b0b0b; --s6-ink: #fff; --s7-ink: #0b0b0b; --s8-ink: #0b0b0b;
  --q1: #0d366b; --q2: #104281; --q3: #184f95; --q4: #1c5cab; --q5: #256abf; --q6: #2a78d6; --q7: #3987e5; --q8: #6da7ec; --q9: #9ec5f4;
  --o1: #184f95; --o2: #256abf; --o3: #3987e5; --o4: #6da7ec; --o5: #9ec5f4;
  --o1-ink: #fff; --o2-ink: #fff; --o3-ink: #0b0b0b; --o4-ink: #0b0b0b; --o5-ink: #0b0b0b;
  --ink-ink: #f2f1ee; --ink-red: #ff6b61; --ink-blue: #74b0ff; --ink-green: #5dd37a;
  --hl-yellow: #f5cc00; --hl-green: #3fb950; --hl-pink: #e86aa3; --hl-blue: #4b9cf0; --hl-alpha: .42;
}

/* 逐题教学：每次展开一个动作，图示随步骤进入；无自动播放或闪烁。 */
.lesson-player { margin: 26px 0; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--surface); overflow: clip; min-width: 0; }
.lesson-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); }
.lesson-heading h2 { margin: 2px 0 4px; font-size: 23px; }
.lesson-heading p { margin: 0; font-size: 13px; }
.lesson-eyebrow { color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.lesson-body { padding: 18px 24px 22px; }
.lesson-notice { margin: 0 0 16px; font-size: 13px; color: var(--ink-2); }
.lesson-phases { display: grid; grid-template-columns: repeat(var(--lesson-phase-count,6),minmax(0,1fr)); gap: 6px; }
.lesson-phase { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); padding: 8px 2px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.lesson-phase:disabled { opacity: .5; cursor: default; }
.lesson-phase.is-current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 750; }
.lesson-phase-dot { font-size: 12px; line-height: 1; }
.lesson-progress { display: block; width: 100%; height: 5px; margin: 12px 0 20px; appearance: none; border: 0; background: var(--surface-3); border-radius: 4px; overflow: hidden; accent-color: var(--accent); }
.lesson-progress::-webkit-progress-bar { background: var(--surface-3); }
.lesson-progress::-webkit-progress-value { background: var(--accent); transition: width 240ms ease; }
.lesson-progress::-moz-progress-bar { background: var(--accent); }
.lesson-stage { min-width: 0; animation: lesson-arrive 260ms ease both; }
.lesson-step-count { color: var(--accent); font: 12px var(--mono); }
.lesson-step-title { margin: 8px 0 12px; font-size: 21px; scroll-margin-top: calc(var(--top-off) + 16px); }
.lesson-step-title:focus { outline: 2px solid var(--accent-line); outline-offset: 5px; border-radius: 2px; }
.lesson-task { font-size: 17px; font-weight: 650; margin: 12px 0; }
.lesson-evidence { border: 0; border-left: 3px solid var(--accent-line); margin: 14px 0; padding: 12px 16px; background: var(--surface-2); font-size: 15px; border-radius: 0 8px 8px 0; }
.lesson-evidence-label { color: var(--accent); font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.lesson-evidence p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lesson-evidence mark { animation: lesson-mark 600ms ease both; background: var(--warn-soft); color: var(--ink); box-shadow: inset 0 -2px var(--warn); }
.lesson-evidence-set, .lesson-hint, .lesson-work, .lesson-index, .lesson-reset, .lesson-source, .lesson-archive { margin: 14px 0; font-size: 14px; }
.lesson-archive { padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.lesson-archived-note { padding: 10px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.lesson-player summary { cursor: pointer; color: var(--accent); font-weight: 650; padding: 7px 0; }
.lesson-hint { padding: 3px 12px; border-radius: 8px; background: var(--warn-soft); }
.lesson-hint summary { color: var(--warn-text); }
.lesson-hint p { margin: 6px 0 10px; }
.lesson-work label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.lesson-note { display: block; width: 100%; resize: vertical; min-height: 100px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--ink); background: var(--surface); font: inherit; }
.lesson-think { padding: 16px; border: 1px dashed var(--accent-line); border-radius: 10px; color: var(--ink-2); }
.lesson-reveal { padding: 18px; margin: 18px 0; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 10px; animation: lesson-arrive 300ms ease both; }
.lesson-explain-label { font-size: 12px; font-weight: 750; color: var(--accent); }
.lesson-reveal p { margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lesson-reveal p:last-child { margin-bottom: 0; }
.lesson-compact .lesson-reveal { margin: 10px 0; padding: 12px 16px; }
.lesson-compact .lesson-reveal p:first-child { margin-top: 0; }
.lesson-compact .lesson-controls { margin-top: 8px; }
.lesson-extras { border-top: 1px solid var(--border); padding-top: 8px; font-size: 14px; }
.lesson-flow { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; padding: 0; margin: 16px 0 0; }
.lesson-flow-node { flex: 1 1 160px; display: flex; align-items: flex-start; gap: 9px; padding: 14px; background: var(--surface); border: 1px solid var(--accent-line); border-radius: 9px; animation: lesson-arrive 300ms ease both; animation-delay: var(--step-delay,0ms); }
.lesson-flow-node + .lesson-flow-node { position: relative; }
.lesson-flow-node + .lesson-flow-node::before { content: "→"; color: var(--accent); position: absolute; left: -15px; top: 15px; font-size: 14px; }
.lesson-flow-n { flex: 0 0 23px; width: 23px; height: 23px; border-radius: 50%; font: 12px/23px var(--mono); text-align: center; color: var(--accent-ink); background: var(--accent); }
.lesson-flow-node > span:last-child { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.lesson-choices { display: grid; gap: 10px; margin: 18px 0; }
.lesson-choice { border: 1px solid var(--border-strong); padding: 14px 16px; border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.lesson-choice:hover, .lesson-choice.is-chosen { background: var(--accent-soft); border-color: var(--accent); }
.lesson-choice.is-chosen { box-shadow: inset 3px 0 var(--accent); }
.lesson-feedback { border: 1px solid var(--accent-line); padding: 16px; border-radius: 10px; background: var(--accent-soft); animation: lesson-arrive 250ms ease both; }
.lesson-feedback.is-good { border-color: var(--good); background: var(--good-soft); }
.lesson-feedback.is-review { border-color: var(--warn); background: var(--warn-soft); }
.lesson-feedback p { margin: 8px 0 0; }
.lesson-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px 0; margin: 14px 0 0; border-top: 1px solid var(--border); }
.lesson-controls button { min-height: 44px; }
.lesson-control-hint { font-size: 12px; color: var(--ink-2); }
.lesson-controls button:disabled { opacity: .5; cursor: default; }
.lesson-index { border-top: 1px solid var(--border); padding-top: 8px; }
.lesson-index ol { max-height: 330px; overflow: auto; list-style: none; padding: 0; }
.lesson-index li { margin: 4px 0; }
.lesson-index button { text-align: left; }
.lesson-index [aria-current="step"] { background: var(--accent-soft); font-weight: 750; }
.lesson-completion { padding: 18px; margin-top: 10px; border: 1px solid var(--accent-line); border-radius: 10px; }
.lesson-completion h3 { margin-top: 0; }
.lesson-diagram { margin: 20px 0 4px; padding: 14px; border: 1px solid var(--accent-line); background: var(--surface); border-radius: 9px; }
.lesson-diagram svg { display: block; width: 100%; max-height: 220px; }
.lesson-diagram figcaption { margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.lesson-diagram-item { animation: lesson-arrive 360ms ease both; animation-delay: var(--step-delay,0ms); }
.lesson-slide-shape { transform: translateX(280px); animation: lesson-translate 1.2s ease both; }
.lesson-bars { display: grid; gap: 12px; }
.lesson-bar-row { display: grid; grid-template-columns: 110px minmax(0,1fr); align-items: center; gap: 10px; font-size: 12px; }
.lesson-bar-track { height: 22px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.lesson-bar-fill { height: 100%; background: var(--accent); transform-origin: left; animation: lesson-grow 650ms ease both; animation-delay: var(--step-delay,0ms); }
@keyframes lesson-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lesson-translate { from { transform: translateX(0); } to { transform: translateX(280px); } }
.lesson-full-text { margin: 22px 0; border-top: 1px solid var(--border-strong); }
.lesson-full-text > summary { cursor: pointer; padding: 16px 4px; color: var(--accent); font-weight: 700; }
.lesson-still *, .lesson-still *::before { animation: none !important; transition: none !important; }
@keyframes lesson-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lesson-mark { from { box-shadow: inset 0 0 transparent; } to { box-shadow: inset 0 -2px var(--warn); } }
@media (prefers-reduced-motion: reduce) {
  .lesson-player *, .lesson-player *::before { animation: none !important; transition: none !important; }
}
@media (max-width: 600px) {
  .lesson-heading { padding: 16px; gap: 6px; }
  .lesson-heading h2 { font-size: 20px; }
  .lesson-body { padding: 14px; }
  .lesson-stage .lesson-step-title { font-size: 19px; }
  .lesson-task { font-size: 16px; }
  .lesson-evidence { padding: 10px; font-size: 14px; }
  .lesson-reveal { padding: 13px; }
  .lesson-control-hint { width: 100%; order: 3; text-align: center; }
  .lesson-flow { flex-direction: column; gap: 18px; }
  .lesson-flow-node { flex-basis: auto; }
  .lesson-flow-node + .lesson-flow-node::before { content: "↓"; left: 21px; top: -20px; }
  .lesson-phases { gap: 3px; }
  .lesson-phase { font-size: 12px; }
}

/* ============ 基础 ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; --top-off: calc(58px + env(safe-area-inset-top, 0px)); scroll-padding-top: calc(var(--top-off) + 16px); }
body { margin: 0; background: var(--page); color: var(--ink); font: calc(16px * var(--fs, 1))/1.75 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { text-wrap: balance; letter-spacing: .005em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
mark { background: color-mix(in srgb, var(--s4) 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.muted { color: var(--muted); }
.tnum, .tnum td { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.loading { color: var(--muted); }
noscript { display: block; padding: 24px; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-off);
  display: flex; align-items: center; gap: 14px;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: 0;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 16.5px; letter-spacing: .02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--xc) 0 50%, var(--sl) 50% 100%); color: #fff; font-size: 15px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.tabs { display: flex; gap: 2px; margin-left: 6px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.tabs a { padding: 4px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 650; font-size: 14.5px; line-height: 1.7; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--border); }
.tabs a[data-tab="xc"].on { color: var(--xc); }
.tabs a[data-tab="sl"].on { color: var(--sl); }
.tabs a[data-tab="bb"].on { color: var(--bb); }
.top-search { flex: 1; display: flex; justify-content: flex-end; min-width: 0; }
.search-input { width: min(340px, 100%); height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); transition: border-color .15s, background .15s; }
.search-input:focus { outline: none; border-color: var(--accent-line); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); cursor: pointer; font-size: 17px; flex: none; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.menu-btn { width: auto; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.menu-label { font-size: 13px; white-space: nowrap; }
.search-link { display: none; font-size: 20px; color: var(--ink); }
.search-link:hover { text-decoration: none; }
.search-page-input { width: 100%; height: 42px; margin: 10px 0 6px; font-size: 16px; }

/* ============ 布局 ============ */
.layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: calc(100vh - var(--top-off)); }
.layout.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
.sidebar {
  position: sticky; top: var(--top-off); height: calc(100vh - var(--top-off)); overflow-y: auto; scrollbar-width: thin;
  border-right: 1px solid var(--border); background: var(--surface); padding: 16px 12px 36px; font-size: 14px;
}
.scrim { display: none; }
.main { min-width: 0; padding-block: 34px 80px; padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); outline: none; }
.nav-home { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; font-weight: 700; color: var(--ink); }
.nav-home:hover { background: var(--surface-2); text-decoration: none; }
.nav-sec { margin-top: 10px; border-radius: 10px; }
.nav-sec > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; cursor: pointer; font-weight: 750; color: var(--ink); }
.nav-sec > summary::-webkit-details-marker { display: none; }
.nav-sec > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.nav-sec[open] > summary::after { transform: rotate(45deg); }
.nav-sec > summary:hover { background: var(--surface-2); }
.nav-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--accent)); flex: none; }
.nav-title { padding: 4px 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.nav-sec ul { list-style: none; margin: 2px 0 6px; padding: 0; }
.nav-sec a { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); line-height: 1.45; }
.nav-sec a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav-sec a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-sec a.on .nav-no { color: var(--accent); }
.nav-no { font: 600 11px/1 var(--mono); color: var(--muted); min-width: 1.8em; }
.nav-read { margin-left: auto; color: var(--good-text); font-size: 12px; }
.nav-foot { margin: 20px 10px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

/* ============ 通用页面 ============ */
.page { max-width: 960px; margin: 0 auto; }
.page-head { margin-bottom: 22px; }
.page-head h1, .doc-title { font-size: 2rem; line-height: 1.3; margin: 8px 0 10px; font-weight: 800; letter-spacing: .01em; }
.lede { color: var(--ink-2); margin: 0; font-size: 1.02rem; line-height: 1.8; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--ink-2); }
.block { margin: 40px 0; }
.block h2 { font-size: 1.3rem; font-weight: 800; margin: 0 0 14px; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.block-head h2 { margin: 0; }
.note { margin: 12px 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: .92rem; }
.hint { color: var(--ink-2); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.warn-text { color: var(--warn-text); font-weight: 600; }
.foot-note { margin-top: 44px; color: var(--muted); font-size: 13px; }

/* 按钮、标签 */
.btn, .btn-ghost, .btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 650; font-size: 14px; color: var(--ink); transition: background .15s, border-color .15s; }
.btn:hover, .btn-ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn-ghost { background: transparent; }
.btn-xs { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-ghost.is-on { color: var(--good-text); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); font-size: 13px; cursor: pointer; line-height: 1.65; }
.chip:hover { text-decoration: none; background: var(--surface-2); color: var(--ink); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 650; }
.tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; line-height: 1.8; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.9; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bc, var(--deemph)); flex: none; }
.mod-0 { --bc: var(--s1); } .mod-1 { --bc: var(--s2); } .mod-2 { --bc: var(--s3); } .mod-3 { --bc: var(--s4); } .mod-4 { --bc: var(--s5); } .mod-5 { --bc: var(--s6); }
.type-0 { --bc: var(--s1); } .type-1 { --bc: var(--s2); } .type-2 { --bc: var(--s3); } .type-3 { --bc: var(--s4); } .type-4 { --bc: var(--s5); }
.subj-badge-xc { --bc: var(--xc); } .subj-badge-sl { --bc: var(--sl); } .subj-badge-bb { --bc: var(--bb); }
.pill { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 650; }
.pill.ans { background: var(--accent-soft); color: var(--accent); }
.pill.is-hidden { color: var(--muted); }
.conf-3, .conf-4 { background: var(--warn-soft); color: var(--warn-text); }
.rec-right { background: var(--good-soft); color: var(--good-text); }
.rec-wrong { background: var(--bad-soft); color: var(--bad-text); }
.seg-ctl { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 0; border-radius: 11px; background: var(--surface-2); }
.seg-btn { border: 0; background: transparent; padding: 4px 14px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 14px; font-weight: 600; line-height: 1.7; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--border); }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.switch input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ============ 文档页 ============ */
.doc-layout { display: grid; grid-template-columns: minmax(0, 860px) 220px; gap: 48px; justify-content: center; }
.doc-main { min-width: 0; }
.doc-head { margin-bottom: 22px; }
.doc-no { display: inline-grid; place-items: center; min-width: 2.3em; height: 1.55em; margin-right: 12px; padding: 0 .35em; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font: 800 .62em/1 var(--mono); vertical-align: .24em; letter-spacing: .02em; }
.doc-subj-sl .doc-no { background: var(--sl-soft); color: var(--sl); }
.doc-subj-bb .doc-no { background: var(--bb-soft); color: var(--bb); }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 13.5px; }
.doc-meta > span + span::before { content: "·"; margin-right: 14px; color: var(--deemph); }
.doc-meta .btn-ghost { margin-left: auto; }
.doc-file { display: none; }
.summary { margin: 20px 0 22px; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.summary-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; color: var(--accent); }
.summary-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.summary-purpose { margin: 8px 0 10px; font-weight: 750; font-size: 1.12rem; line-height: 1.6; }
.summary ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.summary li { position: relative; padding-left: 20px; line-height: 1.7; }
.summary li::before { content: ""; position: absolute; left: 3px; top: .72em; width: 7px; height: 7px; border-radius: 50%; border: 2px solid var(--accent-line); }
.summary-first { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-strong); font-size: 13px; color: var(--ink-2); }
.summary-first .chip { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.summary-first .chip:hover { border-color: var(--accent-line); }
.toc-rail { position: sticky; top: calc(var(--top-off) + 24px); align-self: start; max-height: calc(100vh - var(--top-off) - 48px); overflow-y: auto; scrollbar-width: thin; font-size: 13px; padding-left: 14px; border-left: 2px solid var(--grid); }
.toc-title { font-weight: 800; color: var(--muted); font-size: 12px; letter-spacing: .1em; margin-bottom: 8px; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 1px 0; }
.toc-list a { display: block; color: var(--ink-2); line-height: 1.5; padding: 3px 0; }
.toc-list a:hover { color: var(--ink); text-decoration: none; }
.toc-list a.on { color: var(--accent); font-weight: 650; }
.toc-l3 { padding-left: 12px; font-size: 12.5px; }
/* 本页结构图、本页目录：一排两个按钮，点开后内容占满整行 */
.doc-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.doc-tools > details { flex: 0 1 auto; min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.doc-tools > details[open] { flex: 1 1 100%; box-shadow: var(--shadow); }
.doc-tools > details > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer; font-size: 14px; font-weight: 650; color: var(--ink); }
.doc-tools > details > summary::-webkit-details-marker { display: none; }
.doc-tools > details > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.doc-tools > details[open] > summary::before { transform: rotate(45deg); }
.doc-tools > details > summary .muted { font-weight: 400; font-size: 12.5px; }
.toc-mobile { display: none; }
.toc-mobile .toc-list { padding: 4px 16px 14px; max-height: 55vh; overflow-y: auto; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 52px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 650; transition: border-color .15s, box-shadow .15s; }
.pager a:hover { border-color: var(--accent-line); text-decoration: none; box-shadow: var(--shadow); }
.pager small { color: var(--muted); font-size: 12px; font-weight: 500; }
.pager-next { text-align: right; }

/* 正文排版 */
.prose { font-size: calc(17px * var(--fs, 1)); line-height: 1.85; }
.prose h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.4; margin: 2.4em 0 .8em; padding-top: 1em; border-top: 1px solid var(--grid); }
.prose h3 { font-size: 1.2rem; font-weight: 750; line-height: 1.5; margin: 1.9em 0 .6em; }
.prose h4 { font-size: 1.04rem; font-weight: 700; margin: 1.5em 0 .5em; color: var(--ink-2); }
/* 正文列表与段落的间距不作用于图表内部（图表组件自带排版） */
.prose p:not(.chart *, .docmap *) { margin: .8em 0; }
.prose :is(ul, ol):not(.chart *, .docmap *) { padding-left: 1.5em; margin: .7em 0; }
.prose li:not(.chart *, .docmap *) { margin: .3em 0; }
.prose li::marker { color: var(--muted); }
.prose li > :is(ul, ol):not(.chart *) { margin: .2em 0; }
.prose strong { font-weight: 750; }
.prose hr { border: 0; border-top: 1px solid var(--grid); margin: 2.2em 0; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 3px solid var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); border-radius: 0 12px 12px 0; color: var(--ink-2); font-size: .95em; }
.prose blockquote p { margin: .35em 0; }
.prose code { font-family: var(--mono); font-size: .86em; padding: .1em .4em; border-radius: 6px; background: var(--surface-2); }
.code-wrap pre { margin: 1em 0; padding: 14px 16px; overflow-x: auto; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font: 13.5px/1.65 var(--mono); }
.code-wrap pre code { background: none; padding: 0; font-size: inherit; }
.prose a.xref, .table-wrap a.xref { white-space: nowrap; border-bottom: 1px dotted var(--accent-line); }
.prose a.xref:hover { text-decoration: none; border-bottom-style: solid; }
.table-wrap { position: relative; overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .9em; line-height: 1.65; }
.table-wrap th { background: var(--surface-2); text-align: left; font-weight: 750; color: var(--ink-2); font-size: .94em; white-space: nowrap; }
.table-wrap th, .table-wrap td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap td { min-width: 4.6em; }
.table-wrap tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.table-wrap tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { font-weight: 600; color: var(--ink); }
.math-block { position: relative; overflow-x: auto; overflow-y: hidden; margin: 1em 0; padding: 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
/* KaTeX 的无障碍 MathML 层是绝对定位的：让所有滚动容器成为它的定位祖先，避免撑宽页面 */
.katex-display, .formula, .heat-wrap, .tbar-wrap, .btgrid, .code-wrap pre, .chart-plot { position: relative; }
.katex { position: relative; }
.prose p, .prose li { overflow-wrap: anywhere; }
.katex { font-size: 1.08em; color: inherit; }
.katex .cjk_fallback { font-family: var(--font); }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; margin: .6em 0; }
.math-block .katex-display { margin: 0; }
/* 行内竖排分数会撑高行距：给含公式的行留出上下空间，行与行之间保持均匀 */
.math-inline .katex { padding-block: .12em; }
.math-error { color: var(--bad-text); }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }

/* ============ 图表 ============ */
.viz { margin: 1.6em 0; min-height: 40px; }
.viz-missing { color: var(--bad-text); font-size: 13px; }
.chart { margin: 1.6em 0; padding: 20px 22px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); font-size: 15px; line-height: 1.7; }
.chart figcaption { margin-bottom: 14px; }
.chart-title { font-weight: 800; font-size: 1.06rem; line-height: 1.5; color: var(--ink); }
.chart-sub { color: var(--ink-2); font-size: .9rem; line-height: 1.6; margin-top: 3px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 12px; font-size: 13px; color: var(--ink-2); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg-key { display: inline-block; flex: none; background: var(--c); }
.lg-rect { width: 12px; height: 12px; border-radius: 3px; }
.lg-line { width: 16px; height: 2px; border-radius: 2px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; }
.chart-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--grid); }
.chart-foot > button { flex: none; white-space: nowrap; margin-left: auto; }
.chart-note { flex: 1 1 220px; }
.chart-note { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.chart-table { margin-top: 8px; }
.chart-table .table-wrap { font-size: 13px; }

.bars { --label-w: 12em; font-size: 13.5px; }
.brow { display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); align-items: center; column-gap: 12px; min-height: 32px; }
.blabel { color: var(--ink-2); text-align: right; line-height: 1.35; font-size: 13px; overflow-wrap: anywhere; }
a.blabel:hover { color: var(--accent); }
.brow.is-muted .blabel { color: var(--muted); }
.track { position: relative; height: 28px; margin-right: 5.5em; }
.grid { position: absolute; inset: 0; pointer-events: none; }
.gl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.bar { position: absolute; left: 0; top: 50%; height: 16px; transform: translateY(-50%); background: var(--c); border-radius: 0 5px 5px 0; min-width: 2px; }
.bar-em { height: 20px; }
.whisker { position: absolute; top: 50%; height: 0; border-top: 2px solid var(--ink-2); }
.whisker::before, .whisker::after { content: ""; position: absolute; top: -6px; width: 0; height: 10px; border-left: 2px solid var(--ink-2); }
.whisker::before { left: 0; } .whisker::after { right: 0; }
.ref { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 2px solid var(--ink-2); opacity: .55; pointer-events: none; }
.val { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; }
.brow-axis { min-height: 20px; }
.axis, .reflabels { position: relative; height: 20px; margin-right: 5.5em; }
.axis span, .reflabels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reflabels span { color: var(--ink-2); font-weight: 600; }
.track:hover .bar, .track:focus .bar { filter: brightness(1.08); }
.bars-stack .track { margin-right: 3.5em; }
.bars-stack .axis { margin-right: 3.5em; }
.stack { position: absolute; left: 0; top: 50%; height: 18px; transform: translateY(-50%); display: flex; }
.seg { position: relative; height: 100%; background: var(--c); box-shadow: inset -2px 0 0 var(--surface); min-width: 2px; display: grid; place-items: center; cursor: default; }
.seg:last-child { border-radius: 0 4px 4px 0; box-shadow: none; }
.seg:hover, .seg:focus { filter: brightness(1.1); outline: none; }
.seg-label { font-size: 11px; font-weight: 600; color: var(--ci, var(--ink)); pointer-events: none; }
.track-group { height: auto; display: flex; flex-direction: column; gap: 3px; padding: 5px 0; }
.gline { position: relative; height: 12px; }
.gline .bar { height: 10px; }
.dots .track-dots { height: 36px; }
.brow-dots { min-height: 38px; }
.dotg { position: absolute; left: 0; right: 0; height: 0; }
.ci { position: absolute; top: -1px; height: 2px; background: var(--c); border-radius: 2px; }
.dot { position: absolute; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface); transform: translate(-50%, -50%); cursor: default; }
.dot::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.dot:hover, .dot:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); outline: none; }
.dots .track { margin-right: 1em; }
.dots .axis, .dots .reflabels { margin-right: 1em; }

.heat-wrap { overflow-x: auto; }
.heat { display: grid; gap: 2px; font-size: 12px; min-width: 300px; }
.hh { text-align: center; color: var(--muted); font-size: 11.5px; padding: 2px 0; }
.hr { text-align: right; padding-right: 8px; color: var(--ink-2); font-size: 12px; line-height: 1.3; align-self: center; }
.hc { display: grid; place-items: center; min-height: 26px; border-radius: 4px; font-variant-numeric: tabular-nums; font-size: 11.5px; cursor: default; }
.hc:hover, .hc:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.hc-empty { color: var(--muted); }
.hc-zero { color: var(--muted); background: var(--surface-2); }
.heat-scale { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.heat-ramp { display: inline-flex; }
.heat-ramp i { width: 18px; height: 10px; }

.multiples { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.multiples.is-single { grid-template-columns: minmax(0, 420px); }
.panel-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
svg.lines { width: 100%; height: auto; overflow: visible; }
.lines .gridline { stroke: var(--grid); stroke-width: 1; }
.lines .tick { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.lines .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lines .ln-dot { stroke: var(--surface); stroke-width: 2; }
.lines .crosshair { stroke: var(--ink-2); stroke-width: 1; opacity: 0; }
.lines .crosshair.on { opacity: .6; }
.lines .hit { fill: transparent; cursor: crosshair; }

.tbar-wrap { overflow-x: auto; }
.tbar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; min-width: 420px; }
.tseg { background: var(--c); box-shadow: inset -2px 0 0 var(--surface); min-width: 4px; cursor: default; }
.tseg:last-child { box-shadow: none; }
.tseg:hover, .tseg:focus { filter: brightness(1.1); outline: none; }
.tbar-labels { display: flex; min-width: 420px; }
.tlab { display: flex; flex-direction: column; padding: 6px 4px 0 0; font-size: 12px; line-height: 1.4; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.tlab strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.viz-switch .seg-ctl { margin-bottom: 4px; }
.viz-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.viz-pair .chart { margin: .8em 0; }

/* 示意图 */
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.flow-step { position: relative; flex: 1 1 150px; min-width: 150px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.flow-step:not(:last-child)::after { content: "→"; position: absolute; right: -18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.flow-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.flow-no { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; flex: none; }
.flow-title { font-weight: 750; font-size: 14.5px; }
.flow-time { margin-left: auto; font-size: 12px; color: var(--accent); font-weight: 650; }
.flow-body { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.flow-tag { margin-top: 6px; font-size: 12px; color: var(--muted); }
.tone-warn { border-color: color-mix(in srgb, var(--warn) 70%, transparent); background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.tone-accent { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.tone-good { border-color: color-mix(in srgb, var(--good) 55%, transparent); }
.tone-bad { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.tone-muted { opacity: .92; }

.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 18px; padding-left: 16px; border-left: 2px solid var(--grid); }
.tree li { position: relative; margin: 8px 0; }
.tree ul > li::before { content: ""; position: absolute; left: -16px; top: 16px; width: 14px; border-top: 2px solid var(--grid); }
.tnode { display: inline-flex; flex-direction: column; gap: 2px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); }
.tnode-label { font-weight: 650; font-size: 14px; line-height: 1.5; }
.tnode-note { font-size: 13px; color: var(--ink-2); line-height: 1.55; }

.yearline { list-style: none; margin: 0; padding: 0; position: relative; }
.yearline::before { content: ""; position: absolute; left: 2.6em; top: 6px; bottom: 6px; width: 2px; background: var(--grid); }
.yearline li { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 12px; margin: 10px 0; position: relative; }
.yl-year { font: 700 13px/1.8 var(--mono); color: var(--ink-2); text-align: right; padding-right: 14px; position: relative; }
.yl-year::after { content: ""; position: absolute; right: -9px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--surface); }
.yl-card { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.yl-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 14px; }
.yl-level { display: inline-flex; gap: 3px; flex: none; }
.yl-level i { width: 8px; height: 8px; border-radius: 50%; background: var(--grid); }
.yl-level i.on { background: var(--accent); }
.yl-body { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.yl-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.cardgrid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 10px; }
.dcard { padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); }
.dcard-kicker { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.dcard-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--accent); }
.dcard-title { font-weight: 700; font-size: 14px; line-height: 1.45; margin-top: 2px; }
.dcard-body { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.55; }

.matmap { display: flex; flex-direction: column; gap: 8px; }
.mm-row { display: grid; grid-template-columns: 3.4em minmax(0, 1fr) 5.4em; align-items: center; gap: 10px; }
.mm-year { font: 600 13px var(--mono); color: var(--ink-2); }
.mm-bar { display: flex; height: 30px; border-radius: 6px; }
.mm-blk { display: grid; place-items: center; background: var(--c); color: var(--ci); font-size: 11px; font-weight: 700; box-shadow: inset -2px 0 0 var(--surface); min-width: 6px; }
.mm-blk:first-child { border-radius: 6px 0 0 6px; }
.mm-blk:last-child { border-radius: 0 6px 6px 0; box-shadow: none; }
.mm-blk:hover, .mm-blk:focus { filter: brightness(1.1); text-decoration: none; }
.mm-total { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.btgrid { display: flex; flex-direction: column; gap: 2px; overflow-x: auto; }
.btgrid-row { display: grid; grid-template-columns: minmax(12em, 1fr) repeat(6, 3em); gap: 2px; align-items: center; min-width: 460px; }
.btgrid-head span { font: 600 12px var(--mono); color: var(--muted); text-align: center; }
.btgrid-head span:first-child { text-align: left; font-family: var(--font); }
.bt-rule { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; padding: 4px 6px 4px 0; }
.bt-cell { display: grid; place-items: center; height: 28px; border-radius: 5px; font-weight: 700; font-size: 13px; }
.bt-cell.ok { background: var(--good-soft); color: var(--good-text); }
.bt-cell.no { background: var(--bad-soft); color: var(--bad-text); }
.bt-cell.is-test { box-shadow: inset 0 0 0 2px var(--accent-line); }
.btgrid-head .is-test { color: var(--accent); }

/* 提示框 */
.tip { position: absolute; z-index: 60; min-width: 120px; max-width: 300px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.5; pointer-events: none; opacity: 0; transition: opacity .08s; }
.tip.on { opacity: 1; }
.tip-title { color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.tip-row { display: flex; align-items: baseline; gap: 6px; }
.tip-row strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tip-label { color: var(--ink-2); }
.tip-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; flex: none; align-self: center; }

/* ============ 首页与概览 ============ */
.hero { padding: 14px 0 6px; }
.hero-kicker { margin: 0; color: var(--accent); font-weight: 800; font-size: 13.5px; letter-spacing: .12em; }
.hero h1 { font-size: 2.5rem; line-height: 1.2; margin: 10px 0 14px; font-weight: 850; letter-spacing: .01em; }
.hero-lede { color: var(--ink-2); max-width: 44em; margin: 0; font-size: 1.04rem; line-height: 1.85; }
.subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 30px 0; }
.subj { --c: var(--xc); --cs: var(--xc-soft); position: relative; display: flex; flex-direction: column; padding: 22px 24px 20px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .18s, transform .18s; }
.subj-sl { --c: var(--sl); --cs: var(--sl-soft); }
.subj::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }
.subj:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.subj-k { display: inline-flex; align-self: flex-start; padding: 1px 12px; border-radius: 999px; background: var(--cs); color: var(--c); font-weight: 800; font-size: 13.5px; letter-spacing: .08em; }
.subj-big { font-size: 2.6rem; font-weight: 850; line-height: 1.15; margin-top: 10px; font-variant-numeric: tabular-nums; }
.subj-sub { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.subj ul { margin: 14px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--border-strong); list-style: none; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.subj li { position: relative; padding-left: 16px; }
.subj li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--c); opacity: .7; }
.subj-go { position: absolute; right: 22px; bottom: 18px; color: var(--c); font-weight: 800; }
.plan { padding: 18px 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.plan h3 { margin: 0 0 10px; font-size: 1.08rem; font-weight: 800; }
.plan-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 2px; }
.plan-steps li { counter-increment: st; position: relative; padding: 9px 0 9px 38px; border-bottom: 1px solid var(--grid); line-height: 1.7; }
.plan-steps li:last-child { border-bottom: 0; }
.plan-steps li::before { content: counter(st); position: absolute; left: 0; top: 10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font: 800 12.5px/1 var(--font); }
.plan-steps a { font-weight: 700; margin-right: 8px; }
.plan-steps span { color: var(--ink-2); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.stat { padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat-v { font-size: 1.7rem; font-weight: 850; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.triple { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tcard { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.tcard:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); }
.tcard > :first-child { font-weight: 750; }
.tcard span { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }
.doclist { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.dcard-link { display: flex; flex-direction: column; gap: 5px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.dcard-link:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.dcard-link.is-read { opacity: .86; }
.dcard-q { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.dl-no { font: 800 12px var(--mono); color: var(--accent); display: flex; justify-content: space-between; }
.dl-read { color: var(--good-text); font-family: var(--font); }
.dl-title { font-weight: 750; font-size: 15.5px; }
.dl-purpose { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }
.dl-meta { margin-top: auto; padding-top: 4px; font-size: 12px; color: var(--muted); }
.hub-charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }

/* ============ 题库 ============ */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow); position: sticky; top: calc(var(--top-off) + 10px); z-index: 5; }
.filters select, .filters input[type="search"] { height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); max-width: 100%; }
.filters input[type="search"] { flex: 1 1 200px; }
.qstat { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 2px; font-size: 13.5px; color: var(--ink-2); }
.qlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.qrow { border-bottom: 1px solid var(--grid); padding: 12px 18px; transition: background .12s; }
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.qrow-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--ink); }
.qrow-main:hover { text-decoration: none; }
.qrow-main:hover .qsub { color: var(--accent); }
.qid { font: 750 13px var(--mono); color: var(--ink-2); }
.qsub { font-weight: 650; font-size: 15px; }
.qmeta { margin-left: auto; display: inline-flex; gap: 4px; }
.qslogan { margin: 5px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.qpager { display: flex; justify-content: space-between; align-items: center; margin: 20px 0; font-size: 14px; }
.qpager a { padding: 6px 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font-weight: 650; }
.qpager a:hover { text-decoration: none; border-color: var(--accent-line); }
.qdetail .qhead h1 { font-size: 1.9rem; font-weight: 850; margin: 8px 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-variant-numeric: tabular-nums; }
/* 解析里的长算式（1588+1604+…）和网址没有断行点，手机上允许在任意处换行，避免横向溢出 */
.qdetail p, .qdetail li, .qdetail blockquote { overflow-wrap: anywhere; }
/* 短公式与其后的收尾标点作为一个整体换行（见 src/lib/math.ts、tools/md.ts 的 TRAIL_PUNCT）；
   用 inline-block + max-width 而不是 nowrap：整体比一行还宽时仍可在内部断行，不会撑出横向滚动 */
.math-nobr { display: inline-block; max-width: 100%; }
.qhead-sub { font-size: 1.05rem; font-weight: 650; color: var(--ink-2); }
.qhead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: 13px; }
.qhead-meta > span { padding: 1px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.qhead-meta > .warn-text { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-soft); }
.stem { margin: 20px 0; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.stem-k { font-size: 12.5px; font-weight: 800; color: var(--muted); letter-spacing: .12em; }
.stem-text { margin: 6px 0 10px; font-size: 1.06em; line-height: 1.9; white-space: pre-wrap; }
.stem-req { margin: 0; color: var(--ink-2); font-size: .95rem; }
.opts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.opt { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; line-height: 1.65; flex-wrap: wrap; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.opt-k { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-weight: 800; font-size: 13px; flex: none; }
.opt:hover .opt-k { background: var(--accent-soft); color: var(--accent); }
.opt.is-right { border-color: var(--good); background: var(--good-soft); }
.opt.is-right .opt-k { background: var(--good); color: #fff; }
.opt.is-right::after { content: "✓ 正确"; margin-left: auto; color: var(--good-text); font-weight: 750; font-size: 13px; }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.is-wrong .opt-k { background: var(--bad); color: #fff; }
.opt.is-wrong::after { content: "✗ 你的选择"; margin-left: auto; color: var(--bad-text); font-weight: 750; font-size: 13px; }
.opt-why { flex-basis: 100%; font-size: 13px; color: var(--ink-2); padding-left: 38px; }
.opt-mono { font-size: 15.5px; }
.answer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 20px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-line) 70%, transparent); }
.answer-k { font-weight: 800; color: var(--accent); }
.answer-v { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 1.5rem; font-weight: 850; }
.answer-src { font-size: 13px; color: var(--ink-2); }
.answer.is-hidden, .analysis.is-hidden { display: none; }
.analysis { margin-top: 14px; display: grid; gap: 14px; }
/* 解析：口诀置顶，其余分成"怎么解 / 避开陷阱 / 考场策略 / 举一反三"四张卡 */
.qgroup { padding: 18px 22px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.qgroup > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 1.08rem; font-weight: 800; }
.qgroup > h2::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--gc, var(--accent)); flex: none; }
.qg-solve { --gc: var(--s1); } .qg-trap { --gc: var(--s2); } .qg-exam { --gc: var(--s3); } .qg-more { --gc: var(--s7); }
.qsec { margin: 12px 0 14px; padding-top: 12px; border-top: 1px solid var(--grid); }
.qgroup > h2 + .qsec { border-top: 0; padding-top: 4px; }
.qsec h3 { display: flex; align-items: baseline; gap: 6px; font-size: .92rem; font-weight: 750; margin: 0 0 4px; color: var(--ink-2); letter-spacing: .02em; }
.qsec p { margin: 4px 0; line-height: 1.85; }
.qsec ul { margin: 4px 0; padding-left: 1.3em; }
.qsec li { margin: 3px 0; line-height: 1.8; }
.chain { color: var(--ink-2); }
.slogan { position: relative; margin: 0; padding: 16px 20px 16px 52px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn-soft) 80%, var(--surface)); font-weight: 650; font-size: 1.04em; line-height: 1.8; }
.slogan::before { content: "诀"; position: absolute; left: 14px; top: 15px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--warn); color: #3a2600; font-size: 13px; font-weight: 850; }
.slogan-k { display: block; font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--warn-text); margin-bottom: 2px; }
.qrel { margin: 2px 2px 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* 申论题库 */
.sl-year h2 { display: flex; align-items: baseline; justify-content: space-between; font-size: 1.2rem; margin: 26px 0 10px; }
.sl-year-link { font-size: 13px; font-weight: 500; }
.slcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.slcard { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.slcard:hover { text-decoration: none; border-color: color-mix(in srgb, var(--sl) 45%, transparent); box-shadow: var(--shadow); transform: translateY(-1px); }
.slcard-top { display: flex; align-items: center; gap: 8px; }
.slcard-score { font-weight: 700; }
.slcard-words { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.slcard-id { font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.slcard-id span { font-weight: 500; color: var(--ink-2); font-size: 12.5px; }
.slcard-stem { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.slcard-done { font-size: 12px; color: var(--good-text); }
.tabs-local { display: flex; gap: 4px; margin: 18px 0 10px; border-bottom: 1px solid var(--border); }
.tabs-local a { padding: 8px 14px; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-local a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs-local a:hover { text-decoration: none; color: var(--ink); }
.mats { display: flex; flex-direction: column; gap: 8px; }
.mat { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.mat.is-rel { border-color: var(--accent-line); }
.mat summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.mat-no { font-weight: 700; }
.mat-chars { font-size: 12.5px; color: var(--muted); }
.para { margin: 0; padding: 6px 12px 6px 14px; line-height: 1.85; border-left: 3px solid transparent; }
.para.is-key { border-left-color: var(--s4); background: color-mix(in srgb, var(--warn-soft) 70%, transparent); }
.para-id { display: inline-block; margin-right: 8px; padding: 0 5px; border-radius: 4px; background: var(--surface-2); font: 600 11px/1.8 var(--mono); color: var(--muted); vertical-align: .1em; }
.para.is-key .para-id { background: var(--s4); color: var(--s4-ink); }
.practice-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; font-size: 14px; color: var(--ink-2); }
.clock { font: 700 1.4rem/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.clock.over { color: var(--bad-text); }
.answer-input { width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); line-height: 1.85; resize: vertical; font-size: max(16px, calc(16px * var(--fs, 1))); }
.counter { display: flex; align-items: center; gap: 12px; margin: 6px 2px; font-size: 14px; }
.lim { font-size: 13px; }
.lim-good { color: var(--good-text); } .lim-good::before { content: "✓ "; }
.lim-mid { color: var(--ink-2); }
.lim-bad { color: var(--bad-text); font-weight: 600; } .lim-bad::before { content: "✗ "; }
.practice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.reveal { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--border); }
.reveal h3 { font-size: 1.05rem; }
.ptlist { padding-left: 1.4em; }
.ptlist li { margin: 6px 0; }
.ptlist label { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; cursor: pointer; }
.ptlist input { transform: translateY(2px); }
.pt-text { font-weight: 600; }
.pt-basis { font-size: 12.5px; color: var(--muted); }
.selfscore { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.selfscore strong { font-size: 1.2rem; }
.refans { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); line-height: 1.9; }
.refans p { margin: 4px 0; }

/* ============ 搜索 ============ */
.srlist { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.sr { padding: 12px 18px; border-bottom: 1px solid var(--grid); }
.sr:last-child { border-bottom: 0; }
.sr a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--ink); }
.sr a:hover { text-decoration: none; }
.sr a:hover .sr-h { color: var(--accent); }
.sr-t { font: 600 12.5px var(--mono); color: var(--muted); }
.sr-h { font-weight: 600; }
.sr-x { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.65; }

/* ============ 工具 ============ */
.toolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.toolcard { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.toolcard:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.toolcard > :first-child { font-weight: 750; font-size: 15.5px; }
.toolcard span { color: var(--ink-2); font-size: 13.5px; line-height: 1.65; }
.formulas { display: grid; gap: 6px; }
.formula { padding: 10px 16px; margin: 8px 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.field-label { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); font-weight: 600; }
.field input[type="number"], .field input[type="text"], .field select { height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.field input[type="range"] { width: 100%; accent-color: var(--accent); }
.field-hint { font-size: 12px; color: var(--muted); }
.result { margin: 14px 0; padding: 12px 16px 12px 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); position: relative; }
.result::before { position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.result.good { border-color: color-mix(in srgb, var(--good) 50%, transparent); background: var(--good-soft); }
.result.good::before { content: "✓"; background: var(--good); }
.result.warn { border-color: color-mix(in srgb, var(--warn) 70%, transparent); background: var(--warn-soft); }
.result.warn::before { content: "!"; background: var(--warn); color: #0b0b0b; }
.result.bad { border-color: color-mix(in srgb, var(--bad) 50%, transparent); background: var(--bad-soft); }
.result.bad::before { content: "✗"; background: var(--bad); }
.result.mid::before { content: "i"; background: var(--accent); color: var(--accent-ink); }
.result p { margin: 4px 0; }
.result-big { font-size: 1.6rem; font-weight: 700; line-height: 1.3; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.quiz { margin: 18px 0; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.quiz-type { display: inline-block; padding: 1px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 800; }
.quiz-q { font-size: 1.1rem; line-height: 1.85; margin: 10px 0; font-weight: 650; }
.quiz-opts { display: grid; gap: 8px; margin: 12px 0; }
.quiz-fb .btn-primary { margin-top: 10px; }
.recip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 12px 0 18px; }
.recip { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-variant-numeric: tabular-nums; font-size: 14.5px; }
.recip strong { color: var(--accent); }
.passage { padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); line-height: 1.9; }
.passage p { margin: 4px 0; }
.gen { margin-top: 16px; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); }
.gen-type { font-size: 13px; color: var(--ink-2); }
.gen h3 { font-size: 1rem; margin: 14px 0 6px; color: var(--accent); }
.gen-thesis { font-weight: 700; font-size: 1.05rem; }
.gen-points li { font-weight: 600; margin: 4px 0; }

/* ============ 第二批示意图 ============ */
.chart-extra { margin-top: 12px; }
.chart-extra > p { margin: 0; font-size: 13px; line-height: 1.6; }
.chart .chart { margin: .6em 0 0; padding: 12px 0 0; border: 0; border-top: 1px dashed var(--border); border-radius: 0; background: transparent; }
.fx .katex { font-size: 1em; }

/* 思维导图 */
.mm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.mm-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.mm-scroll { overflow-x: auto; padding-bottom: 4px; }
.mmap { display: inline-flex; align-items: center; padding: 4px 2px; }
.mm-node { position: relative; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; flex: none; padding: 6px 11px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13.5px; line-height: 1.5; max-width: 18em; }
.mm-node.lv0 { max-width: 9em; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 14px; font-weight: 800; font-size: 15px; background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); }
.mm-node.lv0 .mm-badge { white-space: normal; background: var(--surface); }
.mm-node.lv1 { max-width: 12.5em; font-weight: 700; border: 2px solid var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--surface)); }
.mm-node.lv2 { max-width: 15em; border-left: 3px solid var(--c, var(--accent)); }
.mm-node.lv3 { max-width: 19em; font-size: 13px; border-color: var(--border); color: var(--ink-2); }
.mm-text { display: flex; flex-direction: column; color: inherit; min-width: 0; }
a.mm-text:hover { text-decoration: none; color: var(--accent); }
.mm-label { overflow-wrap: anywhere; }
.mm-note { font-size: 11.5px; font-weight: 400; color: var(--ink-2); line-height: 1.4; }
.mm-badge { flex: none; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font: 600 11px/1.7 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mm-tog { flex: none; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); font: 700 12px/1 var(--mono); cursor: pointer; }
.mm-tog:hover { border-color: var(--accent-line); color: var(--accent); }
.mm-kids { list-style: none; margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; justify-content: center; position: relative; }
.mm-kids::before { content: ""; position: absolute; left: 0; top: 50%; width: 18px; border-top: 2px solid var(--c, var(--axis)); }
.mm-li { position: relative; display: flex; align-items: center; padding: 3px 0 3px 16px; }
.mm-li::before { content: ""; position: absolute; left: 0; top: 50%; width: 16px; border-top: 2px solid var(--c, var(--axis)); }
.mm-li::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--c, var(--axis)); }
.mm-li:first-child::after { top: 50%; }
.mm-li:last-child::after { bottom: 50%; }
.mm-li:only-child::after { display: none; }
.mm-kids-root::before { border-top-color: var(--axis); }
.mo { font-size: 14px; }
.mo-root { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-weight: 700; }
.mo-ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.mo-top { padding-left: 4px; margin-top: 6px; }
.mo-li { margin: 2px 0; }
.mo-lv1 { margin: 8px 0; padding: 4px 0 4px 10px; border-left: 3px solid var(--c, var(--accent)); }
.mo-lv1 > .mo-row { font-weight: 700; }
.mo-row { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; line-height: 1.5; }
.mo-row .mm-tog { margin-top: 1px; }
.mo-dot { flex: none; width: 22px; text-align: center; color: var(--muted); }
.mo-dot::before { content: "·"; font-weight: 700; }
.mo-text { display: flex; flex-direction: column; min-width: 0; color: var(--ink); }
a.mo-text { color: var(--ink); }
a.mo-text:hover { color: var(--accent); text-decoration: none; }
.mo-text .mm-note { font-weight: 400; }
.mo-lv3 .mo-text, .mo-lv2 .mo-text { font-size: 13.5px; }
.docmap > summary { flex-wrap: wrap; }
.docmap-k { font-weight: 700; }
.docmap .chart { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; box-shadow: none; }
.rpaths { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--border); }
.rpaths-title { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.rpath { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rpath-name { min-width: 5.5em; font-size: 13px; font-weight: 700; }
.rpath-steps { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rpath-arrow { color: var(--muted); font-weight: 700; }

/* 阶梯 */
.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lad { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 10px; align-items: start; margin-left: calc(var(--i, 0) * 7px); padding: 8px 12px 8px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.lad-rank { display: grid; place-items: center; min-height: 2.2em; border-radius: 8px; font: 700 14px/1 var(--font); background: var(--o3); color: var(--o3-ink); }
.lad-t3 .lad-rank { background: var(--o5); color: var(--o5-ink); }
.lad-t1 .lad-rank { background: var(--o1); color: var(--o1-ink); }
.lad-title { font-weight: 700; font-size: 14.5px; line-height: 1.5; }
.lad-why { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin-top: 2px; }
.lad-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lad-chip { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 2px 8px; border-radius: 7px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.lad-chip b { color: var(--ink); font-weight: 600; }
.lad-tail { margin: 0; font-size: 13px; color: var(--ink-2); }

/* 自查清单 */
.ck-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.ck-per { padding: 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; line-height: 1.8; }
.ck-done { margin-left: auto; font-variant-numeric: tabular-nums; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ck { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ck label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; line-height: 1.6; font-size: 14.5px; }
.ck input { flex: none; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.ck-no { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.ck:has(input:checked) { border-color: color-mix(in srgb, var(--good) 50%, transparent); background: color-mix(in srgb, var(--good-soft) 70%, var(--surface)); }
.ck:has(input:checked) .ck-q { color: var(--ink-2); }
.ck-guards { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 0 56px; font-size: 12px; }
.ck-k { color: var(--muted); }

/* 判定卡 */
.vd-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.vd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.vd-pill i, .vd-verdict i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--muted); flex: none; }
.vd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.vd { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; background: var(--surface); }
.vd-phrase { font-weight: 700; font-size: 14.5px; line-height: 1.5; }
.vd-verdict { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1.55; }
.vd-verdict i { margin-top: 1px; }
.vd-ev { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.vd-bad { border-left-color: var(--bad); } .vd-bad .vd-verdict { color: var(--bad-text); } .vd-pill.vd-bad i, .vd-bad .vd-verdict i { background: var(--bad); }
.vd-warn { border-left-color: var(--warn); } .vd-warn .vd-verdict { color: var(--warn-text); } .vd-pill.vd-warn i, .vd-warn .vd-verdict i { background: var(--warn); color: #0b0b0b; }
.vd-part { border-left-color: var(--serious); } .vd-part .vd-verdict { color: var(--ink); } .vd-pill.vd-part i, .vd-part .vd-verdict i { background: var(--serious); color: #0b0b0b; }
.vd-none { border-left-color: var(--deemph); } .vd-none .vd-verdict { color: var(--ink-2); } .vd-pill.vd-none i, .vd-none .vd-verdict i { background: var(--muted); }

/* 7 天计划 */
.wk { display: grid; grid-template-columns: 4.4em repeat(var(--slots, 3), minmax(0, 1fr)); gap: 4px; font-size: 12.5px; line-height: 1.55; }
.wk-corner { min-height: 1px; }
.wk-slot { padding: 2px 8px; font-weight: 700; color: var(--ink-2); font-size: 12px; }
.wk-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 4px; border-radius: 8px; background: var(--surface-2); font-family: var(--mono); }
.wk-day.is-key { background: var(--accent); color: var(--accent-ink); }
.wk-flag { font: 600 11px var(--font); padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent-ink) 22%, transparent); }
.wk-cell { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); overflow-wrap: anywhere; }
.wk-cell.is-key { border-color: var(--accent-line); background: var(--accent-soft); }
.wk-cell p { margin: 0; }

/* 证据可靠性 */
.ev-strip { display: flex; height: 26px; margin-bottom: 10px; border-radius: 6px; overflow: hidden; font-size: 12px; font-weight: 700; }
.ev-seg { display: grid; place-items: center; background: var(--c); color: var(--ci); box-shadow: inset -2px 0 0 var(--surface); white-space: nowrap; min-width: 2.6em; }
.ev-seg:last-child { box-shadow: none; }
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ev { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ev-chip { display: grid; place-items: center; align-self: start; min-height: 2em; border-radius: 7px; background: var(--c, var(--surface-2)); color: var(--ci, var(--ink-2)); font-weight: 700; font-size: 12.5px; }
.ev-concl { font-weight: 700; font-size: 14px; line-height: 1.5; }
.ev-grade { margin-left: 6px; color: var(--accent); font-weight: 600; }
.ev-rel, .ev-meta, .ev-limit { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin-top: 2px; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.ev-limit { color: var(--muted); }
.ev b { color: var(--ink); font-weight: 600; }

/* 时间轴（甘特） */
.gt-scroll { overflow-x: auto; }
.gt { min-width: 520px; font-size: 12.5px; }
.gt-row { display: grid; grid-template-columns: 8.6em minmax(0, 1fr); align-items: center; column-gap: 10px; min-height: 36px; }
.gt-label { color: var(--ink-2); line-height: 1.3; text-align: right; display: flex; flex-direction: column; }
.gt-label small { color: var(--muted); font-size: 11px; }
.gt-track { position: relative; height: 30px; margin-right: 12px; }
.gt-seg { position: absolute; top: 3px; bottom: 3px; background: var(--c); box-shadow: inset -2px 0 0 var(--surface); display: grid; place-items: center; overflow: hidden; cursor: default; }
.gt-seg:first-of-type { border-radius: 5px 0 0 5px; }
.gt-seg.is-ghost { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 55%, transparent) 0 6px, color-mix(in srgb, var(--c) 25%, transparent) 6px 12px); }
.gt-seg:hover, .gt-seg:focus { filter: brightness(1.08); outline: none; }
.gt-lab { font-size: 11px; font-weight: 700; color: var(--ink); background: color-mix(in srgb, var(--surface) 78%, transparent); padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.gt-mark { position: absolute; top: -8px; bottom: -8px; width: 0; border-left: 2px dashed var(--bad); pointer-events: none; }
.gt-row-marks { min-height: 22px; }
.gt-marklabels { position: relative; height: 20px; margin-right: 12px; }
.gt-marklabels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; font-size: 11.5px; font-weight: 700; color: var(--bad-text); }
.gt-row-axis { min-height: 22px; }
.gt .axis { margin-right: 12px; }

/* 对应矩阵 */
.rmx-scroll { overflow-x: auto; }
.rmx { display: grid; gap: 3px; min-width: 420px; font-size: 12.5px; }
.rmx-h { text-align: center; font: 600 11.5px var(--mono); color: var(--muted); padding: 2px 0; }
.rmx-r { color: var(--ink-2); text-align: right; padding-right: 8px; align-self: center; }
.rmx-c { min-height: 28px; border-radius: 5px; background: var(--surface-2); }
.rmx-c.is-on { display: grid; place-items: center; background: var(--c); color: var(--ci); font-weight: 700; cursor: default; }
.rmx-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 14px; font-size: 12.5px; color: var(--ink-2); }
.rmx-key b { font-family: var(--mono); margin-right: 6px; color: var(--ink); }

/* 公文样张 */
.sheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 6px; font-size: 13.5px; }
.sheet-id { font: 700 12px var(--mono); color: var(--accent); }
.paper { padding: 14px 16px 16px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; line-height: 1.7; }
.pl { display: flex; align-items: baseline; gap: 8px; }
.pl-text { flex: 1; min-width: 0; }
.pl-tag { order: 2; flex: none; display: inline-flex; align-items: center; gap: 4px; max-width: 46%; font-size: 11px; color: var(--accent); line-height: 1.35; text-align: right; }
.pl-tag i { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-style: normal; font-size: 10px; font-weight: 700; }
.pl-title .pl-text { text-align: center; font-weight: 700; font-size: 15px; letter-spacing: .08em; }
.pl-sub .pl-text { text-align: center; color: var(--ink-2); }
.pl-para .pl-text { text-indent: 2em; color: var(--ink-2); }
.pl-item .pl-text { padding-left: 2em; }
.pl-close .pl-text { text-indent: 2em; color: var(--ink-2); }
.pl-sign .pl-text, .pl-date .pl-text { text-align: right; }
.pl-title, .pl-salute { margin-top: 4px; }
.pl-sign { margin-top: 8px; }
.sheet-notes { margin: 8px 0 0; padding-left: 1.2em; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.gw3 { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.6; }

/* 比例结构条 */
.pb-total { font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.pb-bar { display: flex; height: 34px; border-radius: 6px; overflow: hidden; }
.pb-seg { display: grid; place-items: center; background: var(--c); box-shadow: inset -2px 0 0 var(--surface); min-width: 0; overflow: hidden; cursor: default; }
.pb-seg:last-child { box-shadow: none; }
.pb-seg span { font-size: 12px; font-weight: 700; color: var(--ink); background: color-mix(in srgb, var(--surface) 75%, transparent); padding: 0 5px; border-radius: 4px; white-space: nowrap; }
.pb-ranges { display: flex; margin-top: 4px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pb-ranges span { min-width: 0; text-align: center; }
.pb-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 12px; }
.pb-card { padding: 8px 12px; border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: 8px; background: var(--surface); }
.pb-card-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; font-weight: 700; font-size: 13.5px; }
.pb-card-h span { font-weight: 500; color: var(--muted); font-size: 12px; }
.pb-card ol { margin: 4px 0 0; padding-left: 1.3em; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.ess-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.chip-static { cursor: default; }
.chip-static:hover { background: var(--surface); }

/* 骨架卡 */
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.cc { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); }
.cc-head { display: flex; align-items: baseline; gap: 8px; font-size: 14.5px; }
.cc-head a { font-weight: 700; }
.cc-id { font: 700 12px var(--mono); color: var(--accent); }
.cc-when { font-size: 12.5px; color: var(--ink-2); }
.cc-when b { color: var(--ink); font-weight: 600; }
.cc-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; counter-reset: cc; }
.cc-steps li { position: relative; padding: 4px 8px 4px 30px; border-radius: 7px; background: var(--surface-2); font-size: 13px; line-height: 1.5; counter-increment: cc; }
.cc-steps li::before { content: counter(cc); position: absolute; left: 7px; top: 5px; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.cc-note { font-size: 12px; color: var(--ink-2); line-height: 1.55; padding-top: 2px; }
.cc-cover { margin-top: auto; padding-top: 4px; font-size: 12px; color: var(--muted); }

/* 并行泳道 */
.lanes { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 10px; }
.lane { padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.lane-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.lane-kicker { font-size: 12px; color: var(--muted); font-weight: 600; }
.lane-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.lane-steps li { position: relative; display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.lane-steps li:not(:last-child)::after { content: "↓"; position: absolute; left: 18px; bottom: -15px; color: var(--muted); font-weight: 700; font-size: 12px; line-height: 1; }
.lane-k { font-weight: 700; font-size: 12.5px; color: var(--accent); }
.lane-v { font-size: 13px; line-height: 1.55; }

/* 信号行 */
.sig { display: flex; flex-direction: column; gap: 4px; }
.sig-row { display: grid; grid-template-columns: minmax(6em, 10em) minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 13px; }
.sig-head { border: 0; background: transparent; padding-block: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.sig-row.tone-accent { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.sig-row.tone-warn { border-color: color-mix(in srgb, var(--warn) 70%, transparent); background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.sig-tag { font-weight: 700; line-height: 1.45; }
.sig-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sig-res { display: flex; align-items: baseline; gap: 6px; line-height: 1.55; }
.sig-res > i { flex: none; font-style: normal; color: var(--accent); font-weight: 700; }
.sig-res small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.four-checks { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.fc-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.fc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fc { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 8px; background: var(--surface); font-size: 12.5px; }
.fc strong { font-size: 14px; }
.fc-note { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-2); }

/* 漏斗 */
.fnl-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.fnl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fnl-l { width: var(--w); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px; border-radius: 8px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); font-size: 13px; text-align: center; flex-wrap: wrap; }
.fnl-no { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.fnl-side { display: flex; flex-direction: column; gap: 6px; }
.fnl-card { padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 13px; }
.fnl-card p { margin: 2px 0 0; color: var(--ink-2); line-height: 1.6; }

/* 类比、逻辑、论证、资料关系 */
.mini-flow { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.mini-flow li { position: relative; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.mini-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -14px; color: var(--muted); }
.mini-flow span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.an { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.an-rel { font-weight: 700; font-size: 13.5px; }
.an-tpl { font-size: 13px; color: var(--accent); font-weight: 600; }
.an-ex { font-size: 12px; color: var(--muted); }
.lg-scroll { overflow-x: auto; }
.lgc { display: flex; flex-direction: column; gap: 3px; min-width: 560px; }
.lg-row { display: grid; grid-template-columns: minmax(8em, 1fr) minmax(7em, 1fr) minmax(10em, 1.4fr) minmax(9em, 1.2fr); gap: 8px; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.lg-head { background: transparent; font-size: 12px; font-weight: 700; color: var(--muted); padding-block: 0; }
.lg-name { font-weight: 600; }
.lg-f { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.lg-f small { color: var(--ink-2); font-size: 11.5px; }
.lg-ok .katex { color: var(--good-text); }
.lg-bad .katex { color: var(--bad-text); }
.lg4 { margin-top: 12px; }
.lg4-title { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.lg4-grid { display: grid; grid-template-columns: 5em repeat(2, minmax(0, 12em)); gap: 4px; align-items: stretch; }
.lg4-h { display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.lg4-c { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 8px; font-size: 13px; }
.lg4-c.ok { background: var(--good-soft); color: var(--good-text); }
.lg4-c.no { background: var(--bad-soft); color: var(--bad-text); }
.lg4-c .katex { color: var(--ink); }
.lg4 p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; }
.arg { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr) auto minmax(0, 1fr); gap: 8px; align-items: start; }
.arg-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.arg-box { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 3.6em; padding: 8px 10px; border: 2px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); text-align: center; }
.arg-box strong { font-size: 15px; }
.arg-box span { font-size: 12px; color: var(--ink-2); }
.arg-arrow { align-self: start; padding-top: 1.1em; color: var(--accent); font-size: 20px; font-weight: 700; }
.arg-ops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.arg-op { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; padding: 6px 8px; border-radius: 8px; border-left: 4px solid var(--c); background: var(--surface-2); font-size: 12.5px; line-height: 1.5; }
.arg-kind { font-weight: 700; }
.arg-op small { margin-left: auto; color: var(--muted); font-family: var(--mono); }
.zr-scroll { overflow-x: auto; }
.zr { display: grid; grid-template-columns: minmax(7em, 1fr) minmax(12em, 1.6fr) minmax(7em, 1fr); gap: 8px; align-items: center; min-width: 480px; }
.zr-node { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 12px; border: 2px solid var(--accent-line); background: var(--accent-soft); font-size: 13px; }
.zr-sym { font: 700 22px/1.2 var(--mono); color: var(--accent); }
.zr-edge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; font-size: 13px; }
.zr-h { background: linear-gradient(var(--axis), var(--axis)) center / 100% 2px no-repeat; }
.zr-v { background: linear-gradient(var(--axis), var(--axis)) center / 2px 100% no-repeat; min-height: 4.4em; justify-content: center; }
.zr-lab { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 8px; padding: 2px 8px; border-radius: 6px; background: var(--surface); }
.zr-lab b { font-size: 11.5px; color: var(--accent); white-space: nowrap; }
.zr-center { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 10px; border: 1px dashed var(--accent-line); font-size: 12.5px; }
.rules { margin: 0; padding-left: 1.3em; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.rules b { color: var(--ink); }
.baodi-x { display: flex; flex-direction: column; gap: 4px; }
.baodi-x .formula { margin: 0; }

/* 申论题目总览 */
.qov { display: flex; flex-direction: column; gap: 6px; }
.qov-row { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); align-items: center; gap: 10px; }
.qov-year { font: 600 13px var(--mono); color: var(--ink-2); }
.qov-bar { display: flex; height: 46px; border-radius: 7px; overflow: hidden; }
.qov-q { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 0 8px; min-width: 0; background: var(--c); color: var(--ci); box-shadow: inset -2px 0 0 var(--surface); line-height: 1.25; overflow: hidden; }
.qov-q:last-child { box-shadow: none; }
.qov-q:hover, .qov-q:focus { filter: brightness(1.08); text-decoration: none; }
.qov-n { font: 700 12px var(--mono); }
.qov-s { font-size: 12px; font-weight: 700; }
.qov-s::after { content: " 分"; font-weight: 400; }
.qov-t { font-size: 11px; opacity: .9; }

/* 题目页：推理链、思路图、热区、原卷链接、优先级分布 */
.chainflow { margin: 10px 0 4px; }
.chainflow figcaption { font-weight: 700; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.chainflow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.chainflow li { position: relative; display: flex; align-items: baseline; gap: 6px; flex: 1 1 160px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); font-size: .95em; line-height: 1.55; }
.chainflow li:not(.is-last)::after { content: "→"; position: absolute; right: -17px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.chainflow li.is-last { border-color: var(--accent-line); background: var(--accent-soft); }
.cf-no { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.pdf-link { font-weight: 600; white-space: nowrap; }
.prbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 2px 0; font-size: 12.5px; color: var(--ink-2); }
.prbar-k { font-weight: 700; }
.prbar-track { flex: 1 1 260px; display: flex; height: 22px; border-radius: 6px; overflow: hidden; min-width: 0; }
.prbar-seg { display: grid; place-items: center; background: var(--c); color: var(--ci); font-size: 11.5px; font-weight: 700; box-shadow: inset -2px 0 0 var(--surface); min-width: 1.6em; }
.prbar-seg:last-child { box-shadow: none; }
.prbar-seg:hover { text-decoration: none; filter: brightness(1.08); }
.prbar-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.prbar-legend span { display: inline-flex; align-items: center; gap: 4px; }
.prbar-legend i { width: 10px; height: 10px; border-radius: 3px; }
.think { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.think-title { font-weight: 700; margin-bottom: 8px; }
.tm { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 8px 16px; }
.tm-step { position: relative; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); font-size: 12.5px; line-height: 1.55; min-width: 0; }
.tm-step:not(:last-child)::after { content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.tm-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; font-size: 13.5px; }
.tm-k { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.tm-body p { margin: 0; }
.tm-body ul { margin: 0; padding-left: 1.1em; }
.tm-body li { margin: 1px 0; overflow-wrap: anywhere; }
.tm-chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px !important; }
.ph { margin-top: 12px; }
.ph-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.ph-title .muted { font-weight: 400; font-size: 12px; }
.ph-row { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); align-items: center; gap: 8px; margin: 3px 0; }
.ph-label { font-size: 12px; color: var(--ink-2); }
.ph-track { display: flex; gap: 2px; height: 24px; }
.ph-cell { min-width: 6px; padding: 0; border: 0; border-radius: 3px; background: var(--surface-3); color: var(--ink-2); font: 600 10.5px var(--mono); cursor: pointer; overflow: hidden; }
.ph-cell:hover, .ph-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ph-scale { display: flex; align-items: center; gap: 2px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.ph-scale i { width: 18px; height: 10px; }
.ph-scale span { margin: 0 4px; }
.para.flash { animation: flash 1.6s ease-out; }

/* 手机外壳：底部导航、回到顶部、字号、滑动提示 */
.bottomnav { display: none; }
.fs-wrap { position: relative; flex: none; }
.fs-btn { font-size: 14px; font-weight: 700; }
.fs-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); white-space: nowrap; }
.fs-k { font-size: 12.5px; color: var(--ink-2); margin-right: 2px; }
.fs-val { min-width: 3.2em; text-align: center; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; }
.to-top { position: fixed; z-index: 25; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-size: 20px; cursor: pointer; }
.to-top:hover { border-color: var(--accent-line); color: var(--accent); }
.scroll-hint { margin: 1em 0 -0.7em; text-align: right; font-size: 11.5px; color: var(--muted); }
.chart .scroll-hint, .think .scroll-hint, .mm-wrap .scroll-hint { margin: 0 0 4px; }
.can-scroll:not(.at-end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), rgba(0, 0, 0, .25)); mask-image: linear-gradient(to right, #000 calc(100% - 28px), rgba(0, 0, 0, .25)); }
.nav-app { margin: 6px 0 0; }
.nav-app > summary { padding: 5px 10px; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 12.5px; }
.nav-app > summary:hover { background: var(--surface-2); color: var(--ink); }
.nav-app ul { list-style: none; margin: 2px 0 0; padding: 0 0 0 8px; }

/* ============ 笔记（手写笔 / 手指涂画） ============ */
.main { position: relative; }
.ink-layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 6; overflow: visible; pointer-events: none; }
.ink-layer.is-on { pointer-events: auto; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; box-shadow: inset 0 0 0 2px var(--accent-line); border-radius: 6px; }
.ink-layer.is-on.is-erase { cursor: cell; }
.ink-layer.is-hidden .ink-hl, .ink-layer.is-hidden .ink-pen { display: none; }
.ink-hl { opacity: var(--hl-alpha, .4); }
/* 笔迹＝圆头圆角描边；内容块缩放时笔宽保持不变 */
.ink-layer path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* 书写中的实时画布：与屏幕同大，盖在页面上、顶栏之下 */
.ink-live { position: fixed; left: 0; top: 0; z-index: 29; pointer-events: none; }
.ink-ring { fill: color-mix(in srgb, var(--surface) 40%, transparent); stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 3 3; }
body.inking .main { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
body.inking .to-top { display: none; }

.ink-fab { position: fixed; z-index: 44; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px 0 13px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); font: 700 14px var(--font); cursor: pointer; }
.ink-fab:hover { filter: brightness(1.07); }
.ink-fab .ink-ico { width: 18px; height: 18px; }
.ink-fab-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent-ink); color: var(--accent); font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.ink-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ink-bar { position: fixed; z-index: 46; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: max-content; max-width: min(820px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 97%, transparent); backdrop-filter: saturate(1.4) blur(10px); box-shadow: 0 6px 28px rgba(0, 0, 0, .18); }
.ink-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ink-grow { flex: 1 1 0; min-width: 4px; }
.ink-sep { width: 1px; height: 22px; background: var(--border-strong); flex: none; }
.ink-segs, .ink-tools { display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--surface-2); }
.ink-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 34px; min-width: 34px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-2); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; }
.ink-btn:hover:not(:disabled) { color: var(--ink); background: var(--surface-3); }
.ink-btn.on { background: var(--surface); border-color: var(--accent-line); color: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.ink-btn:disabled { opacity: .35; cursor: default; }
.ink-btn.is-armed { background: var(--bad-soft); color: var(--bad-text); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.ink-done { background: var(--accent); color: var(--accent-ink); }
.ink-done:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); filter: brightness(1.07); }
.ink-colors { display: inline-flex; align-items: center; gap: 6px; padding: 0 2px; }
.ink-colors.is-dim { opacity: .45; }
.ink-sw { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.ink-sw.on { box-shadow: 0 0 0 2px var(--accent); }
.ink-size { min-width: 52px; }
.ink-dot { display: inline-block; border-radius: 50%; background: currentColor; }
.ink-hint { font-size: 12px; color: var(--muted); padding: 0 2px; }
.ink-toast { position: fixed; z-index: 47; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom, 0px)); max-width: min(560px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--page); font-size: 13.5px; line-height: 1.6; box-shadow: var(--shadow); }
.ink-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.ink-list a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); }
.ink-list a:hover { text-decoration: none; border-color: var(--accent-line); }
.ink-list small { color: var(--muted); font-size: 12px; }

/* ============ 响应式 ============ */
@media (max-width: 1439px) {
  .doc-layout { grid-template-columns: minmax(0, 880px); }
  .toc-rail { display: none; }
  .toc-mobile { display: block; }
}
@media (max-width: 1023px) {
  .menu-btn { width: 38px; padding: 0; }
  .menu-label { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; top: var(--top-off); left: 0; width: min(300px, 86vw); height: calc(100vh - var(--top-off)); padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-102%); transition: transform .18s ease; box-shadow: var(--shadow); }
  body.drawer-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: var(--top-off) 0 0 0; z-index: 35; background: rgba(0, 0, 0, .35); }
  .main { padding-block: 20px 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .brand-text { display: none; }
}
@media (max-width: 720px) {
  body { font-size: calc(16px * var(--fs, 1)); }
  .prose { font-size: calc(16.5px * var(--fs, 1)); line-height: 1.85; }
  .prose h2 { font-size: 1.32rem; margin-top: 2em; }
  .prose h3 { font-size: 1.12rem; }
  .topbar { gap: 8px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
  .tabs { margin-left: 0; }
  .tabs a { padding: 6px 8px; font-size: 14px; }
  .search-input { width: 100%; }
  .page-head h1, .doc-title { font-size: 1.55rem; }
  .doc-meta > span + span::before { margin-right: 8px; }
  .hero h1 { font-size: 1.9rem; }
  .summary { padding: 16px 16px; }
  .stem, .qgroup { padding-left: 16px; padding-right: 16px; }
  .qrow { padding: 12px 14px; }
  .table-wrap th, .table-wrap td { padding: 9px 11px; }
  .subjects, .triple { grid-template-columns: minmax(0, 1fr); }
  .bars { --label-w: 7.2em; }
  .track, .axis, .reflabels { margin-right: 4em; }
  .cardgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { flex-direction: column; gap: 14px; }
  .flow-step { flex-basis: auto; }
  .flow-step:not(:last-child)::after { content: "↓"; right: auto; left: 18px; top: auto; bottom: -19px; transform: none; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-next { text-align: left; }
  .qmeta { margin-left: 0; }
  .filters { position: static; }
  .chart { padding: 12px 12px 10px; }
  .main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .mm-row { grid-template-columns: 2.8em minmax(0, 1fr); }
  .mm-total { display: none; }
  .yearline li { grid-template-columns: 3.6em minmax(0, 1fr); }
  .yearline::before { left: 2.4em; }
}
@media (max-width: 1023px) {
  .tm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-step:first-child { grid-column: 1 / -1; }
  .tm-step::after { display: none; }
}
@media (max-width: 720px) {
  /* 底部导航承载科目切换；顶栏保留侧栏开关。 */
  .tabs { display: none; }
  .top-search { display: none; }
  .search-link { display: inline-grid; margin-left: auto; }
  .brand-text { display: inline; font-size: 15px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: max(6px, env(safe-area-inset-left, 0px)); padding-right: max(6px, env(safe-area-inset-right, 0px));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-top: 1px solid var(--border);
  }
  .bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 56px; border: 0; background: transparent; color: var(--ink-2); font: 600 11.5px/1.2 var(--font); cursor: pointer; }
  .bn-item:hover { text-decoration: none; }
  .bn-ico { font-size: 17px; line-height: 1.2; }
  .bn-item.on { color: var(--accent); }
  .bn-item.on .bn-ico { transform: translateY(-1px); }
  .sidebar { bottom: 0; height: auto; }
  .to-top { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); }
  .lad { margin-left: 0; }
  .sig-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sig-head { display: none; }
  .fc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fnl-wrap { grid-template-columns: minmax(0, 1fr); }
  .lanes { grid-template-columns: minmax(0, 1fr); }
  .arg { grid-template-columns: minmax(0, 1fr); }
  .arg-arrow { padding: 0; text-align: center; transform: rotate(90deg); }
  .ev { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ev-chip { justify-self: start; min-height: 1.7em; padding: 0 10px; }
  .wk { display: flex; flex-direction: column; gap: 4px; }
  .wk-corner, .wk-slot { display: none; }
  .wk-day { flex-direction: row; justify-content: space-between; margin-top: 8px; padding: 6px 10px; }
  .wk-cell::before { content: attr(data-slot); display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
  .chainflow ol { flex-direction: column; gap: 14px; }
  .chainflow li { flex-basis: auto; }
  .chainflow li:not(.is-last)::after { content: "↓"; right: auto; left: 16px; top: auto; bottom: -17px; transform: none; }
  .tm { grid-template-columns: minmax(0, 1fr); }
  .qov-t { display: none; }
  .qov-q { padding: 0 4px; }
  .pl-tag { max-width: 40%; }
  .mm-count { margin-left: 0; width: 100%; }
  /* 笔记：手机上工具条贴底（替代底部导航），按钮只留图标 */
  body.inking .bottomnav { display: none; }
  .ink-fab { bottom: calc(124px + env(safe-area-inset-bottom, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); }
  .ink-bar { left: 0; right: 0; bottom: 0; transform: none; width: auto; max-width: none; border-radius: 14px 14px 0 0; padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  .ink-row { flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .ink-row-b .ink-lbl, .ink-hide .ink-lbl, .ink-clear .ink-lbl { display: none; }
  .ink-row-b .ink-size .ink-lbl { display: inline; }
  .ink-row-b .ink-sep { display: none; }
  .ink-hint { display: none; }
  .ink-btn { padding: 0 6px; flex: none; }
  .ink-colors { gap: 5px; flex: none; }
  .ink-sw { width: 24px; height: 24px; }
  .ink-size { min-width: 42px; }
  .ink-toast { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
  .gt { min-width: 440px; }
  .gt-row { grid-template-columns: 6.6em minmax(0, 1fr); column-gap: 6px; }
}
@media (max-width: 420px) {
  .cardgrid { grid-template-columns: minmax(0, 1fr); }
  .brand-text { display: none; }
  .qov-s::after { content: ""; }
}
/* 在线页面：外框已经按安全区留出顶部空白，粘性顶栏贴在安全区下沿 */
html.mode-artifact .topbar { top: env(safe-area-inset-top, 0px); padding-top: 0; height: 58px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .sidebar, .toc-rail, .toc-mobile, .pager, .chart-foot button, .filters, .tabs-local, .practice-bar, .btn, .btn-ghost, .bottomnav, .to-top, .scroll-hint, .mm-tools, .ink-fab, .ink-bar, .ink-toast, .ink-live { display: none !important; }
  .ink-layer { box-shadow: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .chart, .table-wrap { break-inside: avoid; }
}
@media (forced-colors: active) {
  .bar, .seg, .tseg, .mm-blk, .dot { forced-color-adjust: none; }
}
/* 原题完整页：保持原卷版面，手机可放大横向查看。 */
.source-pages { margin: 14px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.source-pages > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-weight: 650; font-size: 14.5px; }
.source-pages > summary::-webkit-details-marker { display: none; }
.source-pages > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin: 0 4px 0 2px; }
.source-pages[open] > summary::before { transform: rotate(45deg); }
.source-pages > div { padding: 0 14px 14px; }
.source-pages > div > .muted { margin: 0 0 4px; font-size: 13px; }
.source-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 10px; }
.source-controls select { height: 30px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.source-scroll { overflow: auto; max-height: 85vh; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.source-image { display: block; width: 100%; height: auto; max-width: 1100px; margin: auto; }
.source-image.zoom { width: 1100px; min-width: 1100px; max-width: none; }
.shared-material { margin-bottom: 16px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent-line) 45%, transparent); }
.shared-material h2 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 800; }
.shared-material .stem-text { white-space: pre-wrap; }
.opt[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Reviewed teaching images: lazy selection, readable steps, and scrollable detail. */
.visual-gallery { margin: 18px 0; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); min-width: 0; }
.visual-gallery > summary { padding: 14px 16px; cursor: pointer; font-weight: 700; color: var(--accent); }
.visual-selector { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 16px 10px; }
.visual-selector select { max-width: 100%; min-width: 0; flex: 1; padding: 8px; background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 8px; }
.generated-visual { padding: 0 16px 16px; min-width: 0; }
.generated-visual h4 { margin: 8px 0; }
.generated-visual p { overflow-wrap: anywhere; line-height: 1.8; }
.visual-kind { font-size: 12px; font-weight: 700; color: var(--accent); }
.visual-image-frame { border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: auto; max-height: 75vh; margin: 10px 0; }
.visual-image-frame img { display: block; width: 100%; height: auto; max-width: none; }
.visual-image-frame img[hidden] { display: none; }
.visual-image-frame.is-expanded img { width: max(100%, 1500px); }
.visual-image-frame.is-expanded { overscroll-behavior: contain; }
.visual-load-error { padding: 16px; color: #333; }
.visual-explanation { margin-top: 12px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.visual-explanation p { margin: 6px 0; animation: visual-step-in .25s ease-out; }
.visual-step-label { font-size: 12px; font-weight: 700; color: var(--accent); }
.visual-boundary { border-top: 1px solid var(--border); padding-top: 10px; }
.visual-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.visual-controls button { min-height: 42px; }
.visual-counter { font-variant-numeric: tabular-nums; color: var(--muted); }
.visual-controls button:disabled { opacity: .45; cursor: default; }
@keyframes visual-step-in { from { opacity: .3; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.lesson-still .visual-explanation p { animation: none; }
@media (prefers-reduced-motion: reduce) { .visual-explanation p { animation: none; } }
@media (max-width: 480px) { .generated-visual { padding: 0 10px 12px; } .visual-explanation { padding: 10px; } .visual-controls { gap: 4px; } }

/* ---------- 必背清单：标签、遮住答案自测、复述打卡、首页安排 ---------- */
.tag { display: inline-block; margin: 0 .3em; padding: .05em .55em; border-radius: 999px; font-size: .62em; font-weight: 800; line-height: 1.55; letter-spacing: .04em; vertical-align: .2em; white-space: nowrap; }
.prose td .tag, .prose li .tag, .prose p .tag, .dl-no .tag, .bb-plan .tag, .bb-today .tag, .bb-feature .tag { font-size: .78em; vertical-align: .08em; }
.t-must { background: var(--sl); color: #fff; }
.t-should { background: var(--xc); color: #fff; }
.t-know { background: var(--surface-3); color: var(--ink-2); }
.t-method { background: var(--warn-soft); color: var(--warn-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent); }
:root[data-theme="dark"] .t-must, :root[data-theme="dark"] .t-should { color: #0b0b0b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-must, :root:not([data-theme="light"]) .t-should { color: #0b0b0b; } }
.doc-title .tag { font-size: .4em; vertical-align: .55em; }
/* 秒杀手册：可靠性标签、折叠解法、可勾选清单、今日卡片 */
.t-strict { background: var(--good-soft); color: var(--good-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 40%, transparent); }
.t-exp { background: var(--bad-soft); color: var(--bad-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 35%, transparent); }
.prose details.hb-ans { margin: .6em 0 1.1em; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.prose details.hb-ans > summary { cursor: pointer; list-style: none; padding: 8px 14px; font-weight: 750; color: var(--good-text); }
.prose details.hb-ans > summary::-webkit-details-marker { display: none; }
.prose details.hb-ans > summary::before { content: "▸ "; }
.prose details.hb-ans[open] > summary::before { content: "▾ "; }
.prose details.hb-ans[open] > summary { border-bottom: 1px dashed var(--border); }
.prose details.hb-ans > :not(summary) { margin-left: 14px; margin-right: 14px; }
.prose li.hb-todo { list-style: none; margin-left: -1.25em; }
.prose li.hb-todo.is-done { color: var(--ink-2); }
.hb-check { width: 1.1em; height: 1.1em; margin: 0 .45em 0 0; vertical-align: -.15em; accent-color: var(--bb); cursor: pointer; }
.hb-today-list { display: grid; gap: 6px; line-height: 1.8; font-size: 14.5px; }
.hb-today-note { font-weight: 700; color: var(--bad-text); }
.hb-today .bb-hub-actions { margin-top: 14px; }

.doc-meta > .bb-rev { margin-left: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.doc-meta > .bb-rev::before { content: none; }
.bb-rev-info { color: var(--ink-2); }
.bb-rev-btn.is-on { color: var(--good-text); border-color: color-mix(in srgb, var(--good) 45%, transparent); }

.bb-recite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 14px 0 18px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--bb) 35%, transparent); border-radius: 12px; background: var(--bb-soft); font-size: 13.5px; }
.bb-recite-k { font-weight: 800; color: var(--bb); letter-spacing: .04em; }
.bb-recite .btn-ghost { background: var(--surface); }
.bb-recite-toggle.is-on { color: var(--bb); border-color: color-mix(in srgb, var(--bb) 50%, transparent); }
.bb-recite-count { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 650; }
.bb-recite-tip { margin-left: auto; font-size: 12.5px; }
.recite .rc:not(.shown) { color: transparent !important; background: var(--rc); border-radius: 5px; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.recite .rc:not(.shown) * { visibility: hidden; }
.recite .table-wrap td.rc:not(.shown) { background: var(--rc) !important; background-clip: padding-box; }
.recite .rc:not(.shown):hover { background: color-mix(in srgb, var(--rc) 75%, var(--bb)); }
.recite .table-wrap td.rc:not(.shown):hover { background: color-mix(in srgb, var(--rc) 75%, var(--bb)) !important; }
.recite .rc.shown { background: var(--rc-shown); border-radius: 4px; }
.recite .table-wrap td.rc.shown { background: var(--rc-shown) !important; }
.recite .table-wrap tbody tr:hover td.rc:not(.shown) { background: var(--rc) !important; }

.bb-related { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--bb-soft); font-size: 13px; }
.bb-related-k { font-weight: 800; color: var(--bb); margin-right: 4px; letter-spacing: .04em; }
.bb-related .chip { background: var(--surface); }
.bb-related-all { margin-left: auto; font-weight: 650; color: var(--bb); }

.nav-sub { display: block; padding: 8px 10px 2px; font-size: 11.5px; font-weight: 750; letter-spacing: .1em; color: var(--muted); }
.nav-sec[data-sec="bb"] a.on { background: var(--bb-soft); color: var(--bb); }
.nav-sec[data-sec="bb"] a.on .nav-no { color: var(--bb); }

.bb-kicker { color: var(--bb); }
.bb-hub-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 16px; }
.bb-hub .btn-primary, .bb-feature .btn-primary { background: var(--bb); border-color: var(--bb); color: #fff; }
:root[data-theme="dark"] .bb-hub .btn-primary, :root[data-theme="dark"] .bb-feature .btn-primary { color: #0b0b0b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bb-hub .btn-primary, :root:not([data-theme="light"]) .bb-feature .btn-primary { color: #0b0b0b; } }
.bb-today { padding: 18px 22px; border: 1px solid color-mix(in srgb, var(--bb) 35%, transparent); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.bb-today h2 { margin-top: 0; }
.bb-today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.bb-today-grid p { margin: 4px 0 0; line-height: 1.8; }
.bb-plan-k { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 6px; background: var(--bb-soft); color: var(--bb); font-size: 12.5px; font-weight: 800; letter-spacing: .06em; }
.bb-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bb-plan-row { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 6px 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.bb-plan-row.is-now { border-color: color-mix(in srgb, var(--bb) 55%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bb) 18%, transparent); }
.bb-plan-row.is-past { opacity: .62; }
.bb-plan-when { font-weight: 750; line-height: 1.7; }
.bb-now { margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--bb); color: var(--surface); font-size: 12px; font-weight: 800; }
.bb-plan-what { display: grid; gap: 4px; line-height: 1.75; font-size: 14.5px; }
.bb-card.is-due { border-color: color-mix(in srgb, var(--bb) 55%, transparent); }
.bb-card .dl-no { color: var(--bb); align-items: center; }
.bb-card-tags .tag { margin: 0 0 0 4px; }
.bb-howto { margin: 0; padding-left: 1.2em; line-height: 1.85; color: var(--ink-2); }
.dcard-bb { border-color: color-mix(in srgb, var(--bb) 40%, transparent); background: var(--bb-soft); }
.dcard-bb .dl-no { color: var(--bb); }
.bb-qlinks ul { margin: 6px 0 0; padding-left: 1.2em; }
.bb-qlinks li { line-height: 1.75; }

.bb-feature { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 26px 0 0; padding: 20px 24px; border: 1px solid color-mix(in srgb, var(--bb) 38%, transparent); border-radius: 18px; background: linear-gradient(135deg, var(--bb-soft), var(--surface) 70%); box-shadow: var(--shadow); }
.bb-feature-main { flex: 1 1 360px; min-width: 0; }
.bb-feature .subj-k { --c: var(--bb); --cs: var(--surface); }
.bb-feature h2 { margin: 10px 0 6px; font-size: 1.35rem; }
.bb-feature-learn { margin: 0 0 6px; line-height: 1.8; }
.bb-feature .muted { margin: 0; font-size: 13px; }
.bb-feature-go { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 720px) {
  .bb-today-grid { grid-template-columns: minmax(0, 1fr); }
  .bb-plan-row { grid-template-columns: minmax(0, 1fr); }
  .bb-recite-tip { margin-left: 0; }
  .doc-meta > .bb-rev { margin-left: 0; }
  .bb-feature { padding: 16px; }
}
@media print {
  .bb-recite, .bb-related { display: none !important; }
  .recite .rc, .recite .table-wrap td.rc { color: inherit !important; background: none !important; }
  .recite .rc * { visibility: visible !important; }
}
.bb-prose td.nw, .bb-prose th.nw { white-space: nowrap; }
.summary.recite li.rc:not(.shown)::before { visibility: visible; }
