/* ============================================================================
   style.css — 全部视觉样式
   ----------------------------------------------------------------------------
   ✎ 想改主题 / 配色 / 圆角 / 间距：只改下面 :root 与 [data-theme="light"] 变量区
   ✎ 组件样式按「顶栏 / 导航 / 章节 / 区块 / 底栏 / 弹窗 / 响应式」顺序排列
   ============================================================================ */

:root {
  /* ── 深色主题（默认） ───────────────────────────────── */
  --bg:            #080c14;
  --bar-bg:        rgba(9, 14, 24, .86);
  --rail-bg:       rgba(11, 16, 27, .68);
  --panel:         rgba(255, 255, 255, .035);
  --panel-2:       rgba(255, 255, 255, .065);
  --hover:         rgba(255, 255, 255, .045);
  --line:          rgba(255, 255, 255, .10);
  --line-2:        rgba(255, 255, 255, .20);
  --text:          #eaf0fb;
  --text-2:        #a5b2c8;
  --text-3:        #71809a;
  --accent:        #6de3c8;
  --accent-2:      #a48bff;
  --accent-ink:    #06231d;
  --accent-soft:   rgba(109, 227, 200, .10);
  --accent-line:   rgba(109, 227, 200, .34);
  --warn:          #ffbc70;
  --warn-soft:     rgba(255, 188, 112, .10);
  --warn-line:     rgba(255, 188, 112, .32);
  --shadow:        0 22px 60px rgba(0, 0, 0, .42);
  --orb-a:         rgba(109, 227, 200, .15);
  --orb-b:         rgba(164, 139, 255, .15);
  --grid-line:     rgba(255, 255, 255, .035);

  /* ── 尺寸 / 字体 ────────────────────────────────────── */
  --top-h:         66px;
  --bot-h:         72px;
  --rail-w:        246px;
  --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", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  --bg:            #f5f7fc;
  --bar-bg:        rgba(255, 255, 255, .88);
  --rail-bg:       rgba(255, 255, 255, .62);
  --panel:         #ffffff;
  --panel-2:       #eef2fa;
  --hover:         #f3f6fc;
  --line:          rgba(22, 36, 62, .11);
  --line-2:        rgba(22, 36, 62, .22);
  --text:          #142033;
  --text-2:        #4c5a70;
  --text-3:        #8994a8;
  --accent:        #0a9883;
  --accent-2:      #6f4fe0;
  --accent-ink:    #ffffff;
  --accent-soft:   rgba(10, 152, 131, .09);
  --accent-line:   rgba(10, 152, 131, .30);
  --warn:          #b56a0a;
  --warn-soft:     rgba(181, 106, 10, .09);
  --warn-line:     rgba(181, 106, 10, .28);
  --shadow:        0 20px 50px rgba(24, 39, 75, .14);
  --orb-a:         rgba(10, 152, 131, .12);
  --orb-b:         rgba(111, 79, 224, .10);
  --grid-line:     rgba(22, 36, 62, .045);
}

*, *::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: 15px;
  line-height: 1.7;
  -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; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── 背景装饰 ─────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .85; }
.orb--a { width: 620px; height: 620px; top: -260px; right: -140px; background: var(--orb-a); }
.orb--b { width: 540px; height: 540px; bottom: -280px; left: 10%; background: var(--orb-b); }
.grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 72%, transparent);
}

/* ── 全局进度条 ───────────────────────────────────────────── */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: var(--line); }
.progress__fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px var(--accent);
  transition: width .45s cubic-bezier(.22, .8, .3, 1);
}

/* ── 顶栏 ─────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 22px;
  background: var(--bar-bg); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__mark {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #06231d; font-size: 19px; font-weight: 700;
  box-shadow: 0 6px 22px var(--accent-soft);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand__text b { font-size: 15px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__text small { color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.switch { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.switch__btn {
  border: 0; background: none; color: var(--text-3); cursor: pointer;
  font-size: 12.5px; padding: 5px 12px; border-radius: 7px; transition: all .22s ease;
}
.switch__btn.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 650; box-shadow: inset 0 0 0 1px var(--accent-line); }
.counter { font-family: var(--mono); font-size: 12px; color: var(--text-3); padding: 0 4px; white-space: nowrap; }
.counter b { color: var(--text); font-size: 14px; }
.counter i { font-style: normal; margin: 0 3px; opacity: .5; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  color: var(--text-2); font-size: 15px; cursor: pointer; transition: all .2s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); }

/* ── 章节导航 ─────────────────────────────────────────────── */
.rail {
  position: fixed; top: var(--top-h); bottom: var(--bot-h); left: 0;
  width: var(--rail-w); z-index: 40;
  padding: 22px 14px 30px; overflow-y: auto;
  background: var(--rail-bg); border-right: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.rail__title { display: flex; flex-direction: column; gap: 2px; padding: 0 12px 16px; }
.rail__title b { font-size: 15px; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.rail__item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; margin-bottom: 4px; text-align: left;
  border: 1px solid transparent; border-radius: 10px;
  background: none; color: var(--text-2); cursor: pointer;
  transition: background .22s ease, color .22s ease, border-color .22s ease;
}
.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__item.is-active::before {
  content: ''; position: absolute; left: -15px; top: 22%; bottom: 22%; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.rail__no { font-family: var(--mono); font-size: 11px; color: var(--text-3); flex: 0 0 24px; }
.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: 13.5px; font-weight: 600; white-space: nowrap; }
.rail__text small { font-size: 10.5px; color: var(--text-3); }
.rail__foot { margin-top: 18px; padding: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-3); line-height: 1.8; }
.rail__foot span { color: var(--accent); }

/* ── 内容舞台 ─────────────────────────────────────────────── */
.stage {
  position: relative; z-index: 1;
  margin-left: var(--rail-w);
  padding: 40px clamp(20px, 5vw, 76px) 110px;
  max-width: 1320px;
}
.chapter { animation: chapterIn .5s cubic-bezier(.2, .75, .3, 1) both; scroll-margin-top: calc(var(--top-h) + 24px); }
@keyframes chapterIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.chapter__head { position: relative; display: flex; align-items: flex-start; gap: 22px; margin-bottom: 32px; overflow: hidden; }
.chapter__no {
  flex: 0 0 auto; font-family: var(--mono); font-size: clamp(56px, 8vw, 96px);
  font-weight: 700; line-height: 1; letter-spacing: -.06em;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .85;
}
.chapter__headtext { padding-top: 6px; min-width: 0; }
.chapter__headtext h2 {
  margin: 8px 0 8px; font-size: clamp(27px, 3.6vw, 46px);
  line-height: 1.22; letter-spacing: -.015em; font-weight: 700;
}
.chapter__headtext p { margin: 0; color: var(--text-2); font-size: 14.5px; max-width: 60ch; }
.chapter__head::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--accent-line), var(--line), transparent);
}
.chapter__head { padding-bottom: 26px; }

/* ── 要点步骤 ─────────────────────────────────────────────── */
.chapter__steps { display: flex; flex-direction: column; gap: 12px; }
.step {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); scroll-margin-top: calc(var(--top-h) + 20px);
  transition: border-color .3s ease, background .3s ease, opacity .3s ease;
}
body.mode-present .step.is-current {
  border-color: var(--accent-line);
  background: linear-gradient(120deg, var(--accent-soft), var(--panel) 62%);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .10);
}
body.mode-present .step.is-current::before {
  content: ''; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 3px;
  border-radius: 3px; background: var(--accent); box-shadow: 0 0 16px var(--accent);
}
body.mode-present .step.is-done { opacity: .68; }
body.mode-present .step.is-done.is-open { opacity: 1; }
.step__head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 18px; border: 0; background: none; color: inherit;
  text-align: left; cursor: pointer;
}
.step__idx {
  flex: 0 0 auto; min-width: 34px; text-align: center;
  font-family: var(--mono); font-size: 11.5px; padding: 4px 6px;
  border: 1px solid var(--accent-line); border-radius: 7px; color: var(--accent);
}
.step__label { flex: 1; font-size: 16px; font-weight: 650; letter-spacing: .01em; }
.step__state { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
body.mode-present .step.is-current .step__state { color: var(--accent); }
.step__chev { font-size: 15px; color: var(--text-3); transition: transform .25s ease; }
.step__body { padding: 2px 18px 22px; }

/* 「接下来」提示：演示模式给观众一个明确的方向 */
.upnext {
  display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 12px 18px;
  border: 1px dashed var(--line-2); border-radius: 12px;
  background: transparent; color: var(--text-3);
}
.upnext__kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; white-space: nowrap; }
.upnext__label { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-2); }
.upnext__arrow { color: var(--accent); font-size: 15px; }
body.mode-read .upnext { display: none; }

/* 演示模式：未来要点隐藏、已讲要点收起、点击可回看 */
body.mode-present .step.is-future { display: none; }
body.mode-present .step.is-done { padding-bottom: 0; }
body.mode-present .step.is-done .step__head { padding-top: 10px; padding-bottom: 10px; }
body.mode-present .step.is-done .step__body { display: none; }
body.mode-present .step.is-done.is-open .step__body { display: block; padding-top: 4px; }
body.mode-present .step.is-done .step__chev { transform: rotate(-90deg); }
body.mode-present .step.is-done.is-open .step__chev { transform: rotate(0); }
body.mode-present .step.is-current .step__body > .blk { animation: rise .5s cubic-bezier(.2, .75, .3, 1) both; }
body.mode-present .step.is-current .step__body > .blk:nth-child(1) { animation-delay: .06s; }
body.mode-present .step.is-current .step__body > .blk:nth-child(2) { animation-delay: .12s; }
body.mode-present .step.is-current .step__body > .blk:nth-child(3) { animation-delay: .18s; }
body.mode-present .step.is-current .step__body > .blk:nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* 阅读模式：要点标题仅作标签，不参与交互 */
body.mode-read .step { opacity: 1; }
body.mode-read .step__head { pointer-events: none; cursor: default; }
body.mode-read .step__chev { display: none; }
body.mode-read .chapter + .chapter { margin-top: 70px; padding-top: 60px; border-top: 1px dashed var(--line-2); }

/* ── 内容区块通用 ─────────────────────────────────────────── */
.blk { margin: 0 0 16px; }
.blk:last-child { margin-bottom: 0; }
.blk--lead {
  font-size: clamp(19px, 2.3vw, 28px); line-height: 1.55; font-weight: 650;
  letter-spacing: -.01em; color: var(--text);
  padding-left: 16px; border-left: 3px solid var(--accent);
}
.blk--p { color: var(--text-2); }
.blk--note { font-size: 12.5px; color: var(--text-3); line-height: 1.8; }
.blk--quote {
  padding: 16px 20px; border: 1px solid var(--accent-line); border-radius: 12px;
  background: var(--accent-soft); color: var(--text); font-size: 15px; line-height: 1.85;
}
.blk strong { color: var(--accent); font-weight: 700; }
.blk code, .inline-code {
  font-family: var(--mono); font-size: .88em; padding: 2px 6px;
  border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line);
}
.autolink { overflow-wrap: anywhere; word-break: break-all; }

/* 重点卡片 */
.callout { padding: 17px 20px; border-radius: 13px; border: 1px solid var(--accent-line); background: var(--accent-soft); }
.callout--warn { border-color: var(--warn-line); background: var(--warn-soft); }
.callout__title { font-size: 12px; font-family: var(--mono); letter-spacing: .1em; color: var(--accent); margin-bottom: 6px; }
.callout--warn .callout__title { color: var(--warn); }
.callout p { margin: 0; line-height: 1.85; }
.callout--warn strong { color: var(--warn); }

/* 数字条 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2);
}
.stat b { font-family: var(--mono); font-size: clamp(24px, 3vw, 34px); line-height: 1.1; color: var(--accent); }
.stat span { font-size: 12px; color: var(--text-3); }

/* 流程步骤 */
.flow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 10px; }
.flow__item {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 15px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
  transition: transform .25s ease, border-color .25s ease;
}
.flow__item:hover { transform: translateY(-3px); border-color: var(--accent-line); }
.flow__n { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.flow__item b { font-size: 14.5px; }
.flow__text { font-size: 12px; color: var(--text-3); line-height: 1.6; }

/* 卡片网格 */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.cards--1 { grid-template-columns: 1fr; }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  position: relative; padding: 18px 19px; min-width: 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.card__badge { position: absolute; top: 16px; right: 18px; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.card__top { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; padding-right: 28px; }
.card__logo { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; background: var(--panel-2); padding: 3px; }
.card__top h4 { margin: 0; font-size: 16px; }
.card__text { margin: 0 0 12px; font-size: 13.5px; color: var(--text-2); line-height: 1.8; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--text-2); }
.card__points { margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.card__points > div { display: flex; gap: 10px; font-size: 12.8px; line-height: 1.7; }
.card__points dt { flex: 0 0 92px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.card__points dd { margin: 0; min-width: 0; color: var(--text-2); }
.card__link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.8px; font-weight: 600; }
.card__link:hover { text-decoration: none; filter: brightness(1.15); }

/* 表格 */
.tbl-hint { display: none; margin: 0 0 7px; font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.tbl { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 13px; }
.tbl caption { text-align: left; padding: 12px 16px; font-weight: 650; color: var(--text-2); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.65; }
.tbl th { background: var(--panel-2); color: var(--accent); font-weight: 650; white-space: nowrap; font-size: 12px; letter-spacing: .02em; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl td:first-child { font-weight: 600; white-space: nowrap; color: var(--text); }
.tbl a.autolink { font-family: var(--mono); font-size: 11.5px; }
.tbl strong { color: var(--accent); }

/* 列表 */
.list { padding-left: 22px; color: var(--text-2); }
.list li { margin-bottom: 9px; line-height: 1.8; }
.list li::marker { color: var(--accent); font-family: var(--mono); }

/* 链接卡片 */
.links { display: grid; gap: 10px; }
.linkcard {
  display: flex; align-items: center; gap: 13px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  transition: all .25s ease; color: var(--text);
}
.linkcard:hover { text-decoration: none; border-color: var(--accent-line); background: var(--accent-soft); transform: translateX(3px); }
.linkcard__icon { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.linkcard__body { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; flex: 1; }
.linkcard__body b { font-size: 14px; }
.linkcard__body small { font-size: 11.5px; color: var(--text-3); }
.linkcard__host { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* 代码块 */
.code { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #0b1220; }
.code__head { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.code__head span { font-family: var(--mono); font-size: 11.5px; color: #8fa3c8; }
.code__copy { border: 1px solid rgba(109, 227, 200, .35); background: rgba(109, 227, 200, .1); color: #6de3c8; border-radius: 7px; padding: 4px 11px; font-size: 11.5px; cursor: pointer; transition: all .2s ease; }
.code__copy:hover, .code__copy.is-copied { background: #6de3c8; color: #06231d; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.code code { font-family: var(--mono); font-size: 12.5px; line-height: 1.85; color: #d9e6ff; white-space: pre; }

/* 图片 */
.figure { margin-inline: 0; }
.figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.figure--inline img { max-width: 440px; }
.figure figcaption { margin-top: 8px; font-size: 12px; color: var(--text-3); }

/* 折叠区块 */
.collapse { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.collapse summary {
  display: flex; align-items: center; gap: 12px; padding: 13px 17px;
  cursor: pointer; list-style: none; user-select: none; transition: background .2s ease;
}
.collapse summary::-webkit-details-marker { display: none; }
.collapse summary:hover { background: var(--hover); }
.collapse__label { flex: 1; font-size: 14px; font-weight: 650; }
.collapse__hint { font-size: 11.5px; color: var(--text-3); }
.collapse__icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--accent-line); color: var(--accent); font-size: 15px; transition: transform .25s ease; }
.collapse[open] .collapse__icon { transform: rotate(45deg); }
.collapse[open] summary { border-bottom: 1px solid var(--line); }
.collapse__body { padding: 18px 17px 4px; }
.collapse__body .blk:last-child { margin-bottom: 14px; }

/* ── 底栏 ─────────────────────────────────────────────────── */
.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--bot-h); z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 22px;
  background: var(--bar-bg); border-top: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.bottombar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; flex: 0 0 auto; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(109, 227, 200, .5); } 70% { box-shadow: 0 0 0 9px rgba(109, 227, 200, 0); } 100% { box-shadow: 0 0 0 0 rgba(109, 227, 200, 0); } }
.bottombar__label { font-size: 14px; font-weight: 650; white-space: nowrap; }
.bottombar__steps { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); white-space: nowrap; }
.dots { display: flex; gap: 5px; }
.dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: none; cursor: pointer; transition: all .25s ease; }
.dot:hover { border-color: var(--accent); transform: scale(1.3); }
.dot.is-done { background: var(--text-3); border-color: var(--text-3); }
.dot.is-on { width: 22px; border-radius: 5px; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent-line); }
.bottombar__right { display: flex; gap: 9px; flex: 0 0 auto; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text); font-size: 13px; cursor: pointer;
  transition: all .22s ease; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--accent-line); color: var(--accent); transform: translateY(-2px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn--primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); color: #fff; box-shadow: 0 8px 24px var(--accent-soft); }
.btn--ghost { border-color: var(--line); padding: 7px 13px; font-size: 12.5px; }

/* ── 弹窗 ─────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: 20px; background: rgba(4, 8, 16, .68);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: fadeIn .22s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal__panel {
  width: min(880px, 100%); max-height: 84vh; overflow-y: auto;
  padding: 26px; border: 1px solid var(--line-2); border-radius: 20px;
  background: var(--bg); box-shadow: var(--shadow);
  animation: popIn .3s cubic-bezier(.2, .8, .3, 1) both;
}
.modal__panel--sm { width: min(520px, 100%); }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.modal__head h2 { margin: 4px 0 0; font-size: 26px; }
.overview__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }
.ovcard {
  display: flex; flex-direction: column; gap: 6px; padding: 16px;
  text-align: left; border: 1px solid var(--line); border-radius: 13px;
  background: var(--panel); color: var(--text); cursor: pointer; transition: all .25s ease;
}
.ovcard:hover { border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-3px); }
.ovcard__no { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.ovcard b { font-size: 14.5px; line-height: 1.4; }
.ovcard small { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
.ovcard__meta { margin-top: 6px; font-size: 11px; color: var(--accent); font-family: var(--mono); }
.keys { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0; }
.keys > div, .keys dt, .keys dd { margin: 0; }
.keys { display: grid; grid-template-columns: 190px 1fr; align-items: center; }
.keys dt { color: var(--text-2); font-size: 13px; }
.keys dd { color: var(--text-3); font-size: 13px; }
kbd { display: inline-block; padding: 2px 7px; margin-right: 3px; 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(--accent); }

/* ── 响应式 ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --rail-w: 214px; }
  .stage { padding-inline: 28px; }
  .linkcard__host { display: none; }
}

@media (max-width: 860px) {
  :root { --top-h: 60px; --bot-h: 66px; }
  body { padding-top: var(--top-h); }
  .rail {
    position: sticky; top: var(--top-h); left: auto; right: auto; bottom: auto;
    width: 100%; height: auto; z-index: 45;
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px; overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail__title, .rail__foot { display: none; }
  .rail__item { flex: 0 0 auto; width: auto; margin: 0; padding: 6px 12px; gap: 7px; border-radius: 9px; }
  .rail__item.is-active::before { display: none; }
  .rail__text small { display: none; }
  .rail__text b { font-size: 12.5px; }
  .rail__no { flex-basis: auto; }
  .stage { margin-left: 0; padding: 26px 20px 90px; }
  .step, .chapter { scroll-margin-top: calc(var(--top-h) + 62px); }
  .chapter__head { gap: 16px; }
  .chapter__no { font-size: 58px; }
  .cards--2, .cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl-hint { display: block; }
  .topbar { padding: 0 14px; }
  .bottombar { padding: 0 14px; }
  .keys { grid-template-columns: 150px 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .brand__text small { display: none; }
  .brand__text b { font-size: 13.5px; }
  .brand__mark { width: 32px; height: 32px; font-size: 16px; }
  .topbar__right { gap: 6px; }
  #fullBtn { display: none; }
  #helpBtn { display: none; }
  .switch__btn { padding: 5px 9px; font-size: 12px; }
  .counter { font-size: 11px; }
  .counter b { font-size: 12.5px; }
  .icon-btn { width: 31px; height: 31px; font-size: 14px; }
  .stage { padding: 22px 14px 80px; }
  .chapter__head { margin-bottom: 22px; padding-bottom: 20px; gap: 12px; }
  .chapter__no { font-size: 44px; }
  .chapter__headtext h2 { font-size: 26px; }
  .chapter__headtext p { font-size: 13px; }
  .step__head { padding: 12px 13px; gap: 9px; }
  .step__label { font-size: 14.5px; }
  .step__state { font-size: 10.5px; }
  .step__body { padding: 2px 13px 18px; }
  .upnext { padding: 10px 13px; gap: 9px; }
  .upnext__label { font-size: 12px; }
  .cards, .cards--1, .cards--2, .cards--3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl { min-width: 500px; font-size: 12.5px; }
  .card__points > div { flex-direction: column; gap: 1px; }
  .card__points dt { flex-basis: auto; }
  .linkcard { padding: 11px 12px; }
  .bottombar { gap: 8px; }
  .bottombar__left { gap: 8px; }
  .bottombar__label { font-size: 12.5px; }
  .bottombar__steps { display: none; }
  .dots { display: none; }
  .btn { padding: 8px 11px; font-size: 12.5px; gap: 4px; }
  .bottombar__right { gap: 6px; }
  .modal { padding: 12px; }
  .modal__panel { padding: 18px; max-height: 88vh; }
  .modal__head h2 { font-size: 22px; }
  .overview__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ovcard { padding: 12px; }
  .ovcard small { display: none; }
  .keys { grid-template-columns: 120px 1fr; }
  .keys dt, .keys dd { font-size: 12px; }
}

@media (max-width: 380px) {
  .brand__text { display: none; }
  .flow { grid-template-columns: 1fr; }
}

/* ── 减少动效偏好 ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── 打印 / 导出 PDF：展开全部内容 ─────────────────────────── */
@media print {
  .topbar, .bottombar, .rail, .progress, .backdrop, .modal { display: none !important; }
  body { padding: 0; background: #fff; color: #111; }
  .stage { margin: 0; padding: 0; }
  .chapter, .step, .step__body { display: block !important; opacity: 1 !important; }
  .step { break-inside: avoid; }
  .chapter + .chapter { margin-top: 30px; }
}

/* ── 站点集成（课程站维护，勿随课件版本覆盖） ─────────────────
   品牌区即返回课程首页链接：不额外占用顶栏宽度，窄屏不会挤爆。
   颜色沿用上面的主题变量，深浅主题切换时自动跟随。 */
.brand { color: inherit; text-decoration: none; }
.brand:hover .brand__mark { box-shadow: 0 6px 22px var(--accent-line); }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 11px; }
.overview-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.overview-home {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 0;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text-2);
  font-size: 13px; text-decoration: none; transition: all .2s ease;
}
.overview-home:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.overview-home:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
