/* ============================================================
   MLP 小课堂 · 共用样式
   ============================================================ */

:root {
  --bg: #f7f6f1;
  --bg-soft: #eef2ff;
  --card: #ffffff;
  --ink: #1b2340;
  --ink-2: #39415e;
  --muted: #6b7391;
  --faint: #9aa1ba;
  --line: #e4e6ef;
  --line-strong: #d3d7e6;

  --blue: #3b6ef6;
  --blue-deep: #2450d8;
  --blue-soft: #e9efff;
  --orange: #f5893b;
  --orange-deep: #d96b1b;
  --orange-soft: #fff0e2;
  --green: #1f9d68;
  --green-soft: #e2f7ec;
  --purple: #7c5cf0;
  --purple-soft: #f0ecff;
  --pink: #e8548f;
  --pink-soft: #ffe9f2;
  --yellow: #f7c948;
  --yellow-soft: #fff8db;
  --red: #dd4045;
  --red-soft: #ffe9ea;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 2px 4px rgba(27, 35, 64, 0.04), 0 14px 30px rgba(27, 35, 64, 0.07);
  --shadow-lift: 0 6px 10px rgba(27, 35, 64, 0.06), 0 24px 48px rgba(27, 35, 64, 0.12);
  --font: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC",
    "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -100px, #e7edff 0%, rgba(231, 237, 255, 0) 65%),
    radial-gradient(900px 460px at -10% 760px, #fff1e0 0%, rgba(255, 241, 224, 0) 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
a { color: var(--blue-deep); }

::selection { background: #cfe0ff; }

.wrap {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
}
.wrap--narrow { width: min(820px, calc(100% - 40px)); margin: 0 auto; }

/* ---------- 顶部导航 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 241, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(228, 230, 239, 0.9);
}
.topbar__inner {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(145deg, #ffffff, #e9efff);
  border: 1px solid #dbe3ff;
  box-shadow: 0 2px 6px rgba(59, 110, 246, 0.14);
}
.brand small {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.12em;
  line-height: 1.2;
}
.brand__name { line-height: 1.15; font-size: 17px; }

.navlinks {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.navlinks a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}
.navlinks a:hover { background: #fff; color: var(--ink); }
.navlinks a.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(27, 35, 64, 0.08); }
.navlinks .nav-dot {
  position: absolute;
  top: 4px; right: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.navlinks a.is-done .nav-dot { opacity: 1; transform: scale(1); }

/* ---------- 通用排版 ---------- */

.hero {
  padding: 64px 0 22px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 36px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.eyebrow .spark { color: var(--orange); }

h1.hero-title {
  margin: 18px 0 14px;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 900;
}
.hero-title .hl {
  position: relative;
  white-space: nowrap;
}
.hero-title .hl::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: 4px;
  height: 13px;
  background: linear-gradient(90deg, #ffd98a, #ffb35c);
  border-radius: 4px;
  z-index: -1;
  transform: rotate(-0.6deg);
  opacity: 0.85;
}
.hero-sub {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
  margin: 0 0 26px;
  max-width: 33em;
}
.hero-sub strong { color: var(--ink-2); }

h2.sec-title {
  margin: 0;
  font-size: clamp(25px, 3.4vw, 33px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 900;
}
h3 { font-size: 20px; margin: 0 0 10px; letter-spacing: -0.01em; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.section { padding: 46px 0 8px; }
.sec-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}
.sec-num {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  background: var(--ink);
  color: #fff;
  margin-top: 3px;
  box-shadow: 0 6px 14px rgba(27, 35, 64, 0.18);
}
.sec-sub { color: var(--muted); margin-top: 6px; font-size: 15.5px; }

/* ---------- 卡片 / 面板 ---------- */

.card {
  background: var(--card);
  border: 1px solid rgba(227, 229, 238, 0.9);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card--tight { padding: 20px; }
.card--tinted { background: linear-gradient(180deg, #fbfcff, #f5f7ff); }

.panel {
  background: #f7f9ff;
  border: 1px solid #e4e9f8;
  border-radius: 18px;
  padding: 20px;
}
.panel--warm { background: #fff8f1; border-color: #fbe5d1; }
.panel--mint { background: #f1fbf6; border-color: #d6f1e3; }
.panel--lilac { background: #f8f5ff; border-color: #e9e1ff; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.grid2--wide-left { grid-template-columns: 1.1fr 0.9fr; }
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 780px) {
  .grid2, .grid2--wide-left, .grid3, .grid4 { grid-template-columns: 1fr; }
}

/* ---------- 按钮 / 标签 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #4b7cff, var(--blue));
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(59, 110, 246, 0.28);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.04); box-shadow: 0 9px 22px rgba(59, 110, 246, 0.33); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible { outline: 3px solid #b9ccff; outline-offset: 3px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn--orange {
  background: linear-gradient(180deg, #ffa05a, var(--orange));
  box-shadow: 0 6px 16px rgba(245, 137, 59, 0.3);
}
.btn--orange:hover { box-shadow: 0 9px 22px rgba(245, 137, 59, 0.36); }
.btn--green {
  background: linear-gradient(180deg, #2fbe83, var(--green));
  box-shadow: 0 6px 16px rgba(31, 157, 104, 0.28);
}
.btn--ghost {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
  box-shadow: none;
}
.btn--ghost:hover { border-color: #b9c2dc; background: #fbfcff; }
.btn--sm { padding: 8px 15px; font-size: 13.5px; box-shadow: none; }
.btn--icon { width: 42px; height: 42px; padding: 0; border-radius: 50%; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f3fa;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.chip--blue { background: var(--blue-soft); color: var(--blue-deep); }
.chip--orange { background: var(--orange-soft); color: var(--orange-deep); }
.chip--green { background: var(--green-soft); color: var(--green); }
.chip--purple { background: var(--purple-soft); color: var(--purple); }
.chip--pink { background: var(--pink-soft); color: #c23a72; }
.chip--yellow { background: var(--yellow-soft); color: #9a7300; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

button.chip {
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
button.chip:hover { transform: translateY(-1px); border-color: var(--line-strong); }
button.chip.is-on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.badge-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-done + .chip--green { display: none; }

/* ---------- 首页 ---------- */

.lesson-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 26px;
}
@media (max-width: 860px) { .lesson-grid { grid-template-columns: 1fr; } }

.lesson-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.lesson-card::after {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  right: -90px; top: -110px;
  background: var(--glow, #e9efff);
  opacity: 0.9;
}
.lesson-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: transparent; }
.lesson-card:focus-visible { outline: 3px solid #b9ccff; outline-offset: 4px; }
.lesson-card--blue { --glow: #dbe6ff; }
.lesson-card--orange { --glow: #ffe3c9; }
.lesson-card--green { --glow: #d9f5e8; }
.lesson-card--purple { --glow: #e6ddff; }
.lesson-card__top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.lesson-card__emoji {
  width: 58px; height: 58px; flex: none;
  border-radius: 18px;
  display: grid; place-items: center;
  font-size: 29px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(27, 35, 64, 0.08);
}
.lesson-card__no {
  font-size: 12px; font-weight: 900; letter-spacing: 0.14em;
  color: var(--faint);
}
.lesson-card h3 { font-size: 26px; margin: 2px 0 0; font-weight: 900; }
.lesson-card p { color: var(--muted); font-size: 15.5px; margin: 0; position: relative; z-index: 1; }
.lesson-card__meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: auto; padding-top: 6px; position: relative; z-index: 1;
}
.lesson-card__go {
  margin-left: auto;
  white-space: nowrap;
  font-weight: 800; font-size: 14.5px; color: var(--blue-deep);
  display: inline-flex; align-items: center; gap: 6px;
}
.lesson-card--orange .lesson-card__go { color: var(--orange-deep); }
.lesson-card--green .lesson-card__go { color: var(--green); }
.lesson-card--purple .lesson-card__go { color: var(--purple); }
.lesson-card__go .arrow { transition: transform 0.2s ease; }
.lesson-card:hover .lesson-card__go .arrow { transform: translateX(4px); }

.hero-art {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
}
.hero-art svg { width: 100%; height: auto; }
.hero-art .float-card {
  position: absolute;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(27, 35, 64, 0.1);
  white-space: nowrap;
}
.hero-art .float-card--a { right: 1%; top: 0; left: auto; color: var(--orange-deep); transform: rotate(-3deg); }
.hero-art .float-card--b { left: 5%; bottom: 0; right: auto; color: var(--green); transform: rotate(2.5deg); }

.howto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.howto__item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.howto__n {
  flex: none; width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue-deep);
  font-size: 13px; font-weight: 900;
}
.howto__item b { display: block; font-size: 14.5px; }
.howto__item span { font-size: 13px; color: var(--muted); line-height: 1.55; }
@media (max-width: 780px) { .howto { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 480px;
}
.table th {
  text-align: left;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
  background: #f5f7fc;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid #eef0f6;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.14s ease; }
.table--click tbody tr { cursor: pointer; }
.table--click tbody tr:hover { background: #f8faff; }
.table tbody tr.is-active { background: #eaf0ff; }
.table tbody tr.is-active td { color: var(--ink); font-weight: 700; }
.table .num { font-variant-numeric: tabular-nums; }
.table th.center, .table td.center { text-align: center; }
.table code { font-size: 13.5px; }

/* ---------- 公式 ---------- */

.formula {
  display: block;
  margin: 12px 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fbfcff;
  border: 1px dashed #cfd9f4;
  font-size: 17px;
  line-height: 2.1;
  overflow-x: auto;
  color: var(--ink-2);
}
.formula--warm { background: #fffaf5; border-color: #f4d6b9; }
.formula .var { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 600; }
.formula .op { color: var(--faint); padding: 0 6px; }
.formula strong { color: var(--blue-deep); }
.frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  line-height: 1.35;
  margin: 0 4px;
  font-size: 0.92em;
}
.frac > span:first-child {
  border-bottom: 1.6px solid currentColor;
  padding: 0 8px 3px;
}
.frac > span:last-child { padding: 3px 8px 0; }

.math-note {
  font-size: 13.5px;
  color: var(--muted);
  border-left: 3px solid var(--yellow);
  padding-left: 12px;
  margin: 14px 0 0;
}

kbd {
  font-family: var(--mono);
  font-size: 12.5px;
  background: #f1f3fa;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: #f2f4fb;
  padding: 2px 6px;
  border-radius: 6px;
  color: #3a3f5c;
}
pre {
  margin: 12px 0 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: #1e2438;
  color: #e8ecff;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
pre .c { color: #8d9bc4; }
pre .k { color: #ff9e7a; }
pre .s { color: #a8e6a1; }
pre .n { color: #ffd479; }
pre .hl-line { display: block; margin: 0 -10px; padding: 0 10px; border-radius: 6px; background: rgba(120, 160, 255, 0.16); }

/* ---------- 流程框图 ---------- */

.flow-scroll { overflow-x: auto; padding: 8px 2px 12px; }
.flow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  padding: 8px 4px;
}
.flow--center { justify-content: center; }
.flow-node {
  flex: none;
  padding: 10px 16px;
  border-radius: 13px;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  line-height: 1.35;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.flow-node small { display: block; font-size: 11px; font-weight: 700; color: var(--faint); }
.flow-node--in { border-color: #b9ccff; background: #f3f7ff; }
.flow-node--op {
  width: 44px; height: 44px; padding: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px;
  background: #fff8e8;
  border-color: #f2d79a;
}
.flow-node--out { border-color: #b7e6cf; background: #f1fbf6; }
.flow-node.is-lit {
  border-color: var(--blue);
  background: #eaf0ff;
  box-shadow: 0 0 0 4px rgba(59, 110, 246, 0.15);
  transform: translateY(-2px);
}
.flow-node--out.is-lit { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 4px rgba(31, 157, 104, 0.15); }
.flow-arrow {
  flex: none;
  position: relative;
  width: 34px;
  height: 2px;
  background: #c9cee0;
  margin: 0 2px;
}
.flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px; top: 50%;
  width: 0; height: 0;
  border-left: 7px solid #c9cee0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: translateY(-50%);
}
.flow-arrow.is-lit { background: var(--blue); }
.flow-arrow.is-lit::after { border-left-color: var(--blue); }
.flow-branch { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 720px) {
  .flow { flex-direction: column; min-width: 0; width: 100%; }
  .flow-arrow { width: 2px; height: 26px; margin: 0; }
  .flow-arrow::after {
    right: auto; left: 50%; top: auto; bottom: -1px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid #c9cee0;
    border-bottom: 0;
    transform: translateX(-50%);
  }
  .flow-arrow.is-lit::after { border-top-color: var(--blue); border-left-color: transparent; border-right-color: transparent; }
  .flow-branch { width: 100%; }
  .flow-branch .flow-node { width: 100%; }
}

/* ---------- 成绩表 / 计算器 ---------- */

.calc-row {
  display: grid;
  grid-template-columns: 76px 1fr 62px;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}
.calc-row__label { font-weight: 800; font-size: 14.5px; }
.calc-row__val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 15px;
  color: var(--ink-2);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
  cursor: pointer;
  height: 24px;
  margin: 0;
}
input[type="range"].range--orange { accent-color: var(--orange); }
input[type="range"].range--green { accent-color: var(--green); }
input[type="range"].range--purple { accent-color: var(--purple); }

.readout-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.readout {
  flex: 1 1 120px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.readout__k { font-size: 12px; font-weight: 800; color: var(--faint); letter-spacing: 0.06em; }
.readout__v {
  font-size: 26px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  color: var(--ink);
}
.readout__v small { font-size: 13px; color: var(--muted); font-weight: 700; }
.readout--blue { background: var(--blue-soft); border-color: #d3dfff; }
.readout--blue .readout__v { color: var(--blue-deep); }
.readout--orange { background: var(--orange-soft); border-color: #fbdcc3; }
.readout--orange .readout__v { color: var(--orange-deep); }
.readout--green { background: var(--green-soft); border-color: #c9eddb; }
.readout--green .readout__v { color: var(--green); }

.bar-compare { display: grid; gap: 12px; margin-top: 4px; }
.bar-line { display: grid; grid-template-columns: 108px 1fr 64px; gap: 12px; align-items: center; }
.bar-line__label { font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.bar-track {
  height: 18px;
  border-radius: 999px;
  background: #eef0f8;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: linear-gradient(90deg, #8fb0ff, var(--blue));
}
.bar-fill--orange { background: linear-gradient(90deg, #ffc18c, var(--orange)); }
.bar-fill--green { background: linear-gradient(90deg, #7fe0b4, var(--green)); }
.bar-line__val { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; font-size: 15px; }

.student-panel { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.student-panel__name { font-size: 22px; font-weight: 900; }
.student-panel__scores { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.score-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 5px 10px;
  font-size: 13px; color: var(--muted); font-weight: 700;
}
.score-chip b { font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.student-panel__nums { display: flex; gap: 10px; }
.big-num {
  text-align: center; min-width: 96px;
  padding: 10px 14px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
}
.big-num__v { font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; }
.big-num__k { font-size: 11.5px; font-weight: 800; color: var(--faint); letter-spacing: 0.06em; }
@media (max-width: 720px) {
  .student-panel { grid-template-columns: 1fr; }
}

/* ---------- 循环单步演示 ---------- */

.stepper { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .stepper { grid-template-columns: 1fr; } }
.stepper__code { margin: 0; }
.stepper__code pre { margin: 0; }
.stepper__vars { display: grid; gap: 10px; }
.var-box {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 14px;
}
.var-box span { color: var(--muted); }
.var-box b { font-size: 19px; font-variant-numeric: tabular-nums; }
.var-box--accent { border-color: #b9ccff; background: var(--blue-soft); }
.var-box--accent b { color: var(--blue-deep); }
.step-status {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--muted);
  min-height: 22px;
}
.step-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- 神经元实验室 ---------- */

.lab { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .lab { grid-template-columns: 1fr; } }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.switch-label { display: flex; align-items: baseline; gap: 8px; font-weight: 800; }
.switch-label .var { font-family: Georgia, serif; font-style: italic; font-size: 19px; }
.switch-btns { display: flex; gap: 6px; }
.switch-btn {
  width: 48px; height: 40px;
  border-radius: 11px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.switch-btn:hover { border-color: #aeb8d6; }
.switch-btn.is-on {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(59, 110, 246, 0.3);
}
.switch-btn:focus-visible { outline: 3px solid #b9ccff; outline-offset: 2px; }
.weight-row {
  display: grid;
  grid-template-columns: 54px 1fr 52px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}
.weight-row__name { font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 17px; }
.weight-row__val {
  text-align: right; font-weight: 900; font-variant-numeric: tabular-nums;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 3px 8px; font-size: 14px;
}
.weight-row__val.is-neg { color: var(--red); }

.lamp {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #f1f3fa;
  border: 1px solid var(--line);
  font-weight: 900;
  font-size: 17px;
  transition: all 0.25s ease;
}
.lamp__dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #c5cada;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.5);
  transition: all 0.25s ease;
}
.lamp.is-on {
  background: #eafff4;
  border-color: #9fe3c2;
  color: var(--green);
  box-shadow: 0 0 0 5px rgba(31, 157, 104, 0.1);
}
.lamp.is-on .lamp__dot {
  background: var(--green);
  box-shadow: 0 0 12px rgba(31, 157, 104, 0.8), inset 0 0 0 3px rgba(255,255,255,0.55);
}
.lamp.is-off { color: var(--muted); }

.sum-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.sum-display .eq { font-size: 22px; color: var(--muted); font-weight: 400; }
.sum-display .big { font-size: 42px; font-weight: 900; line-height: 1; }
.sum-display .big--neg { color: var(--red); }
.compare-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 800;
}
.compare-pill--ok { background: var(--green-soft); color: var(--green); }
.compare-pill--no { background: var(--orange-soft); color: var(--orange-deep); }

.gauge {
  position: relative;
  height: 34px;
  margin: 22px 0 6px;
  border-radius: 10px;
  background: #eef1f9;
  overflow: visible;
}
.gauge__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #8fb0ff, var(--blue));
  transition: width 0.25s ease, background 0.25s ease;
}
.gauge__fill.is-neg { background: linear-gradient(90deg, #ff9d9f, var(--red)); }
.gauge__zero {
  position: absolute; top: -5px; bottom: -5px;
  width: 2px; background: #9aa1ba;
  transition: left 0.25s ease;
}
.gauge__th {
  position: absolute; top: -9px; bottom: -9px;
  width: 3px; border-radius: 2px;
  background: var(--orange);
  transition: left 0.25s ease;
}
.gauge__th::after {
  content: "θ";
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-size: 13px; font-weight: 900;
  color: var(--orange-deep);
}
.gauge-legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }

.truth-table { margin-top: 14px; }
.truth-table table.table { min-width: 0; font-size: 14px; }
.truth-table tr.is-current td { background: #eaf0ff; font-weight: 800; }
.truth-table tr.is-current td:first-child { border-radius: 8px 0 0 8px; }

.preset-row { margin-top: 16px; }
.preset-row .chip { font-family: inherit; }

/* ---------- 生物神经元 SVG ---------- */

.neuron-stage {
  background: #fbfcff;
  border: 1px solid #e4e9f8;
  border-radius: 18px;
  padding: 10px;
}
.neuron-stage svg { display: block; width: 100%; height: auto; }
.neuron-part { cursor: pointer; }
.neuron-part .hit { fill: transparent; }
.neuron-part .shape { transition: filter 0.2s ease, opacity 0.2s ease; }
.neuron-part:hover .shape, .neuron-part.is-active .shape { filter: drop-shadow(0 0 6px rgba(59, 110, 246, 0.55)); }
.neuron-part.is-active .shape { stroke: var(--blue); }
.neuron-tip {
  margin-top: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 14.5px;
  min-height: 78px;
}
.neuron-tip b { color: var(--blue-deep); }
.part-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.steps3 { display: grid; gap: 10px; margin-top: 6px; }
.step3 {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 15px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}
.step3__n {
  flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900;
  background: var(--orange-soft); color: var(--orange-deep);
}
.step3 b { display: block; font-size: 14.5px; line-height: 1.5; }
.step3 span { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ---------- 网络图 ---------- */

.net-stage {
  background: radial-gradient(600px 260px at 50% 0%, #f2f6ff, #fbfcff 70%);
  border: 1px solid #e4e9f8;
  border-radius: 18px;
  padding: 12px;
}
.net-stage svg { display: block; width: 100%; height: auto; }
.wire { stroke: #c8d2ea; stroke-width: 1.4; transition: stroke 0.3s ease, stroke-width 0.3s ease; }
.wire.is-hot { stroke: var(--blue); stroke-width: 2.2; }
.node-circle { fill: #fff; stroke: #aebbe0; stroke-width: 1.6; transition: all 0.3s ease; }
.node-circle.is-hot { fill: #eaf0ff; stroke: var(--blue); filter: drop-shadow(0 0 5px rgba(59,110,246,.4)); }
.net-label { font-family: var(--font); font-size: 11px; font-weight: 700; fill: #6b7391; }
.net-caption { font-family: var(--font); font-size: 10.5px; fill: #9aa1ba; }

/* ---------- 感知机小训练 ---------- */

.trainer { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 18px; align-items: start; }
@media (max-width: 780px) { .trainer { grid-template-columns: 1fr; } }
.trainer__weights { display: grid; gap: 8px; }
.wline {
  display: grid; grid-template-columns: 70px 1fr 58px;
  gap: 10px; align-items: center;
  font-size: 14px;
}
.wline__bar { height: 12px; background: #eef0f8; border-radius: 999px; overflow: hidden; position: relative; }
.wline__bar i {
  position: absolute; top: 0; bottom: 0; left: 50%;
  background: var(--blue);
  border-radius: 999px;
  transition: all 0.2s ease;
}
.wline__bar i.is-neg { background: var(--red); }
.wline__v { font-family: var(--mono); font-weight: 800; text-align: right; font-size: 13.5px; }
.trainer__log {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.8;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  height: 132px;
  overflow-y: auto;
  color: var(--muted);
}
.trainer__log b { color: var(--ink); }
.epoch-dots { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.epoch-dot { width: 8px; height: 8px; border-radius: 50%; background: #dfe4f2; }
.epoch-dot.is-ok { background: var(--green); }
.epoch-dot.is-bad { background: var(--red); }

/* ---------- 测验 ---------- */

.quiz {
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.quiz__head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.quiz__icon {
  width: 46px; height: 46px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 23px;
  background: var(--yellow-soft);
  border: 1px solid #f6e3a4;
}
.quiz__head h2 { margin: 0; font-size: 24px; font-weight: 900; }
.quiz__progress { color: var(--muted); font-size: 13.5px; font-weight: 700; margin-top: 2px; }
.quiz__list { display: grid; gap: 16px; margin-top: 18px; }

.q { border-top: 1px dashed var(--line-strong); padding-top: 16px; }
.q:first-child { border-top: 0; padding-top: 0; }
.q__title { display: flex; gap: 10px; font-weight: 800; font-size: 16px; line-height: 1.65; }
.q__no {
  flex: none;
  width: 25px; height: 25px; margin-top: 1px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 900;
  background: var(--blue-soft); color: var(--blue-deep);
}
.q__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
@media (max-width: 640px) { .q__opts { grid-template-columns: 1fr; } }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.opt:hover { border-color: #b9c4e4; background: #fbfcff; }
.opt:active { transform: scale(0.997); }
.opt:focus-visible { outline: 3px solid #b9ccff; outline-offset: 2px; }
.opt__mark {
  flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #c3cbe1;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 900; color: transparent;
  background: #fff;
  transition: all 0.15s ease;
}
.opt.is-picked { border-color: var(--blue); background: var(--blue-soft); }
.opt.is-picked .opt__mark { border-color: var(--blue); background: var(--blue); color: #fff; }
.opt.is-correct { border-color: #6fd0a3; background: #edfbf4; }
.opt.is-correct .opt__mark { border-color: var(--green); background: var(--green); color: #fff; }
.opt.is-wrong { border-color: #f0a0a2; background: #fff2f2; }
.opt.is-wrong .opt__mark { border-color: var(--red); background: var(--red); color: #fff; }
.opt[disabled] { cursor: default; }
.opt[disabled]:hover { transform: none; }
.q__exp {
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: 11px;
  background: #f7f9ff;
  border-left: 3px solid var(--blue);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
}
.q__exp[hidden] { display: none; }
.q__exp b { color: var(--blue-deep); }

.quiz__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; align-items: center; }
.quiz__result {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.quiz__result--good { background: var(--green-soft); color: #146c48; }
.quiz__result--mid { background: var(--yellow-soft); color: #7a5c00; }
.quiz__result--bad { background: var(--orange-soft); color: #8a4a0f; }
.quiz__result strong { font-size: 22px; }
.quiz__result[hidden] { display: none; }
.quiz__score-num { font-variant-numeric: tabular-nums; }

/* ---------- 提示条 / 引用 ---------- */

.callout {
  display: flex;
  gap: 13px;
  padding: 15px 17px;
  border-radius: 15px;
  background: var(--blue-soft);
  border: 1px solid #d5e0ff;
  font-size: 14.5px;
  line-height: 1.7;
}
.callout__icon { flex: none; font-size: 19px; line-height: 1.4; }
.callout b { color: var(--blue-deep); }
.callout--warm { background: var(--orange-soft); border-color: #fadcc1; }
.callout--warm b { color: var(--orange-deep); }
.callout--green { background: var(--green-soft); border-color: #c9eddb; }
.callout--green b { color: #146c48; }
.callout--purple { background: var(--purple-soft); border-color: #e3d9ff; }
.callout--purple b { color: #5b3dc9; }
.callout + .callout { margin-top: 10px; }

/* ---------- 小挑战卡片 ---------- */

.challenge-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.challenge-card__n {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 900;
}
.challenge-card--orange .challenge-card__n { background: var(--orange-soft); color: var(--orange-deep); }
.challenge-card--green .challenge-card__n { background: var(--green-soft); color: var(--green); }
.challenge-card b { display: block; margin-top: 8px; font-size: 16px; }
.challenge-card p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

blockquote {
  margin: 14px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--yellow);
  background: #fffdf5;
  border-radius: 0 12px 12px 0;
  color: var(--ink-2);
  font-size: 15px;
}
blockquote p { margin: 0 0 6px; }
blockquote p:last-child { margin: 0; }

/* ---------- 时间线 ---------- */

.timeline { position: relative; margin-top: 8px; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute; left: 8px; top: 10px; bottom: 10px;
  width: 2px;
  background: linear-gradient(#b9ccff, #ffd0a8);
  border-radius: 2px;
}
.tl-item { position: relative; padding: 0 0 20px 6px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute; left: -24px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff;
  border: 3px solid var(--blue);
}
.tl-item--warm::before { border-color: var(--orange); }
.tl-year { font-size: 12.5px; font-weight: 900; letter-spacing: 0.08em; color: var(--faint); }
.tl-item p { font-size: 14.5px; margin: 2px 0 0; }

/* ---------- 页脚 ---------- */

.footer {
  margin-top: 70px;
  padding: 30px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}
.footer__inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--muted); text-decoration: none; font-weight: 700; }
.footer a:hover { color: var(--ink); }

.page-foot-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 46px;
  flex-wrap: wrap;
}
.page-foot-nav a {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.page-foot-nav a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.page-foot-nav small { color: var(--faint); font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; }
.page-foot-nav b { font-size: 16px; }
.page-foot-nav .align-right { text-align: right; align-items: flex-end; }

.top-link {
  position: fixed;
  right: 20px; bottom: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(27, 35, 64, 0.12);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
}
.top-link.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.top-link:hover { background: #fff; }

/* ---------- 小工具 ---------- */

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

.fade-in { animation: fadeUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.pulse-once { animation: pulseOnce 0.6s ease; }
@keyframes pulseOnce {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 16px; }
  .hero-art { min-height: 240px; max-width: 440px; margin: 0 auto; }
  .section { padding-top: 36px; }
  .card { padding: 20px; border-radius: 18px; }
  .quiz { padding: 20px; }
  .wrap, .wrap--narrow { width: calc(100% - 32px); }
  .brand small { display: none; }
  .navlinks a { padding: 8px 10px; font-size: 13.5px; }
  .topbar__inner { height: 58px; gap: 8px; }
  .brand__mark { width: 34px; height: 34px; font-size: 18px; }
  .brand__name { font-size: 15px; }
}

@media (max-width: 420px) {
  .navlinks a { padding: 7px 8px; font-size: 12.5px; }
  .brand__name { display: none; }
  .big-num { min-width: 82px; padding: 8px 10px; }
  .big-num__v { font-size: 23px; }
}

@media (max-width: 360px) {
  .brand__mark { width: 30px; height: 30px; font-size: 16px; }
  .topbar__inner { gap: 6px; }
  .navlinks { gap: 2px; }
  .navlinks a { padding: 7px 6px; font-size: 12px; }
}

@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;
  }
}

@media print {
  .topbar, .top-link, .quiz__actions, .btn, .page-foot-nav { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ============================================================
   课程页专用
   ============================================================ */

.lesson-hero { padding: 44px 0 4px; }
.lesson-hero .flex-between > div:first-child { flex: 1 1 0; min-width: 0; }
.lesson-hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 900;
}
.lesson-emoji {
  flex: none;
  font-size: 66px;
  line-height: 1;
  transform: rotate(-6deg);
  filter: drop-shadow(0 12px 18px rgba(27, 35, 64, 0.14));
  user-select: none;
}
.anchor-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 9px;
  margin-top: 22px;
  scrollbar-width: none;
}
.anchor-nav::-webkit-scrollbar { display: none; }
.anchor-nav a {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.anchor-nav a:hover { color: var(--ink); border-color: #bec9e6; transform: translateY(-1px); }

.big-year {
  font-size: 64px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #c26115;
  margin: 2px 0 4px;
}

.reveal {
  margin-top: 14px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.reveal summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  color: var(--blue-deep);
  list-style: none;
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary::before {
  content: "＋";
  display: inline-block;
  margin-right: 8px;
  font-weight: 900;
  color: var(--blue);
  transition: transform 0.2s ease;
}
.reveal[open] summary::before { content: "－"; }
.reveal[open] summary { margin-bottom: 8px; }
.reveal p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.75; }

.cases {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  border-left: 2px solid var(--ink-2);
  padding-left: 14px;
  line-height: 1.9;
  font-size: 0.95em;
  text-align: left;
}

.code-line {
  display: block;
  min-height: 1.75em;
  padding: 0 8px;
  margin: 0 -8px;
  border-radius: 6px;
}
.code-line.hl-line { background: rgba(120, 160, 255, 0.2); }

.hero-title .hl { z-index: 0; }

.neuron-stage { position: relative; }
#sig-path { pointer-events: none; }
.neuron-stage.is-firing #sig-path { animation: sigTravel 1.9s ease-in-out both; }
@keyframes sigTravel {
  0%   { stroke: #f5893b; stroke-dashoffset: 0; opacity: 0; }
  8%   { opacity: 1; }
  80%  { opacity: 1; }
  100% { stroke: #f5893b; stroke-dashoffset: -760; opacity: 0; }
}
.neuron-part:focus-visible { outline: none; }
.neuron-part:focus-visible .shape { filter: drop-shadow(0 0 7px rgba(59, 110, 246, 0.8)); }

.wire.is-hot {
  stroke: var(--blue);
  stroke-width: 2.2;
  stroke-dasharray: 6 4;
  animation: wireFlow 0.5s linear infinite;
}
@keyframes wireFlow { to { stroke-dashoffset: -10; } }

.train-row--bad td { background: #fff5f5; }
.train-row--bad td:first-child { border-radius: 8px 0 0 8px; }
.train-row--bad td:last-child { border-radius: 0 8px 8px 0; }
#train-log { height: 158px; }

.table tbody tr:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

@media (max-width: 920px) {
  .anchor-nav { flex-wrap: wrap; overflow-x: visible; }
}

@media (max-width: 860px) {
  .lesson-hero { padding-top: 28px; }
  .lesson-emoji { font-size: 48px; }
  .big-year { font-size: 52px; }
  .anchor-nav { margin-top: 14px; }
}

@media (max-width: 640px) {
  .lesson-emoji { display: none; }
  .cases { font-size: 0.85em; }
  .bar-line { grid-template-columns: 88px 1fr 56px; }
  .q__title { font-size: 15px; }
  .quiz__result strong { font-size: 19px; }
}

@media (max-width: 860px) {
  .lab > div:first-child { max-width: 540px; }
}

@media (max-width: 520px) {
  .table.table--click { min-width: 0; font-size: 14px; }
  .table.table--click th, .table.table--click td { padding: 9px 8px; }
}

.stepper > *, .lab > *, .trainer > *, .grid2 > *, .grid3 > * { min-width: 0; }
pre { max-width: 100%; }
.stepper__code pre { width: 100%; }

@media (max-width: 520px) {
  pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  pre .code-line, pre .hl-line { margin: 0; padding-left: 2.4em; text-indent: -2.4em; }
}
