:root {
  --paper: #f6f4ee;
  --paper-deep: #efede5;
  --card: #fbfaf6;
  --card-muted: #f3f1ea;
  --ink: #272a25;
  --ink-soft: #50564d;
  --ink-muted: #83887d;
  --line: #dedbd1;
  --line-strong: #c8c3b5;
  --accent: #536c5e;
  --accent-deep: #3f574b;
  --accent-soft: #e6ece7;
  --ochre: #9b6a43;
  --ochre-soft: #f0e7dc;
  --danger: #8b5449;
  --serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans SC", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --shell: 1180px;
  --radius: 5px;
  --ease: cubic-bezier(.2, .65, .35, 1);

  --card-hover: #fcfbf8;
  --card-translucent: rgba(251, 250, 246, .72);
  --card-translucent-strong: rgba(251, 250, 246, .8);
  --card-translucent-soft: rgba(251, 250, 246, .7);
  --card-glass: rgba(251, 250, 246, .56);
  --paper-glass: rgba(246, 244, 238, .9);
  --muted-translucent: rgba(239, 237, 229, .38);
  --muted-translucent-strong: rgba(239, 237, 229, .52);
  --line-soft: rgba(222, 219, 209, .6);
  --line-soft-strong: rgba(222, 219, 209, .7);
  --header-bg: rgba(246, 244, 238, .91);
  --header-border: rgba(222, 219, 209, .82);
  --accent-soft-strong: #e8ede8;
  --accent-line: #c6d0c8;
  --accent-line-soft: #bfcbc1;
  --accent-underline: #aebdb2;
  --ochre-ink: #7c512f;
  --ochre-border: #ded0be;
  --ochre-border-soft: #d8c4ae;
  --danger-soft: #f4e9e5;
  --danger-border: #d4b3a8;
  --overlay: rgba(39, 42, 37, .38);
  --backdrop: rgba(39, 42, 37, .26);
  --shadow-sm: rgba(39, 42, 37, .12);
  --shadow-lg: rgba(39, 42, 37, .12);
  --shadow-drawer: rgba(39, 42, 37, .055);
  --shadow-skill: rgba(63, 87, 75, .12);
  --toast-bg: rgba(39, 42, 37, .94);
  --toast-text: var(--card);
  --selection-bg: #dfe7df;
  --on-accent: var(--card);
  --glow-accent: rgba(83, 108, 94, .045);
  --glow-ochre: rgba(155, 106, 67, .045);
  --glow-ochre-soft: rgba(155, 106, 67, .035);
  --grid-line: rgba(200, 195, 181, .26);
  --focus-ring: rgba(83, 108, 94, .09);
  --katex-ink: var(--ink);
  --formula-error: var(--danger);
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #121212;
  --paper-deep: #181818;
  --card: #1e1e1e;
  --card-muted: #262626;
  --card-hover: #242424;
  --card-translucent: rgba(30, 30, 30, .75);
  --card-translucent-strong: rgba(30, 30, 30, .85);
  --card-translucent-soft: rgba(30, 30, 30, .72);
  --card-glass: rgba(30, 30, 30, .6);
  --paper-glass: rgba(18, 18, 18, .9);
  --muted-translucent: rgba(255, 255, 255, .04);
  --muted-translucent-strong: rgba(255, 255, 255, .06);
  --ink: #e0e0e0;
  --ink-soft: #c7c7c7;
  --ink-muted: #9a9a9a;
  --line: #333333;
  --line-soft: rgba(255, 255, 255, .08);
  --line-soft-strong: rgba(255, 255, 255, .1);
  --line-strong: #4a4a4a;
  --header-bg: rgba(18, 18, 18, .92);
  --header-border: rgba(255, 255, 255, .08);
  --accent: #7fa392;
  --accent-deep: #9cc0ae;
  --accent-soft: #24322c;
  --accent-soft-strong: #2a3a32;
  --accent-line: #3c5147;
  --accent-line-soft: #4a6357;
  --accent-underline: #6f8f7f;
  --ochre: #c08a5e;
  --ochre-soft: #2f261f;
  --ochre-ink: #d8a878;
  --ochre-border: #4a3a2a;
  --ochre-border-soft: #5a4632;
  --danger: #d98b7e;
  --danger-soft: #3a2522;
  --danger-border: #5c3a34;
  --overlay: rgba(0, 0, 0, .55);
  --backdrop: rgba(0, 0, 0, .45);
  --shadow-sm: rgba(0, 0, 0, .5);
  --shadow-lg: rgba(0, 0, 0, .55);
  --shadow-drawer: rgba(0, 0, 0, .4);
  --shadow-skill: rgba(0, 0, 0, .5);
  --toast-bg: #e0e0e0;
  --toast-text: #121212;
  --selection-bg: #2f4a3d;
  --on-accent: #121212;
  --glow-accent: rgba(127, 163, 146, .08);
  --glow-ochre: rgba(192, 138, 94, .08);
  --glow-ochre-soft: rgba(192, 138, 94, .05);
  --grid-line: rgba(255, 255, 255, .06);
  --focus-ring: rgba(127, 163, 146, .18);
  --katex-ink: #ececec;
  --formula-error: #e0a090;
  color-scheme: dark;
}

html.theme-changing,
html.theme-changing *,
html.theme-changing *::before,
html.theme-changing *::after {
  transition:
    background-color .3s ease,
    color .3s ease,
    border-color .3s ease,
    box-shadow .3s ease,
    fill .3s ease,
    stroke .3s ease !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 6%, var(--glow-ochre), transparent 28rem),
    radial-gradient(circle at 3% 38%, var(--glow-accent), transparent 25rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

::selection {
  color: var(--ink);
  background: var(--selection-bg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 8px 12px;
  color: var(--card);
  background: var(--ink);
  border-radius: var(--radius);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.serif {
  font-family: var(--serif);
}

.mono {
  font-family: var(--mono);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 34px;
  width: min(var(--shell), calc(100% - 64px));
  min-height: 78px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  min-width: 148px;
  text-decoration: none;
  line-height: 1.15;
}

.brand-cn {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .08em;
}

.brand-en {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .19em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.main-nav a {
  position: relative;
  padding: 7px 0;
  color: var(--ink-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color .18s var(--ease);
}

.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s var(--ease);
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--ink);
}

.main-nav a.is-active::after {
  transform: scaleX(1);
}

.study-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 286px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.study-toggle {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-start;
  min-width: 78px;
  padding: 0;
  text-align: left;
  background: none;
  border: 0;
}

.study-label {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.study-compact {
  display: none;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}

.study-chevron {
  display: none;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1;
}

.study-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 14px;
  width: 100%;
}

.study-metric {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.study-metric span {
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.4;
}

.study-metric strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-panel.is-collapsed {
  min-width: 168px;
}

.study-panel.is-collapsed .study-metrics,
.study-panel.is-collapsed .study-label {
  display: none;
}

.study-panel.is-collapsed .study-compact,
.study-panel.is-collapsed .study-chevron {
  display: inline;
}

.study-panel.is-collapsed .study-toggle {
  flex-direction: row;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}

.theme-toggle:hover {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.theme-icon {
  display: block;
  width: 16px;
  height: 16px;
}

.theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

/* ---------- Page shell ---------- */

#app-root {
  min-height: calc(100vh - 78px);
  outline: none;
}

.page-shell {
  width: min(var(--shell), calc(100% - 64px));
  margin: 0 auto;
}

.page-shell.narrow {
  width: min(980px, calc(100% - 64px));
}

.page-enter {
  animation: page-in .32s var(--ease) both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .19em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 64px;
  padding: 96px 0 92px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 760px;
}

.hero h1 {
  max-width: 800px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(46px, 6vw, 76px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.22;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero .lede {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.9;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 38px;
  border-top: 1px solid var(--line);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
  padding: 16px 28px 0 0;
}

.meta-item + .meta-item {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.meta-item span {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.meta-item strong {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.hero-aside {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 8px;
}

.math-orbit {
  position: relative;
  width: 210px;
  height: 290px;
}

.math-orbit::before,
.math-orbit::after {
  position: absolute;
  content: "";
  border: 1px solid var(--line);
  border-radius: 50%;
}

.math-orbit::before {
  top: 18px;
  right: 12px;
  width: 170px;
  height: 170px;
}

.math-orbit::after {
  top: 70px;
  right: 64px;
  width: 68px;
  height: 68px;
  border-color: var(--line-strong);
}

.math-orbit .orbit-glyph {
  position: absolute;
  top: 38px;
  right: 40px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 118px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.math-orbit .orbit-caption {
  position: absolute;
  right: 6px;
  bottom: 44px;
  max-width: 120px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  line-height: 1.8;
  text-align: right;
}

.math-orbit .orbit-dot {
  position: absolute;
  top: 27px;
  right: 91px;
  width: 5px;
  height: 5px;
  background: var(--ochre);
  border-radius: 50%;
}

/* ---------- Sections ---------- */

.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 30px;
}

.section-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(27px, 3vw, 35px);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.35;
}

.section-note {
  max-width: 430px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: right;
}

.section-rule {
  width: 100%;
  height: 1px;
  margin: 0 0 30px;
  background: var(--line);
}

/* ---------- Push cards ---------- */

.push-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px 24px;
  margin-bottom: 20px;
}

.weight-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.weight-caption {
  color: var(--ink-muted);
  font-size: 11px;
  white-space: nowrap;
}

.weight-bar {
  display: flex;
  width: 150px;
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.weight-bar span {
  display: block;
  height: 100%;
}

.weight-bar .weight-content {
  background: var(--accent);
}

.weight-bar .weight-exercise {
  background: var(--ochre);
}

.weight-values {
  display: flex;
  gap: 9px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.weight-values b {
  color: var(--ink-soft);
  font-weight: 500;
}

.push-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.push-grid.is-single {
  grid-template-columns: 1fr;
}

.push-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 258px;
  padding: 27px 28px 24px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}

.push-card:hover {
  background: var(--card-hover);
  border-color: var(--line-strong);
}

.push-card.is-primary {
  background:
    linear-gradient(135deg, var(--glow-accent), transparent 55%),
    var(--card);
  border-color: var(--accent-line);
}

.push-card.is-exercise {
  background:
    linear-gradient(135deg, var(--glow-ochre-soft), transparent 55%),
    var(--card);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  line-height: 1.4;
}

.tag.tag-exercise {
  color: var(--ochre-ink);
  background: var(--ochre-soft);
}

.tag.tag-soft {
  color: var(--ink-muted);
  background: var(--card-muted);
}

.priority-mark {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
}

.card-title {
  margin: 24px 0 8px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.42;
}

.card-desc {
  max-width: 470px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.85;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  margin-top: 16px;
  color: var(--accent-deep);
  font-size: 12px;
  text-decoration: none;
}

.card-link span {
  transition: transform .18s var(--ease);
}

.card-link:hover span {
  transform: translateX(3px);
}

.push-empty {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ---------- Topic cards ---------- */

.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 248px;
  padding: 26px 28px;
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.topic-card:hover {
  background: var(--card-translucent);
  border-color: var(--line-strong);
}

.topic-card.is-empty {
  color: var(--ink-muted);
  background: var(--muted-translucent);
}

.topic-card.is-empty:hover {
  background: var(--muted-translucent-strong);
  border-color: var(--line);
}

.topic-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.topic-index {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
}

.topic-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
}

.status-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.is-empty .status-dot {
  background: var(--line-strong);
}

.topic-title {
  max-width: 440px;
  margin: 32px 0 4px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.35;
}

.topic-en {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .13em;
}

.topic-desc {
  max-width: 450px;
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.topic-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
}

.topic-arrow {
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
  transition: transform .18s var(--ease);
}

.topic-card:hover .topic-arrow {
  transform: translateX(3px);
}

/* ---------- Page hero / breadcrumbs ---------- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding-top: 38px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
}

.breadcrumbs a {
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--ink);
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 50px;
  padding: 42px 0 64px;
}

.page-kicker {
  margin: 0 0 15px;
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.22;
}

.page-desc {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.9;
}

.page-aside-note {
  align-self: end;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.page-aside-note span {
  display: block;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.page-aside-note strong {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

/* ---------- Mindmap ---------- */

.mindmap-panel {
  margin-bottom: 64px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px 17px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

.panel-note {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .05em;
  text-align: right;
}

.mindmap-canvas {
  position: relative;
  height: 360px;
  overflow: hidden;
}

.mindmap-canvas.is-loading::after {
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  content: "正在绘制知识地图…";
  transform: translate(-50%, -50%);
}

#mindmap-svg {
  display: block;
  max-width: 100%;
  height: auto;
}

#mindmap-svg text {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
}

#mindmap-svg a {
  color: inherit;
  text-decoration: none;
}

#mindmap-svg .markmap-foreign {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
}

#mindmap-svg g[data-depth="1"] .markmap-foreign {
  color: var(--accent-deep);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

#mindmap-svg g[data-depth="2"] .markmap-foreign {
  font-size: 13px;
}

#mindmap-svg g[data-depth="3"] .markmap-foreign {
  color: var(--ink-muted);
  font-size: 11px;
}

#mindmap-svg .markmap-foreign a {
  color: var(--accent-deep);
  text-decoration: none;
}

#mindmap-svg .markmap-foreign a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#mindmap-svg .markmap-node > circle {
  fill: var(--card);
  stroke: var(--accent);
}

#mindmap-svg .markmap-node > line {
  opacity: .42 !important;
  stroke: var(--line-strong) !important;
  stroke-width: .8px !important;
}

#mindmap-svg .markmap-link {
  stroke: var(--line-strong);
  stroke-width: 1.2px;
}

#mindmap-svg .markmap-node a:hover {
  fill: var(--accent-deep);
}

.mindmap-fallback {
  display: flex;
  align-items: stretch;
  gap: 30px;
  height: 100%;
  padding: 30px 28px;
}

.mm-root {
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: center;
  min-width: 120px;
  min-height: 120px;
  padding: 20px;
  color: var(--accent-deep);
  font-family: var(--serif);
  font-size: 20px;
  text-align: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.mm-branches {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding-left: 28px;
}

.mm-branches::before {
  position: absolute;
  top: 50%;
  bottom: 50%;
  left: 0;
  width: 28px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.mm-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}

.mm-node::before {
  position: absolute;
  top: 50%;
  left: -29px;
  width: 28px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.mm-node:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.mm-node-index {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 9px;
}

.mm-node-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mm-node-copy strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.mm-node-copy small {
  color: var(--ink-muted);
  font-size: 10px;
}

.mindmap-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 30px;
  text-align: center;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}

.mindmap-placeholder .placeholder-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
}

.mindmap-placeholder p {
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

/* ---------- Knowledge list ---------- */

.knowledge-section {
  padding-bottom: 30px;
}

.knowledge-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.knowledge-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 23px 4px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background .18s var(--ease), padding .18s var(--ease);
}

.knowledge-card:hover {
  padding-right: 12px;
  padding-left: 12px;
  background: var(--card-translucent-strong);
}

.knowledge-index {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 10px;
}

.knowledge-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.45;
}

.knowledge-hint {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.7;
}

.knowledge-side {
  display: flex;
  align-items: center;
  gap: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  color: var(--ink-muted);
  background: var(--card-muted);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .03em;
}

.chip.is-done {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.knowledge-arrow {
  color: var(--accent);
  font-size: 16px;
}

/* ---------- Detail ---------- */

.detail-header {
  padding: 40px 0 48px;
  border-bottom: 1px solid var(--line);
}

.detail-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 48px;
  align-items: end;
}

.detail-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.26;
}

.detail-hint {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}

.detail-hint span {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-meta div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.detail-meta strong {
  color: var(--ink-soft);
  font-weight: 500;
  text-align: right;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 70px;
  padding: 58px 0 82px;
}

.article {
  min-width: 0;
}

.article-section {
  padding: 0 0 56px;
  margin-bottom: 54px;
  border-bottom: 1px solid var(--line);
}

.article-section:last-of-type {
  margin-bottom: 0;
  border-bottom: 0;
}

.article-section-head {
  display: flex;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 24px;
}

.section-no {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
}

.article-section h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -.02em;
}

.prose {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.95;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose p {
  margin: 0 0 17px;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose ul,
.prose ol {
  margin: 8px 0 20px;
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 7px;
  padding-left: 4px;
}

.prose li::marker {
  color: var(--ochre);
}

.prose .formula {
  padding: 22px 10px;
  margin: 20px 0;
  overflow-x: auto;
  text-align: center;
  background: var(--card-translucent-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.prose .formula .katex-display {
  margin: 0;
}

.prose .note {
  padding: 16px 18px;
  margin: 22px 0;
  color: var(--ink-soft);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  font-size: 13px;
  line-height: 1.85;
}

.pitfall-list,
.application-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pitfall-list li,
.application-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.pitfall-list li::before,
.application-list li::before {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 2.4;
}

.pitfall-list li::before {
  content: "×";
}

.application-list li::before {
  content: "→";
  color: var(--accent);
}

.teacher-tip {
  display: flex;
  gap: 18px;
  padding: 20px 22px;
  margin: 0 0 34px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.teacher-tip-mark {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.2;
}

.teacher-tip p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.teacher-tip small {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
}

/* ---------- Exercises ---------- */

.exercise-intro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0 22px;
  color: var(--ink-muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.exercise-intro p {
  margin: 0;
}

.exercise-group {
  padding-top: 28px;
}

.exercise-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 15px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.exercise-group-title::after {
  flex: 1;
  height: 1px;
  content: "";
  background: var(--line);
}

.quiz-card {
  padding: 22px 22px 20px;
  margin-bottom: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quiz-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.quiz-no {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
}

.quiz-source {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.quiz-question {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.85;
}

.options {
  display: grid;
  gap: 8px;
}

.option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  color: var(--ink-soft);
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}

.option:hover {
  background: var(--card-muted);
  border-color: var(--line-strong);
}

.option-letter {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
}

.option.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.option.is-correct {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.option.is-wrong {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.option:disabled {
  cursor: default;
}

.reveal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 15px;
}

.reveal-btn {
  padding: 7px 13px;
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  font-size: 11px;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}

.reveal-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.done-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
}

.done-badge::before {
  width: 4px;
  height: 4px;
  content: "";
  background: var(--accent);
  border-radius: 50%;
}

.answer-panel {
  padding: 18px;
  margin-top: 17px;
  background: var(--paper-deep);
  border-left: 2px solid var(--accent);
}

.answer-panel[hidden] {
  display: none;
}

.answer-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.answer-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-line;
}

.explain {
  padding-top: 12px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
  border-top: 1px solid var(--line);
}

.essay-card .quiz-question {
  margin-bottom: 18px;
}

.essay-answer {
  padding: 20px 20px 18px;
  margin-top: 17px;
  background: var(--paper-deep);
  border-left: 2px solid var(--ochre);
}

.essay-answer[hidden] {
  display: none;
}

.essay-answer .answer-label {
  color: var(--ochre);
}

.pitfall-box {
  padding-top: 12px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
  border-top: 1px solid var(--line);
}

.pitfall-box strong {
  color: var(--ochre);
  font-weight: 600;
}

.complete-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0 0;
  margin-top: 50px;
  border-top: 1px solid var(--line);
}

.complete-content p {
  max-width: 440px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.8;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  color: var(--on-accent);
  background: var(--accent-deep);
  border: 1px solid var(--accent-deep);
  border-radius: 3px;
  font-size: 12px;
  text-decoration: none;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.button.is-done {
  color: var(--accent-deep);
  background: transparent;
  border-color: var(--accent-line);
}

.button.secondary {
  color: var(--ink-soft);
  background: transparent;
  border-color: var(--line-strong);
}

.button.secondary:hover {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.button.danger {
  color: var(--danger);
  background: transparent;
  border-color: var(--danger-border);
}

.button.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

/* ---------- Aside ---------- */

.aside {
  min-width: 0;
}

.aside-sticky {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.aside-card {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.aside-label {
  display: block;
  margin-bottom: 12px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-list a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
}

.toc-list li:last-child a {
  border-bottom: 0;
}

.toc-list a:hover {
  color: var(--accent-deep);
}

.toc-list span {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 8px;
}

.video-card {
  padding: 20px;
  background: var(--ochre-soft);
  border: 1px solid var(--ochre-border);
  border-radius: var(--radius);
}

.video-card .aside-label {
  color: var(--ochre-ink);
}

.video-title {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
}

.video-note {
  margin: 0 0 14px;
  color: var(--ochre-ink);
  font-size: 10px;
  line-height: 1.7;
}

.video-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  color: var(--ochre-ink);
  font-size: 11px;
  text-decoration: none;
  background: var(--card-glass);
  border: 1px solid var(--ochre-border-soft);
  border-radius: 3px;
}

.video-link:hover {
  background: var(--card);
}

.video-link span {
  font-family: var(--mono);
  font-size: 9px;
}

.aside-complete {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aside-complete p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.7;
}

.point-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.point-nav a {
  min-height: 66px;
  padding: 11px 13px;
  color: var(--ink-soft);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.point-nav a:hover {
  background: var(--card);
  border-color: var(--line-strong);
}

.point-nav span {
  display: block;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .1em;
}

.point-nav strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

/* ---------- Empty state ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 92px 30px 110px;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.empty-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.empty-title {
  margin: 24px 0 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.empty-text {
  max-width: 500px;
  margin: 13px 0 1.5rem;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.9;
}

/* ---------- Plan ---------- */

.plan-hero {
  padding: 74px 0 50px;
  border-bottom: 1px solid var(--line);
}

.plan-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.22;
}

.plan-hero p {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.9;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 48px 0 72px;
}

.plan-card {
  padding: 25px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.plan-card.is-wide {
  grid-column: 1 / -1;
}

.plan-card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.plan-card-label span:last-child {
  color: var(--ochre);
}

.profile-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 25px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft-strong);
}

.profile-row:last-child {
  border-bottom: 0;
}

.profile-row span {
  color: var(--ink-muted);
  font-size: 12px;
}

.profile-row strong {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}

.plan-weights {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.plan-weight-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 44px;
  gap: 14px;
  align-items: center;
}

.plan-weight-row span {
  color: var(--ink-muted);
  font-size: 11px;
}

.plan-weight-row strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-align: right;
}

.plan-weight-track {
  height: 4px;
  overflow: hidden;
  background: var(--line);
}

.plan-weight-track i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.plan-weight-row.is-exercise .plan-weight-track i {
  background: var(--ochre);
}

.progress-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.progress-row-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
}

.progress-row-head span:last-child {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.progress-track {
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.progress-track i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width .35s var(--ease);
}

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.plan-note {
  margin: 18px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.8;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(680px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 24px 70px var(--shadow-lg);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.35;
}

.modal-desc {
  max-width: 500px;
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.8;
}

.modal-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.modal-body {
  padding: 24px 32px 28px;
}

.q-block {
  padding: 0 0 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.q-block:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.q-label {
  display: flex;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.q-label span {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  line-height: 2.6;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-pill {
  min-height: 34px;
  padding: 6px 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 12px;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}

.choice-pill:hover {
  border-color: var(--line-strong);
}

.choice-pill.is-selected {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.multi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 32px 26px;
  border-top: 1px solid var(--line);
}

.modal-footer-note {
  color: var(--ink-muted);
  font-size: 10px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.modal-skip {
  padding: 8px 0;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.modal-skip:hover {
  color: var(--ink);
}

/* ---------- Floating skill / toast / footer ---------- */

.skill-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.skill-hint {
  padding: 4px 8px;
  color: var(--ink-muted);
  background: var(--paper-glass);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: .02em;
  opacity: .9;
}

.skill-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 7px 14px 7px 8px;
  color: var(--on-accent);
  background: var(--accent-deep);
  border: 1px solid var(--accent-deep);
  border-radius: 22px;
  font-size: 12px;
  box-shadow: 0 3px 14px var(--shadow-skill);
}

.skill-button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.skill-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--accent-deep);
  background: var(--accent-soft-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 14px;
}

.toast-root {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100% - 40px));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  padding: 11px 15px;
  color: var(--toast-text);
  background: var(--toast-bg);
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  animation: toast-in .22s var(--ease) both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  width: min(var(--shell), calc(100% - 64px));
  padding: 27px 0 32px;
  margin: 0 auto;
  color: var(--ink-muted);
  font-size: 10px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner .serif {
  color: var(--ink-soft);
  font-size: 12px;
}

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 300;
  padding: 14px 18px;
  color: var(--card);
  text-align: center;
  background: var(--danger);
  border-radius: var(--radius);
  font-size: 13px;
}

/* ---------- Utilities ---------- */

.katex {
  font-size: 1.02em;
  color: inherit;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}

html[data-theme="dark"] .katex,
html[data-theme="dark"] .katex-display {
  color: var(--katex-ink);
}

html[data-theme="dark"] .option.is-wrong .katex,
html[data-theme="dark"] .option.is-correct .katex,
html[data-theme="dark"] .wrong-option.is-wrong .katex,
html[data-theme="dark"] .wrong-option.is-correct .katex,
html[data-theme="dark"] .chat-bubble.is-error .katex {
  color: inherit;
}

.katex-error {
  color: var(--formula-error) !important;
}

.text-muted {
  color: var(--ink-muted);
}

[hidden] {
  display: none !important;
}

/* ---------- Wrong answers ---------- */

.wrong-hero {
  padding: 74px 0 38px;
  border-bottom: 1px solid var(--line);
}

.wrong-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.22;
}

.wrong-hero p {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.9;
}

.wrong-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.wrong-hero-row > div {
  max-width: 720px;
}

.wrong-hero-row > .button {
  flex: 0 0 auto;
}

.wrong-groups {
  display: flex;
  flex-direction: column;
  gap: 38px;
  padding: 42px 0 82px;
}

.wrong-group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.wrong-group-topic {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.wrong-group-head h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
}

.wrong-group-count {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.wrong-card {
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}

.wrong-card:hover {
  border-color: var(--line-strong);
}

.wrong-card-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
}

.wrong-toggle {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
}

.wrong-kicker {
  color: var(--ochre-ink);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
}

.wrong-question {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.8;
}

.wrong-meta {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.wrong-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.wrong-ask {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 10px;
  white-space: nowrap;
}

.wrong-delete {
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}

.wrong-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.wrong-detail {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
}

.wrong-options {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.wrong-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.7;
}

.wrong-option .option-letter {
  color: var(--ink-muted);
}

.wrong-option.is-correct {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.wrong-option.is-wrong {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.wrong-answer {
  margin-top: 16px;
}

.wrong-selected {
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.wrong-selected strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-weight: 500;
}

@media (max-width: 680px) {
  .wrong-hero {
    padding: 50px 0 30px;
  }

  .wrong-hero-row {
    display: block;
  }

  .wrong-hero-row > .button {
    margin-top: 18px;
  }

  .wrong-card-head {
    flex-direction: column;
  }

  .wrong-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .header-inner {
    gap: 22px;
  }

  .study-panel {
    min-width: 250px;
    padding-left: 16px;
  }

  .study-metrics {
    gap: 9px;
  }

  .main-nav {
    gap: 18px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 30px;
  }

  .math-orbit {
    transform: scale(.88);
    transform-origin: top right;
  }

  .detail-layout {
    gap: 40px;
  }
}

@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px 22px;
    padding: 13px 0;
  }

  .brand {
    min-width: 130px;
  }

  .main-nav {
    order: 2;
    width: 100%;
    gap: 25px;
    margin-left: 0;
    padding-top: 2px;
  }

  .main-nav a {
    padding: 4px 0;
  }

  .study-panel {
    order: 1;
    width: auto;
    min-width: 225px;
    margin-left: auto;
    padding-left: 16px;
  }

  .theme-toggle {
    order: 1;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 68px 0 64px;
  }

  .hero-aside {
    display: none;
  }

  .page-hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-bottom: 48px;
  }

  .page-aside-note {
    max-width: 320px;
  }

  .detail-heading {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .detail-meta {
    max-width: 380px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 44px;
  }

  .aside-sticky {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .point-nav,
  .aside-card:first-child {
    grid-column: 1 / -1;
  }

  .mindmap-canvas {
    height: 330px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .header-inner,
  .page-shell,
  .page-shell.narrow,
  .footer-inner {
    width: calc(100% - 36px);
  }

  .header-inner {
    gap: 8px 14px;
  }

  .study-panel {
    position: relative;
    z-index: 2;
    min-width: 0;
    padding-left: 12px;
  }

  .study-metrics {
    display: none;
  }

  .study-panel .study-compact,
  .study-panel .study-chevron {
    display: inline;
  }

  .study-panel .study-label {
    display: none;
  }

  .study-panel .study-toggle {
    flex-direction: row;
    gap: 7px;
    align-items: center;
  }

  .study-panel.is-expanded-mobile .study-metrics {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    display: grid;
    width: 240px;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
  }

  .main-nav {
    order: 3;
    gap: 22px;
    overflow-x: auto;
  }

  .hero {
    padding: 50px 0 52px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero .lede {
    font-size: 14px;
  }

  .hero-meta {
    margin-top: 28px;
  }

  .meta-item {
    min-width: 0;
    padding-right: 18px;
  }

  .meta-item + .meta-item {
    padding-left: 18px;
  }

  .meta-item strong {
    font-size: 13px;
  }

  .section {
    padding: 51px 0;
  }

  .section-head {
    display: block;
  }

  .section-note {
    margin-top: 10px;
    text-align: left;
  }

  .push-grid,
  .topics-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .push-card {
    min-height: 245px;
    padding: 22px;
  }

  .topic-card {
    min-height: 225px;
    padding: 22px;
  }

  .topic-title {
    margin-top: 24px;
    font-size: 24px;
  }

  .page-hero {
    padding-top: 30px;
  }

  .page-title {
    font-size: 40px;
  }

  .panel-head {
    display: block;
    padding: 17px 18px;
  }

  .panel-note {
    margin-top: 5px;
    text-align: left;
  }

  .mindmap-canvas {
    height: auto;
    min-height: 340px;
    overflow: hidden;
  }

  .mindmap-fallback {
    flex-direction: column;
    gap: 15px;
    height: auto;
    padding: 22px 18px;
  }

  .mm-root {
    align-self: flex-start;
    min-width: 0;
    min-height: 0;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 17px;
  }

  .mm-branches {
    gap: 9px;
    padding-left: 0;
  }

  .mm-branches::before,
  .mm-node::before {
    display: none;
  }

  .mindmap-placeholder {
    min-width: 0;
    min-height: 340px;
    padding: 28px 20px;
  }

  .knowledge-card {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    padding: 19px 2px;
  }

  .knowledge-side {
    display: none;
  }

  .knowledge-name {
    font-size: 18px;
  }

  .detail-header {
    padding-top: 26px;
  }

  .detail-title {
    font-size: 38px;
  }

  .detail-hint {
    font-size: 13px;
  }

  .article-section {
    padding-bottom: 42px;
    margin-bottom: 40px;
  }

  .article-section h2 {
    font-size: 23px;
  }

  .prose {
    font-size: 14px;
  }

  .prose .formula {
    padding: 16px 2px;
    margin-right: -5px;
    margin-left: -5px;
  }

  .quiz-card {
    padding: 18px 15px;
  }

  .option {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 9px 10px;
  }

  .aside-sticky {
    grid-template-columns: 1fr;
  }

  .point-nav,
  .aside-card:first-child {
    grid-column: auto;
  }

  .modal-head,
  .modal-body,
  .modal-footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .modal-title {
    font-size: 25px;
  }

  .modal-footer {
    display: block;
  }

  .modal-footer-note {
    margin-bottom: 12px;
  }

  .modal-actions {
    justify-content: space-between;
  }

  .skill-dock {
    right: 14px;
    bottom: 14px;
  }

  .skill-hint {
    max-width: 172px;
    font-size: 8px;
    line-height: 1.5;
    text-align: right;
  }

  .skill-button {
    min-height: 42px;
  }

  .footer-inner {
    display: block;
  }

  .footer-inner p + p {
    margin-top: 4px;
  }

  html {
    scroll-padding-top: 118px;
  }
}

/* ---------- Songhao chat ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.chat-open {
  overflow: hidden;
}

.chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), visibility .22s var(--ease);
}

.chat-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  display: flex;
  flex-direction: column;
  width: min(456px, 100vw);
  background: var(--paper);
  border-left: 1px solid var(--line-strong);
  box-shadow: -18px 0 50px var(--shadow-drawer);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .28s var(--ease), visibility .28s var(--ease);
}

.chat-drawer.is-open {
  transform: none;
  visibility: visible;
}

.chat-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.chat-brand-mark,
.chat-welcome-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--accent-deep);
  font-family: var(--serif);
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
}

.chat-brand-mark {
  width: 36px;
  height: 36px;
  margin-top: 2px;
  font-size: 18px;
}

.chat-brand .eyebrow {
  margin: 0 0 3px;
  font-size: 8px;
  letter-spacing: .14em;
}

.chat-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}

.chat-header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.chat-tool {
  padding: 5px 1px;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  font-size: 10px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color .18s var(--ease), text-decoration-color .18s var(--ease);
}

.chat-tool:hover {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
}

.chat-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}

.chat-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.chat-gear svg {
  display: block;
  width: 14px;
  height: 14px;
}

.chat-status-banner {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 22px;
  color: var(--ochre-ink);
  background: var(--ochre-soft);
  border-bottom: 1px solid var(--ochre-border);
  font-size: 10px;
  line-height: 1.6;
}

.chat-status-banner[hidden] {
  display: none;
}

.chat-status-banner button {
  flex: 0 0 auto;
  padding: 0;
  color: var(--ochre-ink);
  background: transparent;
  border: 0;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  padding: 22px 22px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.chat-welcome {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 330px;
  padding: 28px 18px 38px;
  margin: 0 auto;
  text-align: center;
}

.chat-welcome-mark {
  width: 52px;
  height: 52px;
  font-size: 24px;
}

.chat-welcome h3 {
  margin: 17px 0 7px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.35;
}

.chat-welcome p {
  margin: 0 0 18px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.85;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  max-width: 100%;
  animation: chat-message-in .2s var(--ease) both;
}

@keyframes chat-message-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.chat-message.is-user {
  align-items: flex-end;
}

.chat-message-meta {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.chat-bubble {
  max-width: 94%;
  padding: 11px 14px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.85;
}

.chat-message.is-user .chat-bubble {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.chat-bubble.is-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.chat-bubble .chat-error-note {
  display: block;
  margin-top: 7px;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.65;
}

.chat-typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--ink-muted);
  font-size: 11px;
}

.chat-typing-dots {
  display: inline-flex;
  gap: 3px;
}

.chat-typing-dots i {
  display: block;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  animation: chat-dot 1.15s infinite ease-in-out;
}

.chat-typing-dots i:nth-child(2) { animation-delay: .13s; }
.chat-typing-dots i:nth-child(3) { animation-delay: .26s; }

@keyframes chat-dot {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.chat-markdown {
  font-size: 13px;
  line-height: 1.85;
}

.chat-markdown > :first-child {
  margin-top: 0;
}

.chat-markdown > :last-child {
  margin-bottom: 0;
}

.chat-markdown p {
  margin: 0 0 10px;
}

.chat-markdown h1,
.chat-markdown h2,
.chat-markdown h3,
.chat-markdown h4 {
  margin: 18px 0 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.45;
}

.chat-markdown h1 { font-size: 21px; }
.chat-markdown h2 { font-size: 18px; }
.chat-markdown h3 { font-size: 16px; }
.chat-markdown h4 { font-size: 14px; }

.chat-markdown ul,
.chat-markdown ol {
  padding-left: 1.35em;
  margin: 7px 0 11px;
}

.chat-markdown li {
  margin: 3px 0;
}

.chat-markdown li::marker {
  color: var(--ochre);
}

.chat-markdown blockquote {
  padding: 8px 12px;
  margin: 10px 0;
  color: var(--ink-muted);
  background: var(--paper-deep);
  border-left: 2px solid var(--line-strong);
}

.chat-markdown code {
  padding: .12em .32em;
  color: var(--accent-deep);
  background: var(--card-muted);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .88em;
}

.chat-markdown pre {
  padding: 12px 13px;
  margin: 10px 0;
  overflow-x: auto;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 3px;
}

.chat-markdown pre code {
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  line-height: 1.7;
}

.chat-markdown a {
  color: var(--accent-deep);
  text-decoration-color: var(--accent-underline);
  text-underline-offset: 3px;
}

.chat-markdown hr {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
  border: 0;
}

.chat-markdown table {
  width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
  font-size: 11px;
}

.chat-markdown th,
.chat-markdown td {
  padding: 5px 7px;
  text-align: left;
  border: 1px solid var(--line);
}

.chat-markdown th {
  background: var(--card-muted);
  font-weight: 500;
}

.chat-markdown img {
  max-width: 100%;
  height: auto;
}

.chat-markdown .katex-display {
  margin: 10px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.chat-markdown .katex {
  font-size: 1em;
}

.chat-composer {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 18px 0;
  border-top: 1px solid var(--line);
}

.chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 136px;
  padding: 9px 11px;
  overflow-y: auto;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.65;
  resize: none;
}

.chat-input:focus {
  border-color: var(--accent-line-soft);
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.chat-input:disabled {
  color: var(--ink-muted);
  background: var(--card-muted);
}

.chat-send {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 13px;
  color: var(--on-accent);
  background: var(--accent-deep);
  border: 1px solid var(--accent-deep);
  border-radius: 4px;
  font-size: 11px;
}

.chat-send span {
  margin-left: 2px;
  font-family: var(--mono);
}

.chat-send:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
}

.chat-send:disabled {
  color: var(--ink-muted);
  background: var(--card-muted);
  border-color: var(--line);
  cursor: default;
}

.chat-disclaimer {
  flex: 0 0 auto;
  padding: 7px 18px 10px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

.chat-settings {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.chat-settings[hidden] {
  display: none;
}

.chat-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.chat-settings-head .eyebrow {
  margin: 0 0 4px;
  font-size: 8px;
}

.chat-settings-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.chat-settings-scroll {
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.settings-block {
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.settings-block:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.settings-block-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 14px;
}

.settings-index {
  color: var(--ochre);
  font-family: var(--mono);
  font-size: 9px;
}

.settings-block h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.provider-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.provider-presets:empty {
  display: none;
}

.provider-preset {
  padding: 5px 10px;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
}

.provider-preset:hover,
.provider-preset.is-active {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field > span:first-child {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-muted);
  font-size: 10px;
}

.field input,
.field .secret-row {
  width: 100%;
}

.field input {
  min-height: 36px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 12px;
}

.field input:focus {
  border-color: var(--accent-line-soft);
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.secret-row {
  display: flex;
  gap: 6px;
}

.secret-row input {
  flex: 1;
}

.secret-toggle {
  flex: 0 0 auto;
  padding: 0 9px;
  color: var(--ink-muted);
  background: var(--card-muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
}

.field-note {
  margin: 9px 0 14px;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.75;
}

.field-note code {
  padding: 1px 4px;
  color: var(--ink-soft);
  background: var(--card-muted);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .92em;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.settings-actions .button {
  min-height: 33px;
  font-size: 10px;
}

.skill-status {
  padding: 10px 12px;
  margin: 0 0 13px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  font-size: 10px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.skill-status.is-warning {
  color: var(--ochre-ink);
  background: var(--ochre-soft);
  border-left-color: var(--ochre);
}

@media (max-width: 680px) {
  .chat-drawer {
    width: 100%;
    border-left: 0;
  }

  .chat-header {
    padding: 16px 16px 14px;
  }

  .chat-brand-mark {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .chat-title {
    font-size: 18px;
  }

  .chat-header-actions {
    gap: 5px;
  }

  .chat-tool {
    font-size: 9px;
  }

  .chat-status-banner {
    padding: 8px 16px;
  }

  .chat-messages {
    padding: 18px 16px 8px;
  }

  .chat-composer {
    padding: 9px 12px 0;
  }

  .chat-disclaimer {
    padding-right: 12px;
    padding-left: 12px;
  }

  .chat-settings-head {
    padding: 16px;
  }

  .chat-settings-scroll {
    padding: 18px 16px 30px;
  }

  .chat-bubble {
    max-width: 96%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  html.theme-changing,
  html.theme-changing *,
  html.theme-changing *::before,
  html.theme-changing *::after {
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}

/* ---------- Exam mode ---------- */

:root {
  --exam-limits: #536c5e;
  --exam-derivative: #9b6a43;
  --exam-integral: #4f6f8f;
  --exam-multivariable: #8b5449;
}

html[data-theme="dark"] {
  --exam-limits: #8fb7a2;
  --exam-derivative: #d1a077;
  --exam-integral: #8daecf;
  --exam-multivariable: #cf9387;
}

.mode-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  margin: 22px 0 24px;
  background: var(--card-translucent);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  color: var(--ink-muted);
  border-radius: 999px;
  font-size: 11px;
  text-decoration: none;
  transition: color .18s var(--ease), background .18s var(--ease);
}

.mode-option span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
}

.mode-option:hover {
  color: var(--ink);
}

.mode-option.is-active {
  color: var(--on-accent);
  background: var(--ink);
}

.exam-page {
  padding-bottom: 84px;
}

.exam-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 54px;
  align-items: end;
  padding-top: 64px;
  padding-bottom: 48px;
}

.exam-hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 5.2vw, 66px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.16;
}

.exam-hero-copy h1 em {
  color: var(--ochre-ink);
  font-style: italic;
  font-weight: 400;
}

.exam-hero-copy .lede {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.95;
}

.exam-timer-card {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 18px 50px var(--shadow-sm);
}

.exam-timer-card.is-urgent {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 1px var(--danger-border), 0 18px 50px var(--shadow-sm);
}

.exam-timer-card.is-finished {
  border-color: var(--ochre-border);
}

.exam-timer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.exam-timer-state {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
}

.exam-clock {
  margin: 10px 0 2px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 46px;
  font-weight: 500;
  letter-spacing: -.06em;
  line-height: 1.1;
}

.exam-timer-card.is-urgent .exam-clock {
  color: var(--danger);
}

.exam-timer-note {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.7;
}

.exam-timer-actions {
  display: flex;
  gap: 8px;
}

.exam-timer-actions .button {
  flex: 1;
  min-height: 38px;
  padding: 7px 10px;
  font-size: 11px;
}

.exam-duration-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.exam-duration {
  padding: 5px 2px;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 9px;
  line-height: 1.4;
}

.exam-duration:hover {
  color: var(--ink);
  border-color: var(--line);
}

.exam-duration.is-selected {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.exam-duration:disabled {
  cursor: default;
  opacity: .55;
}

.exam-overall {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  max-width: 620px;
  margin-top: 26px;
}

.exam-overall-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.exam-overall-copy span,
.exam-overall-rate {
  color: var(--ink-muted);
  font-size: 10px;
}

.exam-overall-copy strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.exam-overall-track {
  flex: 1 1 180px;
  height: 4px;
  overflow: hidden;
  background: var(--line);
  border-radius: 99px;
}

.exam-overall-track i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width .35s var(--ease);
}

.exam-body {
  padding-top: 0;
}

.exam-section {
  padding: 52px 0;
  border-top: 1px solid var(--line);
}

.exam-section:first-child {
  border-top: 0;
}

.exam-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.exam-module-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 19px 21px 18px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--exam-color);
  border-radius: 5px;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}

.exam-module-card:hover {
  border-color: var(--line-strong);
  border-left-color: var(--exam-color);
  transform: translateY(-1px);
}

.exam-module-card.is-selected {
  background: var(--card-muted);
  border-color: var(--exam-color);
  box-shadow: inset 0 0 0 1px var(--exam-color);
}

.exam-module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.exam-module-code {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--on-accent);
  background: var(--exam-color);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
}

.exam-module-state {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
}

.exam-module-card.is-selected .exam-module-state {
  color: var(--exam-color);
}

.exam-module-name {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.35;
}

.exam-module-desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.exam-module-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
}

.exam-module-bar {
  display: block;
  height: 3px;
  overflow: hidden;
  margin-top: 5px;
  background: var(--line);
  border-radius: 99px;
}

.exam-module-bar i {
  display: block;
  height: 100%;
  background: var(--exam-color);
  border-radius: inherit;
  transition: width .35s var(--ease);
}

.exam-empty-state {
  padding: 48px 20px;
  text-align: center;
  background: var(--card-translucent-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
}

.exam-empty-state .empty-text {
  max-width: 560px;
  margin-right: auto;
  margin-left: auto;
}

.exam-metro-scroll {
  padding: 12px 14px 6px;
  overflow-x: auto;
  background: var(--card-translucent-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.exam-metro-svg {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
  overflow: visible;
}

.exam-metro-station {
  cursor: pointer;
  outline: none;
}

.exam-metro-station circle,
.exam-metro-station rect {
  transition: transform .18s var(--ease), fill .18s var(--ease), stroke .18s var(--ease);
  transform-box: fill-box;
  transform-origin: center;
}

.exam-metro-station:hover circle,
.exam-metro-station:hover rect,
.exam-metro-station:focus-visible circle,
.exam-metro-station:focus-visible rect {
  transform: scale(1.18);
}

.exam-metro-station text {
  pointer-events: none;
}

.exam-metro-line.is-cross text {
  font-family: var(--serif);
}

.exam-question-list {
  display: flex;
  flex-direction: column;
  gap: 42px;
}

.exam-module-block {
  padding-left: 24px;
  border-left: 2px solid var(--exam-color);
}

.exam-module-block-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.exam-module-block-head h3 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.exam-line-badge {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--on-accent);
  background: var(--exam-color);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 13px;
}

.exam-module-block-progress {
  margin-left: auto;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
}

.exam-question-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.exam-card {
  position: relative;
  padding: 24px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  scroll-margin-top: 104px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.exam-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  content: "";
  background: var(--exam-color);
  border-radius: 6px 0 0 6px;
}

.exam-card.is-flash {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.exam-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.exam-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.exam-card-no {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
}

.exam-card-point {
  color: var(--ink-muted);
  font-size: 10px;
}

.exam-card-type {
  flex: 0 0 auto;
  padding: 2px 7px;
  color: var(--exam-color);
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 9px;
  line-height: 1.6;
  opacity: .85;
}

.exam-kill-tip {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 15px;
  margin: 0 0 20px;
  background: var(--ochre-soft);
  border: 1px solid var(--ochre-border);
  border-left: 4px solid var(--ochre);
  border-radius: 4px;
}

.exam-kill-label {
  flex: 0 0 auto;
  color: var(--ochre-ink);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.8;
}

.exam-kill-tip p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.85;
}

.exam-question {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.95;
}

.exam-choice-options,
.exam-variant-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-choice-option,
.exam-variant-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 13px;
  text-align: left;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.8;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}

.exam-variant-option {
  padding: 8px 11px;
  font-size: 12px;
}

.exam-choice-option:hover,
.exam-variant-option:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.exam-choice-option.is-selected,
.exam-variant-option.is-selected {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.exam-choice-option.is-correct,
.exam-variant-option.is-correct {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.exam-choice-option.is-wrong,
.exam-variant-option.is-wrong {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.exam-choice-option:disabled,
.exam-variant-option:disabled {
  cursor: default;
  opacity: .92;
}

.exam-submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.exam-submit {
  min-height: 36px;
  padding: 7px 18px;
  font-size: 11px;
}

.exam-submit:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.exam-result {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .04em;
}

.exam-result.is-correct {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.exam-result.is-wrong {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.exam-answer-panel {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px dashed var(--line);
}

.exam-answer-panel[hidden] {
  display: none;
}

.exam-answer-panel p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.9;
}

.exam-guess-tip {
  padding: 10px 12px;
  margin-top: 14px;
  color: var(--ink-soft);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  font-size: 11px;
  line-height: 1.8;
}

.exam-guess-tip strong {
  color: var(--accent-deep);
  font-weight: 600;
}

.exam-essay-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.exam-self-check {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 10px;
}

.exam-self-check[hidden] {
  display: none;
}

.exam-self-check button {
  padding: 3px 9px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
}

.exam-self-check button:hover {
  border-color: var(--line-strong);
}

.exam-self-check button[data-action="exam-self-correct"]:hover {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.exam-self-check button[data-action="exam-self-wrong"]:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.exam-variants {
  padding: 18px 18px 20px;
  margin-top: 24px;
  background: var(--card-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.exam-variants-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.exam-variants-head span {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.exam-variants-head small {
  color: var(--ink-muted);
  font-size: 10px;
}

.exam-variant {
  padding: 16px;
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.exam-variant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
}

.exam-variant-state.is-correct {
  color: var(--accent-deep);
}

.exam-variant-state.is-wrong {
  color: var(--danger);
}

.exam-variant-question {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.85;
}

.exam-variant-submit {
  min-height: 32px;
  padding: 5px 13px;
  margin-top: 12px;
  font-size: 10px;
}

.exam-variant-submit:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.exam-variant-answer {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px dashed var(--line);
}

.exam-variant-answer p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.85;
}

.exam-retry {
  padding: 4px 0;
  margin-top: 10px;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.exam-retry:hover {
  color: var(--ink);
}

.exam-cross-locked {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: var(--card-translucent-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
}

.exam-cross-locked-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 13px;
}

.exam-cross-locked h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.exam-cross-locked p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.75;
}

.exam-modal {
  width: min(760px, 100%);
}

.exam-modal-body {
  padding-top: 20px;
}

.exam-report-note {
  padding: 10px 12px;
  margin-bottom: 14px;
  color: var(--ink-muted);
  background: var(--card-muted);
  border-left: 2px solid var(--accent);
  font-size: 10px;
  line-height: 1.7;
}

.exam-report-prompt {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.85;
  resize: vertical;
}

.exam-cross-unlock-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-cross-unlock-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 13px;
  background: var(--card-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.exam-cross-unlock-item span {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
}

.exam-cross-unlock-item small {
  color: var(--ink-muted);
  font-size: 9px;
}

.exam-timeup {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 22px;
  background: var(--ochre-soft);
  border: 1px solid var(--ochre-border);
  border-radius: 5px;
}

.exam-timeup strong {
  color: var(--ochre-ink);
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
}

.exam-timeup span {
  color: var(--ink-soft);
  font-size: 11px;
}

.chat-exam-banner {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 22px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent-line);
  font-size: 10px;
  line-height: 1.6;
}

.chat-exam-banner[hidden] {
  display: none;
}

.chat-exam-banner-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
}

.chat-exam-banner-actions button {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1080px) {
  .exam-hero {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
  }
}

@media (max-width: 900px) {
  .exam-hero {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 46px;
  }

  .exam-timer-card {
    max-width: 460px;
  }

  .exam-module-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .mode-switch {
    margin-top: 18px;
    margin-bottom: 20px;
  }

  .mode-option {
    padding: 6px 11px;
    font-size: 10px;
  }

  .exam-hero-copy h1 {
    font-size: 38px;
  }

  .exam-timer-card {
    padding: 20px;
  }

  .exam-clock {
    font-size: 40px;
  }

  .exam-section {
    padding: 38px 0;
  }

  .exam-module-card {
    padding: 17px 18px;
  }

  .exam-module-name {
    font-size: 21px;
  }

  .exam-module-block {
    padding-left: 14px;
  }

  .exam-module-block-head {
    align-items: flex-start;
  }

  .exam-line-badge {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }

  .exam-module-block-head h3 {
    font-size: 20px;
  }

  .exam-card {
    padding: 19px 17px;
  }

  .exam-kill-tip {
    flex-direction: column;
    gap: 4px;
  }

  .exam-card-head {
    flex-direction: column;
    gap: 6px;
  }

  .exam-variants {
    padding: 14px 12px 16px;
  }

  .exam-variant {
    padding: 13px;
  }

  .exam-cross-locked {
    align-items: flex-start;
    padding: 18px;
  }

  .exam-modal .modal-head,
  .exam-modal .modal-body,
  .exam-modal .modal-footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .chat-exam-banner {
    align-items: flex-start;
    padding: 8px 16px;
  }
}

.wrong-kill-tip {
  padding: 10px 12px;
  margin: 12px 0;
  color: var(--ochre-ink);
  background: var(--ochre-soft);
  border-left: 2px solid var(--ochre);
  font-size: 11px;
  line-height: 1.75;
}

#chat-exam-banner-text {
  cursor: pointer;
}
