/* 2026 CV 面经 · 全站样式（面经卡片体系；与 SubEx 架构同构但视觉全新）
   深浅双主题：变量在 :root（浅色）与下方两处深色块中各定义一遍；
   dark 生效路径有两条——显式 :root[data-theme="dark"] 与 auto 跟随系统的
   @media (prefers-color-scheme: dark)，后者不排除未设置状态的兜底语义。 */

:root {
  --bg: #f5f6f9;
  --card: #ffffff;
  --text: #23272f;
  --muted: #5c6370;
  --faint: #8b91a0;
  --line: #e4e7ee;
  --line-soft: #edeff4;
  --accent: #4263eb;
  --accent-deep: #3b5bdb;
  --accent-tint: #eef2ff;
  /* 频率配色：必考 玫红 / 高频 橙 / 中频 蓝 / 低频 灰 */
  --freq-must: #d6336c;
  --freq-must-bg: #fdf0f5;
  --freq-hot: #e8590c;
  --freq-hot-bg: #fdf1e7;
  --freq-mid: #1971c2;
  --freq-mid-bg: #eaf3fb;
  --freq-low: #737b8a;
  --freq-low-bg: #f1f2f5;
  --ok: #0ca678;
  --ok-bg: #f0faf6;
  --fu: #7048e8;
  --fu-bg: #f7f5fe;
  --warn: #c92a2a;
  --warn-bg: #fdf3f3;
  --gold: #e67700;
  --gold-bg: #fffaeb;
  --slate: #57606a;
  --slate-bg: #f7f9fb;
  --code-bg: #f6f8fa;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --sel-bg: #dbe4ff;
  --th-fg: #2b3a67;
  --inline-code: #364fc7;
  --stars-off: #d8dbe2;
  /* highlight.js token 配色（GitHub Light 变体） */
  --hl-comment: #857f74;
  --hl-keyword: #cf222e;
  --hl-string: #0a3069;
  --hl-number: #0550ae;
  --hl-title: #8250df;
  --hl-attr: #953800;
  --hl-type: #116329;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23, 30, 51, 0.05), 0 4px 16px rgba(23, 30, 51, 0.06);
  --shadow-lift: 0 4px 10px rgba(23, 30, 51, 0.08), 0 12px 32px rgba(23, 30, 51, 0.1);
  --sans: "MiSans VF", "MiSans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: "Maple Mono CN", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  --bg: #101318;
  --card: #191d24;
  --text: #d7dade;
  --muted: #9aa1ad;
  --faint: #6f7684;
  --line: #2a303a;
  --line-soft: #22272f;
  --accent: #748ffc;
  --accent-deep: #91a0ff;
  --accent-tint: #232946;
  --freq-must: #f783ac;
  --freq-must-bg: #2c1a23;
  --freq-hot: #ffa94d;
  --freq-hot-bg: #2d2114;
  --freq-mid: #74c0fc;
  --freq-mid-bg: #16222d;
  --freq-low: #9aa3b2;
  --freq-low-bg: #21252d;
  --ok: #38d9a9;
  --ok-bg: #11271e;
  --fu: #b197fc;
  --fu-bg: #221c36;
  --warn: #ff8787;
  --warn-bg: #2d1a1a;
  --gold: #ffd43b;
  --gold-bg: #2b2312;
  --slate: #adb5bd;
  --slate-bg: #1b2027;
  --code-bg: #0e1217;
  --nav-bg: rgba(16, 19, 24, 0.9);
  --sel-bg: #33406e;
  --th-fg: #c9d3f5;
  --inline-code: #a5b4fc;
  --stars-off: #3a4150;
  /* highlight.js token 配色（GitHub Dark 变体） */
  --hl-comment: #8b949e;
  --hl-keyword: #ff7b72;
  --hl-string: #a5d6ff;
  --hl-number: #79c0ff;
  --hl-title: #d2a8ff;
  --hl-attr: #ffa657;
  --hl-type: #7ee787;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lift: 0 4px 10px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* auto 模式：未显式选浅色时跟随系统（显式 light 由上面的属性选择器排除） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101318;
    --card: #191d24;
    --text: #d7dade;
    --muted: #9aa1ad;
    --faint: #6f7684;
    --line: #2a303a;
    --line-soft: #22272f;
    --accent: #748ffc;
    --accent-deep: #91a0ff;
    --accent-tint: #232946;
    --freq-must: #f783ac;
    --freq-must-bg: #2c1a23;
    --freq-hot: #ffa94d;
    --freq-hot-bg: #2d2114;
    --freq-mid: #74c0fc;
    --freq-mid-bg: #16222d;
    --freq-low: #9aa3b2;
    --freq-low-bg: #21252d;
    --ok: #38d9a9;
    --ok-bg: #11271e;
    --fu: #b197fc;
    --fu-bg: #221c36;
    --warn: #ff8787;
    --warn-bg: #2d1a1a;
    --gold: #ffd43b;
    --gold-bg: #2b2312;
    --slate: #adb5bd;
    --slate-bg: #1b2027;
    --code-bg: #0e1217;
    --nav-bg: rgba(16, 19, 24, 0.9);
    --sel-bg: #33406e;
    --th-fg: #c9d3f5;
    --inline-code: #a5b4fc;
    --stars-off: #3a4150;
    --hl-comment: #8b949e;
    --hl-keyword: #ff7b72;
    --hl-string: #a5d6ff;
    --hl-number: #79c0ff;
    --hl-title: #d2a8ff;
    --hl-attr: #ffa657;
    --hl-type: #7ee787;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 4px 10px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 700; }
p { margin: 0.7em 0; }
::selection { background: var(--sel-bg); }

/* ── 顶部导航 ── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav .brand {
  font-weight: 800;
  color: var(--accent-deep);
  font-size: 17px;
  white-space: nowrap;
}
.topnav .brand:hover { text-decoration: none; }
.topnav .crumb {
  color: var(--muted);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 子页面顶栏右侧的回主页胶囊（brand 只回上一级板块）；
   多个胶囊包在 .nav-actions 组里，避免每个都 margin-left:auto 被剩余空间拆散 */
.topnav .nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topnav .nav-actions .nav-home { margin-left: 0; }
.topnav .nav-home {
  margin-left: auto;
  padding: 3px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.topnav .nav-home:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ── 深浅色切换按钮（三态：浅色 / 深色 / 跟随系统，见 theme.mjs） ── */
.theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle svg { display: none; width: 16px; height: 16px; }
[data-theme="light"] .theme-toggle .i-light { display: block; }
[data-theme="dark"] .theme-toggle .i-dark { display: block; }
[data-theme="auto"] .theme-toggle .i-auto { display: block; }

/* ── 布局容器 ── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 72px;
  overflow-wrap: break-word; /* 长英文/斜杠串（如 CLIP/CoOp/CoCoOp）放不下时折行，避免撑宽手机页面 */
}
.container-wide { max-width: 1120px; }
.subtitle { color: var(--muted); font-size: 15px; }
.footer-note { text-align: center; margin-top: 48px; font-size: 13px; }
.loading { text-align: center; margin-top: 120px; }

/* ── 首页 hero ── */
.home-hero { padding: 22px 0 10px; }
.home-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, var(--accent-deep), var(--fu));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.home-stats span {
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
}
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 8px; }
.cat-chip {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.cat-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── 首页分类与卡片 ── */
.cat-section { margin: 30px 0; }
.cat-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 19px;
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.cat-count { font-size: 13px; font-weight: 500; color: var(--faint); }
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.topic-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.topic-card:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--accent-tint);
  padding: 2px 10px;
  border-radius: 999px;
}
.card-count { font-size: 12.5px; color: var(--faint); }
.card-name { font-size: 19px; font-weight: 800; }
.card-title { color: var(--muted); font-size: 14px; margin-top: 2px; }
.card-intro {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 返回条 ── */
.back-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 22px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--muted);
  width: fit-content;
}
.back-bar:hover { border-color: var(--accent); text-decoration: none; color: var(--accent); }
.back-arrow { font: inherit; }
.back-arrow svg { display: inline-block; height: 0.94em; width: 0.53em; }
.back-label { font-weight: 600; }
.back-ctx { color: var(--faint); }
.back-bar-end { margin: 30px 0 0; }

/* ── 板块目录：小节列表 ── */
.meta-box {
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin: 18px 0;
}
.meta-box b { color: var(--accent-deep); }
.meta-box p { margin: 4px 0 0; color: var(--muted); }
.sec-list { list-style: none; margin: 20px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sec-item {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--faint);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.sec-item:hover { text-decoration: none; box-shadow: var(--shadow); }
.sec-item.freq-must { border-left-color: var(--freq-must); }
.sec-item.freq-hot { border-left-color: var(--freq-hot); }
.sec-item.freq-mid { border-left-color: var(--freq-mid); }
.sec-item.freq-low { border-left-color: var(--freq-low); }
.sec-item.freq-plain { border-left-color: var(--accent); }
.sec-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-line .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  font-weight: 700;
}
.sec-title { font-weight: 700; font-size: 15.5px; flex: 1; min-width: 200px; }
.sec-summary { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* ── 频率徽标 / 难度星 / 小节页 chips ── */
.freq-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.6;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.freq-badge.freq-must { color: var(--freq-must); background: var(--freq-must-bg); border-color: color-mix(in srgb, var(--freq-must) 35%, transparent); }
.freq-badge.freq-hot { color: var(--freq-hot); background: var(--freq-hot-bg); border-color: color-mix(in srgb, var(--freq-hot) 35%, transparent); }
.freq-badge.freq-mid { color: var(--freq-mid); background: var(--freq-mid-bg); border-color: color-mix(in srgb, var(--freq-mid) 35%, transparent); }
.freq-badge.freq-low { color: var(--freq-low); background: var(--freq-low-bg); border-color: color-mix(in srgb, var(--freq-low) 35%, transparent); }
.freq-badge.freq-plain { color: var(--muted); background: var(--line-soft); border-color: var(--line); }
.stars { color: var(--gold); font-size: 13px; letter-spacing: 1.5px; white-space: nowrap; }
.stars .stars-off { color: var(--stars-off); }
.sec-chips { display: flex; align-items: center; gap: 10px; margin: -6px 0 4px; }
.chip-plain {
  font-size: 12px;
  color: var(--muted);
  background: var(--line-soft);
  padding: 1px 10px;
  border-radius: 999px;
}
.prereq-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--slate-bg);
  border: 1px dashed color-mix(in srgb, var(--muted) 40%, transparent);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13.5px;
  margin: 14px 0 0;
}
.prereq-box b { color: var(--slate); font-size: 13px; }
.prereq-box a {
  padding: 1px 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.prereq-box a:hover { border-color: var(--accent); text-decoration: none; }

/* ── 翻页 ── */
.pager {
  display: flex;
  gap: 10px;
  margin: 26px 0;
}
.pager a {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
  min-width: 0;
}
.pager a:last-child { text-align: right; align-items: flex-end; }
.pager a:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.pager .dir { font-size: 12px; color: var(--faint); font-weight: 500; }
.pager a span:not(.dir) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ── 正文排版 ── */
.container > h1 { font-size: clamp(22px, 3.4vw, 28px); margin: 10px 0 14px; }
.content-body h2, .container h2 {
  font-size: 21px;
  margin: 2.1em 0 0.7em;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.container h3 { font-size: 17.5px; margin: 1.6em 0 0.5em; color: var(--text); }
.container h4 { font-size: 15.5px; margin: 1.3em 0 0.4em; }
.container ul, .container ol { padding-left: 1.5em; }
.container li { margin: 0.28em 0; }
.container blockquote {
  margin: 1em 0;
  padding: 6px 18px;
  border-left: 4px solid var(--line);
  background: var(--slate-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
}
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--accent-tint);
  color: var(--inline-code);
  padding: 1px 6px;
  border-radius: 5px;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 13.5px;
  margin: 1em 0;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; border-radius: 0; }
.table-wrap { margin: 1.1em 0; overflow-x: auto; }
.container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.container th, .container td {
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.container th { background: var(--accent-tint); color: var(--th-fg); font-weight: 700; white-space: nowrap; }
.container tr:last-child td { border-bottom: none; }
.formula {
  margin: 1.1em 0;
  padding: 6px 8px;
  overflow-x: auto;
  text-align: center;
  font-size: 1.05em;
}
pre.mermaid {
  background: var(--card);
  text-align: center;
  cursor: zoom-in;
  border: 1px solid var(--line);
}
pre.mermaid:not(:has(svg)) { cursor: default; }
pre.mermaid svg { max-width: 100%; height: auto; }

/* highlight.js token 配色（GitHub Light 变体，对齐浅色主题） */
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-deletion { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp, .hljs-addition { color: var(--hl-string); }
.hljs-number, .hljs-literal, .hljs-built_in, .hljs-symbol, .hljs-link { color: var(--hl-number); }
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id, .hljs-selector-class { color: var(--hl-title); }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property, .hljs-params { color: var(--hl-attr); }
.hljs-type, .hljs-title.class_, .hljs-class .hljs-title { color: var(--hl-type); }
.hljs-meta { color: var(--muted); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ── 面经卡片（qa 容器） ── */
.qa {
  border-radius: var(--radius-sm);
  margin: 14px 0;
  padding: 12px 16px 10px;
  border: 1px solid var(--line);
  background: var(--card);
}
.qa > p:first-child { margin-top: 2px; }
.qa .qa-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}

/* 题目卡：左侧色条按频率 */
.qa-question { border-left: 4px solid var(--accent); padding-top: 10px; }
.qa-question .q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.qa-question .q-no {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: var(--accent-deep);
  border-radius: 6px;
  padding: 0 8px;
  line-height: 1.7;
}
.qa-question.freq-must { border-left-color: var(--freq-must); }
.qa-question.freq-must .q-no { background: var(--freq-must); }
.qa-question.freq-hot { border-left-color: var(--freq-hot); }
.qa-question.freq-hot .q-no { background: var(--freq-hot); }
.qa-question.freq-mid { border-left-color: var(--freq-mid); }
.qa-question.freq-mid .q-no { background: var(--freq-mid); }
.qa-question.freq-low { border-left-color: var(--freq-low); }
.qa-question.freq-low .q-no { background: var(--freq-low); }
.qa-question > p:first-of-type { font-weight: 600; }
.qa-question > p:first-of-type strong { font-weight: 700; }

/* 答案卡：答题纸质感 */
.qa-answer { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.qa-answer .qa-tag { color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, transparent); }

/* 追问链 */
.qa-followup { background: var(--fu-bg); border-color: color-mix(in srgb, var(--fu) 35%, transparent); }
.qa-followup .qa-fu-q { font-weight: 700; color: var(--fu); margin-bottom: 4px; }

/* 减分点 */
.qa-trap { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.qa-trap .qa-tag { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }

/* 关键结论 */
.qa-keypoint { background: var(--gold-bg); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.qa-keypoint .qa-tag { color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, transparent); }

/* 深入块 */
.qa-deep-dive { background: var(--slate-bg); border-color: color-mix(in srgb, var(--slate) 35%, transparent); }
.qa-deep-dive .qa-tag { color: var(--slate); background: color-mix(in srgb, var(--slate) 18%, transparent); }

/* 未知容器兜底 */
.qa-callout { background: var(--line-soft); }

/* ── 页内目录（宽屏右侧浮动） ── */
.page-toc {
  position: fixed;
  top: 84px;
  right: max(28px, calc((100vw - 860px) / 2 - 228px));
  width: 224px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  font-size: 12.5px;
  z-index: 30;
  scrollbar-width: thin;
}
.page-toc-title {
  font-weight: 700;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 1px;
  padding: 0 10px 6px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}
.page-toc button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-toc button:hover { background: var(--accent-tint); color: var(--accent-deep); }
.page-toc .t-q {
  font-style: normal;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--accent-tint);
  border-radius: 4px;
  padding: 0 5px;
  margin-right: 6px;
  font-size: 11px;
}

/* ── 回到顶部 ── */
#back-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--card);
  color: var(--accent-deep);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 40;
}
#back-top.show { opacity: 1; visibility: visible; transform: none; }
#back-top:hover { background: var(--accent-tint); }

/* ── 错误卡片 ── */
.error {
  background: var(--warn-bg);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-top: 40px;
}
.error b { color: var(--warn); font-size: 17px; }
.error code { background: var(--card); }

/* ── mermaid 灯箱 ── */
.diagram-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 22, 33, 0.82);
  display: none;
}
.diagram-lightbox.open { display: block; }
.lb-canvas { position: absolute; inset: 0 0 56px 0; overflow: hidden; cursor: zoom-in; }
.lb-paper {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  cursor: grab;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  padding: 6px;
}
.lb-paper.dragging { cursor: grabbing; }
.lb-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border-radius: 999px;
  padding: 4px 8px;
  box-shadow: var(--shadow-lift);
}
.lb-bar button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  min-width: 32px;
  height: 30px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.lb-bar button:hover { border-color: var(--accent); color: var(--accent); }
.lb-scale {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-width: 44px;
  text-align: center;
}

/* ── 响应式 ── */
@media (max-width: 1359px) {
  .page-toc { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topic-grid { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .pager a:last-child { text-align: left; align-items: flex-start; }
  .sec-title { min-width: 140px; }
  .topnav { flex-wrap: wrap; }
}

/* ── 字重调校（MiSans VF 可变字重 150–700；Maple Mono CN 仅 400，禁止合成加粗） ──
   数值可改：正文 300–450，标题/强调 480–650。放在文件末尾以覆盖前面的固定字重。 */
* { font-synthesis: none; }
body { font-weight: 360; }
h1, h2, h3, h4 { font-weight: 560; }
b, strong, .container th, .card-name, .sec-title, .topnav .brand,
.qa-question > p:first-of-type, .qa-question > p:first-of-type strong,
.meta-box b, .freq-badge, .pager a, .qa .qa-tag, .card-badge,
.qa-question .q-no {
  font-weight: 540;
}

