/* ============================================================================
   style.css — 视觉样式
   改配色只动 :root / [data-theme="light"] 两个变量区。
   顺序：变量 → 基础 → 背景 → 顶栏 → 导航 → 章节/要点 → 区块 → 底栏 → 弹窗 → 响应式 → 打印
   ========================================================================== */

:root {
  /* 深色（默认，投影用） */
  --bg:           #070b14;
  --bar:          rgba(8, 13, 24, .88);
  --rail:         rgba(10, 16, 28, .62);
  --panel:        rgba(255, 255, 255, .038);
  --panel-2:      rgba(255, 255, 255, .07);
  --hover:        rgba(255, 255, 255, .05);
  --line:         rgba(255, 255, 255, .10);
  --line-2:       rgba(255, 255, 255, .20);
  --text:         #e9effb;
  --text-2:       #a7b4ca;
  --text-3:       #74839b;
  --accent:       #5b8cff;   /* 主色：DeepSeek 蓝 */
  --accent-2:     #2fd4d0;   /* 辅色：青 */
  --accent-ink:   #04122e;
  --accent-soft:  rgba(91, 140, 255, .12);
  --accent-line:  rgba(91, 140, 255, .36);
  --warn:         #ffbd6b;
  --warn-soft:    rgba(255, 189, 107, .10);
  --warn-line:    rgba(255, 189, 107, .32);
  --danger:       #ff7a7a;
  --danger-soft:  rgba(255, 122, 122, .12);
  --shadow:       0 24px 64px rgba(0, 0, 0, .45);
  --glow-a:       rgba(91, 140, 255, .17);
  --glow-b:       rgba(47, 212, 208, .13);
  --mesh:         rgba(255, 255, 255, .035);

  --top-h:        64px;
  --bot-h:        70px;
  --rail-w:       244px;
  --radius:       16px;
  --font:         "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:         "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", monospace;
}

[data-theme="light"] {
  --bg:           #f6f8fd;
  --bar:          rgba(255, 255, 255, .9);
  --rail:         rgba(255, 255, 255, .66);
  --panel:        #ffffff;
  --panel-2:      #eef3fc;
  --hover:        #f2f6fe;
  --line:         rgba(20, 34, 60, .12);
  --line-2:       rgba(20, 34, 60, .24);
  --text:         #13203a;
  --text-2:       #4a5872;
  --text-3:       #8794a9;
  --accent:       #2b52d8;
  --accent-2:     #0a8f8b;
  --accent-ink:   #ffffff;
  --accent-soft:  rgba(43, 82, 216, .08);
  --accent-line:  rgba(43, 82, 216, .3);
  --warn:         #b3700c;
  --warn-soft:    rgba(179, 112, 12, .09);
  --warn-line:    rgba(179, 112, 12, .28);
  --danger:       #c0392b;
  --danger-soft:  rgba(192, 57, 43, .08);
  --shadow:       0 20px 50px rgba(22, 38, 72, .14);
  --glow-a:       rgba(43, 82, 216, .12);
  --glow-b:       rgba(10, 143, 139, .10);
  --mesh:         rgba(20, 34, 60, .05);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-top: var(--top-h);
  padding-bottom: var(--bot-h);
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.has-modal { overflow: hidden; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eyebrow { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }

/* ── 背景装饰 ─────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(70px); }
.glow--a { width: 46vw; height: 46vw; left: -12vw; top: -16vw; background: var(--glow-a); }
.glow--b { width: 40vw; height: 40vw; right: -10vw; bottom: -14vw; background: var(--glow-b); }
.mesh {
  position: absolute; inset: 0; opacity: .9;
  background-image:
    linear-gradient(var(--mesh) 1px, transparent 1px),
    linear-gradient(90deg, var(--mesh) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
}

/* ── 全局进度 ─────────────────────────────────────────────── */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: transparent; }
.progress__fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .28s ease; }

/* ── 顶栏 ─────────────────────────────────────────────────── */
.bar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 18px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #04122e; font-size: 15px; box-shadow: 0 6px 18px rgba(91, 140, 255, .3); }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand__text b { font-size: 14.5px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__text small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__right { display: flex; align-items: center; gap: 8px; }

.seg { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.seg__btn { border: 0; cursor: pointer; padding: 5px 11px; border-radius: 7px; background: none; color: var(--text-3); font-size: 12.5px; transition: .18s; }
.seg__btn.is-on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.timer {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text-2); font-size: 12.5px; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: .18s;
}
.timer:hover { border-color: var(--line-2); color: var(--text); }
.timer b { font-size: 13px; color: var(--text); font-weight: 600; }
.timer i { font-style: normal; color: var(--text-3); }
.timer.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.timer.warn b { color: var(--warn); }
.timer.over { border-color: rgba(255, 122, 122, .45); background: var(--danger-soft); }
.timer.over b { color: var(--danger); }
.timer.is-running span[aria-hidden] { animation: tick 1.6s ease-in-out infinite; }
@keyframes tick { 50% { opacity: .35; } }

.counter { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; padding: 0 2px; }
.counter b { color: var(--text); font-size: 13.5px; }

.icon {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  color: var(--text-2); font-size: 14px; cursor: pointer; transition: .18s;
}
.icon:hover { color: var(--text); border-color: var(--line-2); background: var(--hover); }
a.icon { text-decoration: none; }
a.icon:hover { text-decoration: none; }

/* ── 章节导航 ─────────────────────────────────────────────── */
.rail {
  position: fixed; top: var(--top-h); bottom: var(--bot-h); left: 0; width: var(--rail-w);
  z-index: 30; padding: 18px 12px; overflow-y: auto;
  background: var(--rail); border-right: 1px solid var(--line);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 4px;
}
.rail__title { padding: 4px 10px 10px; }
.rail__title b { display: block; font-size: 13px; margin-top: 3px; }
.rail__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 11px;
  background: none; cursor: pointer; text-align: left; color: var(--text-2);
  transition: .18s;
}
.rail__item:hover { background: var(--hover); color: var(--text); }
.rail__item.is-active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.rail__no { font-family: var(--mono); font-size: 11px; color: var(--text-3); min-width: 18px; }
.rail__item.is-active .rail__no { color: var(--accent); }
.rail__text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.rail__text b { font-size: 13px; font-weight: 600; }
.rail__text small { font-size: 11px; color: var(--text-3); }
.rail__item.is-done .rail__text b::after { content: "✓"; margin-left: 6px; color: var(--accent-2); font-size: 11px; }
.rail__foot { margin-top: auto; padding: 12px 10px 4px; font-size: 11px; color: var(--text-3); line-height: 1.7; border-top: 1px solid var(--line); }

/* ── 内容区 ───────────────────────────────────────────────── */
.stage { position: relative; z-index: 10; margin-left: var(--rail-w); padding: 34px 46px 90px; max-width: 1240px; }
body.mode-read .stage { max-width: 1000px; }

.chapter { margin-bottom: 56px; scroll-margin-top: calc(var(--top-h) + 18px); }
body.mode-present .chapter { margin-bottom: 0; }

.chapter__head { display: flex; gap: 18px; align-items: flex-start; padding: 6px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.chapter__no { font-family: var(--mono); font-size: 15px; color: var(--accent); padding: 5px 9px; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--accent-soft); line-height: 1.3; }
.chapter__headtext { min-width: 0; }
.chapter__head h2 { margin: 4px 0 6px; font-size: clamp(26px, 2.5vw, 38px); line-height: 1.24; letter-spacing: -.01em; }
.chapter__head p { margin: 0; color: var(--text-2); font-size: clamp(14px, 1.15vw, 17px); }

/* ── 要点（步骤） ─────────────────────────────────────────── */
.step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 14px; overflow: hidden; transition: border-color .2s, box-shadow .2s, opacity .2s; }
.step.is-current { border-color: var(--accent-line); box-shadow: 0 10px 40px rgba(91, 140, 255, .10); }
.step.is-done { opacity: .78; }
.step.is-done:hover { opacity: 1; }

.step__head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 16px; border: 0; background: none; cursor: pointer; text-align: left;
}
.step__head:hover { background: var(--hover); }
.step__idx { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.step.is-current .step__idx { color: var(--accent); }
.step__label { font-size: 14.5px; font-weight: 600; flex: 1; min-width: 0; }
.step__state { font-size: 11px; color: var(--text-3); padding: 2px 8px; border: 1px solid var(--line); border-radius: 99px; }
.step.is-current .step__state { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.step__chev { color: var(--text-3); font-size: 13px; transition: transform .2s; }
.step.is-open .step__chev { transform: rotate(180deg); }

.step__body { display: none; padding: 2px 18px 18px; }
.step.is-open .step__body { display: block; }
body.mode-read .step__body { display: block; }

/* ── 区块 ─────────────────────────────────────────────────── */
.blk { margin: 12px 0; }
.blk:first-child { margin-top: 0; }
.blk--lead { font-size: clamp(19px, 1.65vw, 25px); line-height: 1.55; font-weight: 600; letter-spacing: -.005em; margin-bottom: 14px; }
.blk--p { color: var(--text-2); }
.blk--note { color: var(--text-3); font-size: 13px; }

.blk--quote { margin: 14px 0; padding: 14px 16px; border-left: 3px solid var(--accent-line); border-radius: 0 12px 12px 0; background: var(--accent-soft); color: var(--text); }
.blk--quote p { margin: 0; }

.callout { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 13px; padding: 13px 15px; }
.callout--warn { border-color: var(--warn-line); background: var(--warn-soft); }
.callout__title { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--accent); margin-bottom: 4px; }
.callout--warn .callout__title { color: var(--warn); }
.callout p { margin: 0; color: var(--text-2); font-size: 14px; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { flex: 1 1 120px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.stat b { display: block; font-size: 22px; font-family: var(--mono); color: var(--accent); line-height: 1.2; }
.stat span { font-size: 12px; color: var(--text-3); }

.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flow__item { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); font-size: 13.5px; }
.flow__n { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.flow__item b { font-weight: 600; }
.flow__text { color: var(--text-3); font-size: 12.5px; margin-left: auto; }

.cards { display: grid; gap: 10px; }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { position: relative; padding: 14px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); }
.card__badge { display: inline-block; font-family: var(--mono); font-size: 10.5px; color: var(--accent); margin-bottom: 6px; }
.card__top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.card h4 { margin: 0; font-size: 15px; }
.card__text { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.65; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag { font-size: 10.5px; font-family: var(--mono); color: var(--text-2); padding: 2px 7px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); }
.card__points { margin: 9px 0 0; display: grid; gap: 4px; }
.card__points dt { font-size: 11px; color: var(--text-3); }
.card__points dd { margin: 0 0 4px; font-size: 13px; color: var(--text-2); }
.card__link { display: inline-block; margin-top: 9px; font-size: 12.5px; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.tbl caption { text-align: left; padding: 10px 14px 8px; font-size: 12px; color: var(--text-3); }
.tbl th, .tbl td { padding: 9px 13px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.tbl th { font-size: 12px; color: var(--text-3); font-weight: 600; background: var(--panel-2); }
.tbl td { color: var(--text-2); }
.tbl td:first-child { color: var(--text); font-weight: 600; }
.tbl-hint { display: none; margin: 0 0 8px; font-size: 11px; color: var(--text-3); }

.list { margin: 10px 0; padding-left: 22px; color: var(--text-2); }
.list li { margin: 5px 0; }
.list li::marker { color: var(--accent); }
.list--tight li { margin: 3px 0; }

.code { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); overflow: hidden; }
.code__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); }
.code__copy { border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text-2); font-size: 11px; padding: 3px 9px; cursor: pointer; transition: .18s; }
.code__copy:hover { color: var(--text); border-color: var(--line-2); }
.code__copy.is-ok { color: var(--accent-2); border-color: var(--accent-2); }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; }
.code code, code.inline { font-family: var(--mono); font-size: 13px; line-height: 1.75; color: var(--text); }
code.inline { padding: 1px 5px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); font-size: .92em; white-space: nowrap; }
.blk--p code, .blk--note code, .card__text code, .list code, .tbl code { font-family: var(--mono); font-size: .9em; padding: 1px 5px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }

.links { display: grid; gap: 8px; }
.linkcard { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); color: var(--text); }
.linkcard:hover { text-decoration: none; border-color: var(--accent-line); background: var(--accent-soft); }
.linkcard__icon { color: var(--accent); font-size: 14px; }
.linkcard__body { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.linkcard__body b { font-size: 13.5px; }
.linkcard__body small { font-size: 11.5px; color: var(--text-3); word-break: break-all; }
.linkcard__host { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-3); }

.collapse { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.collapse summary { display: flex; align-items: center; gap: 9px; padding: 10px 13px; cursor: pointer; list-style: none; font-size: 13px; }
.collapse summary::-webkit-details-marker { display: none; }
.collapse__label { font-weight: 600; }
.collapse__hint { font-size: 11.5px; color: var(--text-3); }
.collapse__icon { margin-left: auto; color: var(--text-3); }
.collapse[open] .collapse__icon { transform: rotate(45deg); }
.collapse__body { padding: 4px 13px 12px; }

.figure { margin: 14px 0; }
.figure img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.figure figcaption { margin-top: 6px; font-size: 11.5px; color: var(--text-3); }

/* 接下来提示 */
.upnext { display: flex; align-items: center; gap: 9px; padding: 12px 2px 0; font-size: 12px; color: var(--text-3); }
body.mode-read .upnext { display: none; }
.upnext__kicker { font-size: 10px; letter-spacing: .14em; }
.upnext__label { color: var(--text-2); }
.upnext__arrow { margin-left: auto; color: var(--accent); }

/* ── 底栏 ─────────────────────────────────────────────────── */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bot-h); z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 20px;
  background: var(--bar); border-top: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%);
}
.bb__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); flex: none; }
.bb__chapter { font-size: 13px; font-weight: 600; white-space: nowrap; }
.bb__steps { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.dots { display: flex; gap: 5px; }
.dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--line-2); cursor: pointer; transition: .18s; }
.dot.is-done { background: var(--accent-2); }
.dot.is-on { width: 18px; border-radius: 99px; background: var(--accent); }
.bb__right { display: flex; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text); font-size: 13px; cursor: pointer; transition: .18s;
}
.btn:hover:not(:disabled) { background: var(--hover); border-color: var(--line-2); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn--primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn--ghost { background: none; }

/* ── 弹窗 ─────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(3, 6, 12, .62); backdrop-filter: blur(6px); }
.modal__panel { width: min(920px, 100%); max-height: 84vh; overflow-y: auto; padding: 22px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--bg); box-shadow: var(--shadow); }
.modal__panel--sm { width: min(560px, 100%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.modal__head h2 { margin: 2px 0 0; font-size: 22px; }
.modal__foot { margin: 16px 0 0; font-size: 11.5px; color: var(--text-3); }

.overview__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ovcard { display: flex; flex-direction: column; gap: 5px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); text-align: left; cursor: pointer; transition: .18s; }
.ovcard:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.ovcard__no { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.ovcard b { font-size: 14px; }
.ovcard small { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.ovcard__meta { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }

.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; align-items: baseline; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--text-2); font-size: 13px; }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--panel-2); font-family: var(--mono); font-size: 11.5px; color: var(--text); }

.notes__item { padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); margin-bottom: 9px; }
.notes__item b { display: block; font-size: 12.5px; color: var(--accent); margin-bottom: 4px; }
.notes__item p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.notes__empty { color: var(--text-3); font-size: 13px; }

/* ── 响应式 ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --rail-w: 208px; }
  .stage { padding: 26px 28px 80px; }
  .cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  .rail { position: static; width: auto; margin: var(--top-h) 0 0; padding: 8px 12px; flex-direction: row; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail__title, .rail__foot { display: none; }
  .rail__item { width: auto; flex: none; padding: 6px 10px; }
  .rail__text small { display: none; }
  .stage { margin-left: 0; padding: 22px 18px 84px; }
  body.mode-present .chapter { margin-bottom: 0; }
  .chapter__head { flex-direction: column; gap: 8px; }
  .cards--2, .cards--3 { grid-template-columns: 1fr; }
  .timer, .counter, .seg { display: none; }
  .brand__text small { display: none; }
  .bottombar { padding: 0 12px; }
  .bb__steps, .dots { display: none; }
  .tbl-hint { display: block; }
  .modal { padding: 12px; }
}

/* ── 打印 / 导出 PDF ─────────────────────────────────────── */
@media print {
  .bar, .rail, .bottombar, .progress, .backdrop, .upnext, .code__copy, .seg, .timer { display: none !important; }
  body { padding: 0; background: #fff; color: #000; }
  .stage { margin: 0; padding: 0; max-width: none; }
  .chapter { break-inside: avoid; margin-bottom: 24px; }
  .step__body { display: block !important; }
  .step { border-color: #ccc; break-inside: avoid; }
  .card, .stat, .tbl-wrap, .code { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}