:root {
  color-scheme: light;
  --ink: #211c31;
  --muted: #615970;
  --subtle: #756d82;
  --violet: #654bc6;
  --violet-dark: #5136b4;
  --violet-light: #f0ebfc;
  --surface: #fff;
  --bg: #f8f7fc;
  --line: #e7e2ef;
  --success: #216953;
  --danger: #a73a4b;
  --shadow: 0 12px 30px rgba(56, 41, 98, .055);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.65; }
a { color: var(--violet-dark); text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #8d78e3; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.3; }
svg { vertical-align: middle; }
.skip { position: fixed; top: -60px; left: 16px; z-index: 10; padding: 8px 15px; border-radius: 8px; background: #fff; }
.skip:focus { top: 10px; }

.topbar { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, .98); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1512px; min-height: 70px; padding: 0 43px; margin: auto; display: flex; align-items: center; gap: 48px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 700; letter-spacing: -.55px; white-space: nowrap; }
.brand strong { color: var(--violet); }
.brand img { flex: none; }
.topnav { display: flex; align-items: stretch; gap: 26px; align-self: stretch; }
.topnav a { position: relative; display: flex; gap: 6px; align-items: center; min-height: 44px; color: var(--muted); font-size: 14px; font-weight: 650; white-space: nowrap; }
.topnav a:hover, .topnav a[aria-current] { color: var(--violet-dark); }
.topnav a[aria-current]::after { content: ""; position: absolute; height: 3px; border-radius: 3px 3px 0 0; background: var(--violet); inset: auto 1px 0; }
.nav-count { background: var(--violet-light); color: var(--violet-dark); border-radius: 12px; min-width: 18px; text-align: center; padding: 1px 4px; font-size: 12px; }
.header-progress { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--ink); white-space: nowrap; }
.header-progress svg { transform: rotate(-90deg); }
.ring-track, .ring-value { fill: none; stroke-width: 3; }
.ring-track { stroke: #e6dff5; }
.ring-value { stroke: var(--violet); stroke-linecap: round; stroke-dasharray: 0 100; }
.header-progress strong, .header-progress small { display: block; line-height: 1.28; }
.header-progress strong { font-size: 14px; }
.header-progress small { color: var(--subtle); font-size: 12px; margin-top: 2px; }

.layout { max-width: 1472px; margin: 0 auto; padding: 31px 28px 64px; display: grid; align-items: start; grid-template-columns: 267px minmax(0, 1fr); gap: 27px; }
.sidebar { position: sticky; top: 98px; max-height: calc(100dvh - 117px); overflow-y: auto; scrollbar-width: thin; border: 1px solid var(--line); background: var(--surface); border-radius: 21px; padding: 19px 13px 13px; box-shadow: var(--shadow); }
.sidebar-top { padding: 0 8px 13px; display: flex; justify-content: space-between; align-items: center; gap: 6px; border-bottom: 1px solid #eeeaf3; }
.sidebar-title { display: grid; gap: 2px; }
.sidebar-title strong { font-size: 20px; line-height: 1.25; letter-spacing: -.5px; }
.sidebar-kicker { font-size: 13px; color: var(--subtle); }
.sidebar-level { border-radius: 20px; background: var(--violet-light); color: var(--violet-dark); padding: 2px 8px; font-size: 12px; }
.phase { margin: 5px 0; }
.phase summary { display: flex; align-items: center; gap: 9px; list-style: none; padding: 10px 8px; border-radius: 9px; cursor: pointer; color: #413950; font-size: 14px; font-weight: 700; }
.phase summary::-webkit-details-marker { display: none; }
.phase summary:hover { background: #f7f4fb; }
.phase-index { background: #f2eef9; border-radius: 7px; color: #6b567c; width: 25px; height: 25px; display: grid; place-items: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.phase[open] .phase-index { background: #e9e1fa; color: var(--violet-dark); }
.phase-chevron { margin-left: auto; color: var(--subtle); }
.phase[open] .phase-chevron { transform: rotate(90deg); }
.lesson-list { display: grid; gap: 2px; padding: 0 0 4px; }
.lesson-link { display: flex; gap: 8px; align-items: center; min-height: 38px; padding: 6px 8px; border-radius: 9px; font-size: 14px; color: #50475f; }
.lesson-link:not([aria-disabled="true"]):hover { background: #f7f4fc; color: var(--violet-dark); }
.lesson-link[aria-disabled="true"] { color: #746c80; }
.lesson-link[aria-current="page"] { background: #ece6fb; color: #5136ae; font-weight: 700; }
.lesson-index { flex: 0 0 23px; text-align: center; color: #706380; font-size: 12px; font-variant-numeric: tabular-nums; }
.lesson-status { margin-left: auto; flex: none; color: #847992; }
.lesson-status.done { color: var(--success); }
.sidebar-save { display: flex; align-items: center; gap: 7px; padding: 11px 8px 0; margin-top: 8px; border-top: 1px solid #eeeaf3; color: var(--subtle); font-size: 12px; }
.save-icon { display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #e8f4ed; color: var(--success); font-size: 11px; }

main { min-width: 0; outline: none; }
.hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 270px; padding: 34px 39px; border: 1px solid #e2d9f6; border-radius: 24px; background: linear-gradient(115deg,#f3edfc 7%,#eee8fa 62%,#e9e1f8 100%); overflow: hidden; }
.hero-copy { position: relative; z-index: 1; max-width: 62%; }
.hero-art { position: absolute; inset: 50% -9px auto auto; width: 43%; height: auto; transform: translateY(-50%); }
.hero-eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; color: var(--violet-dark); font-size: 14px; font-weight: 700; }
.hero-eyebrow span { display: inline-flex; border: 1px solid #dcd0f4; background: rgba(255,255,255,.54); padding: 2px 10px; border-radius: 20px; }
.hero-eyebrow .eyebrow-plain { border: 0; background: transparent; padding-left: 3px; color: #69547c; }
.hero h1 { font-size: clamp(31px, 4vw, 53px); letter-spacing: -.04em; margin: 0 0 11px; font-weight: 760; overflow-wrap: anywhere; }
.hero p { font-size: 16px; line-height: 1.7; color: #50445f; max-width: 590px; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 18px; color: #584a70; font-size: 13px; font-weight: 600; }
.hero-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta a { color: var(--violet-dark); border: 1px solid #d9caf1; background: #faf7ff; border-radius: 7px; padding: 4px 10px; }
.hero-meta a:hover { background: #fff; }
.content-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 15px; margin-top: 17px; align-items: stretch; }
.stack { display: grid; gap: 15px; margin-top: 17px; }
.card { min-width: 0; padding: 23px 25px; border: 1px solid var(--line); background: var(--surface); border-radius: 17px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.card-head h2 { font-size: 20px; letter-spacing: -.025em; }
.card-icon { display: grid; place-items: center; background: #f1ebfc; color: var(--violet-dark); width: 31px; height: 31px; border-radius: 8px; flex: none; }
.card p { color: #51475e; }
.card p + p { margin-top: 10px; }
.objective { margin-bottom: 13px; font-weight: 700; }
.example { border-left: 3px solid #9b87e0; padding: 11px 14px; border-radius: 0 9px 9px 0; background: #f7f4fd; }
.example h3 { font-size: 15px; margin-bottom: 4px; }
.example p { font-size: 15px; }
.lesson-example { margin-top: 13px; }
.terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); margin: 13px 0 0; gap: 8px; }
.terms div { border: 1px solid #ece6f3; background: #faf8fd; border-radius: 9px; padding: 8px 11px; }
.terms dt { color: #5136a9; font-size: 14px; font-weight: 700; }
.terms dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.formula { margin: 0 0 10px; padding: 13px 15px; background: #f1ecfb; color: #413179; border-radius: 9px; overflow: auto; font: 600 clamp(14px, 2vw, 17px) / 1.55 ui-monospace, Consolas, "Microsoft YaHei", monospace; }
.sources { font-size: 14px; color: var(--subtle); }
.sources summary { cursor: pointer; width: fit-content; color: var(--violet-dark); }
.sources ul { margin: 7px 0 0; padding-left: 20px; }
.sources li + li { margin-top: 4px; }
.sources a:hover { text-decoration: underline; }
.diagram { display: flex; flex-direction: column; background: #fcfbff; }
.diagram figure { margin: 0; display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 10px; }
.diagram figcaption { color: var(--subtle); margin-top: 4px; font-size: 13px; line-height: 1.5; }
.diagram svg.graph { width: 100%; max-height: 135px; overflow: visible; }
.graph text { font-family: inherit; fill: #4a3973; font-size: 14px; }
.graph .node-letter { font-size: 16px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.graph .node { fill: #eee8fb; stroke: #c8b9ee; stroke-width: 1.5; }
.graph .node-active { fill: #7259d4; stroke: #644bc4; }
.graph .node-active + text { fill: #fff; }
.graph .edge { fill: none; stroke: #927bdc; stroke-width: 2; }
.graph .inhibit { stroke: #a6516b; }
.graph .guide { stroke: #d6c9eb; stroke-width: 1; stroke-dasharray: 4 4; }
.graph .axis { stroke: #a99cbf; stroke-width: 1; }
.flow { display: flex; align-items: stretch; gap: 6px; }
.flow-step { flex: 1; display: grid; place-items: center; min-width: 0; border-radius: 10px; background: #eee8fa; color: #513b82; text-align: center; padding: 10px 5px; font-size: 13px; font-weight: 700; }
.flow-sep { flex: none; align-self: center; color: #8269cf; }
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, .95fr) minmax(55px,1fr) 36px; align-items: center; gap: 7px; font-size: 13px; color: #514460; }
.bar-track { border-radius: 10px; background: #eee8f7; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: #856cd6; }

.quiz-intro { margin-bottom: 14px; }
.question { min-width: 0; border: 0; margin: 0; padding: 0; }
.question + .question { border-top: 1px solid #ede9f3; margin-top: 18px; padding-top: 18px; }
.question legend, .question-title { padding: 0; font-size: 16px; line-height: 1.5; font-weight: 700; margin-bottom: 9px; color: var(--ink); }
.question + .question legend { float: left; width: 100%; }
.question + .question .options { clear: left; }
.options, .review-list { display: grid; gap: 7px; }
.option { display: flex; gap: 8px; align-items: center; min-height: 42px; padding: 7px 10px; border: 1px solid #e8e2f1; border-radius: 8px; color: var(--ink); cursor: pointer; }
.option:hover { border-color: #bba8e8; }
.option:has(input:checked) { border-color: #8a72d9; background: #f2edfb; }
.option input { accent-color: var(--violet); flex: none; margin: 2px 4px 2px 0; width: 16px; height: 16px; }
.option.is-correct { border-color: #6eaa94; background: #edf7f1; }
.option.is-incorrect { border-color: #d0a0ab; background: #fcf0f3; }
.feedback { margin-top: 9px; padding: 9px 12px; border-radius: 9px; color: #3c3550; font-size: 14px; background: #f0edf8; }
.feedback.correct { color: #1d5846; background: #edf7f1; }
.feedback.incorrect { color: #80354a; background: #fcf0f3; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; border: 1px solid transparent; border-radius: 8px; padding: 7px 12px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.btn.primary { background: var(--violet); color: #fff; }
.btn.primary:hover { background: var(--violet-dark); }
.btn.secondary { border-color: #e0d7ef; background: #fff; color: var(--violet-dark); }
.btn.secondary:hover { background: #f3eefb; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.footnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--subtle); font-size: 14px; margin-top: 17px; }
.footnav > span { text-align: center; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 7px; font-size: 13px; font-weight: 650; background: #f1ebfc; color: var(--violet-dark); }
.badge.pass { background: #e9f5ee; color: var(--success); }
.pager-head { min-height: 221px; }
.pager-head h1 { font-size: clamp(29px,4vw,43px); }
.pager-head .hero-art { opacity: .62; }
.progress-list { display: grid; gap: 14px; }
.progress-item { display: grid; gap: 7px; }
.progress-item .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 14px; }
.progress-item strong { color: var(--ink); }
.progress-item progress { width: 100%; accent-color: var(--violet); height: 12px; }
.locked-panel { padding: 23px; }
.exam-result { margin: 13px 0; }
.exam-result p { margin-top: 3px; }
.quiz-hint { font-size: 14px; color: var(--subtle); }
.lab-controls { display: grid; grid-template-columns: repeat(auto-fit,minmax(178px,1fr)); gap: 11px; margin-bottom: 14px; }
.control { display: grid; gap: 4px; background: #f8f5fd; border: 1px solid #ede6f6; border-radius: 9px; padding: 9px 10px; }
.control span { display: flex; justify-content: space-between; gap: 7px; font-size: 14px; font-weight: 700; }
.control output { color: var(--violet-dark); }
.control input[type="range"] { width: 100%; accent-color: var(--violet); }
.lab-chart { display: block; width: 100%; height: auto; border: 1px solid #eae3f3; border-radius: 10px; background: #fcfaff; }
.lab-status { margin-top: 8px; font-size: 14px; }
.oral-prompt { font-size: 21px; line-height: 1.6; margin-bottom: 10px; }
.oral-answer { width: 100%; min-height: 105px; padding: 8px 11px; border-radius: 9px; border: 1px solid #dcd2ea; color: var(--ink); resize: vertical; }
.oral-rubric { margin: 10px 0 0; }
.oral-rubric summary { color: var(--violet-dark); cursor: pointer; font-weight: 650; }
.oral-rubric ul { margin: 7px 0; padding-left: 21px; }
.review-list details { background: #faf8fd; border: 1px solid #eae3f3; border-radius: 8px; padding: 8px 10px; }
.review-list summary { cursor: pointer; }
.review-list .question { margin-top: 8px; }
@media (max-width: 950px) {
  .topbar-inner { padding: 0 22px; gap: 25px; }
  .topnav { gap: 17px; }
  .layout { grid-template-columns: 225px minmax(0, 1fr); gap: 16px; padding: 22px 16px 45px; }
  .hero { padding: 27px 25px; min-height: 243px; }
  .hero-copy { max-width: 73%; }
  .card { padding: 20px; }
}
@media (max-width: 740px) {
  html { scroll-padding-top: 119px; }
  .topbar-inner { display: grid; grid-template-columns: 1fr auto; gap: 0 9px; min-height: 0; padding: 8px 16px 0; }
  .brand { font-size: 17px; gap: 8px; }
  .brand img { width: 33px; height: 33px; }
  .header-progress { grid-column: 2; grid-row: 1; }
  .topnav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 9px; }
  .topnav a { min-height: 40px; }
  .layout { grid-template-columns: minmax(0,1fr); gap: 13px; padding: 13px 12px 32px; }
  .sidebar { position: static; max-height: none; padding: 8px 9px 9px; border-radius: 14px; }
  .sidebar-top { padding: 2px 5px 7px; border-bottom: 0; }
  .sidebar-title { display: flex; align-items: baseline; gap: 8px; }
  .sidebar-title strong { font-size: 16px; }
  #curriculum { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 5px; align-items: start; }
  .phase { margin: 0; padding: 1px; border-radius: 8px; background: #faf8fd; }
  .phase summary { padding: 5px 3px; gap: 4px; font-size: 13px; }
  .phase-index { width: 21px; height: 21px; }
  .lesson-link { font-size: 13px; padding: 4px 3px; gap: 3px; min-height: 32px; }
  .lesson-index { flex-basis: 17px; }
  .sidebar-save { display: none; }
  .hero { min-height: 224px; padding: 20px 18px; border-radius: 16px; }
  .hero-copy { max-width: 83%; }
  .hero-art { width: 47%; right: -23px; opacity: .35; }
  .hero p { font-size: 15px; }
  .hero-meta { margin-top: 12px; gap: 8px; }
  .content-grid { grid-template-columns: minmax(0,1fr); margin-top: 12px; gap: 10px; }
  .stack { margin-top: 12px; gap: 10px; }
  .card { padding: 15px; border-radius: 12px; }
  .card-head h2 { font-size: 18px; }
  .pager-head { min-height: 182px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .option, .lesson-link { transition: background-color .16s, border-color .16s; }
}
