/* =========================================================
   分析師備考站 — static study site
   Warm paper palette, serif display, quiet exam-prep utility
   ========================================================= */

:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --bg-deep: #eee8dc;
  --surface: #fffdf8;
  --surface-2: #faf6ee;
  --ink: #182426;
  --ink-soft: #334246;
  --muted: #667477;
  --line: #ded6c8;
  --line-strong: #c9bfae;
  --accent: #0f5c5c;
  --accent-ink: #0a4444;
  --accent-soft: #e3efeb;
  --gold: #a86d27;
  --gold-soft: #f5ead8;
  --danger: #9a3f35;
  --shadow-sm: 0 1px 2px rgba(24, 36, 38, 0.05);
  --shadow-md: 0 14px 40px rgba(24, 36, 38, 0.09);
  --shadow-lg: 0 28px 70px rgba(24, 36, 38, 0.16);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", "Times New Roman", serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
  --maxw: 1180px;
  --header-h: 72px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1719;
  --bg-deep: #0b1214;
  --surface: #162124;
  --surface-2: #1a282b;
  --ink: #edf3f1;
  --ink-soft: #d3dfdc;
  --muted: #9fb0ad;
  --line: #29393c;
  --line-strong: #3b4e51;
  --accent: #66c9ba;
  --accent-ink: #8ce0d2;
  --accent-soft: #17302e;
  --gold: #e1b06a;
  --gold-soft: #33261a;
  --danger: #e28b7f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.5);
}

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

[hidden] {
  display: none !important;
}

body.search-open {
  overflow: hidden;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 28px);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% -10%, rgba(168, 109, 39, 0.10), transparent 34rem),
    radial-gradient(circle at 96% 4%, rgba(15, 92, 92, 0.10), transparent 38rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% -10%, rgba(225, 176, 106, 0.08), transparent 34rem),
    radial-gradient(circle at 96% 4%, rgba(102, 201, 186, 0.08), transparent 38rem),
    var(--bg);
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.28;
  color: var(--ink);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

h3 {
  font-size: clamp(1.16rem, 1.8vw, 1.45rem);
}

p {
  color: var(--ink-soft);
}

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

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px) saturate(1.15);
  transition: border-color 180ms ease, background 180ms ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  width: min(100% - 40px, var(--maxw));
  height: var(--header-h);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-serif);
  font-size: 1.22rem;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 1.03rem;
  letter-spacing: 0.04em;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.main-nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease, background 150ms ease;
}

.main-nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.main-nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.icon-btn:active {
  transform: translateY(0);
}

.menu-btn {
  display: none;
}

.reading-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 80ms linear;
}

/* ----------------------------- Layout ----------------------------- */

#main {
  min-height: 70vh;
  outline: none;
}

.page {
  width: min(100% - 40px, var(--maxw));
  margin: 0 auto;
  padding: 54px 0 88px;
}

.page > * {
  animation: rise-in 420ms ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.04rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
}

.section-heading h2 {
  margin-bottom: 4px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.home-section {
  margin-top: 58px;
}

.page-head {
  padding: 8px 0 34px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
}

.page-head .lede {
  margin-bottom: 0;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  gap: 9px;
}

/* ----------------------------- Hero ----------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 32px 0 30px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40px -10% auto;
  height: 520px;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 92, 92, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 92, 92, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 5%, transparent 70%);
}

[data-theme="dark"] .hero::before {
  background-image:
    linear-gradient(rgba(102, 201, 186, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 201, 186, 0.06) 1px, transparent 1px);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  gap: 54px;
  align-items: center;
}

.hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(2.6rem, 5.4vw, 4.65rem);
  line-height: 1.06;
  letter-spacing: 0.015em;
}

.hero-copy h1 em {
  color: var(--accent);
  font-style: normal;
  position: relative;
  white-space: nowrap;
}

.hero-copy h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 0.05em;
  height: 0.12em;
  background: var(--gold);
  opacity: 0.32;
  z-index: -1;
}

.hero-copy .lede {
  font-size: 1.09rem;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-ink);
  color: #fff;
}

[data-theme="dark"] .btn-primary {
  color: #0d1618;
}

[data-theme="dark"] .btn-primary:hover {
  color: #0d1618;
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
}

.btn-small {
  min-height: 38px;
  padding: 0 15px;
  font-size: 0.84rem;
}

.btn[disabled],
.btn.is-done {
  cursor: default;
  opacity: 0.8;
}

.hero-aside {
  position: relative;
}

.exam-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.exam-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 0 0 3px 3px;
}

.exam-card .eyebrow {
  margin-bottom: 14px;
}

.exam-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.exam-card > p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.exam-meta {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.exam-meta li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.exam-meta strong {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.stat {
  padding: 18px 20px;
  background: var(--surface);
}

.stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.65rem;
  line-height: 1.2;
  color: var(--ink);
}

.stat span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* ----------------------------- Subject cards ----------------------------- */

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.subject-macro {
  --subject-color: #0f5c5c;
  --subject-soft: #e3efeb;
  --accent: #0f5c5c;
  --accent-ink: #0a4444;
  --accent-soft: #e3efeb;
}

.subject-investment {
  --subject-color: #9a5b2b;
  --subject-soft: #f3e8da;
  --accent: #9a5b2b;
  --accent-ink: #713f1d;
  --accent-soft: #f3e8da;
}

.subject-accounting {
  --subject-color: #3f5d7d;
  --subject-soft: #e4ebf3;
  --accent: #3f5d7d;
  --accent-ink: #2c425b;
  --accent-soft: #e4ebf3;
}

.subject-law {
  --subject-color: #7a3e5c;
  --subject-soft: #f1e5eb;
  --accent: #7a3e5c;
  --accent-ink: #5b2943;
  --accent-soft: #f1e5eb;
}

[data-theme="dark"] .subject-macro {
  --subject-color: #66c9ba;
  --subject-soft: #17302e;
  --accent: #66c9ba;
  --accent-ink: #8ce0d2;
  --accent-soft: #17302e;
}

[data-theme="dark"] .subject-investment {
  --subject-color: #e1b06a;
  --subject-soft: #33261a;
  --accent: #e1b06a;
  --accent-ink: #f0c98b;
  --accent-soft: #33261a;
}

[data-theme="dark"] .subject-accounting {
  --subject-color: #9fc3e8;
  --subject-soft: #1a2b3d;
  --accent: #9fc3e8;
  --accent-ink: #bfd9f4;
  --accent-soft: #1a2b3d;
}

[data-theme="dark"] .subject-law {
  --subject-color: #d79ab8;
  --subject-soft: #34202b;
  --accent: #d79ab8;
  --accent-ink: #efbdd4;
  --accent-soft: #34202b;
}

.subject-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 290px;
  padding: 28px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--subject-color);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  border-top-color: var(--subject-color);
}

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

.subject-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--subject-soft);
  color: var(--subject-color);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.subject-card h2 {
  margin: 0 0 10px;
  font-size: 1.7rem;
}

.subject-card > p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.93rem;
}

.subject-card-list {
  display: grid;
  gap: 7px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.subject-card-list li {
  display: flex;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.subject-card-list li::before {
  content: "·";
  color: var(--subject-color);
  font-weight: 900;
}

.subject-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.subject-card .text-link {
  color: var(--subject-color);
}

/* ----------------------------- Progress ----------------------------- */

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

.progress-track {
  position: relative;
  width: 120px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-deep);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--subject-color, var(--accent));
  transition: width 300ms ease;
}

.progress-text {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

/* ----------------------------- How to ----------------------------- */

.howto {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.step-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-serif);
  font-size: 0.9rem;
}

.step-card h3 {
  margin: 0 0 7px;
  font-size: 1.08rem;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ----------------------------- Subject page ----------------------------- */

.subject-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 44px;
  align-items: center;
  padding: 18px 0 40px;
  border-bottom: 1px solid var(--line);
}

.subject-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.3rem, 4.6vw, 3.8rem);
}

.subject-hero .lede {
  margin-bottom: 0;
}

.subject-hero-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--subject-color);
  border-radius: var(--radius);
  background: var(--surface);
}

.subject-hero-panel .progress-wrap {
  margin-bottom: 16px;
}

.subject-hero-panel .progress-track {
  flex: 1;
  width: auto;
}

.subject-hero-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.subject-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.subject-mini-stats strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

.subject-mini-stats span {
  color: var(--muted);
  font-size: 0.74rem;
}

.ratio-overview {
  min-width: 0;
  margin: 28px 0 8px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.ratio-overview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.ratio-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ratio-overview .eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
}

.ratio-overview h2 {
  margin: 0 0 7px;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
}

.ratio-overview p {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.ratio-groups {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.ratio-group {
  min-width: 0;
}

.ratio-group h3 {
  margin: 0 0 7px;
  color: var(--accent-ink);
  font-size: 0.94rem;
}

.ratio-table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ratio-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.ratio-table th,
.ratio-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ratio-table thead th {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.ratio-table tbody th {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.ratio-table td {
  color: var(--ink-soft);
  line-height: 1.6;
}

.ratio-formula {
  color: var(--accent-ink) !important;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.ratio-math {
  display: inline-block;
  color: var(--accent-ink);
  font-family: var(--font-sans);
}

.ratio-math .katex {
  font-size: 1em;
}

.ratio-math .katex-display {
  margin: 0;
}

.ratio-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 3px;
  vertical-align: middle;
  line-height: 1.05;
}

.ratio-num {
  padding: 0 3px 1px;
  border-bottom: 1px solid currentColor;
}

.ratio-den {
  padding: 1px 3px 0;
}

.ratio-math sub,
.ratio-math sup {
  font-size: 0.68em;
  line-height: 1;
}

.formula-math {
  white-space: normal;
}

.formula-math .ratio-math {
  font-size: 1rem;
}

.ratio-source {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.ratio-note,
.ratio-inline-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.7;
}

.ratio-inline {
  margin-top: 18px;
}

.ratio-inline .subheading {
  margin-top: 0;
}

.option-priority {
  min-width: 0;
  margin: 28px 0 8px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.option-priority-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.option-priority .eyebrow {
  margin-bottom: 5px;
  color: var(--gold);
}

.option-priority h2 {
  margin: 0 0 7px;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
}

.option-priority p {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.priority-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.priority-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.priority-table th,
.priority-table td {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.priority-table thead th {
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.priority-table tbody td {
  color: var(--ink-soft);
  line-height: 1.6;
}

.priority-table .priority-rank {
  width: 84px;
  color: var(--gold) !important;
  font-family: var(--font-mono);
  font-weight: 800;
}

.option-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}

.option-card {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.option-card.is-lite {
  border-style: dashed;
  background: var(--surface);
}

.option-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.priority-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
}

.option-card h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.option-card-goal {
  margin: 0;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
}

.option-card-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.option-formulas {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.option-formula {
  overflow-x: auto;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-deep);
}

.option-formula-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.option-formula .ratio-math {
  font-size: 1rem;
}

.option-variables {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.option-variables-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.option-variable-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0;
}

.option-variable-list dt {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
}

.option-variable-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.option-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.chapter-list {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.subject-parts {
  display: grid;
  gap: 34px;
}

.part-block {
  display: grid;
  gap: 0;
}

.part-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.part-heading .eyebrow {
  margin-bottom: 4px;
}

.part-heading h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
}

.part-page {
  flex-shrink: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.part-block .chapter-list {
  margin-top: 16px;
}

.subject-chapters-head {
  margin-top: 38px;
  padding-bottom: 4px;
}

.subject-chapters-head .progress-text {
  flex-shrink: 0;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.chapter-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.chapter-row:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.chapter-num {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 20px;
  border-right: 1px solid var(--line);
  color: var(--subject-color);
}

.chapter-num strong {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1;
}

.chapter-row h2 {
  margin: 0 0 5px;
  font-size: 1.24rem;
}

.chapter-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.65;
}

.chapter-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  min-width: 118px;
}

.chapter-row-side .section-count {
  color: var(--muted);
  font-size: 0.75rem;
}

.done-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
}

.done-pill.subtle {
  background: var(--surface-2);
  color: var(--muted);
}

/* ----------------------------- Chapter page ----------------------------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.82rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  opacity: 0.55;
}

.chapter-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.chapter-head h1 {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
}

.chapter-head .lede {
  margin-bottom: 0;
}

.chapter-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.chapter-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
  margin-top: 38px;
}

.chapter-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.chapter-toc h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.toc-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-list a {
  display: block;
  padding: 8px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.toc-list a:hover {
  color: var(--ink);
  border-left-color: var(--line-strong);
}

.toc-list a.active {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.toc-progress {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.toc-progress .progress-track {
  width: 100%;
  margin-bottom: 7px;
}

.chapter-content {
  min-width: 0;
}

.chapter-summary {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.chapter-summary strong {
  color: var(--ink);
}

.section-block {
  padding: 36px 0 34px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.section-block:first-of-type {
  border-top: 0;
  padding-top: 32px;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.section-block h2 {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 2.2vw, 1.72rem);
}

.section-body {
  display: grid;
  gap: 12px;
}

.section-body p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.9;
}

.subheading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 12px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

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

.term-card {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.term-card dt {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.5;
}

.term-card dd {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.exam-box {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: var(--gold-soft);
}

.exam-box h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.exam-box ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.exam-box li {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.7;
}

.exam-box li::marker {
  color: var(--gold);
}

.memory-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 15px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
}

.memory-card .memory-label {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.memory-card p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.65;
}

.formula {
  display: block;
  margin-top: 16px;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  white-space: nowrap;
}

.formula::before {
  content: "KEY FORMULA  ";
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.formula-katex {
  font-family: var(--font-sans);
  font-size: 1rem;
  white-space: normal;
}

.formula-katex .katex-display {
  margin: 0;
  padding: 2px 0;
}

.formula-katex .katex {
  font-size: 1.05em;
}

.formula-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
  white-space: normal;
}

.katex-fallback {
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  white-space: pre-wrap;
}

.model-diagram {
  margin: 22px 0 4px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.diagram-head {
  margin-bottom: 12px;
}

.diagram-kicker {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.diagram-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.5;
}

.diagram-canvas {
  padding: 10px 8px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.diagram-canvas::-webkit-scrollbar {
  height: 8px;
}

.diagram-canvas::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.diagram-canvas::-webkit-scrollbar-track {
  background: transparent;
}

.diagram-scroll-hint {
  display: none;
}

.diagram-canvas svg {
  width: 100%;
  height: auto;
}

.model-diagram figcaption {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.75;
}

.diagram-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.diagram-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.diagram-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.diagram-table caption {
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
}

.diagram-table th,
.diagram-table td {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.diagram-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.diagram-table td {
  color: var(--ink-soft);
  line-height: 1.6;
}

.diagram-table .diagram-symbol {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.diagram-note {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

/* ----------------------------- Macro model atlas ----------------------------- */

.model-atlas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 26px 0 4px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.model-atlas .eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
}

.model-atlas h2 {
  margin: 0 0 7px;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
}

.model-atlas p {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.model-atlas .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.model-atlas-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.models-head {
  align-items: start;
}

.models-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.models-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
}

.models-summary strong {
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 0.96rem;
}

.models-binding {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.models-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.models-jump .eyebrow {
  flex: 1 0 100%;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
}

.models-jump a {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.models-jump a span {
  color: var(--muted);
  font-size: 0.68rem;
}

.models-jump a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.models-jump a.is-empty {
  opacity: 0.62;
}

.models-list {
  margin-top: 26px;
}

.models-chapter {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.models-chapter-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.models-chapter-head .eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
}

.models-chapter-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
}

.models-chapter-side {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.models-badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.7rem;
  font-weight: 700;
}

.models-entry + .models-entry {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}

.models-entry-ref {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.models-entry-ref .eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.models-entry-ref a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted var(--line-strong);
}

.models-entry-ref a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.models-entry .model-diagram {
  margin-top: 10px;
}

.models-empty {
  margin: 8px 0 0;
  padding: 20px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.9rem;
}

.models-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.models-foot p {
  margin: 0;
}

.models-foot a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.models-foot a:hover {
  text-decoration: underline;
}

.models-nobel {
  margin-top: 34px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.models-nobel-intro {
  max-width: 78ch;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.nobel-entry-years {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
}

/* ----------------------------- Nobel laureates page ----------------------------- */

.nobel-head {
  align-items: start;
}

.nobel-page .chapter-head-side .btn {
  white-space: nowrap;
}

.nobel-source-note {
  border-left-color: var(--gold);
  background: var(--surface-2);
  color: var(--ink-soft);
}

.nobel-source-note a {
  color: var(--accent);
  font-weight: 700;
}

.nobel-formula-note {
  border-left-color: var(--line-strong);
  background: var(--surface);
}

.nobel-table-section {
  margin-top: 34px;
}

.nobel-section-heading {
  align-items: end;
  margin-bottom: 12px;
}

.nobel-section-heading .eyebrow {
  margin-bottom: 4px;
  color: var(--gold);
}

.nobel-table-hint {
  max-width: 420px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  text-align: right;
}

.nobel-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header-h) + 20px);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

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

.nobel-table-wrap::-webkit-scrollbar {
  height: 9px;
}

.nobel-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.nobel-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.nobel-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.84rem;
}

.nobel-table caption {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
}

.nobel-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  vertical-align: bottom;
}

.nobel-table th:first-child {
  width: 42%;
}

.nobel-table th:last-child {
  width: 58%;
}

.nobel-table td {
  padding: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.65;
  vertical-align: top;
}

.nobel-table tbody tr:nth-child(even) .nobel-year-data {
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.nobel-table tbody tr:hover .nobel-year-data {
  background: var(--accent-soft);
}

.nobel-year-row {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.nobel-year-data {
  position: relative;
  border-right: 1px solid var(--line);
}

.nobel-group-anchor {
  display: block;
  height: 0;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.nobel-year-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
}

.nobel-year-sequence {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.nobel-year-group-label {
  margin: 0 0 13px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.55;
}

.nobel-entry-fields {
  display: grid;
  gap: 9px;
  margin: 0;
}

.nobel-entry-fields > div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 9px;
}

.nobel-entry-fields dt {
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.nobel-entry-fields dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.nobel-year-link,
.nobel-year-chip {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nobel-year-link {
  display: inline-flex;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 1rem;
}

.nobel-year-link:hover,
.nobel-year-chip:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  text-decoration: underline;
}

.nobel-laureates {
  color: var(--ink) !important;
  font-weight: 650;
}

.nobel-formula {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.nobel-formula sub,
.nobel-formula sup,
.nobel-inline-math sub,
.nobel-inline-math sup,
.ratio-math sub,
.ratio-math sup {
  font-size: 0.68em;
  line-height: 1;
}

.ratio-math sub {
  display: inline-block;
  vertical-align: baseline;
  transform: translateY(0.35em);
}

.ratio-math sup {
  display: inline-block;
  vertical-align: baseline;
  transform: translateY(-0.45em);
}

.nobel-inline-math {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.94em;
  white-space: nowrap;
}

.nobel-year-model-cell {
  padding: 16px 16px 18px;
}

.nobel-year-figure {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.nobel-year-model-head {
  margin-bottom: 9px;
}

.nobel-year-model-head .eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.64rem;
}

.nobel-year-model-head h3 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.45;
}

.nobel-group-description {
  max-width: 78ch;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.nobel-year-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 11px;
}

.nobel-year-chip {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.nobel-year-chip.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.nobel-year-canvas {
  padding: 10px 10px 6px;
}

.nobel-year-figure figcaption {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.7;
}

.nobel-model-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.nobel-model-details summary {
  padding: 9px 12px;
  color: var(--accent-ink);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.nobel-model-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.nobel-model-details .diagram-tables {
  margin-top: 0;
  padding: 12px;
}

.nobel-model-details .diagram-note {
  margin: 0;
  border-radius: 0;
}

.nobel-model-repeat {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.nobel-model-repeat a {
  color: var(--accent);
  font-weight: 800;
}

.nobel-model-jump {
  margin-top: 0;
  margin-bottom: 14px;
}

.model-diagram svg .dg-axis {
  stroke: var(--ink-soft);
  stroke-width: 1.6;
}

.model-diagram svg .dg-curve {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
}

.model-diagram svg .dg-curve-alt {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.6;
}

.model-diagram svg .dg-curve-soft {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-dasharray: 7 6;
}

.model-diagram svg .dg-guide {
  stroke: var(--line-strong);
  stroke-width: 1.3;
  stroke-dasharray: 5 5;
}

.model-diagram svg .dg-arrow {
  stroke: var(--danger);
  stroke-width: 2;
  fill: none;
}

.model-diagram svg .dg-arrow-head {
  fill: var(--danger);
}

.model-diagram svg .dg-point {
  fill: var(--accent-ink);
}

.model-diagram svg .dg-box,
.model-diagram svg .dg-panel {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1.4;
}

.model-diagram svg .dg-panel {
  fill: var(--surface-2);
  stroke: var(--line);
}

.model-diagram svg .dg-label {
  fill: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 15px;
}

.model-diagram svg .dg-label-sm {
  fill: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
}

.law-fulltext {
  margin-top: 8px;
}

.law-fulltext-note {
  max-width: 850px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.8;
}

.law-source-list,
.law-external-list {
  display: grid;
  gap: 14px;
}

.law-source {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.law-source-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 16px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.law-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.law-source-badge.is-external {
  background: var(--gold-soft);
  color: var(--gold);
}

.law-source-title {
  flex: 1 1 240px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.5;
}

.law-source-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

.law-source-body {
  padding: 0 18px 18px;
}

.law-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 0 10px;
  color: var(--muted);
  font-size: 0.74rem;
}

.law-source-meta a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.law-article-list {
  border-top: 1px solid var(--line);
}

.law-chapter-heading {
  margin: 16px 0 4px;
  padding: 7px 10px;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  color: var(--ink-soft);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.law-article {
  display: grid;
  grid-template-columns: 6.8em minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.law-article:last-child {
  border-bottom: 0;
}

.law-article-no {
  padding-top: 2px;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.7;
}

.law-article-text {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.95;
  white-space: pre-wrap;
}

.law-empty-note {
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.law-external-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.law-external-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 8px;
}

.law-external-head h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
}

.law-external-card p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.8;
}

.law-external-note {
  color: var(--muted) !important;
  font-size: 0.76rem !important;
}

.law-external-link {
  display: inline-block;
  margin-top: 2px;
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.chapter-refs {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.chapter-refs h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ref-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ref-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.84rem;
}

.ref-list li::before {
  content: "↗";
  color: var(--accent);
  font-size: 0.8rem;
}

.ref-list a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.ref-list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.chapter-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.chapter-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 150ms ease, transform 150ms ease;
}

.chapter-nav a:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  color: var(--ink);
}

.chapter-nav small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-nav strong {
  font-family: var(--font-serif);
  font-size: 1rem;
}

.chapter-nav a.next {
  text-align: right;
  align-items: flex-end;
}

.chapter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

/* ----------------------------- Sources / about ----------------------------- */

.source-group {
  margin-top: 30px;
}

.source-group h2 {
  margin-bottom: 12px;
  font-size: 1.35rem;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.source-item a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.source-item a:hover {
  color: var(--accent);
}

.source-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.source-item .source-domain {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.notice {
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: var(--gold-soft);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.notice strong {
  color: var(--ink);
}

.prose {
  max-width: 780px;
}

.prose h2 {
  margin-top: 34px;
  margin-bottom: 10px;
}

.prose h3 {
  margin-top: 24px;
  margin-bottom: 8px;
}

.prose p,
.prose li {
  font-size: 0.97rem;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

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

/* ----------------------------- Search ----------------------------- */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: start center;
  padding: 10vh 20px 20px;
  background: rgba(13, 22, 24, 0.55);
  backdrop-filter: blur(6px);
}

.search-overlay[hidden] {
  display: none;
}

.search-panel {
  width: min(100%, 680px);
  max-height: 78vh;
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise-in 220ms ease both;
}

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

.search-head h2 {
  margin: 0;
  font-size: 1.5rem;
}

.search-panel input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
}

.search-panel input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.search-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.search-results {
  display: grid;
  gap: 5px;
  margin-top: 16px;
}

.search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.search-result:hover,
.search-result.is-active {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.result-type {
  min-width: 44px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 800;
  text-align: center;
}

.result-type.term {
  background: var(--gold-soft);
  color: var(--gold);
}

.search-result strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.5;
}

.search-result small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.search-result .result-arrow {
  color: var(--muted);
  font-size: 0.9rem;
}

.search-empty {
  padding: 26px 10px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.search-group-label {
  margin: 14px 2px 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ----------------------------- Footer / toast ----------------------------- */

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

.footer-inner {
  width: min(100% - 40px, var(--maxw));
  margin: 0 auto;
  padding: 38px 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
}

.footer-brand {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.9rem;
}

.footer-note {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-content: start;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  width: min(100% - 40px, var(--maxw));
  margin: 0 auto;
  padding: 16px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 400;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@media (max-width: 980px) {
  .hero-grid,
  .subject-hero {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero-aside {
    max-width: 560px;
  }

  .chapter-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 32px;
  }

  .subject-grid {
    grid-template-columns: 1fr;
  }

  .subject-card {
    min-height: auto;
  }

  .nobel-table,
  .nobel-table tbody,
  .nobel-table tr,
  .nobel-table td,
  .nobel-table caption {
    display: block;
    width: 100%;
  }

  .nobel-table {
    min-width: 0;
    font-size: 0.8rem;
  }

  .nobel-table thead {
    display: none;
  }

  .nobel-table td {
    padding: 14px;
    border-top: 0;
    line-height: 1.6;
  }

  .nobel-year-row {
    border-top: 1px solid var(--line-strong);
  }

  .nobel-year-row:first-child {
    border-top: 0;
  }

  .nobel-year-data {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nobel-year-model-cell {
    padding: 14px 12px 16px;
  }

  .nobel-entry-fields > div {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .nobel-year-canvas {
    overflow-x: auto;
  }
}

@media (max-width: 780px) {
  :root {
    --header-h: 64px;
  }

  .header-inner {
    width: min(100% - 28px, var(--maxw));
    gap: 12px;
  }

  .brand-text small {
    display: none;
  }

  .main-nav {
    position: absolute;
    top: calc(var(--header-h) - 1px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 10px 14px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 11px 12px;
    border-radius: 8px;
  }

  .menu-btn {
    display: grid;
  }

  .hero {
    padding-top: 18px;
  }

  .hero-copy h1 {
    font-size: clamp(2.1rem, 9vw, 3.2rem);
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 28px;
  }

  .hero-grid {
    gap: 24px;
  }

  .page {
    width: min(100% - 28px, var(--maxw));
    padding-top: 34px;
    padding-bottom: 62px;
  }

  .subject-hero {
    padding-bottom: 28px;
  }

  .home-section {
    margin-top: 42px;
  }

  .page-head {
    padding-bottom: 26px;
  }

  .subject-chapters-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 30px;
  }

  .part-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .chapter-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
  }

  .chapter-row-side {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
    margin-top: 2px;
  }

  .chapter-num {
    padding-right: 12px;
  }

  .chapter-num strong {
    font-size: 1.55rem;
  }

  .chapter-head {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .chapter-head-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .model-atlas {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .model-atlas .btn {
    width: 100%;
    justify-content: center;
  }

  .model-atlas-actions {
    flex-direction: column;
    width: 100%;
  }

  .nobel-head .chapter-head-side {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .nobel-section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nobel-table-hint {
    max-width: none;
    text-align: left;
  }

  .models-chapter-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .models-chapter-side {
    justify-content: space-between;
    width: 100%;
  }

  .chapter-layout {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 26px;
  }

  .chapter-toc {
    position: relative;
    top: auto;
    max-height: none;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
  }

  .chapter-toc h2 {
    margin-bottom: 8px;
  }

  .toc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .toc-list a {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.78rem;
  }

  .toc-list a.active {
    border-color: var(--accent);
  }

  .toc-progress {
    display: none;
  }

  .term-grid,
  .source-list {
    grid-template-columns: 1fr;
  }

  .howto {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 30px;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .chapter-nav {
    grid-template-columns: 1fr;
  }

  .chapter-nav a.next {
    text-align: left;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .header-actions {
    gap: 4px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-text strong {
    font-size: 0.94rem;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .exam-card {
    padding: 22px;
  }

  .subject-card {
    padding: 22px;
  }

  .chapter-head h1 {
    font-size: 2rem;
  }

  .models-head h1 {
    font-size: 1.95rem;
  }

  .models-summary span {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .models-jump {
    padding: 14px;
  }

  .models-jump a {
    font-size: 0.74rem;
  }

  .chapter-summary {
    padding: 18px;
  }

  .section-block {
    padding: 28px 0;
  }

  .memory-card {
    flex-direction: column;
    gap: 8px;
  }

  .search-overlay {
    padding: 4vh 10px 10px;
  }

  .search-panel {
    padding: 20px;
  }

  .search-result {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .result-arrow {
    display: none;
  }
}

@media (max-width: 680px) {
  .model-diagram {
    padding: 14px 12px 12px;
  }

  .diagram-tables {
    grid-template-columns: 1fr;
  }

  .diagram-canvas {
    overflow-x: auto;
  }

  .diagram-canvas svg {
    min-width: 460px;
  }

  .diagram-scroll-hint {
    display: block;
    margin: 8px 2px 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
    text-align: right;
  }

  .ratio-overview {
    padding: 16px 14px;
  }

  .ratio-overview-head {
    display: block;
  }

  .ratio-overview-head .btn {
    margin-top: 12px;
  }

  .ratio-overview-actions {
    margin-top: 12px;
  }

  .ratio-table {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
  }

  .ratio-table thead {
    display: none;
  }

  .ratio-table,
  .ratio-table tbody,
  .ratio-table tr,
  .ratio-table th,
  .ratio-table td {
    display: block;
    width: 100%;
  }

  .ratio-table tr {
    padding: 12px 14px;
    border-top: 1px solid var(--line);
  }

  .ratio-table tr:first-child {
    border-top: 0;
  }

  .ratio-table tbody th {
    padding: 0 0 4px;
    border: 0;
    font-size: 0.9rem;
    white-space: normal;
  }

  .ratio-table tbody td {
    padding: 2px 0;
    border: 0;
    white-space: normal;
  }

  .ratio-table tbody td::before {
    content: attr(data-label) "：";
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
  }

  .ratio-table .ratio-formula {
    white-space: normal;
  }

  .ratio-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .option-priority {
    padding: 16px 14px;
  }

  .option-priority-head {
    display: block;
  }

  .option-priority-head .btn {
    margin-top: 12px;
  }

  .priority-table {
    font-size: 0.8rem;
  }

  .priority-table th,
  .priority-table td {
    padding: 8px 9px;
  }

  .law-source-head {
    align-items: flex-start;
    padding: 14px;
  }

  .law-source-title {
    flex-basis: calc(100% - 80px);
    font-size: 0.88rem;
  }

  .law-source-count {
    width: 100%;
    padding-left: 2px;
  }

  .law-source-body {
    padding: 0 12px 12px;
  }

  .law-source-meta {
    display: grid;
    gap: 4px;
  }

  .law-chapter-heading {
    padding: 7px 8px;
    font-size: 0.8rem;
  }

  .law-article {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 12px 0;
  }

  .law-article-no {
    padding-top: 0;
    font-size: 0.72rem;
  }

  .law-article-text {
    font-size: 0.86rem;
  }

  .law-external-card {
    padding: 15px 14px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .search-overlay,
  .chapter-toc,
  .chapter-actions,
  .chapter-nav,
  .model-atlas,
  .models-jump,
  .models-foot,
  .models-head .chapter-head-side,
  .nobel-head .chapter-head-side,
  .nobel-table-hint,
  .nobel-formula-note,
  .toast {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .chapter-layout {
    display: block;
  }

  .section-block {
    break-inside: avoid;
  }

  .term-card,
  .exam-box,
  .memory-card,
  .model-diagram,
  .models-entry,
  .chapter-summary {
    break-inside: avoid;
  }

  .diagram-scroll-hint {
    display: none !important;
  }

  .diagram-canvas {
    overflow: visible;
  }

  .diagram-canvas svg {
    min-width: 0;
  }

  .nobel-table-wrap {
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  .nobel-table {
    min-width: 0;
    font-size: 0.62rem;
  }

  .nobel-year-table,
  .nobel-year-table tbody {
    display: table;
    width: 100%;
  }

  .nobel-year-table thead {
    display: table-header-group;
  }

  .nobel-year-table tr {
    display: table-row;
    break-inside: avoid;
  }

  .nobel-year-table th,
  .nobel-year-table td {
    display: table-cell;
    padding: 8px;
  }

  .nobel-year-row,
  .nobel-year-figure {
    break-inside: avoid;
  }

  .nobel-year-data {
    border-right: 1px solid var(--line);
  }

  .nobel-year-table th:first-child,
  .nobel-year-table td:first-child {
    position: static;
    background: transparent;
  }
}

/* ----------------------------- Macro school evolution ----------------------------- */

.macro-evolution {
  position: relative;
  margin: 30px 0 10px;
  padding: 26px 26px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 38%);
  box-shadow: var(--shadow-sm);
}

.macro-evolution::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent));
  content: "";
  opacity: 0.8;
}

.macro-evolution-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.macro-evolution-intro {
  min-width: 0;
}

.macro-evolution .eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
}

.macro-evolution h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
}

.macro-evolution-intro > p:last-child {
  max-width: 75ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.evolution-meta {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 290px;
}

.evolution-meta span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.evolution-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 16px 0 20px;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.7rem;
}

.evolution-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-school {
  background: var(--accent);
}

.legend-model {
  border-radius: 2px;
  background: var(--accent-ink);
}

.legend-nobel {
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

.evolution-track {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evolution-track::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 110px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  content: "";
  opacity: 0.35;
}

.evolution-stage {
  position: relative;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  column-gap: 28px;
  padding-bottom: 26px;
}

.evolution-stage:last-child {
  padding-bottom: 0;
}

.evolution-stage::before {
  position: absolute;
  top: 8px;
  left: 110px;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
  content: "";
  transform: translateX(-50%);
}

.evolution-marker {
  padding-top: 1px;
  padding-right: 15px;
  text-align: right;
}

.evolution-year {
  display: block;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.evolution-period {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.evolution-stage-body {
  min-width: 0;
}

.evolution-stage-head {
  margin-bottom: 12px;
}

.evolution-stage-index {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.evolution-stage-head h3 {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.evolution-stage-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.evolution-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.evolution-card {
  position: relative;
  min-width: 0;
  padding: 17px 17px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.evolution-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  content: "";
  opacity: 0.65;
}

.evolution-card-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.evolution-card-index {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.evolution-card-title {
  min-width: 0;
}

.evolution-card-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin-bottom: 1px;
}

.evolution-kind {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.evolution-card-period {
  color: var(--muted);
  font-size: 0.66rem;
}

.evolution-card-title h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
}

.evolution-card-en {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.evolution-founders {
  margin: 11px 0 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--gold);
  border-radius: 0 7px 7px 0;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.evolution-founders span {
  display: inline-block;
  margin-right: 6px;
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.evolution-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.7;
}

.evolution-models,
.evolution-nobels {
  margin-top: 12px;
}

.evolution-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.evolution-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.evolution-model-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  line-height: 1.35;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.evolution-model-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.evolution-model-name {
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.evolution-nobel-list {
  display: grid;
  gap: 6px;
}

.evolution-nobel-chip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.evolution-nobel-chip:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.evolution-nobel-year {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.evolution-nobel-body {
  min-width: 0;
}

.evolution-nobel-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.evolution-nobel-field {
  display: block;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.4;
}

.evolution-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.evolution-card-foot a {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
}

.evolution-card-foot a:hover {
  text-decoration: underline;
}

.evolution-note {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.65;
}

.evolution-note strong {
  color: var(--ink-soft);
}

.evolution-note a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.models-entry {
  position: relative;
}

.models-entry.is-targeted::before {
  position: absolute;
  inset: -10px -8px;
  z-index: 2;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 0 0 4px var(--accent-soft);
  content: "";
  pointer-events: none;
  animation: model-target-fade 2.6s ease-out forwards;
}

@keyframes model-target-fade {
  0%,
  65% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@media (max-width: 980px) {
  .macro-evolution-head {
    display: block;
  }

  .evolution-meta {
    justify-content: flex-start;
    max-width: none;
    margin-top: 10px;
  }
}

@media (max-width: 780px) {
  .macro-evolution {
    padding: 20px 18px 18px;
  }

  .evolution-track::before {
    top: 8px;
    bottom: 8px;
    left: 7px;
  }

  .evolution-stage {
    grid-template-columns: 1fr;
    column-gap: 0;
    padding-bottom: 22px;
    padding-left: 26px;
  }

  .evolution-stage::before {
    top: 7px;
    left: 7px;
  }

  .evolution-marker {
    margin-bottom: 8px;
    text-align: left;
  }

  .evolution-year {
    font-size: 1.15rem;
  }

  .evolution-period {
    display: inline-block;
    margin-top: 0;
    margin-left: 7px;
  }

  .evolution-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .macro-evolution {
    margin-top: 22px;
    padding: 17px 13px 15px;
    border-radius: var(--radius);
  }

  .macro-evolution h2 {
    font-size: 1.35rem;
  }

  .evolution-legend {
    gap: 7px 12px;
    padding: 7px 0;
  }

  .evolution-card {
    padding: 14px 13px 12px;
  }

  .evolution-card-head {
    gap: 9px;
  }

  .evolution-card-index {
    width: 28px;
    height: 28px;
  }

  .evolution-nobel-chip {
    grid-template-columns: 38px minmax(0, 1fr);
  }
}
