/* ==========================================================================
   DeepSeek Harness 学习手册 — 正式版设计令牌
   纸白 / 墨蓝 / 黄铜；衬线标题 + 无衬线正文；发丝线、无阴影、低动效。
   对比度：正文 15.8:1，次要 5.3:1，黄铜文字 6.7:1，青绿 7.6:1，白字墨底 18:1。
   ========================================================================== */

:root {
  /* 色彩 */
  --ink: #14202b;
  --ink-2: #2e3b47;
  --muted: #5d6a76;
  --paper: #fbfaf6;
  --paper-2: #f3f1ea;
  --card: #ffffff;
  --navy: #0c1722;
  --navy-2: #122230;
  --brass: #a8874a;
  --brass-deep: #6f5522;
  --brass-wash: #f2ead9;
  --teal: #0f5a5a;
  --teal-wash: #e6efee;
  --red: #8c2f2f;
  --red-wash: #f6e8e6;
  --rule: #d8dde1;
  --rule-strong: #b9c2c8;

  /* 字体 */
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong",
    "SimSun", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

  /* 尺度 */
  --wrap: 1488px;
  --header-h: 96px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;

  /* 动效 */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --t: 160ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brass-deep); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
::selection { background: var(--brass-wash); color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 900;
  line-height: 1.3;
  margin: 0 0 var(--s3);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(34px, 5vw, 54px); }
h2 { font-size: clamp(25px, 3.2vw, 32px); }
h3 { font-size: 21px; }
p { margin: 0 0 var(--s4); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s6); }
.narrow { max-width: 820px; margin: 0 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--brass); color: var(--navy); padding: 10px 16px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  transition: top var(--t) var(--ease);
}
.skip:focus { top: 12px; }
.small { font-size: 13.5px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.9em; }
.kicker {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--brass-deep); margin-bottom: 10px;
}
.rule { border: 0; border-top: 1px solid var(--rule); margin: var(--s6) 0; }

/* —— 顶部 —— */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--paper);
  border-top: 4px solid var(--brass);
}
.topbar-in {
  max-width: calc(var(--wrap) - 64px); width: calc(100% - 64px); height: 100%; margin: 0 auto; padding: 0 16px;
  border-bottom: 1px solid var(--rule-strong);
  display: flex; align-items: center; gap: var(--s5);
}
.brand { display: inline-flex; align-items: center; gap: 28px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark {
  width: 56px; height: 56px; border: 2px solid var(--brass); display: grid; place-items: center;
  font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--brass-deep);
}
.brand-text { display: flex; align-items: baseline; gap: 14px; padding-left: 28px; border-left: 1px solid var(--brass); font-family: var(--serif); font-size: 46px; font-weight: 900; line-height: 1.2; white-space: nowrap; }
.brand-text small {
  font-size: 27px; font-weight: 700; color: var(--brass-deep);
}
.topnav { margin-left: auto; display: flex; align-items: center; gap: 38px; height: 100%; }
.topnav a {
  color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 24px; font-weight: 900; white-space: nowrap;
  display: inline-flex; align-items: center; height: 100%; padding: 0;
  border-bottom: 2px solid transparent;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.topnav a:hover { color: var(--brass-deep); border-color: var(--brass); }
.topnav a[aria-current="page"] { color: var(--brass-deep); }
.page-index .mini-progress { display: none; }
.mini-progress { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.mini-bar { width: 54px; height: 3px; background: var(--rule); }
.mini-bar > i { display: block; height: 100%; width: 0; background: var(--brass); transition: width var(--t) var(--ease); }

.read-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--brass); z-index: 60; }

/* —— 封面 —— */
.cover {
  background: var(--paper); padding: 40px 0 28px;
}
.cover-grid {
  display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 48px;
  width: calc(100% - 64px); max-width: calc(var(--wrap) - 64px); padding: 0 24px 32px;
  border-bottom: 1px solid var(--rule-strong);
}
.cover-intro { min-width: 0; }
.cover h1 { font-size: clamp(38px, 4.7vw, 70px); line-height: 1.32; letter-spacing: -0.025em; margin-bottom: 18px; text-wrap: balance; }
.cover .deck { font-family: var(--serif); font-size: clamp(20px, 1.8vw, 27px); color: var(--ink-2); margin-bottom: 24px; }
.cover-description { max-width: 40em; font-size: 20.5px; line-height: 1.7; color: var(--ink-2); margin-bottom: 34px; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 44px; align-items: stretch; }
.cover-actions [data-resume] { min-width: min(100%, 440px); max-width: 100%; text-align: left; overflow-wrap: anywhere; line-height: 1.4; font-family: var(--serif); font-size: 30px; font-weight: 900; padding: 14px 36px; min-height: 68px; }
.cover-progress { border-left: 1px solid var(--rule-strong); padding-left: 36px; font-size: 18px; line-height: 1.4; }
.cover-progress > div { font-family: var(--serif); font-size: 26px; }
.cover-progress b { color: var(--brass-deep); font-size: 38px; font-weight: 700; }
.resume-note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.cover-dates { display: flex; flex-wrap: wrap; gap: 16px; margin: 26px 0 0; font-size: 15px; color: var(--muted); }
.cover-dates a { color: var(--ink-2); text-decoration: none; }
.cover-dates a:hover { text-decoration: underline; }
.cover-catalog { border-left: 1px solid var(--rule); padding-left: 54px; min-width: 0; }
.cover-catalog h2 { font-size: 39px; margin-bottom: 0; }
.cover-catalog h2::after, .routes-section h2::after { content: ""; display: block; width: 68px; border-bottom: 3px solid var(--brass); margin-top: 18px; }
.cover-catalog .path-table { border-top: 0; }
.cover-catalog .path-row { grid-template-columns: 46px minmax(0, 1fr) 48px 24px; gap: 14px; padding: 15px 0; align-items: center; }
.cover-catalog .path-title { font-size: 28px; font-weight: 900; line-height: 1.35; }
.cover-catalog .path-no { font-size: 32px; line-height: 1.2; font-weight: 700; color: var(--brass-deep); }
.cover-catalog .path-meta { font-size: 18px; line-height: 1.2; white-space: nowrap; }
.cover-catalog .path-arrow { color: var(--ink); font-size: 27px; line-height: 1.2; }
.section.routes-section { background: #f7f4ee; padding: 24px 0 32px; }
.routes-section > .wrap { padding-left: 56px; padding-right: 56px; }
.routes-section .section-head { margin-bottom: 24px; }
.routes-section h2 { font-size: 35px; }
.reading-routes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.route { min-width: 0; padding: 0 32px; border-left: 1px solid var(--rule-strong); }
.route:first-child { padding-left: 0; border-left: 0; }
.route:last-child { padding-right: 0; }
.route h3 { font-size: 32px; }
.route h3 a { text-decoration: none; }
.route p { font-size: 18px; line-height: 1.7; margin-bottom: 12px; }
.route summary { width: fit-content; min-height: 32px; cursor: pointer; color: var(--muted); font-size: 13px; }
.route ul { padding-left: 1.2em; margin: 8px 0 0; font-size: 13px; }
.route li { margin-bottom: 8px; }
@media (min-width: 721px) and (max-width: 1200px) {
  .brand { gap: 14px; }
  .brand-mark { width: 44px; height: 44px; font-size: 26px; }
  .brand-text { font-size: 28px; gap: 10px; padding-left: 14px; }
  .brand-text small { font-size: 18px; }
  .topnav { gap: 20px; }
  .topnav a { font-size: 18px; }
  .mini-progress { display: none; }
  .cover-grid { gap: 30px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .cover h1 { font-size: clamp(40px, 4.4vw, 54px); }
  .cover-catalog { padding-left: 30px; }
  .cover-catalog .path-row { grid-template-columns: 34px minmax(0, 1fr) 38px 20px; gap: 8px; }
  .cover-catalog .path-title { font-size: 22px; }
  .cover-actions { gap: 24px; }
  .cover-actions [data-resume] { min-width: 0; font-size: 22px; }
  .cover-progress { padding-left: 20px; }
}
@media (min-width: 721px) and (max-width: 900px) {
  .brand-text small { display: none; }
  .brand-text { font-size: 24px; }
  .topbar-in { gap: 16px; }
}
.storage-notice { padding: var(--s3) var(--s5); background: var(--red-wash); color: var(--red); font-size: 14px; }
.storage-notice[hidden] { display: none; }

/* —— 按钮 —— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); background: var(--card); color: var(--ink);
  border-radius: 2px;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.btn:hover { background: var(--paper-2); color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: #fff; color: #fff; }
.btn.sm { min-height: 36px; padding: 6px 13px; font-size: 12.5px; }
.btn svg { width: 16px; height: 16px; }

/* —— 首页版块 —— */
.section { padding: var(--s8) 0 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.section-head p { margin: 0; color: var(--muted); max-width: 42em; }
.section-head h2 { margin-bottom: 4px; }

.path-table { border-top: 1px solid var(--ink); }
.path-row {
  display: grid; grid-template-columns: 64px 1fr 170px 120px; gap: var(--s4);
  align-items: baseline; padding: 18px 4px; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
  transition: background var(--t) var(--ease);
}
.path-row:hover { background: var(--paper-2); color: var(--ink); }
.path-no { font-family: var(--serif); font-size: 24px; color: var(--brass-deep); }
.path-title { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.path-desc { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.path-meta { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.path-arrow { text-align: right; font-size: 12px; color: var(--teal); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); }
.panel { border-top: 1px solid var(--rule-strong); padding: var(--s5) 0; }
.panel h3 { font-size: 19px; margin-bottom: var(--s2); }
.panel p { font-size: 14.5px; color: var(--ink-2); margin-bottom: var(--s3); }
.panel ul { margin: 0; padding-left: 1.1em; }
.panel li { font-size: 14px; margin-bottom: 6px; color: var(--ink-2); }

.audit-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rule); background: var(--card); }
.audit-strip div { padding: var(--s4) var(--s5); border-left: 1px solid var(--rule); }
.audit-strip div:first-child { border-left: 0; }
.audit-strip b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.2; }
.audit-strip span { font-size: 12px; color: var(--muted); }
.audit-strip .ok b { color: var(--teal); }
.audit-strip .old b { color: var(--brass-deep); }
.audit-strip .todo b { color: var(--red); }

/* —— 阶段页头部 —— */
.page-head { background: var(--paper); border-bottom: 1px solid var(--rule-strong); padding: var(--s7) 0 var(--s6); }
.page-head .wrap { max-width: 1200px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: var(--s3); flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brass-deep); text-decoration: underline; }
.page-head h1 { max-width: 20em; }
.page-head .lede { max-width: 46em; color: var(--ink-2); margin-bottom: var(--s4); }
.meta-line { display: flex; flex-wrap: wrap; gap: var(--s4); font-size: 12.5px; color: var(--muted); }
.meta-line span { display: inline-flex; align-items: center; gap: 6px; }
.meta-line span::before { content: ""; width: 5px; height: 5px; background: var(--brass); }
.stage-progress { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); font-size: 12.5px; color: var(--muted); }
.stage-progress .bar { flex: 1 1 160px; max-width: 320px; height: 3px; background: var(--rule); }
.stage-progress .bar > i { display: block; height: 100%; width: 0; background: var(--brass); transition: width var(--t) var(--ease); }

/* —— 布局 —— */
.layout > * { min-width: 0; }
.lesson { min-width: 0; }
code { overflow-wrap: anywhere; }
.layout { display: grid; grid-template-columns: 1fr; gap: var(--s6); padding: var(--s6) var(--s6) var(--s8); max-width: 1200px; }
.toc { display: none; }
.mobile-toc {
  position: sticky; top: var(--header-h); z-index: 40;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  padding: 0 var(--s4);
}
.mobile-toc summary {
  display: flex; align-items: center; gap: var(--s3); min-height: 52px;
  padding: 10px 0; cursor: pointer; font-size: 14px; font-weight: 700; list-style: none;
}
.mobile-toc summary::-webkit-details-marker { display: none; }
.mobile-toc summary > span:first-child { flex: none; }
.mobile-toc summary::after { content: "＋"; margin-left: auto; flex: none; }
.mobile-toc details[open] summary::after { content: "－"; }
.toc-current { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-weight: 400; color: var(--muted); }
.mobile-toc ol { list-style: none; padding: 0; margin: 0; max-height: 50vh; overflow-y: auto; }
.mobile-toc details[open] ol {
  position: absolute; top: 100%; left: 0; right: 0;
  padding: 0 var(--s4); background: var(--paper); border-bottom: 1px solid var(--rule);
}
.mobile-toc li { border-top: 1px solid var(--rule); }
.mobile-toc a { display: flex; gap: 10px; align-items: baseline; padding: 12px 4px; min-height: 44px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.mobile-toc .n { flex: none; color: var(--brass-deep); }
.mobile-toc a[aria-current="location"] { background: var(--brass-wash); color: var(--ink); font-weight: 700; }
@media (max-width: 1023px) {
  .lesson { scroll-margin-top: 52px; }
}
@media (min-width: 1024px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); gap: var(--s7); align-items: start; }
  .toc { display: block; position: sticky; top: calc(var(--header-h) + 28px); }
  .mobile-toc { display: none; }
}
.toc h2 { font-family: var(--sans); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s3); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { border-top: 1px solid var(--rule); }
.toc li:last-child { border-bottom: 1px solid var(--rule); }
.toc a {
  display: flex; gap: 10px; padding: 10px 2px; text-decoration: none;
  color: var(--ink-2); font-size: 13.5px; line-height: 1.5;
  transition: color var(--t) var(--ease);
}
.toc a .n { font-family: var(--mono); font-size: 11px; color: var(--brass-deep); flex: none; padding-top: 2px; }
.toc a:hover, .toc a.active { color: var(--ink); }
.toc a.active { font-weight: 700; box-shadow: inset 2px 0 0 var(--brass); padding-left: 10px; }
.toc-note { font-size: 11.5px; color: var(--muted); margin-top: var(--s4); line-height: 1.6; }

/* —— 课程 —— */
.lesson {
  border-bottom: 1px solid var(--rule-strong);
  padding: var(--s5) 0 var(--s7);
  margin-bottom: var(--s5);
}
.lesson + .lesson { margin-top: 0; }
.lesson-head { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.lesson-no { font-family: var(--mono); font-size: 12px; color: var(--brass-deep); letter-spacing: 0.06em; flex: none; }
.lesson h2 { font-size: clamp(22px, 2.6vw, 27px); margin: 0; flex: 1 1 300px; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; margin: var(--s2) 0 var(--s4); font-size: 12px; color: var(--muted); }
.lesson-meta a { color: var(--teal); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.lesson-meta a:hover { border-color: var(--brass); }
.lesson-audit { margin-bottom: var(--s4); padding: var(--s3); background: var(--paper-2); font-size: 13px; }
.lesson-audit summary { cursor: pointer; color: var(--ink-2); }
.lesson-audit p { margin: var(--s2) 0 0; overflow-wrap: anywhere; }
.lesson.is-done .lesson-head { color: var(--teal); }
.lesson.is-done .lesson-no::after { content: " · 已完成"; color: var(--teal); }

.block { padding: var(--s3) 0; border-top: 1px solid var(--rule); }
.block:first-child { border-top: 0; padding-top: 0; }
.block .label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brass-deep); margin-bottom: 6px;
}
.block p { margin: 0; font-size: 15.5px; }
.block ol, .block ul { margin: 0; padding-left: 1.3em; }
.block li { margin-bottom: 7px; font-size: 15.5px; line-height: 1.75; }
.block li::marker { color: var(--brass-deep); }
.block.task { background: var(--paper-2); padding: var(--s4) var(--s5); margin: var(--s3) 0; border-top: 0; }
.block.task .label { color: var(--brass-deep); }
.block.check { border-top: 1px solid var(--rule); padding-top: var(--s3); }
.practice h3 { font-size: 19px; margin-bottom: var(--s3); }
.practice h4 { font-family: var(--sans); font-size: 14px; margin: var(--s4) 0 var(--s2); }
.practice > ol { margin-top: var(--s3); }
.code-example { margin: var(--s4) 0; min-width: 0; border: 1px solid var(--rule); }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s3); background: var(--paper-2); }
.code-head > span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; color: var(--ink-2); }
.copy-btn { flex: none; min-height: 44px; padding: 6px 10px; border: 1px solid var(--rule-strong); background: var(--card); color: var(--ink); cursor: pointer; font: inherit; font-size: 12px; }
.copy-btn:hover { border-color: var(--ink); }
.copy-btn:disabled { cursor: wait; }
.code-example pre { max-width: 100%; margin: 0; padding: var(--s4); overflow-x: auto; background: var(--navy); color: #edf3f7; font: 13px/1.8 var(--mono); tab-size: 2; }
.code-example code { font: inherit; overflow-wrap: normal; white-space: pre; }
.practice-errors { margin-top: var(--s4); font-size: 14px; }
.practice-errors summary { cursor: pointer; font-weight: 600; }
.practice-errors ul { margin-top: var(--s2); }
.practice .example-source { margin-top: var(--s3); color: var(--muted); font-size: 12px; }
.qa { margin-top: 4px; }
.qa details { border-top: 1px dashed var(--rule-strong); padding: 9px 0 2px; }
.qa details:first-child { border-top: 0; padding-top: 0; }
.qa summary { cursor: pointer; font-size: 14.5px; font-weight: 600; list-style: none; display: flex; gap: 9px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: "＋"; flex: none; color: var(--brass-deep); font-weight: 400; }
.qa details[open] summary::before { content: "－"; }
.qa .a { margin: 6px 0 0 22px; font-size: 14px; color: var(--ink-2); line-height: 1.75; }

.lesson-foot { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.done-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px;
  padding: 6px 14px; font: inherit; font-size: 12.5px; font-weight: 700;
  background: transparent; color: var(--ink); border: 1px solid var(--ink);
  border-radius: 2px; cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.done-btn:hover { background: var(--paper-2); }
.done-btn[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.done-btn .dot { width: 6px; height: 6px; background: currentColor; }
.done-btn[aria-pressed="true"] .dot { background: #fff; }
.lesson-foot .note { font-size: 11.5px; color: var(--muted); }

.chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); margin-top: var(--s6); border-top: 1px solid var(--ink); padding-top: var(--s3); }
.chapter-nav a { text-decoration: none; color: var(--ink); display: block; }
.chapter-nav a:hover { color: var(--brass-deep); }
.chapter-nav .dir { display: block; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.chapter-nav .t { font-size: 14px; font-weight: 600; line-height: 1.5; }
.chapter-nav .next { text-align: right; }

/* —— 文档页 —— */
.doc { max-width: 980px; margin: 0 auto; padding: var(--s7) var(--s5) var(--s8); }
.doc > h1 { padding-bottom: var(--s4); border-bottom: 1px solid var(--rule-strong); }
.doc h2 { margin-top: var(--s7); }
.doc h2 .no { font-family: var(--mono); font-size: 0.55em; color: var(--brass-deep); margin-right: 10px; vertical-align: 0.25em; }
.doc p { max-width: 48em; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin-bottom: 7px; }
.doc .lede { font-size: 18px; color: var(--ink-2); }

/* —— 表格 —— */
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--rule); background: var(--card); margin: var(--s4) 0 var(--s5); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
caption { caption-side: top; text-align: left; padding: 10px 14px; font-size: 11.5px; letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--rule); }
th, td { padding: 10px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); line-height: 1.65; }
thead th { background: var(--paper-2); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--rule-strong); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8f6f0; }
.status { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 1px 6px; border-left: 2px solid; }
.status.ok { color: var(--teal); border-color: var(--teal); background: var(--teal-wash); }
.status.old { color: var(--brass-deep); border-color: var(--brass); background: var(--brass-wash); }
.status.add { color: var(--ink); border-color: var(--ink); background: var(--paper-2); }
.status.todo { color: var(--red); border-color: var(--red); background: var(--red-wash); }
.status.p0 { color: #fff; background: var(--red); border-color: var(--red); }
.status.p1 { color: #fff; background: var(--brass-deep); border-color: var(--brass-deep); }
.status.p2 { color: var(--ink); background: var(--paper-2); border-color: var(--rule-strong); }

/* —— 提示块 —— */
.callout { border: 1px solid var(--rule); border-left: 3px solid var(--brass); background: var(--brass-wash); padding: var(--s4) var(--s5); margin: var(--s4) 0; font-size: 14.5px; }
.callout p { margin: 0; }
.callout p + p { margin-top: 6px; }
.callout.warn { border-left-color: var(--red); background: var(--red-wash); }
.callout.info { border-left-color: var(--teal); background: var(--teal-wash); }
.callout b { font-weight: 700; }

/* —— 目录 / 章节列表 —— */
.catalog { border-top: 1px solid var(--ink); margin: var(--s5) 0 var(--s6); }
.catalog-group h2 { font-size: 20px; margin: var(--s5) 0 var(--s2); }
.catalog-group .group-desc { font-size: 13px; color: var(--muted); margin-bottom: var(--s3); }
.chapter-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.chapter-row {
  display: grid; grid-template-columns: 42px 1fr 92px 86px 28px; gap: var(--s3);
  align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--rule);
}
.chapter-row:hover { background: var(--paper-2); }
.chapter-row[hidden] { display: none; }
.chapter-row .idx { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.chapter-row a.main { color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.chapter-row a.main:hover { color: var(--brass-deep); text-decoration: underline; }
.chapter-row .stage { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.chapter-row a.src { font-size: 11.5px; color: var(--teal); text-decoration: none; }
.chapter-row .done-dot { width: 8px; height: 8px; border: 1px solid var(--rule-strong); justify-self: end; }
.chapter-row.is-done .done-dot { background: var(--teal); border-color: var(--teal); }
.catalog-search { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin: var(--s4) 0; }
.catalog-search label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.catalog-search input {
  flex: 1 1 240px; min-height: 42px; padding: 8px 12px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--card);
  border: 1px solid var(--rule-strong); border-radius: 0;
}
.catalog-search input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.catalog-count { font-size: 12px; color: var(--muted); }
.catalog-empty { padding: var(--s5); border: 1px dashed var(--rule-strong); color: var(--muted); font-size: 14px; }
.catalog-empty[hidden] { display: none; }

/* —— 搜索 —— */
.search-box { margin: var(--s5) 0 var(--s4); }
.search-box label { display: block; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.search-box input {
  width: 100%; min-height: 52px; padding: 10px 14px;
  font: inherit; font-size: 17px; color: var(--ink); background: var(--card);
  border: 1px solid var(--ink); border-radius: 0;
}
.search-box input:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
.search-suggests { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: var(--s5); font-size: 12px; color: var(--muted); }
.search-suggests button {
  font: inherit; font-size: 12px; padding: 4px 9px; cursor: pointer;
  background: transparent; color: var(--ink-2); border: 1px solid var(--rule-strong); border-radius: 0;
}
.search-suggests button:hover { border-color: var(--ink); color: var(--ink); }
.search-meta { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-bottom: var(--s3); border-bottom: 1px solid var(--ink); font-size: 12px; color: var(--muted); }
.search-results { display: grid; gap: 0; }
.search-result { display: block; padding: var(--s4) 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.search-result:hover { background: var(--paper-2); color: var(--ink); }
.sr-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.sr-stage { font-size: 10.5px; letter-spacing: 0.08em; color: var(--brass-deep); text-transform: uppercase; }
.sr-title { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.sr-snippet { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.sr-snippet .kind { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--rule-strong); padding: 0 4px; margin-right: 6px; }
.search-result mark { background: var(--brass-wash); color: var(--ink); padding: 0 2px; }
.search-empty { margin-top: var(--s4); padding: var(--s5); border: 1px dashed var(--rule-strong); color: var(--muted); font-size: 14px; }
.search-empty[hidden] { display: none; }

/* —— 翻页 / 页脚 —— */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-top: var(--s7); border-top: 1px solid var(--ink); padding-top: var(--s3); }
.pager a { text-decoration: none; color: var(--ink); padding: 8px 0; }
.pager a:hover { color: var(--brass-deep); }
.pager .dir { display: block; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.pager .t { font-size: 14px; font-weight: 600; }
.pager .next { text-align: right; }

.footer { border-top: 1px solid var(--rule); background: var(--paper-2); padding: var(--s6) 0 var(--s7); }
.footer-in { display: grid; grid-template-columns: 1.8fr 1fr 1fr; gap: var(--s6); }
.footer h3 { font-family: var(--sans); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.footer p, .footer li { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 5px; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--brass-deep); text-decoration: underline; }
.footer .fine { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--rule); font-size: 11.5px; color: var(--muted); }

/* —— 轻提示 —— */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  z-index: 90; background: var(--ink); color: var(--paper);
  padding: 10px 18px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* —— 响应式 —— */
@media (max-width: 900px) {
  .footer-in { grid-template-columns: 1fr; gap: var(--s4); }
  .two-col { grid-template-columns: 1fr; }
  .audit-strip { grid-template-columns: 1fr 1fr; }
  .audit-strip div:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule); }
  .audit-strip div:nth-child(4) { border-top: 1px solid var(--rule); }
  .cover-grid { grid-template-columns: 1fr; gap: 32px; }
  .cover h1 { font-size: clamp(38px, 6.6vw, 58px); }
  .cover-catalog { border-left: 0; border-top: 1px solid var(--rule); padding: 24px 0 0; }
  .cover-catalog h2 { font-size: 30px; margin-bottom: 12px; }
  .reading-routes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 0; }
  .route:nth-child(3) { padding-left: 0; border-left: 0; }
  .route:nth-child(2) { padding-right: 0; }
}
@media (max-width: 720px) {
  :root { --header-h: 56px; }
  body { font-size: 16px; }
  .wrap { padding: 0 var(--s4); }
  .topbar-in { width: calc(100% - 32px); padding: 0; gap: var(--s3); }
  .brand-mark { width: 26px; height: 26px; font-size: 16px; border-width: 1px; }
  .brand-text { display: none; }
  .topnav { gap: var(--s3); }
  .topnav a { font-size: 12px; }
  .mini-progress { display: none; }
  .cover { padding: 28px 0 24px; }
  .cover-grid { width: calc(100% - 32px); padding: 0 0 24px; }
  .cover h1 { font-size: clamp(31px, 6.8vw, 46px); letter-spacing: -0.02em; }
  .cover .deck { font-size: 20px; margin-bottom: 18px; }
  .cover-description { font-size: 15px; margin-bottom: 24px; }
  .cover-actions { gap: 18px; }
  .cover-actions [data-resume] { min-width: 0; font-size: 20px; min-height: 56px; padding: 12px 18px; }
  .cover-progress { padding-left: 18px; font-size: 13px; }
  .cover-progress > div { font-size: 22px; }
  .cover-progress b { font-size: 28px; }
  .cover-dates { font-size: 12px; gap: 8px; margin-top: 20px; }
  .cover-catalog .path-row { grid-template-columns: 36px minmax(0, 1fr) 38px 20px; gap: 8px; padding: 14px 0; }
  .cover-catalog .path-title { font-size: 21px; }
  .cover-catalog .path-no { font-size: 26px; }
  .cover-catalog .path-meta { grid-column: auto; font-size: 14px; }
  .cover-catalog .path-arrow { grid-column: auto; font-size: 22px; text-align: right; }
  .routes-section > .wrap { padding: 0 16px; }
  .routes-section h2 { font-size: 28px; }
  .route { padding: 0 20px; }
  .route h3 { font-size: 24px; }
  .route p { font-size: 14px; }
  .route summary { min-height: 44px; padding-top: 8px; }
  .path-row { grid-template-columns: 44px 1fr; gap: var(--s2) var(--s3); }
  .path-meta { grid-column: 2; }
  .path-arrow { grid-column: 2; text-align: left; }
  .lesson { padding: var(--s4) 0 var(--s6); }
  .layout { padding: var(--s5) var(--s4) var(--s7); }
  .lesson h2 { flex-basis: 100%; }
  .chapter-nav { grid-template-columns: 1fr; gap: var(--s3); }
  .chapter-nav .next { text-align: left; }
  .chapter-row { grid-template-columns: 34px 1fr 80px; }
  .chapter-row .stage, .chapter-row a.src { display: none; }
  .chapter-row .done-dot { grid-column: 3; grid-row: 1; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .doc { padding: var(--s6) var(--s4) var(--s7); }
  table { min-width: 540px; }
}

@media (max-width: 350px) {
  .topnav { gap: 8px; }
  .topnav .nav-secondary { display: none; }
}
@media (max-width: 480px) {
  .reading-routes { grid-template-columns: 1fr; gap: 20px; }
  .route, .route:nth-child(2), .route:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule); padding: 18px 0 0; }
  .route:first-child { border-top: 0; padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

@media print {
  .topbar, .toc, .mobile-toc, .pager, .footer, .read-progress, .done-btn, .copy-btn, .toast { display: none !important; }
  .code-example pre { white-space: pre-wrap; background: #fff; color: #000; }
  .code-example code { white-space: pre-wrap; overflow-wrap: anywhere; }
  body { background: #fff; }
  .lesson, .panel, .table-wrap { break-inside: avoid; }
  .cover { background: #fff; color: #000; }
  .cover h1, .cover .deck, .cover-meta b { color: #000; }
}
