/* ==========================================================================
   AI4S 全自动科研学院 · 样式
   零外部依赖：不引 CDN、不引网络字体，弱网可用
   ========================================================================== */

:root {
  --bg:        #fcfbf8;
  --bg-alt:    #f5f3ec;
  --surface:   #ffffff;
  --ink:       #1b1b19;
  --ink-soft:  #43423d;
  --muted:     #6d6c64;
  --line:      #e4e0d4;
  --line-soft: #eeebe0;
  --accent:    #0d6b59;
  --accent-in: #0a5446;
  --accent-bg: #e6f2ee;
  --warm:      #a94f26;
  --warm-bg:   #fbeee6;
  --danger:    #a3242b;
  --danger-bg: #fdeced;
  --code-bg:   #f6f4ed;
  --shadow:    0 1px 2px rgba(28,26,20,.05), 0 8px 24px -12px rgba(28,26,20,.16);
  --sidebar-w: 288px;
  --toc-w:     216px;
  --topbar-h:  56px;
  --radius:    10px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg:        #131519;
  --bg-alt:    #191c21;
  --surface:   #1c2027;
  --ink:       #e9e7e1;
  --ink-soft:  #c6c3bb;
  --muted:     #918f87;
  --line:      #2c3138;
  --line-soft: #23272d;
  --accent:    #55cfb1;
  --accent-in: #7fe0c7;
  --accent-bg: #16302a;
  --warm:      #e79a6f;
  --warm-bg:   #33231a;
  --danger:    #e88a8f;
  --danger-bg: #331c1e;
  --code-bg:   #171a1f;
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 12px 32px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:        #131519;
    --bg-alt:    #191c21;
    --surface:   #1c2027;
    --ink:       #e9e7e1;
    --ink-soft:  #c6c3bb;
    --muted:     #918f87;
    --line:      #2c3138;
    --line-soft: #23272d;
    --accent:    #55cfb1;
    --accent-in: #7fe0c7;
    --accent-bg: #16302a;
    --warm:      #e79a6f;
    --warm-bg:   #33231a;
    --danger:    #e88a8f;
    --danger-bg: #331c1e;
    --code-bg:   #171a1f;
    --shadow:    0 1px 2px rgba(0,0,0,.3), 0 12px 32px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               "Noto Sans CJK SC", sans-serif;
  font-size: 16.5px;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-in); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 60;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent) 45%, var(--warm) 100%);
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: -.4px;
}
.brand .nm { font-size: 15px; letter-spacing: .2px; white-space: nowrap; }
.brand .ver { font-size: 11px; color: var(--muted); font-weight: 500; padding: 1px 6px; border: 1px solid var(--line); border-radius: 20px; }

.spacer { flex: 1; }

.searchbtn {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 12px;
  min-width: 200px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--bg-alt); color: var(--muted); font-size: 13.5px; cursor: pointer;
  font-family: inherit;
}
.searchbtn:hover { border-color: var(--accent); color: var(--ink-soft); }
.searchbtn kbd {
  margin-left: auto; font-family: inherit; font-size: 11px; padding: 1px 6px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--surface);
}
.iconbtn {
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg-alt); color: var(--ink-soft); cursor: pointer;
  display: grid; place-items: center; font-size: 15px; flex-shrink: 0;
}
.iconbtn:hover { border-color: var(--accent); color: var(--accent-in); }
.menubtn { display: none; }

.readbar { position: fixed; top: var(--topbar-h); left: 0; height: 2px; background: var(--accent); z-index: 61; width: 0; transition: width .1s linear; }

/* ---------- 布局 ---------- */
.layout { display: flex; padding-top: var(--topbar-h); }

.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w);
  overflow-y: auto; overscroll-behavior: contain; padding: 18px 12px 60px;
  border-right: 1px solid var(--line); background: var(--bg-alt); z-index: 50;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.sb-progress { padding: 0 10px 14px; }
.sb-overview {
  display: block; margin: 0 10px 14px; padding: 9px 11px;
  background: var(--accent-bg); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 8px;
  font-size: 12.5px; line-height: 1.5; color: var(--accent-in);
  font-weight: 650; text-decoration: none;
}
.sb-overview:hover { background: var(--surface); }
.sb-progress .lbl { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 6px; }
.bar { height: 5px; background: var(--line); border-radius: 5px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--warm)); width: 0; transition: width .35s ease; }

.part { margin-bottom: 4px; }
.part > .hd {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px;
  border: 0; background: none; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 650;
  cursor: pointer; border-radius: 8px; text-align: left;
}
.part > .hd:hover { background: var(--line-soft); }
.part > .hd .cnt { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 500; }
.part > .hd .caret { font-size: 9px; color: var(--muted); transition: transform .18s; }
.part.closed > .hd .caret { transform: rotate(-90deg); }
.part.closed > ul { display: none; }
.part > ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 10px; border-left: 1px solid var(--line); margin-left: 14px; }
.part > ul > li > a {
  display: flex; gap: 7px; align-items: baseline; padding: 5px 9px; border-radius: 7px;
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.55;
}
.part > ul > li > a:hover { background: var(--line-soft); text-decoration: none; color: var(--ink); }
.part > ul > li > a.on { background: var(--accent-bg); color: var(--accent-in); font-weight: 650; }
.part > ul > li > a .tick { flex-shrink: 0; width: 13px; font-size: 10px; color: var(--accent); opacity: 0; }
.part > ul > li > a.read .tick { opacity: 1; }

.content { flex: 1; min-width: 0; margin-left: var(--sidebar-w); }
.wrap { max-width: 768px; margin: 0 auto; padding: 40px 28px 96px; }

.toc {
  position: fixed; top: calc(var(--topbar-h) + 40px); right: 24px; width: var(--toc-w);
  max-height: calc(100vh - var(--topbar-h) - 80px); overflow-y: auto; display: none;
  font-size: 12.8px; line-height: 1.65; padding-left: 14px; border-left: 1px solid var(--line);
}
.toc .h { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; }
.toc a { display: block; padding: 3px 0; color: var(--muted); }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.on { color: var(--accent-in); font-weight: 650; }

@media (min-width: 1360px) {
  .toc { display: block; }
  .wrap { padding-right: calc(var(--toc-w) + 40px); max-width: 1010px; }
}

/* ---------- 页头 ---------- */
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--muted); }
h1.title { font-size: 30px; line-height: 1.35; margin: 0 0 12px; letter-spacing: -.4px; font-weight: 750; }
.lede { font-size: 16px; color: var(--ink-soft); margin: 0 0 18px; line-height: 1.8; }
.metabar {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; margin-bottom: 34px;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 12.5px; color: var(--muted);
}
.metabar b { color: var(--ink-soft); font-weight: 650; }
.metabar .it { display: flex; gap: 5px; align-items: baseline; min-width: 0; }
/* v11：前置那一格现在装的是一到多个可点课名，可能很长。
   不给它 flex-basis，它会被挤成一竖条、把"读完"两个字从中间劈开
   （390px 与 1180px 实拍都逮到过）。标签本身不许换行。 */
.metabar .it:last-child { flex: 1 1 340px; }
.metabar .lb { white-space: nowrap; flex: 0 0 auto; }
.metabar .it + .it::before { content: ""; }
.metabar .sep { color: var(--line); }

/* ---------- 三分钟速览（v7·备忘录「长但扼要」） ----------
   放在 metabar 之下、正文之上。存在的理由：单页动辄上万字，
   先给三五条要点，读者才好判断这一课要不要现在细读。
   颜色走 accent 一系，与正文引用块（warm）区分开，避免看成"注意事项"。 */
.tldr {
  margin: -18px 0 34px; padding: 15px 17px 13px;
  background: var(--accent-bg); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.tldr .h {
  font-size: 13px; font-weight: 750; color: var(--accent-in);
  letter-spacing: .3px; margin-bottom: 9px;
}
.tldr .h .hint {
  font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 9px;
  font-size: 12px;
}
.tldr ul { margin: 0; padding-left: 19px; }
.tldr li {
  font-size: 14.5px; line-height: 1.75; color: var(--ink-soft);
  margin: 3px 0; padding-left: 2px;
}
.tldr li::marker { color: var(--accent); }
.tldr .skip {
  margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--muted); line-height: 1.7;
}
.tldr .skip b { color: var(--ink-soft); }
@media (max-width: 720px) {
  .tldr { margin-top: -8px; padding: 13px 14px 11px; }
  .tldr li { font-size: 14px; }
}

/* ---------- 全站速览页（v7） ----------
   全站每课一张速览卡排成一页。密度是这一页的全部意义——它要能被 Ctrl+F 一次扫完，
   所以卡片比正文紧、留白比正文小，且不加任何折叠。 */
.ovpart { margin: 40px 0 0; }
.ovh {
  font-size: 19px; font-weight: 750; margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--accent); display: flex;
  align-items: baseline; justify-content: space-between;
}
.ovh .c { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.ovcard {
  padding: 13px 15px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ovcard h3 { font-size: 15.5px; margin: 0 0 7px; font-weight: 700; line-height: 1.5; }
.ovcard h3 a { color: var(--ink); text-decoration: none; }
.ovcard h3 a:hover { color: var(--accent); text-decoration: underline; }
.ovcard h3 .meta {
  font-size: 11.5px; font-weight: 400; color: var(--muted);
  margin-left: 8px; white-space: nowrap;
}
.ovcard ul { margin: 0; padding-left: 18px; }
.ovcard li {
  font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); margin: 2px 0;
}
.ovcard li::marker { color: var(--accent); }
.ovcard .nodata { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.ovskip {
  margin: 8px 0 0; padding-top: 7px; border-top: 1px dashed var(--line-soft);
  font-size: 12.5px; color: var(--muted); line-height: 1.65;
}
@media (max-width: 720px) {
  .ovcard { padding: 11px 12px; }
  .ovcard h3 .meta { display: block; margin-top: 3px; }
}

/* ---------- 正文排版 ---------- */
.md > :first-child { margin-top: 0; }
.md h2 {
  font-size: 21.5px; margin: 46px 0 14px; padding-bottom: 8px; letter-spacing: -.2px;
  border-bottom: 1px solid var(--line-soft); font-weight: 700; scroll-margin-top: 76px;
}
.md h3 { font-size: 17.5px; margin: 32px 0 10px; font-weight: 700; scroll-margin-top: 76px; }
.md h4 { font-size: 15.5px; margin: 24px 0 8px; font-weight: 700; color: var(--ink-soft); }
.md h2 .headerlink, .md h3 .headerlink {
  margin-left: 8px; color: var(--line); font-weight: 400; opacity: 0; text-decoration: none;
}
.md h2:hover .headerlink, .md h3:hover .headerlink { opacity: 1; }
.md p { margin: 0 0 16px; }
.md strong { font-weight: 700; color: var(--ink); }
.md em { font-style: normal; background: linear-gradient(transparent 62%, var(--warm-bg) 62%); padding: 0 1px; }
.md ul, .md ol { margin: 0 0 16px; padding-left: 1.5em; }
.md li { margin: 5px 0; }
.md li > ul, .md li > ol { margin: 5px 0; }
.md li.tk { list-style: none; margin-left: -1.2em; }
.md li.tk::before { content: "☐"; color: var(--muted); margin-right: 8px; }
.md li.tk.done::before { content: "☑"; color: var(--accent); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.md blockquote {
  margin: 20px 0; padding: 12px 16px; border-left: 3px solid var(--warm);
  background: var(--warm-bg); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
}
.md blockquote > :last-child { margin-bottom: 0; }

/* 表格 */
.tw { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.md table { border-collapse: collapse; width: 100%; font-size: 14.2px; }
.md th, .md td { padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; line-height: 1.7; }
.md thead th { background: var(--bg-alt); font-weight: 700; font-size: 13.2px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.md tbody tr:last-child td { border-bottom: 0; }
.md tbody tr:hover { background: var(--bg-alt); }

/* 代码 */
.md code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .875em; background: var(--code-bg); padding: .15em .4em; border-radius: 5px;
  border: 1px solid var(--line-soft); word-break: break-word;
}
.md pre {
  position: relative; margin: 20px 0; padding: 14px 16px; overflow-x: auto;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius);
  line-height: 1.68;
}
.md pre code { background: none; border: 0; padding: 0; font-size: 13.4px; }
.md .hl { position: relative; margin: 20px 0; }
.md .hl pre { margin: 0; }
.copy {
  position: absolute; top: 8px; right: 8px; z-index: 2; padding: 3px 9px; font-size: 11.5px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted);
  cursor: pointer; opacity: 0; transition: opacity .15s; font-family: inherit;
}
pre:hover .copy, .hl:hover .copy { opacity: 1; }
.copy:hover { color: var(--accent-in); border-color: var(--accent); }
.copy.ok { color: var(--accent); border-color: var(--accent); }

/* 语法高亮 */
.hl .c, .hl .c1, .hl .cm, .hl .ch, .hl .cs { color: var(--muted); font-style: italic; }
.hl .k, .hl .kd, .hl .kn, .hl .kp, .hl .kr, .hl .kt, .hl .kc { color: #9a3c8f; font-weight: 600; }
.hl .s, .hl .s1, .hl .s2, .hl .sb, .hl .sc, .hl .sd, .hl .se, .hl .sh, .hl .si, .hl .sx, .hl .sr, .hl .ss { color: #1a7a4a; }
.hl .m, .hl .mf, .hl .mh, .hl .mi, .hl .mo, .hl .il { color: #a94f26; }
.hl .nb, .hl .bp { color: #0d6b59; }
.hl .nf, .hl .fm { color: #2b5fa8; }
.hl .nc, .hl .nn { color: #8a6d1f; }
.hl .o, .hl .ow, .hl .p { color: var(--ink-soft); }
.hl .nv, .hl .vi, .hl .vg, .hl .vc { color: #b0552b; }
.hl .err, .hl .gr { color: var(--danger); }
html[data-theme="dark"] .hl .k { color: #d79ce0; }
html[data-theme="dark"] .hl .s, html[data-theme="dark"] .hl .s1, html[data-theme="dark"] .hl .s2 { color: #8ed9a0; }
html[data-theme="dark"] .hl .m, html[data-theme="dark"] .hl .mi, html[data-theme="dark"] .hl .mf { color: #e79a6f; }
html[data-theme="dark"] .hl .nf { color: #82b6ee; }
html[data-theme="dark"] .hl .nb { color: #55cfb1; }
html[data-theme="dark"] .hl .nc, html[data-theme="dark"] .hl .nn { color: #dcc47a; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .hl .k { color: #d79ce0; }
  html:not([data-theme="light"]) .hl .s, html:not([data-theme="light"]) .hl .s1, html:not([data-theme="light"]) .hl .s2 { color: #8ed9a0; }
  html:not([data-theme="light"]) .hl .m, html:not([data-theme="light"]) .hl .mi { color: #e79a6f; }
  html:not([data-theme="light"]) .hl .nf { color: #82b6ee; }
  html:not([data-theme="light"]) .hl .nb { color: #55cfb1; }
  html:not([data-theme="light"]) .hl .nc, html:not([data-theme="light"]) .hl .nn { color: #dcc47a; }
}

/* ---------- 页脚导航 ---------- */
.pagenav { display: flex; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pagenav a {
  flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.pagenav a:hover { border-color: var(--accent); text-decoration: none; }
.pagenav .dir { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 3px; }
.pagenav .t { font-size: 14.5px; font-weight: 650; color: var(--ink); display: block; }
.pagenav a.nx { text-align: right; }
.donebtn {
  margin-top: 28px; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--bg-alt);
  font-size: 13.5px; color: var(--muted);
}
.donebtn button {
  margin-left: auto; padding: 6px 14px; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent-bg); color: var(--accent-in); font: inherit; font-size: 13px;
  font-weight: 650; cursor: pointer;
}
.donebtn.done { border-style: solid; border-color: var(--accent); color: var(--accent-in); }

.footer { margin-top: 60px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); line-height: 1.9; }

/* ---------- 首页 ---------- */
.hero { padding: 56px 0 40px; }
.hero .kicker { font-size: 12.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--warm); font-weight: 700; margin-bottom: 14px; }
.hero h1 { font-size: 40px; line-height: 1.25; margin: 0 0 16px; letter-spacing: -.9px; font-weight: 780; }
.hero .sub { font-size: 18px; color: var(--ink-soft); max-width: 44em; margin: 0 0 26px; line-height: 1.8; }
.hero .stats { display: flex; flex-wrap: wrap; gap: 22px; font-size: 13px; color: var(--muted); margin-bottom: 30px; }
.hero .stats b { display: block; font-size: 22px; color: var(--ink); font-weight: 750; line-height: 1.3; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.cta a {
  padding: 11px 20px; border-radius: 9px; font-size: 14.5px; font-weight: 650;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
/* v19：主按钮字色用 --bg 而不是写死 #fff——暗色主题的 --accent 是浅青（#55cfb1），白字压在上面只有约 1.9:1；
   --bg 在亮色下近白、暗色下近黑，两套主题都在 6:1 以上。 */
.cta a.p { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.cta a:hover { text-decoration: none; transform: translateY(-1px); }

.notice {
  margin: 34px 0; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 3px solid var(--warm); background: var(--warm-bg);
}
.notice .t { font-weight: 700; margin-bottom: 6px; font-size: 14.5px; }
.notice p { margin: 0; font-size: 14.2px; color: var(--ink-soft); line-height: 1.8; }

.pathcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 24px 0 44px; }
.pathcard {
  padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); display: block; color: var(--ink);
}
.pathcard:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.pathcard .n { font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--warm); font-weight: 700; }
.pathcard .t { font-size: 16.5px; font-weight: 700; margin: 6px 0 8px; }
.pathcard .d { font-size: 13.5px; color: var(--muted); line-height: 1.75; }

.partlist { margin: 10px 0 0; }
.partblock { margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--line-soft); }
.partblock:last-child { border-bottom: 0; }
.partblock > .n { font-size: 11.5px; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.partblock > h3 { font-size: 20px; margin: 4px 0 6px; font-weight: 730; }
.partblock > .d { font-size: 14px; color: var(--muted); margin: 0 0 14px; line-height: 1.75; }
.partblock ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.partblock ol a { display: flex; gap: 9px; align-items: baseline; padding: 7px 10px; border-radius: 8px; font-size: 14px; color: var(--ink-soft); }
.partblock ol a:hover { background: var(--bg-alt); text-decoration: none; color: var(--ink); }
.partblock ol a .i { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 1.4em; }
.partblock ol a.read .i::after { content: " ✓"; color: var(--accent); }

/* ---------- 搜索浮层 ---------- */
.ovl { position: fixed; inset: 0; z-index: 90; background: rgba(20,18,14,.42); backdrop-filter: blur(3px); display: none;
  overflow-y: auto; overscroll-behavior: contain; padding-bottom: 4vh; } /* 浮层内容高于视口时（窄屏的卡住浮层）可滚到底部按钮 */
.ovl.on { display: block; }
.sbox {
  max-width: 680px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 24px 64px -16px rgba(0,0,0,.4); overflow: hidden;
}
.sbox input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px;
  font: inherit; font-size: 16px; background: none; color: var(--ink); outline: none;
}
.sres { max-height: 62vh; overflow-y: auto; }
.sres a { display: block; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.sres a:hover, .sres a.on { background: var(--accent-bg); text-decoration: none; }
.sres .rt { font-size: 14.2px; font-weight: 650; }
.sres .rp { font-size: 11.5px; color: var(--warm); margin-bottom: 3px; }
.sres .rx { font-size: 12.8px; color: var(--muted); line-height: 1.65; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sres mark { background: var(--warm-bg); color: var(--warm); padding: 0 1px; border-radius: 2px; }
.sfoot { padding: 9px 18px; font-size: 11.5px; color: var(--muted); background: var(--bg-alt); border-top: 1px solid var(--line); }
.sempty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- 登录页 ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gatebox { width: 100%; max-width: 400px; text-align: center; }
.gatebox .mark { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 20px;
  background: linear-gradient(140deg, var(--accent), var(--warm)); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px; }
.gatebox h1 { font-size: 22px; margin: 0 0 6px; font-weight: 730; }
.gatebox .s { font-size: 14px; color: var(--muted); margin: 0 0 26px; line-height: 1.75; }
.gatebox form { display: flex; gap: 8px; }
.gatebox input {
  flex: 1; padding: 11px 14px; font: inherit; font-size: 15px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); color: var(--ink); outline: none;
}
.gatebox input:focus { border-color: var(--accent); }
.gatebox button {
  padding: 11px 20px; font: inherit; font-size: 15px; font-weight: 650; border: 1px solid var(--accent);
  border-radius: 9px; background: var(--accent); color: #fff; cursor: pointer;
}
.gatebox .err { margin-top: 14px; font-size: 13.5px; color: var(--danger); min-height: 20px; }
.gatebox .tip { margin-top: 30px; font-size: 12.5px; color: var(--muted); line-height: 1.8; }

/* ---------- 移动端 ---------- */
.scrim { position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(20,18,14,.4); z-index: 45; display: none; }
.scrim.on { display: block; }

@media (max-width: 1024px) {
  :root { --sidebar-w: 272px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.on { transform: none; }
  .content { margin-left: 0; }
  .menubtn { display: grid; }
  .searchbtn { min-width: 0; }
  .searchbtn .ph, .searchbtn kbd { display: none; }
  .brand .nm { display: none; }
  .brand .ver { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 16px; line-height: 1.82; }
  .wrap { padding: 26px 16px 72px; }
  h1.title { font-size: 24px; }
  .hero { padding: 34px 0 26px; }
  .hero h1 { font-size: 28px; letter-spacing: -.5px; }
  .hero .sub { font-size: 16px; }
  .md h2 { font-size: 19px; margin-top: 36px; }
  .md h3 { font-size: 16.5px; }
  .md pre code { font-size: 12.6px; }
  .pagenav { flex-direction: column; }
  .partblock ol { grid-template-columns: 1fr; }
  .sbox { margin-top: 2vh; border-radius: 10px; }
  /* 窄屏下三个元信息竖排，否则「前置」两个字会被挤成两行 */
  .metabar { font-size: 12.5px; flex-direction: column; gap: 6px; }
  .metabar .it { align-items: baseline; }
  .metabar .sep { display: none; }
}


/* 死链的可见标记：构建已阻断部署，这是万一漏网时的肉眼兜底 */
.md .deadlink {
  color: var(--danger); background: var(--danger-bg); padding: 0 4px; border-radius: 4px;
  text-decoration: line-through; cursor: help;
}

/* v9 分档可见：正文里指向"你这一档看不见的课"的链接，构建时被摘成纯文本。
   不做成红色警告——它不是错误，是这一档本来就到不了的地方。
   保留虚下划线与 help 光标，让人知道"这里原本是个链接"，鼠标悬停有说明。 */
/* W16：升级为"锁定"样式——小锁图标 + 灰色虚下划线 + 可聚焦；正文与前置栏都用。
   说明气泡由 app.js initLocked() 浮出（单个 #lk-tip，按视口夹紧位置，390 宽不溢出）。 */
.locked {
  color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px;
  cursor: not-allowed; border-radius: 3px; white-space: normal;
}
.locked b { color: inherit; }
.locked .lk-ic { display: inline-block; vertical-align: -1px; margin-right: 3px; opacity: .85; }
.locked:hover, .locked.on { color: var(--ink-soft); }
.locked:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lk-tip {
  position: fixed; z-index: 90; max-width: min(280px, calc(100vw - 24px));
  padding: 8px 11px; border-radius: 8px; font-size: 13px; line-height: 1.5;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow);
  pointer-events: none; opacity: 0; transition: opacity .12s;
}
.lk-tip.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .lk-tip { transition: none; } }

/* ===========================================================================
   内容保护（v4）
   正文一律不可选中；代码块与指令块靠右上角的「复制」按钮取用。
   配套脚本 guard.js 负责拦截与插件检测，这里只管样式与可见性。
   =========================================================================== */

body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 输入控件必须还能用，否则搜索框打不了字 */
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* 代码块与指令块可选。
   本来就该这样——guard.js 里"代码块留右键，方便手动选"那句注释是这个意思，
   但样式一直没跟上，实测下来代码是选不中的（2026-07-31 真浏览器测出来的）。
   学生经常只需要命令里的一个参数，让他整块复制再删掉多余的，是没必要的摩擦；
   而代码本来就是给他拿走用的。正文、表格、图示仍然禁选，guard.js 也只对
   "选区不在代码块里" 的复制判违规。 */
.md pre, .md pre *, .md .hl, .md .hl * {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* 插件探针：它的计算样式一旦不是 none，就说明有人在强行放开选中 */
#ai4sProbe {
  position: fixed; left: -9999px; top: 0; width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: none;
}
.noselect { -webkit-user-select: none; -moz-user-select: none; user-select: none; }

/* 复制按钮：默认就露出来，不靠 hover——手机上没有 hover */
.copy { opacity: .55; }
@media (hover: none) { .copy { opacity: .8; } }

/* 关掉 JS 就等于关掉保护，所以没有 JS 时不给正文 */
html.nojs .md,
html.nojs .toc,
html.nojs .partblock,
html.nojs .sidebar { display: none !important; }
.nojs-tip { display: none; }
html.nojs .nojs-tip {
  display: block; margin: 28px 0; padding: 16px 18px;
  border: 1px solid var(--danger, #b3261e); border-radius: var(--radius);
  background: var(--warm-bg, #fff8e6); color: var(--danger, #b3261e); font-size: 14.5px;
}

/* 身份条 */
.idbar {
  position: fixed; right: 12px; bottom: 12px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px; font-size: 11.5px; line-height: 1.9;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.08);
  color: var(--muted); max-width: calc(100vw - 24px); overflow: hidden;
}
.idbar .who { font-weight: 600; color: var(--ink); }
.idbar .ip { font-family: ui-monospace, Menlo, Consolas, monospace; }
.idbar a { color: var(--muted); text-decoration: none; }
.idbar a:hover { color: var(--accent); }
@media (max-width: 620px) { .idbar .ip { display: none; } }

/* 暗水印：几乎看不见，截图会带出账号与 IP */
.wmark {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .03; background-repeat: repeat;
}
html[data-theme="dark"] .wmark { filter: invert(1); opacity: .05; }

/* 拦截提示气泡 */
.guardtip {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%) translateY(12px);
  z-index: 70; max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 10px; font-size: 13.5px; text-align: center;
  background: var(--ink); color: var(--bg); opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.guardtip.on { opacity: .96; transform: translateX(-50%) translateY(0); }

/* 底部红字声明 */
.copynotice {
  margin-top: 26px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid rgba(179,38,30,.35); background: rgba(179,38,30,.06);
  color: #b3261e; font-size: 12.8px; line-height: 1.8;
}
html[data-theme="dark"] .copynotice { color: #ff8f86; border-color: rgba(255,143,134,.3); }
/* v11 修：此前只有上面那一支。用户从没点过主题按钮、跟随系统暗色时，
   这段最需要被读清的红色警示仍是亮色版颜色，在暗底上对比度不够。
   同文件别处（如 .hl 那组）早就是双轨写法，说明这里是遗漏不是设计。 */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .copynotice { color: #ff8f86; border-color: rgba(255,143,134,.3); }
}
.copynotice b { color: inherit; }

/* 打印：直接不给。
   **这是有意为之，不要按"打印排版不好看"去修。** 全站策略是禁复制、禁下载、
   禁打印，配隐式水印与 IP 绑定；开一个可打印视图等于把"整页可导出"重新打开，
   直接抵消那两样东西。v11 顺手删掉了本块之前那段"可用的打印样式"——
   它写在这块之前、又没有 !important，从来没生效过，只会让下一个人以为打印可用。 */
@media print {
  body * { display: none !important; }
  body::after {
    content: "本站内容受版权保护，禁止打印与导出。";
    display: block !important; font-size: 18px; text-align: center; padding: 80px 20px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   v6 · 学生体验组件
   悬浮按钮 / 术语速查 / 卡住了 / 页脚反馈 / 自测答案折叠 / 路线进度 / 快捷键
   ══════════════════════════════════════════════════════════════════ */

/* 右下角悬浮按钮。手机上要够大够好点，桌面上要不挡正文。 */
.fabs {
  /* bottom 要让开身份条（.idbar 固定在 right:12 bottom:12，高约 30px）。
     实拍确认过：按 18px 放，「卡住了」会被身份条整个压住，等于这个按钮不存在。 */
  position: fixed; right: 18px; bottom: 58px; z-index: 56;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.fab {
  min-width: 58px; padding: 9px 13px; border-radius: 22px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-alt); color: var(--ink-soft);
  font-size: 13px; font-weight: 600; box-shadow: 0 3px 14px rgba(0,0,0,.12);
  transition: transform .12s, border-color .12s, color .12s;
}
.fab:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent-in); }
.fab.hot { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.fab.hot:hover { color: var(--bg); }
/* v19：窄屏改成贴底的一条操作栏（规则在本文件末尾「v19 · 窄屏底栏」）。
   此前在这里只是把浮动按钮挪近边缘，390 宽实拍仍压住首页统计行与课页正文——
   悬浮在正文上的东西，挪到哪里都会在某个滚动位置盖住一段字。 */

/* 术语速查条目 */
.gitem { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.gitem:last-child { border-bottom: 0; }
.gt { font-weight: 650; font-size: 14.5px; }
.gt .ge { font-weight: 450; color: var(--muted); font-size: 13px; margin-left: 8px; }
.gd { color: var(--ink-soft); font-size: 13.2px; line-height: 1.7; margin-top: 2px; }
.gall {
  display: block; padding: 11px 14px; text-align: center; font-size: 13px;
  border-top: 1px solid var(--line);
}

/* 卡住了 */
.helpbox { padding: 20px 22px 16px; text-align: left; }
.helpbox h2 { font-size: 19px; margin: 0 0 12px; font-weight: 720; }
/* v20：卡住浮层里的"装环境"分叉——新手最常见的卡点先给出口，再走通用三步 */
.envfork { border: 1px solid var(--line); border-left: 4px solid var(--warm); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; font-size: 14px; line-height: 1.8; color: var(--ink-soft); }
.envfork b { display: block; color: var(--ink); }
.envfork ul { margin: 4px 0 0; padding-left: 18px; }
.envfork code { font-size: 12.5px; }
.helprec { margin-left: 6px; font: inherit; font-size: 13px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
.helpsteps { margin: 0 0 14px; padding-left: 20px; font-size: 14px; line-height: 1.85; color: var(--ink-soft); }
.helpsteps b { color: var(--ink); }
.askbox { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.askbox .hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; background: var(--bg-alt); border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.askbox .hd button {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft);
  border-radius: 6px; padding: 3px 11px; font-size: 12px; cursor: pointer;
}
.askbox .hd button:hover { border-color: var(--accent); color: var(--accent-in); }
.askbox pre {
  margin: 0; padding: 12px; max-height: 40vh; overflow: auto;
  font-size: 12.6px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  -webkit-user-select: text; user-select: text;      /* 求助模板本来就是给他拿走的 */
}
.helpbox .sub { font-size: 12.8px; color: var(--muted); line-height: 1.8; margin: 12px 0 0; }
.helpbox .sub b { color: var(--ink-soft); }

/* 页脚反馈 */
.fbbox {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-alt);
}
.fbbox .q { font-size: 14.5px; font-weight: 650; margin-bottom: 10px; }
.fbbox .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fbbox .btns button {
  padding: 7px 15px; border-radius: 18px; cursor: pointer; font-size: 13.2px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft);
}
.fbbox .btns button:hover { border-color: var(--accent); color: var(--accent-in); }
.fbbox .more { margin-top: 12px; }
.fbbox .more label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.fbbox textarea {
  width: 100%; box-sizing: border-box; padding: 9px 11px; font: inherit; font-size: 13.4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink);
  resize: vertical; -webkit-user-select: text; user-select: text;
}
.fbbox #fbSend {
  margin-top: 8px; padding: 7px 18px; border-radius: 18px; cursor: pointer; font-size: 13.2px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
.fbbox .ok { font-size: 14px; color: var(--accent-in); font-weight: 600; }
.fbbox .sub { margin: 10px 0 0; font-size: 12.2px; color: var(--muted); line-height: 1.7; }

/* 自测答案折叠 */
.md details.answer {
  margin: 10px 0 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-alt);
}
.md details.answer summary {
  cursor: pointer; padding: 9px 13px; font-size: 13.4px; color: var(--muted);
  list-style: none; user-select: none;
}
.md details.answer summary::-webkit-details-marker { display: none; }
.md details.answer summary::before { content: "▸ "; }
.md details.answer[open] summary::before { content: "▾ "; }
.md details.answer summary:hover { color: var(--accent-in); }
.md details.answer blockquote { margin: 0; border-radius: 0 0 var(--radius) var(--radius); }

/* 首页路线进度 */
.pathcard .rbar {
  margin-top: 12px; height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden;
}
.pathcard .rbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .35s; }
.pathcard .rnum { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* 快捷键说明 */
.keyhelp {
  position: fixed; right: 18px; bottom: 158px; z-index: 60;
  padding: 12px 16px; border-radius: var(--radius); font-size: 13px; line-height: 2;
  border: 1px solid var(--line); background: var(--bg-alt); box-shadow: 0 6px 24px rgba(0,0,0,.16);
}
.keyhelp b { display: block; margin-bottom: 4px; font-size: 13.5px; }
.keyhelp kbd {
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px;
  font-size: 12px; background: var(--bg);
}

/* 页脚署名 */
.footer .byline { color: var(--ink-soft); }
.footer .byline b { font-weight: 650; }


/* ══════════════════════════════════════════════════════════════════
   v11 · 学习态与可发现性
   跨设备进度 / 收藏 / 笔记 / 自测自评 / 窄屏页内目录 / 最近更新 /
   搜索历史与零结果自救 / 无障碍
   ══════════════════════════════════════════════════════════════════ */

/* 跳到正文：读屏与纯键盘用户的第一个落点。平时藏起来，聚焦时才出现。 */
.skiplink {
  position: fixed; left: 8px; top: -60px; z-index: 300;
  background: var(--accent); color: #fff; padding: 8px 14px;
  border-radius: var(--radius); font-size: 14px; text-decoration: none;
  transition: top .12s;
}
.skiplink:focus { top: 8px; }

/* 全站统一的焦点环。此前只有登录框有一处 :focus-visible，
   纯键盘走整个站看不出自己在哪。 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* 侧栏：继续上次 / 上次来之后更新过 / 最近更新入口 */
.sb-resume, .sb-fresh {
  margin: 0 14px 8px; font-size: 12.5px; line-height: 1.6;
}
.sb-resume a {
  display: block; padding: 7px 10px; border-radius: 8px;
  background: var(--accent-bg); color: var(--accent-in);
  text-decoration: none; font-weight: 600;
}
.sb-resume a:hover { background: var(--accent); color: #fff; }
.sb-fresh { color: var(--warm); font-weight: 600; }
.sb-changelog {
  display: block; margin: 0 14px 12px; padding: 8px 10px;
  border: 1px dashed var(--line); border-radius: 8px;
  font-size: 12.5px; color: var(--muted); text-decoration: none;
}
.sb-changelog:hover { border-color: var(--accent); color: var(--accent); }

/* 「你上次来之后更新过」的小圆点 */
.newdot {
  display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-radius: 50%; background: var(--warm); vertical-align: middle;
}
a.fresh > span:last-child { font-weight: 600; }

/* 信息条上的"久未更新" */
.metabar .stale {
  margin-left: 6px; color: var(--warm); text-decoration: none;
  border-bottom: 1px dotted var(--warm); font-size: 12px;
}

/* 窄屏页内目录。右侧那份 .toc 只在 ≥1360px 出现，这一份补的是它够不到的宽度。 */
.tocmini {
  margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-alt); font-size: 14px;
}
.tocmini > summary {
  padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--ink-soft);
  list-style: none;
}
.tocmini > summary::-webkit-details-marker { display: none; }
.tocmini > summary::before { content: "▸ "; color: var(--muted); }
.tocmini[open] > summary::before { content: "▾ "; }
.tocmini .tmbody { padding: 0 14px 12px; }
.tocmini .tmbody a {
  display: block; padding: 4px 0 4px 10px; color: var(--ink-soft);
  text-decoration: none; border-left: 2px solid var(--line-soft);
}
.tocmini .tmbody a:hover { color: var(--accent); border-left-color: var(--accent); }
@media (min-width: 1360px) { .tocmini { display: none; } }

/* 收藏按钮：挂在打勾条右边，两者都是"这一课我怎么处理"的动作 */
.donebtn .bm {
  margin-left: 8px; background: transparent; color: var(--muted);
  border: 1px solid var(--line);
}
.donebtn .bm:hover { border-color: var(--warm); color: var(--warm); }
.donebtn .bm.on { background: var(--warm-bg); border-color: var(--warm); color: var(--warm); }

/* 自测自评 */
.quizcheck {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 22px 0 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-alt);
  font-size: 14px;
}
.quizcheck .q { color: var(--ink-soft); font-weight: 600; }
.quizcheck button {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: 13.5px;
}
.quizcheck button:hover { border-color: var(--accent); color: var(--accent); }
.quizcheck button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.quizcheck .qcmsg { color: var(--muted); font-size: 13px; }

/* 私有笔记 */
.notebox {
  margin: 14px 0 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.notebox > summary {
  padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--ink-soft);
  font-size: 14px; list-style: none;
}
.notebox > summary::-webkit-details-marker { display: none; }
.notebox > summary::before { content: "✎ "; color: var(--muted); }
.notebox textarea {
  display: block; width: calc(100% - 28px); margin: 0 14px 6px; padding: 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  color: var(--ink); font: inherit; font-size: 14px; line-height: 1.7; resize: vertical;
  /* 笔记是学生自己写的字，这里必须能选中能改——禁复制管的是正文，不管这里 */
  -webkit-user-select: text; user-select: text;
}
.notebox .nhint { padding: 0 14px 12px; color: var(--muted); font-size: 12.5px; }

/* 搜索：历史、提示与"这一课另有 N 处命中" */
.shist { padding: 10px 16px 14px; font-size: 13px; color: var(--muted); }
.shist button {
  margin: 4px 6px 0 0; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); cursor: pointer; font-size: 13px;
}
.shist button:hover { border-color: var(--accent); color: var(--accent); }
.shint {
  padding: 8px 16px; font-size: 12.8px; color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.sres .rmore { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* 首页路线卡上的「接着学」 */
.rnext { display: block; margin-top: 8px; font-size: 13px; color: var(--accent); font-weight: 600; }
.rnext:empty { display: none; }

/* 最近更新页 */
.clgroup { margin: 26px 0 0; }
.cldate {
  margin: 0 0 10px; padding-bottom: 6px; font-size: 17px; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.cldate .cln { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--muted); }
.cllist { list-style: none; margin: 0; padding: 0; }
.cllist li { margin: 0; }
.cllist a {
  display: flex; gap: 10px; align-items: baseline; padding: 7px 10px;
  border-radius: 8px; text-decoration: none; color: var(--ink-soft);
}
.cllist a:hover { background: var(--bg-alt); color: var(--accent); }
.cllist a.read .clt::before { content: "✓ "; color: var(--accent); }
.cllist .clp {
  flex: 0 0 auto; min-width: 116px; font-size: 12.5px; color: var(--muted);
}
.cllist .clt { font-size: 14.5px; }
@media (max-width: 640px) {
  .cllist a { flex-direction: column; gap: 2px; }
  .cllist .clp { min-width: 0; }
}

/* 快捷键 fab。刻意用文字不用 ⌨ 符号——本机实拍那个符号是个空方框，
   而"一个看不懂的图标"恰恰是这条改动要解决的问题本身。
   ⚠️ 窄屏直接不显示：手机上没有键盘，这个按钮零价值，
   而它挤在另外两个 fab 上面会实打实盖住一段正文（390px 实拍逮到的）。 */
.fab.keys { font-size: 12px; }
@media (max-width: 860px) { .fab.keys { display: none; } }

/* 浮层的 Tab 序不用管：`.ovl` 基线就是 display:none（本文件 441 行），
   关掉的浮层内部元素本来就不在 Tab 序列里。
   审计里"关闭状态下内部元素仍可 Tab"那条经实测不成立，故这里刻意不加
   visibility 规则——加了是纯噪声，还会让下一个人以为它在解决什么问题。 */

/* 窄屏底部留白：v19 起按钮与身份条并进一条贴底操作栏（见本文件末尾），
   正文只需让出那一条的高度，留白在末尾那节里一并给出。 */

/* 给代理的任务书 */
.taskbook {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 14px 0 0; padding: 12px 14px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent-bg); font-size: 14px; color: var(--ink-soft);
}
.taskbook button {
  padding: 6px 14px; border-radius: 8px; border: 0;
  background: var(--accent); color: #fff; cursor: pointer; font-size: 13.5px;
}
.taskbook button:hover { background: var(--accent-in); }
.taskbook .tb-note { font-size: 12.5px; color: var(--muted); }

/* 结业里程碑：只在某条路线真跑完时弹一次 */
.milestone {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 200; max-width: min(560px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--accent);
  box-shadow: 0 20px 48px -16px rgba(0,0,0,.35);
  font-size: 14px; line-height: 1.7; color: var(--ink-soft);
}
.milestone b { color: var(--accent); font-size: 15.5px; }
.milestone button {
  align-self: flex-end; margin-top: 4px; padding: 5px 14px;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-alt); color: var(--ink-soft); cursor: pointer;
}

/* ======================================================================
   v12（W8）门面视觉：首页主视觉、路线图、部分卡片、学习地图、页首图标条。
   只用站点色 token，亮/暗两主题自动跟随；一切动画在 prefers-reduced-motion
   下直接给终态（文件末尾那一段）。零外部资源。
   ====================================================================== */
.ic { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -.2em; }
.ic path, .ic circle, .ic rect, .ic ellipse { stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes vx-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes vx-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vx-pop  { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* 首页主视觉 */
.hero-vx { padding-bottom: 34px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 28px; align-items: center; }
.hero-vx .sub { margin-bottom: 8px; }
.myprog { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px 14px; text-align: center; box-shadow: var(--shadow); position: relative; }
.myprog .ring { width: 128px; height: 128px; display: block; margin: 0 auto; transform: rotate(-90deg); }
.myprog .ring circle { fill: none; stroke-width: 10; }
.myprog .ring .trk { stroke: var(--line-soft); }
.myprog .ring .val { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.7,.2,1); }
.myprog .rtxt { position: absolute; left: 0; right: 0; top: 58px; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.myprog .rtxt b { font-size: 25px; font-weight: 780; color: var(--ink); line-height: 1.1; }
.myprog .rtxt span { font-size: 12px; color: var(--muted); }
.myprog .rnote { font-size: 12.5px; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.6; }

.flowline { list-style: none; margin: 26px 0 26px; padding: 18px 8px 16px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 14px; position: relative; overflow: hidden; }
.flowline li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 0 4px; min-width: 0;
  animation: vx-rise .6s calc(var(--i) * .35s + .1s) both; }
.flowline li .ic { width: 50px; height: 50px; padding: 11px; box-sizing: border-box; border-radius: 50%; background: var(--surface); color: var(--accent);
  border: 2px solid var(--accent); position: relative; z-index: 1; }
.flowline li .ic * { animation: vx-draw 1s calc(var(--i) * .35s + .2s) both; }
.flowline li:last-child .ic { color: var(--warm); border-color: var(--warm); }
.flowline li b { font-size: 14.5px; font-weight: 720; color: var(--ink); margin-top: 4px; }
.flowline li span { font-size: 12px; color: var(--muted); line-height: 1.45; }
/* 站与站之间的连线：底线 + 一道沿线流动的光 */
.flowline li + li::before { content: ""; position: absolute; top: 25px; right: calc(50% + 27px); width: calc(100% - 54px); height: 2px;
  background: linear-gradient(90deg, var(--line), var(--line)); }
.flowline li + li::after { content: ""; position: absolute; top: 24px; right: calc(50% + 27px); width: calc(100% - 54px); height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, transparent 0 30%, var(--accent) 50%, transparent 70% 100%); background-size: 300% 100%;
  animation: vx-flow 2.8s calc(var(--i) * .35s) linear infinite; opacity: .9; }
@keyframes vx-flow { from { background-position: 100% 0; } to { background-position: 0 0; } }

.hero .stats > div { display: flex; flex-direction: column; }
.hero .stats > div > .ic { color: var(--accent); width: 20px; height: 20px; margin-bottom: 2px; }
.hero .stats > div > .ic * { animation: vx-draw 1.1s .3s both; }

/* 路线图：一课一站 */
.pathcard .rico { color: var(--warm); margin-right: 5px; }
.rdots { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 2px; position: relative; }
.rdots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); border: 1px solid var(--line); box-sizing: border-box; }
.rdots i:first-child { background: var(--surface); border-color: var(--warm); }
.rdots i.on { background: var(--accent); border-color: var(--accent); animation: vx-pop .45s calc(var(--k, 0) * 40ms) both; }
.rdots i.next { border: 2px solid var(--accent); background: var(--surface); }

/* 部分卡片 */
.partgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.partgrid .pcard { margin: 0; padding: 16px 16px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  animation: vx-rise .5s calc(min(var(--i), 12) * 45ms) both; display: flex; flex-direction: column; }
.partgrid .pcard:last-child { border-bottom: 1px solid var(--line); }
.partgrid .pcard:hover { border-color: var(--accent); }
.pcard .phead { display: flex; gap: 12px; align-items: center; }
.pico { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto;
  background: var(--accent-bg); color: var(--accent); }
.pico .ic { width: 24px; height: 24px; }
.pcard .pico .ic * { animation: vx-draw 1.2s calc(min(var(--i), 12) * 45ms + .2s) both; }
.pcard:hover .pico .ic * { animation: vx-draw .9s both; }
.partgrid .pcard > h3, .pcard .phead h3 { font-size: 17px; margin: 2px 0 0; font-weight: 730; line-height: 1.35; }
.pcard .phead .n { font-size: 11.5px; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.partgrid .pcard > .d { font-size: 13.5px; margin: 10px 0 12px; flex: 1 0 auto; }
.pbar { height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden; display: inline-block; width: calc(100% - 68px); vertical-align: middle; }
.pbar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 1s cubic-bezier(.2,.7,.2,1); }
.pcnt { display: inline-block; width: 56px; text-align: right; font-size: 12px; color: var(--muted); vertical-align: middle; }
.pcard details { margin-top: 8px; }
.pcard summary { cursor: pointer; font-size: 13px; color: var(--accent); padding: 4px 0; }
.pcard details ol { margin-top: 6px; }

/* 侧栏部分小图标 */
.sidebar .part .hd .hdico { display: inline-flex; color: var(--accent); }
.sidebar .part .hd .hdico .ic { width: 15px; height: 15px; }

/* 学习地图（/overview/） */
.lmap { position: relative; margin: 8px 0 30px; padding: 18px 16px 12px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 14px; }
.lmap-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.lmap-edges path { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .45; stroke-dasharray: 1; stroke-dashoffset: 1; }
.lmap.drawn .lmap-edges path { animation: vx-draw 1s calc(var(--k, 0) * 60ms) forwards; }
.lmap-edges .hd { fill: var(--accent); opacity: .7; }
.lrow { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: center; padding: 11px 0; position: relative;
  animation: vx-rise .5s calc(var(--i) * 90ms) both; }
.lrow.side { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 16px; }
.lname { font-size: 12px; font-weight: 700; color: var(--warm); letter-spacing: .5px; }
.lnodes { display: flex; flex-wrap: wrap; gap: 26px 10px; justify-content: center; min-width: 0; }
.mnode { position: relative; z-index: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; row-gap: 1px; align-items: center;
  width: 172px; max-width: 100%; box-sizing: border-box; padding: 9px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  color: var(--ink); text-decoration: none; transition: border-color .2s, transform .2s; }
.mnode:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.mnode .pico { grid-row: span 2; width: 36px; height: 36px; border-radius: 9px; }
.mnode .pico .ic { width: 20px; height: 20px; }
.mnode .mt { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.mnode .mc { font-size: 11.5px; color: var(--muted); }
.mnode .mc em { font-style: normal; color: var(--accent); font-weight: 700; }
.mnode .mbar { grid-column: 1 / -1; height: 3px; margin-top: 6px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.mnode .mbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1s; }
.mnode.done { border-color: var(--accent); }
.lmap-cap { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.7; }
.ovh .pico { width: 30px; height: 30px; border-radius: 8px; margin-right: 9px; vertical-align: -7px; }
.ovh .pico .ic { width: 18px; height: 18px; }

/* 课程页页首信息条：图标化 + 难度三格 */
.metabar .lb { display: inline-flex; align-items: center; gap: 4px; }
.metabar .lb .ic { color: var(--accent); width: 15px; height: 15px; }
.metabar .pips { display: inline-flex; gap: 2px; align-self: center; margin-right: 3px; }
.metabar .pips i { width: 11px; height: 6px; border-radius: 2px; background: var(--line); }
.metabar .pips i.on { background: var(--warm); }
.readbar { height: 3px; background: linear-gradient(90deg, var(--accent), var(--warm)); }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; gap: 18px; }
  .myprog { display: grid; grid-template-columns: 96px 1fr; gap: 4px 14px; text-align: left; align-items: center; padding: 12px 14px; }
  .myprog .ring { width: 96px; height: 96px; grid-row: span 2; }
  .myprog .rtxt { position: absolute; left: 14px; width: 96px; right: auto; top: 12px; height: 96px; justify-content: center; }
  .myprog .rtxt b { font-size: 20px; }
  .myprog .rtxt span { font-size: 10.5px; }
  .myprog .rnote { margin: 0; }
  .flowline { padding: 14px 2px 12px; }
  .flowline li { padding: 0 1px; }
  .flowline li .ic { width: 40px; height: 40px; padding: 8px; }
  .flowline li + li::before, .flowline li + li::after { top: 20px; right: calc(50% + 22px); width: calc(100% - 44px); }
  .flowline li b { font-size: 12.5px; }
  .flowline li span { font-size: 10.5px; }
  .lrow { grid-template-columns: 1fr; gap: 6px; }
  .lname { text-align: center; }
  .lnodes { gap: 22px 8px; }
  .mnode { width: calc(50% - 5px); padding: 8px; column-gap: 7px; }
  .mnode .pico { width: 30px; height: 30px; }
  .mnode .pico .ic { width: 17px; height: 17px; }
  .mnode .mt { font-size: 12.5px; }
  .mnode .mc { font-size: 11px; }
  .lmap { padding: 14px 10px 10px; }
  /* 速览卡里偶有超长无空格串（路径、URL），不让它把整页撑出横向滚动 */
  .ovcard, .ovcard h3, .ovcard li, .ovcard .ovskip { overflow-wrap: anywhere; min-width: 0; }
  .ovcard h3 .meta { white-space: normal; }
  .metabar .it { display: block; }
  .metabar .lb { margin-right: 6px; vertical-align: -2px; }
  .metabar .pips { vertical-align: 1px; }
  .partgrid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .flowline li span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .flowline li, .flowline li .ic *, .hero .stats .ic *, .partgrid .pcard, .pcard .pico .ic *, .lrow, .rdots i.on { animation: none !important; }
  .flowline li + li::after { animation: none; background: var(--accent); opacity: .5; }
  .lmap-edges path { stroke-dashoffset: 0 !important; animation: none !important; }
  .myprog .ring .val, .pbar i, .mnode .mbar i { transition: none; }
}

/* ── v12 W10：窄屏横向溢出的全站通用兜底 ──
   实测 390px 溢出的真因是正文里的长裸 URL（纯文本、不是链接，W1 的断行只管了 <a>）和代码块外的长行内代码；
   代码块与表格本来就各自在容器内横向滚动（pre / .tw 的 overflow-x:auto），这里再补三件：
   ① 正文文字允许在词内断行（只在一行放不下时才断，不影响正常排版）；
   ② 表格不动（单元格允许词内断行会把列挤窄，表格仍走 .tw 容器内滚动）；③ flex 子项 min-width:0，页头元信息条逐项换行。 */
.content, .wrap, .md { min-width: 0; }
.md p, .md li, .md blockquote, .md dd, .md figcaption, .lede { overflow-wrap: anywhere; }
.md :not(pre) > code { overflow-wrap: anywhere; word-break: break-word; }
.md pre, .md .hl, .md .tw, .md figure { max-width: 100%; }
.metabar { flex-wrap: wrap; min-width: 0; }
/* 窄屏竖排时 flex 主轴变成纵向，末项的 flex-basis:340px 会被当成高度撑出一大块空白——竖排下一律按内容高 */
@media (max-width: 640px) { .metabar .it, .metabar .it:last-child { flex: 0 0 auto; } }
.metabar .it { min-width: 0; overflow-wrap: anywhere; }

/* ---------- v13 交付物清单 ---------- */
.sb-dv { margin-top: 6px; }
.dv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.dv-chips button { font: inherit; font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: inherit; cursor: pointer; }
.dv-chips button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.dvpart { margin: 28px 0 8px; }
.dvlist { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: dv; }
.dvi { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.dvi[hidden] { display: none; }
.dvi > a { font-weight: 600; text-decoration: none; display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.dvi > a .dvck { margin-top: 3px; }
.dvi p { margin: 4px 0 0 26px; font-size: 14px; color: var(--muted); line-height: 1.65; }
.dvm { margin: 6px 0 0 26px; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.dvck { width: 16px; height: 16px; flex: none; border: 1.5px solid var(--line); border-radius: 4px; position: relative; transition: background .2s, border-color .2s; }
.dvi > a.read .dvck { background: var(--accent); border-color: var(--accent); }
.dvi > a.read .dvck::after { content: ""; position: absolute; left: 4px; top: 0px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dvpart .ovh .c em { font-style: normal; }
@media (prefers-reduced-motion: reduce) { .dvck { transition: none; } }
@media (max-width: 600px) { .dvi p, .dvm { margin-left: 0; } }

/* ===========================================================================
   v14 入门档首页（home_intro.html）
   =========================================================================== */
.flowline.flow4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flowline li.done .ic { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.intro-home .ih2 { font-size: 22px; margin: 44px 0 14px; font-weight: 600; }
.intro-gains { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.intro-gains .ig { border: 1px solid var(--line); border-radius: 8px; padding: 16px 14px; display: flex; flex-direction: column; gap: 6px;
  animation: vx-rise .6s calc(var(--k, 0) * .12s + .2s) both; }
.intro-gains .ig:nth-child(2) { --k: 1; } .intro-gains .ig:nth-child(3) { --k: 2; } .intro-gains .ig:nth-child(4) { --k: 3; }
.intro-gains .ig .ic { width: 34px; height: 34px; color: var(--accent); }
.intro-gains .ig b { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.intro-gains .ig span { font-size: 14px; color: var(--muted); line-height: 1.6; }
.intro-stages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ip-stage .ip-num { display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px;
  font-variant-numeric: tabular-nums; }
.ip-list { list-style: none; margin: 10px 0 0; padding: 0; }
.ip-list li a { display: flex; gap: 8px; align-items: baseline; padding: 6px 4px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.ip-list li a:hover { background: var(--surface); }
.ip-list li a .i { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.ip-list li a em { margin-left: auto; font-style: normal; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ip-list li a.read span:nth-child(2)::after { content: " ✓"; color: var(--accent); }
.intro-more .locked-demo { color: var(--muted); border-bottom: 1px dashed var(--line); }
@media (max-width: 900px) {
  .intro-gains { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-stages { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .intro-gains { grid-template-columns: 1fr; }
  .ip-list li a em { display: none; }
}
@media (prefers-reduced-motion: reduce) { .intro-gains .ig { animation: none; } }

/* v14：首屏概念动图与三分钟速览并排（frontmatter hero_vx: "first"） */
.tldr-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; margin: 18px 0; }
.tldr-hero .hero-fig .vxf { margin: 0; }
.tldr-hero .tldr { margin: 0; }
@media (max-width: 900px) { .tldr-hero { grid-template-columns: 1fr; } }
/* v14：交付物"件名"标签（替代截在列表中间的摘要） */
.dvh { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; padding: 0; }
.dvh li { font-size: 13px; line-height: 1.5; padding: 1px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }

/* v14「我的学习」 */
.mine-top { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: center; margin: 18px 0 8px; }
.mine-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mine-stats .ms { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 4px;
  animation: vx-rise .5s both; }
.mine-stats .ms:nth-child(2) { animation-delay: .1s; } .mine-stats .ms:nth-child(3) { animation-delay: .2s; } .mine-stats .ms:nth-child(4) { animation-delay: .3s; }
.mine-stats .ms .ic-w { width: 26px; height: 26px; color: var(--accent); }
.mine-stats .ms.warn .ic-w { color: var(--warm); }
.mine-stats .ms b { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.mine-stats .ms span:last-child { font-size: 13.5px; color: var(--muted); }
.mine-bars { display: grid; gap: 8px; }
.mine-bars .mb { display: grid; grid-template-columns: 9em minmax(0, 1fr) 4.5em; gap: 10px; align-items: center; font-size: 14px; }
.mine-bars .mbt { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine-bars .mbb { height: 10px; border-radius: 5px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.mine-bars .mbb i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .9s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 60ms); }
.mine-bars.on .mbb i { width: var(--w); }
.mine-bars .mbn { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.mine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
.mine-hint { font-size: 13.5px; color: var(--muted); margin: -6px 0 8px; }
.mine-list { list-style: none; margin: 0; padding: 0; }
.mine-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line);
  animation: vx-rise .4s calc(var(--i, 0) * 40ms) both; }
.mine-list li a { color: var(--ink); }
.mine-list li span { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mine-list li em { flex-basis: 100%; font-style: normal; font-size: 13px; color: var(--muted); }
.mine-list li.empty { color: var(--muted); font-size: 14px; }
.mine-err { color: var(--warm); }
@media (max-width: 900px) { .mine-top { grid-template-columns: 1fr; justify-items: center; } .mine-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; } .mine-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .mine-bars .mb { grid-template-columns: 6.5em minmax(0, 1fr) 4em; font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .mine-stats .ms, .mine-list li { animation: none; } .mine-bars .mbb i { transition: none; } }

/* v15：课页路线条、路线时长、组长入口、"仅组长"小标 */
.rtbar { margin: 8px 0 28px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--card, transparent); overflow: hidden; }
/* v17：一行摘要 + 可展开明细。高度用 grid 0fr→1fr 过渡，明细行依次落下，箭头翻转。
   折叠态只在 .rtbar.js 下生效：脚本没跑时明细原样可见，不靠动效才显示。 */
.rtsum { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 14px; width: 100%; padding: 7px 14px; font-size: 13.5px; line-height: 1.5; cursor: pointer; white-space: nowrap; overflow: hidden; transition: background-color .25s ease; }
.rtsum:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.rtsum:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rtsum .rtn { font-weight: 700; color: var(--warm); display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.rtsum .rtn svg { width: 15px; height: 15px; }
.rtchip { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rtchip b { color: var(--ink); font-weight: 600; margin-right: 2px; }
.rtmore { margin-left: auto; flex-shrink: 0; display: none; align-items: center; gap: 3px; color: var(--accent); font-weight: 600; }
.rtbar.js .rtmore { display: inline-flex; }
.rtmore svg { width: 15px; height: 15px; transition: transform .4s cubic-bezier(.34, 1.4, .5, 1); }
.rtbar.open .rtmore svg { transform: rotate(180deg); }
.rtrows { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .42s cubic-bezier(.2, .7, .2, 1); }
.rtrows-in { min-height: 0; overflow: hidden; }
.rtbar.js:not(.open) .rtrows { grid-template-rows: 0fr; }
.rtbar.js .rtrows-in { visibility: visible; transition: visibility 0s; }
.rtbar.js:not(.open) .rtrows-in { visibility: hidden; transition: visibility 0s .42s; }
.rtrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 13.5px;
  transition: opacity .32s ease calc(var(--k, 0) * 70ms + 90ms), transform .42s cubic-bezier(.2, .7, .2, 1) calc(var(--k, 0) * 70ms + 90ms); }
.rtbar.js:not(.open) .rtrow { opacity: 0; transform: translateY(-8px); transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) { .rtrows, .rtrow, .rtmore svg { transition: none; } }
@media print { .rtbar.js .rtrows { grid-template-rows: 1fr !important; } .rtbar.js .rtrows-in { visibility: visible !important; } .rtbar.js .rtrow { opacity: 1 !important; transform: none !important; } }
.rtrow .rtn { font-weight: 700; color: var(--warm); display: inline-flex; align-items: center; gap: 4px; }
.rtrow .rtn svg { width: 15px; height: 15px; }
.rtrow .rtpos b, .rtrow .rtleft b { color: var(--accent); }
.rtrow .rtleft { color: var(--muted); }
.rtdots { display: inline-flex; flex-wrap: wrap; gap: 3px; max-width: 360px; }
.rtdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .4s, transform .4s; }
.rtdots i.on { background: var(--accent); }
.rtdots i.cur { background: var(--warm); transform: scale(1.5); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warm) 30%, transparent); animation: rtpulse 1.8s ease-in-out infinite; }
@keyframes rtpulse { 50% { transform: scale(1.9); } }
.rtrow .rtnext { margin-left: auto; font-weight: 600; }
.rtrow .rtnext.done { color: var(--muted); font-weight: 400; }
.pathcard .rtime, .pathcard .rhid { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.pathcard .rhid { font-style: italic; }
.leadcard { border: 1px solid var(--line); border-left: 3px solid var(--warm); border-radius: 8px; padding: 14px 16px; margin: 0 0 16px; }
.leadcard .lh { font-weight: 700; color: var(--warm); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.leadcard .lh svg { width: 18px; height: 18px; }
.leadcard .ll { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.leadcard .ll a { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; transition: border-color .2s, transform .2s; }
.leadcard .ll a:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.leadcard .ll b { display: block; font-size: 14.5px; }
.leadcard .ll span { font-size: 12.5px; color: var(--muted); }
sup.lk-lead { font-size: 10.5px; margin-left: 2px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--warm); color: var(--warm); vertical-align: super; }

/* v16 入门档路线导引：进度条从 0 生长到当前位置，提示下一课 */
.introguide{border:1px solid var(--line,#d9dee7);border-left:4px solid var(--accent,#2f6fed);border-radius:10px;padding:.7rem 1rem;margin:0 0 1.2rem;background:var(--card,rgba(47,111,237,.05))}
.introguide p{margin:.45rem 0 0;line-height:1.7}
.introguide .ig-bar{height:6px;border-radius:3px;background:rgba(127,127,127,.18);overflow:hidden}
.introguide .ig-bar i{display:block;height:100%;width:calc(var(--ig) * 100%);background:linear-gradient(90deg,var(--accent,#2f6fed),#20b2aa);transform-origin:left;animation:igGrow 1.1s cubic-bezier(.2,.8,.2,1) both}
@keyframes igGrow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
/* v17：图形块在打印时一律终态（滚动揭示与入场动效都不该决定纸面上有没有内容） */
@media print { .md > h2, .md figure.vxf { animation: none !important; opacity: 1 !important; transform: none !important; } }
/* v17：课页首屏。正文第一节的标题不再带 46px 的节间距（它上面没有上一节），速览框与正文的间隔同步收紧，
   让第一段正文落在第一屏里。只动"正文第一个元素是二级标题"的情形，节与节之间的间距不变。 */
.md > h2:first-child { margin-top: 0; }
.wrap > .tldr { margin-bottom: 12px; }
.wrap > .tocmini { margin-bottom: 12px; }
.metabar + .rtbar { margin-top: -26px; }
.wrap > .crumb { margin-top: -18px; }
.wrap > .lede { margin-bottom: 14px; }
.wrap > .metabar { padding: 9px 14px; gap: 5px 8px; }


/* ══════════════════════════════════════════════════════════════════
   v19 · 首页「今天先做这一件」 + 窄屏底栏
   ══════════════════════════════════════════════════════════════════ */

/* 首屏：第一课跑完后真实拿到手的三样东西。数值与图来自起步项目实跑输出（见 home.html 注释）。 */
.today { margin: 26px 0 28px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-alt); }
.today-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 18px; margin-bottom: 14px; }
.today-head > div { flex: 1 1 360px; min-width: 0; }
.today-k { font-size: 12px; letter-spacing: 1.2px; color: var(--warm); font-weight: 700; margin-bottom: 4px; }
.today h2 { font-size: 21px; font-weight: 740; margin: 0 0 6px; letter-spacing: -.3px; line-height: 1.35; }
.today-head p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.7; }
.today-go { flex: 0 0 auto; display: inline-block; padding: 10px 18px; border-radius: 10px; font-size: 15px; font-weight: 650;
  background: var(--accent); border: 1px solid var(--accent); color: var(--bg); transition: transform .12s, background-color .12s; }
.today-go:hover { text-decoration: none; color: var(--bg); transform: translateY(-1px); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .8fr) minmax(0, 1.05fr); gap: 12px; }
.tcard { margin: 0; min-width: 0; padding: 12px 13px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  display: flex; flex-direction: column; }
.tcard figcaption { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.tcard .tn { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 750; background: var(--accent-bg); color: var(--accent); flex: 0 0 auto; }
.tcard .tnote { margin: auto 0 0; padding-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.tmetrics table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tmetrics th { text-align: left; font-size: 11.5px; font-weight: 650; color: var(--muted); padding: 0 6px 5px 0; border-bottom: 1px solid var(--line); }
.tmetrics td { padding: 7px 6px 7px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); vertical-align: baseline; }
.tmetrics tr:last-child td { border-bottom: 0; }
.tmetrics td:nth-child(2), .tmetrics td:nth-child(3), .tmetrics th:nth-child(2), .tmetrics th:nth-child(3) { text-align: right; white-space: nowrap; }
.tmetrics td b { font-size: 17px; font-weight: 760; color: var(--ink); font-variant-numeric: tabular-nums; }
.tmetrics td i { font-style: normal; display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 5px; font-size: 11.5px; font-weight: 700;
  background: var(--accent-bg); color: var(--accent); }
.tmetrics .m-leaky td i { background: var(--warm-bg); color: var(--warm); }
.tmetrics .m-leaky td b { color: var(--warm); }
.tplot img { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto; aspect-ratio: 1 / 1; object-fit: contain;
  border-radius: 8px; border: 1px solid var(--line-soft); background: #fff; }
.tl-file { font: 600 11.5px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); margin-bottom: 4px; }
.tl-row { font: 12px/1.65 ui-monospace, Menlo, Consolas, monospace; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 9px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-soft); }
.tl-row .tl-h { color: var(--muted); }
@media (max-width: 1100px) {
  .today-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tledger { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .today { padding: 14px 12px 12px; margin: 18px 0 22px; }
  .today h2 { font-size: 19px; }
  .today-go { width: 100%; text-align: center; box-sizing: border-box; }
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .tplot img { max-width: 240px; }
}

/* 窄屏底栏：「术语／卡住了」与身份条并进贴底的一条，正文让出这一条的高度。
   悬浮按钮压字是位置问题，挪到哪里都会在某个滚动位置盖住一段正文；贴底一条相当于把可视区缩短，
   栏上方的每一行都完整可读。按钮仍在原处可点，身份条移到同一条的左侧。 */
@media (max-width: 860px) {
  .fabs { left: 0; right: 0; bottom: 0; z-index: 58; flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
  .fab { min-width: 0; padding: 6px 13px; font-size: 13px; box-shadow: none; }
  .idbar { left: 10px; right: auto; bottom: calc(9px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 170px);
    padding: 2px 10px; gap: 8px; box-shadow: none; }
  .content .wrap { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .guardtip { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .milestone { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
}

/* ── v21 公开首页（真首页的公开版）：无侧栏、登录入口、怎么进来 ───────────────── */
.layout.nosb .content { margin-left: 0; }
.layout.nosb .wrap { max-width: 1040px; }
.topbar .publogin { font-size: 14px; font-weight: 600; color: var(--bg); background: var(--accent); border: 1px solid var(--accent);
  border-radius: 8px; padding: 6px 14px; margin-right: 8px; white-space: nowrap; }
.topbar .publogin:hover { background: var(--accent-in); text-decoration: none; }
.publogin-card { text-align: left; display: flex; flex-direction: column; gap: 10px; padding: 20px 18px; }
.publogin-card .plc-k { font-size: 12px; letter-spacing: .08em; color: var(--accent); font-weight: 600; }
.publogin-card .plc-t { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.publogin-card .plc-go { display: block; text-align: center; background: var(--accent); color: var(--bg); border-radius: 8px;
  padding: 10px 12px; font-weight: 600; font-size: 14px; transition: transform .2s ease, background .2s ease; }
.publogin-card .plc-go:hover { background: var(--accent-in); text-decoration: none; transform: translateY(-1px); }
.publogin-card .rnote { margin: 0; text-align: left; }
.pubaccess { margin: 52px 0 8px; padding: 26px 26px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pubaccess h2 { font-size: 22px; margin: 0 0 6px; font-weight: 600; }
.pubaccess .pa-sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.pa-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.pa-steps li { position: relative; border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px 14px 12px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.pa-steps li i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-bg); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.pa-steps li b { font-size: 15px; color: var(--ink); }
.pa-steps li span { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.pa-steps li:not(:last-child)::after { content: ""; position: absolute; right: -9px; top: 26px; width: 6px; height: 6px;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg); opacity: .7; }
.pubaccess .pa-contact { margin: 20px 0 0; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 16px; font-weight: 600; color: var(--ink); }
@media (max-width: 860px) { .pa-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pa-steps li:nth-child(2)::after { display: none; } }
@media (max-width: 520px) { .pa-steps { grid-template-columns: 1fr; } .pa-steps li::after { display: none; } .topbar .publogin { padding: 5px 10px; font-size: 13px; } .pubaccess { padding: 20px 16px; } }
@media (min-width: 1360px) { .layout.nosb .wrap { padding-right: 28px; max-width: 1120px; } }
