/* ============================================================
   GeekHour · 全栈工程与后端工具交互学习文档站
   视觉基准：深色极客终端 + 架构蓝图（翡翠绿 / 天空蓝 / 琥珀金）
   ============================================================ */

:root {
  --ink: #080b10;
  --ink-2: #0d1219;
  --panel: #111722;
  --panel-2: #161f2d;
  --line: #233044;
  --line-soft: #192231;
  --text: #eef2f7;
  --muted: #9aa7b8;
  --dim: #68768a;

  --accent: #2ee6a6;
  --accent-deep: #158f65;
  --accent-soft: rgba(46, 230, 166, 0.12);
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.12);
  --green: #4ade80;

  --font-sans: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  --rail: 272px;
  --content: 890px;
  --wide: 1140px;
  --radius: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 78%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(920px 480px at 82% -10%, rgba(46, 230, 166, 0.09), transparent 60%),
    radial-gradient(720px 420px at 0% 24%, rgba(56, 189, 248, 0.06), transparent 60%);
  pointer-events: none;
}

::selection {
  background: rgba(46, 230, 166, 0.28);
  color: #fff;
}

a {
  color: var(--text);
  text-decoration-color: rgba(46, 230, 166, 0.55);
  text-underline-offset: 4px;
  transition: color 0.18s ease;
}
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

img { max-width: 100%; display: block; }

code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  color: var(--accent);
  background: rgba(46, 230, 166, 0.08);
  border: 1px solid rgba(46, 230, 166, 0.18);
  padding: 1px 6px;
  border-radius: 5px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  background: rgba(8, 11, 16, 0.84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 26px rgba(46, 230, 166, 0.5);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.topbar-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.topbar-nav a {
  padding: 6px 11px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
}
.topbar-nav a:hover { color: var(--text); background: var(--panel-2); }
.topbar-nav .sep { color: var(--line); }

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}
.mode-toggle:hover { background: rgba(56, 189, 248, 0.16); color: #fff; }
.mode-toggle.clean {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(46, 230, 166, 0.4);
}
.mode-toggle i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.read-progress {
  position: fixed;
  top: 59px;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 61;
  background: transparent;
}
.read-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  box-shadow: 0 0 14px rgba(46, 230, 166, 0.75);
}

/* ---------- 左侧课程轨 ---------- */
.rail {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: var(--rail);
  padding: 28px 18px 40px 24px;
  border-right: 1px solid var(--line-soft);
  overflow-y: auto;
  font-size: 13.5px;
  z-index: 40;
  background: rgba(8, 11, 16, 0.68);
}
.rail::-webkit-scrollbar { width: 3px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); }

.rail-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 12px 10px;
}

.rail .rail-meta {
  margin: 0 0 22px 10px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
}

.rail ol {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  counter-reset: rail;
}
.rail li { position: relative; }
.rail li a {
  display: block;
  padding: 6px 10px 6px 34px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.5;
}
.rail li a::before {
  counter-increment: rail;
  content: counter(rail, decimal-leading-zero);
  position: absolute;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--dim);
  top: 9px;
}
.rail li a:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.rail li a.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(46,230,166,0.14), transparent 82%);
  box-shadow: inset 2px 0 0 var(--accent);
}
.rail li a.active::before { color: var(--accent); }
.rail li a.current-course {
  color: var(--accent);
  font-weight: 600;
}

.rail-courses {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  margin-bottom: 18px;
}
.rail-courses summary {
  cursor: pointer;
  list-style: none;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 8px;
}
.rail-courses summary::-webkit-details-marker { display: none; }
.rail-courses summary::after {
  content: " +";
  color: var(--accent);
}
.rail-courses[open] summary::after { content: " −"; }
.rail-courses summary:hover { background: var(--panel-2); color: var(--text); }
.rail-courses ol { margin: 8px 0 0; font-size: 12.5px; }

.rail-tools {
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rail-tools a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 6px;
}
.rail-tools a:hover { color: var(--text); background: var(--panel-2); }

/* ---------- 主内容 ---------- */
.shell {
  margin-left: var(--rail);
  padding: 60px 40px 110px;
}
.shell.no-rail { margin-left: 0; }
.wrap { max-width: var(--content); margin: 0 auto; }
.wrap-wide { max-width: var(--wide); margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  padding: 66px 0 26px;
  position: relative;
}
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
}
.eyebrow .chip {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  letter-spacing: 0.05em;
  text-transform: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 22px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(46, 230, 166, 0.3);
}

.lede {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 64ch;
  margin: 0 0 28px;
}
.lede strong { color: var(--text); font-weight: 650; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 38px;
}
.hero-meta span { display: inline-flex; gap: 7px; align-items: center; }
.hero-meta b { color: var(--text); font-weight: 500; }

/* 信号轨：电路折线章节导航 */
.signal-map {
  position: relative;
  margin: 0 0 58px;
  padding: 20px 22px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 60%), var(--ink-2);
  overflow: hidden;
}
.signal-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56,189,248,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}
.signal-map svg { display: block; width: 100%; height: auto; position: relative; }
.signal-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(46, 230, 166, 0.55));
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: draw-path 2s 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes draw-path { to { stroke-dashoffset: 0; } }

.signal-node { cursor: pointer; }
.signal-node circle {
  fill: var(--ink);
  stroke: var(--accent);
  stroke-width: 2;
  transition: fill 0.2s ease, transform 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.signal-node text {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  transition: fill 0.2s ease;
}
.signal-node:hover circle, .signal-node.active circle {
  fill: var(--accent);
  transform: scale(1.25);
}
.signal-node:hover text, .signal-node.active text { fill: var(--text); }

/* ---------- 章节 ---------- */
.chapter {
  position: relative;
  padding: 50px 0 18px;
  border-top: 1px solid var(--line-soft);
}
.chapter:first-of-type { border-top: 0; padding-top: 8px; }

.chapter-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
}
.ch-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid rgba(46, 230, 166, 0.35);
  border-radius: 6px;
  padding: 2px 8px;
  transform: translateY(-3px);
}
.chapter h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 750;
  flex: 1;
}

.ch-done {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  transform: translateY(-2px);
}
.ch-done:hover { border-color: var(--green); color: var(--green); }
.ch-done.on {
  background: rgba(74, 222, 128, 0.14);
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.25);
}

.t-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px dashed rgba(56, 189, 248, 0.45);
  padding-bottom: 1px;
}
.t-link:hover { color: var(--cyan); border-bottom-style: solid; }

.chapter h3 {
  font-size: 1.16rem;
  margin: 34px 0 10px;
  font-weight: 650;
}
.chapter h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  margin-right: 10px;
  transform: translateY(-3px);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.7);
}

.chapter p { margin: 14px 0; color: #d5dce6; }
.chapter p strong { color: #fff; font-weight: 650; }
.chapter ul, .chapter ol { color: #d5dce6; padding-left: 1.4em; }
.chapter li { margin: 7px 0; }
.chapter li::marker { color: var(--accent); }

/* 关键结论 */
.takeaway {
  margin: 28px 0;
  padding: 16px 20px 16px 22px;
  border: 1px solid rgba(46, 230, 166, 0.28);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, var(--accent-soft), transparent 75%);
}
.takeaway .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.takeaway p { margin: 0; color: #e8eef5; }
.takeaway p + p { margin-top: 8px; }

/* 截图 */
.shot {
  margin: 24px 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-2);
}
.shot a { display: block; position: relative; }
.shot img {
  width: 100%;
  height: auto;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease;
}
.shot a:hover img { transform: scale(1.012); opacity: 0.94; }
.shot a::after {
  content: "▶ 跳到视频";
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(8, 11, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 4px 9px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(6px);
}
.shot a:hover::after { opacity: 1; transform: translateY(0); }
.shot figcaption {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 11px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.shot figcaption .ts {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  white-space: nowrap;
}

.shot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0 28px;
}
.shot-grid .shot { margin: 0; }

/* 命令卡片与代码块 */
.cmd-box {
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0e14;
  overflow: hidden;
}
.cmd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.cmd-head .dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.cmd-head .dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--line);
}
.cmd-head .dots i:nth-child(1) { background: #ef4444; }
.cmd-head .dots i:nth-child(2) { background: #f59e0b; }
.cmd-head .dots i:nth-child(3) { background: #10b981; }
.copy-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 9px;
  cursor: pointer;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.cmd-box pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: #e2e8f0;
}
.cmd-box .c-cmt { color: var(--dim); }
.cmd-box .c-p { color: var(--accent); user-select: none; }

/* 对比表 */
.compare-wrap {
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.compare-table th, .compare-table td {
  padding: 11px 15px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.compare-table th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.05);
}
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table td { color: #cbd5e1; }
.compare-table td strong { color: var(--text); }

/* 原话引用 */
.quote {
  margin: 24px 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--line);
  color: #b4c0cf;
}
.quote p { margin: 0; font-size: 0.96rem; }
.quote cite {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

/* 常见误区 */
.misconception {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
  position: relative;
}
.misconception::before {
  content: "常见误区";
  position: absolute;
  top: -9px;
  left: 16px;
  background: var(--ink);
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--amber);
}
.misconception p { margin: 4px 0; font-size: 0.95rem; }
.misconception .wrong { color: #fca5a5; }
.misconception .right { color: #86efac; }

/* 讨论卡 */
.discuss {
  margin: 30px 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: radial-gradient(600px 200px at 100% 0%, rgba(56, 189, 248, 0.08), transparent 70%), var(--ink-2);
}
.discuss .tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--cyan);
  text-transform: uppercase;
}
.discuss h4 { margin: 8px 0 10px; font-size: 1.02rem; font-weight: 650; }
.discuss ul { margin: 0; padding-left: 1.2em; }
.discuss li { color: #cbd5e1; font-size: 0.94rem; margin: 6px 0; }

/* ---------- 逐字稿对照块（原话 → 解析穿插） ---------- */
.beat {
  margin: 26px 0 34px;
  padding-top: 6px;
}
.beat + .beat {
  border-top: 1px dashed var(--line-soft);
  padding-top: 24px;
}

.verbatim-block {
  margin: 14px 0 18px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-left: 3px solid var(--cyan);
  border-radius: 0 12px 12px 0;
  background: rgba(56, 189, 248, 0.038);
}
.verbatim-block summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  user-select: none;
}
.verbatim-block summary::-webkit-details-marker { display: none; }
.verbatim-block summary:hover { color: var(--text); }
.vb-badge {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.vb-topic {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
}
.vb-time { color: var(--cyan); }
.vb-toggle-hint {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--dim);
}
.verbatim-block[open] .vb-toggle-hint::before { content: "收起原话 −"; }
.verbatim-block:not([open]) .vb-toggle-hint::before { content: "展开原话 +"; }

.vb-body {
  padding: 4px 18px 16px;
  border-top: 1px solid rgba(56, 189, 248, 0.12);
  font-size: 14.5px;
  line-height: 1.85;
  color: #b7c5d6;
}
.vb-body p { margin: 10px 0; color: #b7c5d6; }
.vb-body p:first-child { margin-top: 10px; }
.vb-body p:last-child { margin-bottom: 2px; }
.vb-body a.ts {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--cyan);
  margin-right: 7px;
  text-decoration: none;
  background: rgba(56, 189, 248, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}
.vb-body a.ts:hover { color: var(--accent); background: var(--accent-soft); }

.analysis-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(46, 230, 166, 0.28);
  border-radius: 5px;
  padding: 2px 9px;
  margin: 4px 0 8px;
}

/* 兼容旧逐字稿样式 */
.transcript {
  margin: 22px 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}
.transcript summary {
  cursor: pointer;
  padding: 11px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  list-style: none;
}
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary::before {
  content: "+";
  display: inline-block;
  width: 16px;
  color: var(--accent);
}
.transcript[open] summary::before { content: "−"; }
.transcript summary:hover { color: var(--text); }
.transcript-body {
  padding: 4px 18px 16px;
  font-size: 14px;
  line-height: 1.85;
  color: #b4c0cf;
  max-height: 420px;
  overflow-y: auto;
}
.transcript-body p { margin: 6px 0; }
.transcript-body .ts {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--cyan);
  margin-right: 9px;
  text-decoration: none;
}
.transcript-body a.ts:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 交互组件 ---------- */
.widget {
  margin: 34px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 40%), var(--panel);
  overflow: hidden;
}
.widget-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}
.widget-head .w-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  border: 1px solid rgba(46, 230, 166, 0.35);
  border-radius: 5px;
  padding: 2px 7px;
}
.widget-head h4 { margin: 0; font-size: 0.98rem; font-weight: 650; flex: 1; min-width: 200px; }
.widget-head .w-hint { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); }
.widget-body { padding: 20px; }
.widget-body canvas { display: block; width: 100%; height: auto; }
.widget-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
}
.widget-foot strong { color: var(--text); }

.w-canvas-wrap {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #080b10;
  overflow: hidden;
}

/* 组件内微终端 */
.w-term {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #070a0f;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: #dbe6f2;
  min-height: 130px;
  overflow-x: auto;
}
.w-term .t-line { white-space: pre-wrap; word-break: break-all; }
.w-term .t-prompt { color: var(--accent); }
.w-term .t-path { color: var(--cyan); }
.w-term .t-warn { color: var(--amber); }
.w-term .t-err { color: var(--red); }
.w-term-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-soft);
}
.w-term-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
}

/* 交互式 CLI 实操台 + 状态面板 */
.cli-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.cli-split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  align-items: stretch;
}
.cli-state {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-2);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  overflow-x: auto;
}
.cli-state-title {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}
.step-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.step-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  color: var(--muted);
  cursor: pointer;
}
.step-pill.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #05130e;
  font-weight: 700;
}
@media (max-width: 720px) {
  .cli-split { grid-template-columns: 1fr; }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-end;
  margin-top: 14px;
}
.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 130px;
  flex: 1;
}
.control label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.control label output { color: var(--text); }
.control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--line);
  border-radius: 99px;
  outline: none;
}
.control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(46, 230, 166, 0.7);
  cursor: grab;
}
.control input[type="text"], .control select {
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}
.btn:hover { border-color: var(--accent); background: rgba(46, 230, 166, 0.08); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #05130e; font-weight: 700; }
.btn.primary:hover { background: #4bf0b8; }
.btn.active { border-color: var(--cyan); background: var(--cyan-soft); color: var(--cyan); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-right: 1px solid var(--line);
  padding: 7px 12px;
  cursor: pointer;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: #05130e; font-weight: 700; }

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.readout b { color: var(--text); font-weight: 600; }
.readout .hot { color: var(--accent); }
.readout .cool { color: var(--cyan); }
.readout .warn { color: var(--amber); }
.readout .err { color: var(--red); }

/* ---------- 术语表 / 自测 ---------- */
.section-block {
  margin: 64px 0 0;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}
.section-block h2 { font-size: 1.55rem; margin: 0 0 8px; }
.section-block > .sub { color: var(--muted); font-size: 0.95rem; margin: 0 0 24px; }

.glossary { margin: 0; display: grid; gap: 0; }
.glossary div {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.glossary dt { font-weight: 650; color: var(--text); font-size: 0.95rem; }
.glossary dt span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--dim);
  font-weight: 400;
  margin-top: 2px;
}
.glossary dd { margin: 0; color: #c4cfdd; font-size: 0.93rem; line-height: 1.8; }

.quiz { counter-reset: quiz; display: grid; gap: 12px; }
.quiz details {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--ink-2);
  padding: 0 18px;
}
.quiz details[open] { border-color: rgba(56, 189, 248, 0.35); }
.quiz summary {
  cursor: pointer;
  padding: 14px 0;
  font-size: 0.96rem;
  color: var(--text);
  list-style: none;
  counter-increment: quiz;
}
.quiz summary::-webkit-details-marker { display: none; }
.quiz summary::before {
  content: "Q" counter(quiz);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--cyan);
  margin-right: 12px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 5px;
  padding: 1px 6px;
}
.quiz .answer {
  padding: 14px 0 16px;
  color: #c4cfdd;
  font-size: 0.94rem;
  border-top: 1px solid var(--line-soft);
}
.quiz .answer strong { color: var(--accent); }

/* 交互式选择题 */
.mcq-list { display: grid; gap: 14px; margin-bottom: 20px; }
.mcq {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--ink-2);
}
.mcq .q-title { font-weight: 650; margin: 0 0 12px; font-size: 0.97rem; }
.mcq-opts { display: grid; gap: 8px; }
.mcq-opt {
  text-align: left;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mcq-opt:hover { border-color: var(--cyan); }
.mcq-opt.correct { border-color: var(--green); background: rgba(74, 222, 128, 0.14); color: #dcfce7; }
.mcq-opt.wrong { border-color: var(--red); background: var(--red-soft); color: #fee2e2; }
.mcq-fb { margin-top: 10px; font-size: 0.9rem; color: var(--muted); display: none; }
.mcq-fb.show { display: block; }

/* ---------- 页脚 / 翻页 ---------- */
.lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 72px 0 0;
}
.lesson-nav a {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  background: var(--ink-2);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.lesson-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.lesson-nav .dir {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
  display: block;
  margin-bottom: 5px;
}
.lesson-nav .name { font-size: 0.95rem; color: var(--text); }
.lesson-nav .next { text-align: right; }

.site-foot {
  margin: 80px auto 0;
  max-width: var(--wide);
  padding: 28px 0 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}
.site-foot a { color: var(--muted); }

/* ---------- 首页 ---------- */
.home-hero { padding: 76px 0 34px; }
.home-hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 850;
  margin: 16px 0 22px;
  max-width: 19ch;
}
.home-hero h1 .thin {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(238, 242, 247, 0.72);
  font-weight: 800;
}
.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}
.home-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
}
.home-stats b { color: var(--text); font-weight: 600; }

.track-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 10px;
}
.track-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  color: var(--muted);
  cursor: pointer;
}
.track-btn:hover { border-color: var(--accent); color: var(--text); }
.track-btn.on { background: var(--accent); border-color: var(--accent); color: #05130e; font-weight: 700; }

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 26px 0 0;
}
.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: radial-gradient(360px 160px at 100% 0%, rgba(46, 230, 166, 0.06), transparent 70%), var(--ink-2);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.22s ease, transform 0.22s ease;
}
.course-card:hover { border-color: rgba(46, 230, 166, 0.55); transform: translateY(-3px); color: var(--text); }
.course-card.hidden { display: none; }
.course-card .top-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.course-card .num { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }
.course-card .track-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 999px;
  padding: 1px 8px;
}
.course-card h3 { font-size: 1.15rem; line-height: 1.4; margin: 12px 0 8px; font-weight: 700; }
.course-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.7; margin: 0; flex: 1; }
.course-card .meta {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--dim);
}

.route {
  margin: 56px 0 0;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--ink-2);
}
.route h2 { font-size: 1.25rem; margin: 0 0 8px; }
.route p { color: var(--muted); font-size: 0.93rem; margin: 0 0 18px; }
.route-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}
.route-line .node {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--text);
  text-decoration: none;
}
.route-line .node:hover { border-color: var(--accent); color: var(--accent); }
.route-line .arrow { color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .rail { display: none; }
  .shell { margin-left: 0; padding: 60px 24px 96px; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .shell { padding: 60px 16px 80px; }
  .hero { padding-top: 44px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand span:last-child { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
  .topbar-nav { overflow-x: auto; scrollbar-width: none; }
  .topbar-nav::-webkit-scrollbar { display: none; }
  .topbar-nav a { padding: 5px 7px; font-size: 12px; }
  .topbar-nav .sep, .topbar-nav a[href*="transcripts"] { display: none; }
  .mode-toggle { padding: 4px 8px; font-size: 11px; }
  .vb-toggle-hint { display: none; }
  .shot-grid, .course-grid, .lesson-nav { grid-template-columns: 1fr; }
  .glossary div { grid-template-columns: 1fr; gap: 4px; }
  .chapter-head { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .signal-path { stroke-dashoffset: 0; }
}

@media print {
  body { background: #fff; color: #111; }
  .rail, .topbar, .read-progress, .signal-map, .widget, .lesson-nav { display: none; }
  .shell { margin: 0; }
}
