/* =============================================================
   AI 自学成才 — Styles
   学术 × 狂野:大号衬线 / 米色底 / 单色块面 / 强对比强调橙红
============================================================= */

:root {
  /* Light mode tokens */
  --bg:        #f3efe6;
  --surface:   #ebe6d9;
  --surface-2: #e1dcce;
  --ink:       #141414;
  --ink-soft:  #2a2a2a;
  --muted:     #6b6657;
  --hairline:  #1414141a;
  --hairline-strong: #14141433;

  --primary:   #0e3a3a;   /* deep teal */
  --primary-ink: #f3efe6;
  --accent:    #ff4d1f;   /* orange-red */
  --accent-ink:#1a0700;
  --warn:      #b56b00;

  /* Type */
  --f-display: "Instrument Serif", "Noto Serif SC", "Source Han Serif SC", ui-serif, Georgia, serif;
  --f-body:    "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --f-mono:    "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --radius: 2px;
  --radius-lg: 4px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg:        #0d0f10;
  --surface:   #15181a;
  --surface-2: #1c2022;
  --ink:       #f1ede4;
  --ink-soft:  #d9d4c8;
  --muted:     #8a8576;
  --hairline:  #f1ede426;
  --hairline-strong: #f1ede440;

  --primary:   #4fbab1;
  --primary-ink: #06181a;
  --accent:    #ff6a3a;
  --accent-ink:#1a0700;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Paper grain — subtle, on body only */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
html[data-theme="dark"] body::before {
  mix-blend-mode: screen;
  opacity: 0.4;
}
#root { position: relative; z-index: 2; }

/* Vertical running label fixed on left edge */
.running-label {
  position: fixed;
  top: 50%;
  left: 16px;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 40;
  pointer-events: none;
  white-space: nowrap;
}
.running-label::before {
  content: "";
  display: block;
  width: 1px;
  height: 32px;
  background: var(--hairline-strong);
  margin: 0 auto 16px;
}
@media (max-width: 900px) { .running-label { display: none; } }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

/* selection */
::selection { background: var(--accent); color: var(--accent-ink); }

/* utility */
.mono { font-family: var(--f-mono); font-feature-settings: "ss01","cv11"; }
.serif { font-family: var(--f-display); font-style: italic; }
.upper { text-transform: uppercase; letter-spacing: 0.08em; }
.tiny  { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.small { font-size: 13px; }

/* ============== Marquee Ticker ============== */
.ticker {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
  padding: 10px 0;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.ticker-track {
  display: inline-flex;
  gap: 36px;
  white-space: nowrap;
  animation: tickslide 60s linear infinite;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.ticker-item .pip {
  width: 6px; height: 6px;
  background: var(--accent);
  display: inline-block;
}
.ticker-item .code { color: var(--accent); }
.ticker-item .nm { color: var(--bg); opacity: 0.85; font-family: "Noto Sans SC", sans-serif; }
@keyframes tickslide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============== Drop cap ============== */
.dropcap::first-letter {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 5.2em;
  float: left;
  line-height: 0.85;
  margin: 6px 12px 0 -2px;
  color: var(--accent);
  font-weight: 400;
}

/* ============== Big watermark ============== */
.watermark {
  position: absolute;
  font-family: var(--f-display);
  font-style: italic;
  pointer-events: none;
  user-select: none;
  color: transparent;
  -webkit-text-stroke: 1px var(--hairline-strong);
  line-height: 0.78;
  z-index: 0;
}
.watermark.fill {
  -webkit-text-stroke: 0;
  color: var(--hairline);
}

/* ============== Auth ============== */
.auth-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--ink) 50%, transparent);
  backdrop-filter: blur(8px) saturate(120%);
  z-index: 200;
  display: grid; place-items: center;
  padding: 24px;
  animation: fadein .18s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.auth-modal {
  width: min(960px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.18), 16px 16px 0 var(--ink);
}
.auth-x {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  z-index: 5;
}
.auth-left {
  padding: 36px 32px;
  background: var(--ink);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}
.auth-left::after {
  content: "AI/16";
  position: absolute;
  bottom: -32px; right: -16px;
  font-family: var(--f-display);
  font-style: italic;
  font-size: 200px;
  line-height: 0.78;
  color: var(--accent);
  opacity: 0.15;
  pointer-events: none;
}
.auth-eyebrow {
  display: flex; gap: 12px; align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: color-mix(in srgb, var(--bg) 60%, transparent);
}
.auth-eyebrow .swatch {
  width: 10px; height: 10px;
  background: var(--accent);
}
.auth-title {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 64px;
  line-height: 0.95;
  margin: 28px 0 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.auth-title .cn {
  font-family: "Noto Serif SC", serif;
  font-style: normal;
  color: var(--accent);
}
.auth-blurb {
  font-size: 14px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--bg) 75%, transparent);
  max-width: 320px;
}
.auth-bullets {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.auth-bullets li { display: flex; gap: 10px; align-items: center; }
.auth-bullets .b-mark { color: var(--accent); }

.auth-right {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--ink);
  margin-bottom: 8px;
}
.auth-tabs button {
  background: transparent;
  border: 0;
  padding: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--muted);
  border-right: 1px solid var(--hairline);
}
.auth-tabs button:last-child { border-right: 0; }
.auth-tabs button.active {
  background: var(--ink);
  color: var(--bg);
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}
.auth-field input {
  font-family: var(--f-body);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  outline: none;
  border-radius: 1px;
  letter-spacing: 0.02em;
  text-transform: none;
}
.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.auth-error {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  font-size: 13px;
  color: var(--ink);
}
.auth-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1.6;
}
.auth-note strong { color: var(--ink); }

@media (max-width: 760px) {
  .auth-modal { grid-template-columns: 1fr; }
  .auth-title { font-size: 44px; }
}

/* user chip in nav */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--ink);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
}
.user-chip .avatar {
  width: 22px; height: 22px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
}
.user-chip:hover { background: var(--surface); }

.login-cta {
  padding: 6px 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.login-cta:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* User menu dropdown */
.user-menu {
  position: absolute;
  top: 100%; right: 0;
  margin-top: 8px;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  z-index: 60;
  font-family: var(--f-mono);
  font-size: 12px;
}
.user-menu .um-head {
  padding: 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}
.user-menu .um-head .nm {
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 500;
}
.user-menu .um-head .em {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}
.user-menu button:last-child { border-bottom: 0; }
.user-menu button:hover { background: var(--surface); color: var(--accent); }

/* Login gate / lock wall on course detail */
.lockwall {
  position: relative;
  padding: 60px 0 120px;
  min-height: 70vh;
  overflow: hidden;
}
.lockwall-bg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 32px;
  pointer-events: none;
  z-index: 0;
}
.lockwall-zh {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(80px, 18vw, 280px);
  font-weight: 500;
  color: transparent;
  -webkit-text-stroke: 1px var(--hairline-strong);
  line-height: 0.85;
  letter-spacing: -0.02em;
  user-select: none;
  filter: blur(0.3px);
}
.lockwall-en {
  position: absolute;
  bottom: 24%;
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(28px, 4vw, 56px);
  color: var(--hairline-strong);
  letter-spacing: -0.01em;
}
.lockwall-card {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 60px auto;
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 36px 36px 32px;
  box-shadow: 18px 18px 0 var(--ink);
}
.lock-eyebrow {
  display: flex; gap: 10px; align-items: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
}
.lock-code {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.lock-title {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 40px;
  line-height: 1.05;
  margin: 18px 0 16px;
  font-weight: 400;
}
.lock-title .cn {
  font-family: "Noto Serif SC", serif;
  font-style: normal;
}
.lock-title em { color: var(--muted); font-size: 22px; line-height: 1.3; display: block; margin-top: 6px; }
.lock-body {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.lock-cta {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin: 24px 0;
}
.lock-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
  margin-top: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.lock-meta div { display: flex; flex-direction: column; gap: 4px; }
.lock-meta span { color: var(--muted); }
.lock-meta strong { font-family: var(--f-display); font-style: italic; font-size: 32px; color: var(--ink); font-weight: 400; }

/* ============== Top Nav ============== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}

.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--f-display);
  font-size: 22px;
  font-style: italic;
  cursor: pointer;
}
.nav-brand .mark {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 3px 7px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 1px;
}

.nav-links {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.nav-links a {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 1px;
  color: var(--ink-soft);
  position: relative;
  cursor: pointer;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--ink);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  border-bottom: 2px solid var(--accent);
}

.nav-right { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  border-radius: 1px;
  transition: background .15s;
}
.icon-btn:hover { background: var(--surface); }
.progress-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--hairline-strong);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.progress-chip .dot {
  width: 22px; height: 22px;
  background: var(--ink);
  color: var(--bg);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 10px;
}

/* ============== Layout ============== */
.page { min-height: calc(100vh - 64px); }

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

.section { padding: 80px 0; border-top: 1px solid var(--hairline); }
.section:first-child { border-top: 0; }

/* ============== HERO / Home ============== */
.hero {
  padding: 80px 0 40px;
  position: relative;
}
.hero-eyebrow {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 36px;
}
.hero-eyebrow .swatch {
  width: 10px; height: 10px;
  background: var(--accent);
  display: inline-block;
}
.hero-title {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(56px, 9vw, 136px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.hero-title .cn {
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  font-style: normal;
}
.hero-title .accent {
  color: var(--accent);
}
.hero-sub {
  margin-top: 32px;
  max-width: 760px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 56px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.hero-meta .cell {
  padding: 20px 18px;
  border-right: 1px solid var(--hairline);
}
.hero-meta .cell:last-child { border-right: 0; }
.hero-meta .v {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 44px;
  line-height: 1;
}
.hero-meta .l {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.cta-row {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 40px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  font-size: 13px;
  font-family: var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: 1px;
  background: transparent;
  color: var(--ink);
  transition: all .15s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-accent:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ============== Section heading pattern ============== */
.sect-head {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  align-items: baseline;
  margin-bottom: 36px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}
.sect-head .num {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.sect-head .title {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 44px;
  line-height: 1;
}
.sect-head .title .cn {
  font-family: "Noto Serif SC", serif;
  font-style: normal;
}
.sect-head .aside {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ============== Module Cards ============== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}
.mod-card {
  position: relative;
  padding: 28px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  cursor: pointer;
  background: var(--bg);
  transition: background .2s;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}
.mod-card:hover { background: var(--surface); }
.mod-card .topline {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.mod-card .topline .module-no {
  font-size: 14px;
  color: var(--ink);
}
.mod-card .mod-zh {
  font-family: "Noto Serif SC", serif;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.1;
  margin-top: 28px;
  letter-spacing: -0.01em;
}
.mod-card .mod-en {
  font-family: var(--f-display);
  font-style: italic;
  color: var(--muted);
  font-size: 20px;
  margin-top: 4px;
}
.mod-card .mod-desc {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 14px;
  flex-grow: 1;
}
.mod-card .mod-foot {
  display: flex; gap: 24px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.mod-card .mod-foot strong { color: var(--ink); font-weight: 500; }
.mod-card .corner {
  position: absolute;
  top: 28px; right: 28px;
  font-family: var(--f-display);
  font-style: italic;
  font-size: 64px;
  line-height: 0.8;
  color: var(--hairline-strong);
}
.mod-card.has-accent::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: var(--accent);
}
.mod-card .mini-progress {
  position: absolute;
  bottom: 28px; right: 28px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ============== Roadmap ============== */
.roadmap-wrap {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
  padding: 32px 0 24px;
  position: relative;
  overflow: hidden;
}
.roadmap-wrap.bare {
  background: var(--bg);
}
.roadmap-key {
  display: flex; gap: 24px; flex-wrap: wrap;
  padding: 0 32px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.roadmap-key .item { display: flex; align-items: center; gap: 8px; }
.roadmap-key .sw { width: 12px; height: 12px; border: 1px solid var(--ink); display: inline-block; }
.roadmap-key .sw.done { background: var(--ink); }
.roadmap-key .sw.active { background: var(--accent); border-color: var(--accent); }

.rm-station-wrap { cursor: pointer; }
/* Position lives on the OUTER <g transform="translate(x,y)"> attribute.
   All CSS transforms (pop-in + hover lift) go on this INNER group so they
   never override the outer translate() and teleport the station. */
.rm-station-inner {
  transform-box: fill-box;
  transform-origin: center;
  animation: stationPop .35s cubic-bezier(.7,.1,.2,1) backwards;
  transition: transform .15s;
}
.rm-station-wrap:hover .rm-station-inner { transform: translateY(-2px); }

/* Roadmap animations */
@keyframes drawIn {
  from { stroke-dashoffset: 1200; }
  to   { stroke-dashoffset: 0; }
}
.rm-track {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawIn 1.4s cubic-bezier(.7,.1,.2,1) forwards;
}
.rm-track.t-0 { animation-delay: 0.05s; }
.rm-track.t-1 { animation-delay: 0.20s; }
.rm-track.t-2 { animation-delay: 0.35s; }
.rm-track.t-3 { animation-delay: 0.50s; }

@keyframes stationPop {
  from { opacity: 0; transform: scale(.6); }
  to   { opacity: 1; transform: scale(1); }
}
/* station pop-in + hover lift handled by .rm-station-inner above */

@keyframes pulseRing {
  0%   { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}
.rm-pulse {
  transform-origin: center;
  transform-box: fill-box;
  animation: pulseRing 1.4s ease-out infinite;
}

@keyframes arcDraw {
  from { stroke-dashoffset: 200; }
  to   { stroke-dashoffset: 0; }
}
.rm-arc {
  stroke-dasharray: 4 5;
  animation: arcDraw 2s linear infinite;
}
.rm-arc.hi {
  stroke: var(--accent) !important;
  opacity: 1 !important;
  stroke-width: 2 !important;
  stroke-dasharray: 200;
  animation: arcDraw 1s ease-out forwards;
}

.station-tooltip {
  position: fixed;
  pointer-events: none;
  padding: 12px 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  max-width: 280px;
  z-index: 100;
  border-radius: 1px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  transition: opacity .12s;
}
.station-tooltip .t {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 18px;
  margin-bottom: 4px;
}
.station-tooltip .t .cn {
  font-family: "Noto Serif SC", serif;
  font-style: normal;
}
.station-tooltip .m {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--bg) 60%, transparent);
}

/* ============== Course list (Module page) ============== */
.course-list {
  border-top: 1px solid var(--ink);
}
.course-row {
  display: grid;
  grid-template-columns: 60px 1fr 120px 100px 120px 32px;
  gap: 24px;
  align-items: center;
  padding: 28px 16px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background .15s, padding-left .2s;
  position: relative;
}
.course-row:hover {
  background: var(--surface);
  padding-left: 32px;
}
.course-row .num {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.course-row .name .zh {
  font-family: "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
}
.course-row .name .en {
  font-family: var(--f-display);
  font-style: italic;
  color: var(--muted);
  font-size: 16px;
  margin-top: 2px;
}
.course-row .meta {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.course-row .meta strong { color: var(--ink); font-weight: 500; }
.course-row .tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 4px 8px;
  width: max-content;
  justify-self: start;
}
.course-row .tag.acc { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.course-row .arrow {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 24px;
  color: var(--muted);
}
.course-row:hover .arrow { color: var(--accent); transform: translateX(4px); }
.course-row.done { color: var(--muted); }
.course-row.done .name .zh { text-decoration: line-through; text-decoration-color: var(--accent); }

.check-cell {
  width: 22px; height: 22px;
  border: 1px solid var(--ink);
  display: inline-grid;
  place-items: center;
  background: var(--bg);
}
.check-cell.checked { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ============== Course detail page ============== */
.course-layout {
  display: grid;
  grid-template-columns: 240px 1fr 220px;
  gap: 48px;
  padding: 40px 0 120px;
}

.course-toc {
  position: sticky;
  top: 80px;
  align-self: start;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  border-left: 1px solid var(--hairline);
  padding-left: 16px;
}
.course-toc .toc-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.course-toc a {
  display: block;
  padding: 5px 0;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -18px;
  padding-left: 16px;
  cursor: pointer;
}
.course-toc a.active {
  color: var(--ink);
  border-left-color: var(--accent);
}
.course-toc a:hover { color: var(--ink); }

.course-aside {
  position: sticky;
  top: 80px;
  align-self: start;
  font-family: var(--f-mono);
  font-size: 12px;
  border-top: 1px solid var(--ink);
}
.course-aside .row {
  display: flex; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.course-aside .k {
  color: var(--muted); letter-spacing: 0.1em;
  text-transform: uppercase; font-size: 10px;
}
.course-aside .v { color: var(--ink); text-align: right; }
.course-aside .v.acc { color: var(--accent); }
.toggle-done {
  margin-top: 20px;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px;
  border: 1px solid var(--ink);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--bg);
  color: var(--ink);
}
.toggle-done.done {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.course-body {
  max-width: 720px;
}
.course-header-zh {
  font-family: "Noto Serif SC", serif;
  font-size: 64px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
}
.course-header-en {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 30px;
  color: var(--muted);
}
.course-tagrow {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.course-tagrow span strong { color: var(--ink); }

.cs-block {
  margin-top: 48px;
}
.cs-block h2 {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 32px;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: baseline;
  font-weight: 400;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 8px;
}
.cs-block h2 .cn {
  font-family: "Noto Serif SC", serif;
  font-style: normal;
}
.cs-block h2 .idx {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.cs-block p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.list-ordered {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: li;
  border-top: 1px solid var(--hairline);
}
.list-ordered li {
  counter-increment: li;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
  align-items: baseline;
}
.list-ordered li::before {
  content: counter(li, decimal-leading-zero);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.resource-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
.resource-card {
  display: flex; flex-direction: column;
  padding: 16px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  cursor: pointer;
  transition: background .15s;
}
.resource-card:hover { background: var(--surface); }
.resource-card .kind {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.resource-card .rt {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.25;
}

.paper {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: baseline;
  cursor: pointer;
}
.paper:first-of-type { border-top: 1px solid var(--hairline); }
.paper .ref {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
}
.paper .pt {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.3;
}
.paper .venue {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.paper:hover .pt { color: var(--accent); }

.checklist li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 15px;
  align-items: baseline;
}
.checklist li::before {
  content: "□";
  font-family: var(--f-mono);
  font-size: 18px;
  color: var(--muted);
  line-height: 1;
}
.checklist { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hairline); }

/* progress bar at top of home */
.bigbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.bigbar .left {
  font-family: var(--f-display);
  font-style: italic;
}
.bigbar .pct {
  font-size: 96px;
  line-height: 1;
}
.bigbar .pct .accent { color: var(--accent); }
.bigbar .lbl {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.bigbar .right {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: right;
  color: var(--muted);
}
.bigbar .right strong { color: var(--ink); }

.linebar {
  margin-top: 16px;
  height: 12px;
  border: 1px solid var(--ink);
  position: relative;
  background: var(--bg);
}
.linebar .fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  transition: width .4s ease;
}

/* about page */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
  padding: 60px 0;
}
.about-grid h3 {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 32px;
  font-weight: 400;
  margin: 0 0 16px;
}
.about-grid h3 .cn { font-family: "Noto Serif SC", serif; font-style: normal; }
.about-grid p { color: var(--ink-soft); font-size: 16px; line-height: 1.7; }

/* footer */
.footer {
  border-top: 1px solid var(--ink);
  padding: 32px;
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

/* breadcrumb */
.breadcrumb {
  display: flex; gap: 8px; align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 0 0;
}
.breadcrumb a { cursor: pointer; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--hairline-strong); }

/* responsive */
@media (max-width: 1100px) {
  .course-layout { grid-template-columns: 1fr; }
  .course-toc, .course-aside { position: static; }
  .course-aside { margin-bottom: 40px; }
}
@media (max-width: 760px) {
  .container { padding: 0 20px; }
  .nav { padding: 12px 20px; grid-template-columns: auto auto; }
  .nav-links { display: none; }
  .module-grid { grid-template-columns: 1fr; }
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
  .hero-meta .cell:nth-child(2) { border-right: 0; }
  .hero-meta .cell:nth-child(-n+2) { border-bottom: 1px solid var(--hairline); }
  .course-row {
    grid-template-columns: 40px 1fr 32px;
    gap: 12px;
  }
  .course-row .meta, .course-row .tag { display: none; }
  .resource-grid, .about-grid { grid-template-columns: 1fr; }
  .sect-head { grid-template-columns: 1fr; gap: 8px; }
  .sect-head .title { font-size: 32px; }
  .course-header-zh { font-size: 44px; }
}

/* ============================================================
   Mobile polish — extends the breakpoint above with the parts
   the original 760px block didn't cover (nav crowding, bigbar
   stacking, inline-style grids in pages.jsx, lockwall, papers,
   footer, iOS input zoom). Plus a tighter <480 tier for phones.
   ============================================================ */
@media (max-width: 760px) {
  /* Nav: tighten the right cluster so brand stays visible */
  .nav { gap: 8px; }
  .nav-brand .mark { font-size: 9px; padding: 2px 5px; }
  .nav-brand > span:last-child { font-size: 14px; }
  .nav-right { gap: 6px; flex-shrink: 0; }
  .progress-chip { display: none; }
  .user-chip { padding: 6px 10px; }
  .user-chip > span:last-child { display: none; }
  .login-cta { font-size: 12px; padding: 8px 12px; }

  /* Hero */
  .hero { padding-top: 36px; padding-bottom: 40px; }
  .hero-title { font-size: clamp(44px, 11vw, 72px); line-height: 1.02; }
  .hero-sub { font-size: 16px; line-height: 1.65; }
  .cta-row { flex-wrap: wrap; gap: 10px; }
  .cta-row .btn { flex: 1 1 calc(50% - 5px); justify-content: center; min-width: 0; }

  /* Big % bar on home — stack the two columns */
  .bigbar { flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px 24px; }
  .bigbar .pct { font-size: 80px; }
  .bigbar .right { text-align: left; }

  /* Ticker */
  .ticker-item { padding: 0 14px; }
  .ticker-item .nm { font-size: 14px; }

  /* Inline-style grids in pages.jsx (module meta-strip 4-col, philosophy 3-col) */
  div[style*="repeat(4, 1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  div[style*="repeat(4, 1fr)"] > div:nth-child(2) { border-right: 0 !important; }
  div[style*="repeat(4, 1fr)"] > div:nth-child(-n+2) { border-bottom: 1px solid var(--hairline); }
  div[style*="repeat(3, 1fr)"] { grid-template-columns: 1fr !important; }
  div[style*="repeat(3, 1fr)"] > div { border-right: 0 !important; border-bottom: 1px solid var(--hairline); }
  div[style*="repeat(3, 1fr)"] > div:last-child { border-bottom: 0 !important; }

  /* Course detail */
  .course-aside { padding: 22px; }
  .course-header-en { font-size: 20px; }
  .course-tagrow { flex-wrap: wrap; gap: 8px 14px; font-size: 13px; }

  /* Papers — long titles + venue wrap cleanly */
  .paper { grid-template-columns: auto 1fr; row-gap: 4px; align-items: start; }
  .paper .pt { font-size: 15px; }
  .paper .venue { grid-column: 1 / -1; padding-left: 0; font-size: 11px; opacity: 0.7; }
  .resource-card { padding: 16px 18px; }

  /* Login gate */
  .lockwall-zh { font-size: clamp(72px, 18vw, 120px); }
  .lockwall-en { font-size: clamp(28px, 8vw, 52px); }
  .lockwall-card { padding: 28px 22px; max-width: 100%; }
  .lock-title { font-size: 22px; line-height: 1.3; }
  .lock-title em { font-size: 16px; }
  .lock-body { font-size: 14px; }
  .lock-cta { flex-wrap: wrap; }
  .lock-cta .btn { flex: 1 1 auto; justify-content: center; }
  .lock-meta { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .lock-meta strong { font-size: 26px; }

  /* Footer wraps so it never overflows */
  .footer { flex-wrap: wrap; gap: 8px 14px; font-size: 12px; padding: 24px 20px; }

  /* Auth modal polish + iOS-no-zoom on inputs (≥16px) */
  .auth-modal { max-height: 92vh; }
  .auth-left { padding: 28px 24px 24px; }
  .auth-right { padding: 24px; }
  .auth-title { font-size: 40px; line-height: 1.05; }
  .auth-field input { font-size: 16px; }
}

@media (max-width: 480px) {
  /* Tight phones (iPhone SE ~320–375 portrait) */
  .nav { padding: 10px 14px; }
  .nav-brand > span:last-child { display: none; } /* keep just AI/16 */
  .container { padding: 0 14px; }

  .hero { padding-top: 24px; }
  .hero-title { font-size: clamp(34px, 13vw, 58px); }
  .hero-eyebrow { font-size: 10px; }
  .hero-sub { font-size: 15px; }
  .cta-row .btn { flex: 1 1 100%; }

  .bigbar .pct { font-size: 64px; }

  .course-header-zh { font-size: 36px; }
  .course-body .watermark { font-size: clamp(120px, 32vw, 200px) !important; }

  .lock-cta { flex-direction: column; }
  .lock-cta .btn { width: 100%; }
}

/* ============== Course body prose (导读/讲义正文) ============== */
.course-prose {
  font-family: "Noto Serif SC", serif;
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 70ch;
}
.course-prose > :first-child { margin-top: 0; }
.course-prose p { margin: 0 0 18px; }
.course-prose strong { color: var(--ink); font-weight: 600; }
.course-prose em { font-style: italic; color: var(--muted); }
.course-prose h3 {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  margin: 32px 0 12px;
  letter-spacing: -0.01em;
}
.course-prose h4 {
  font-family: "Noto Sans SC", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 10px;
}
.course-prose ul, .course-prose ol { margin: 0 0 18px; padding-left: 22px; }
.course-prose li { margin-bottom: 7px; }
.course-prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--hairline-strong); }
.course-prose a:hover { border-bottom-color: var(--accent); }
.course-prose code {
  font-family: var(--f-mono);
  font-size: 0.85em;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink);
}
.course-prose blockquote {
  margin: 0 0 18px;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
@media (max-width: 760px) {
  .course-prose { font-size: 16px; line-height: 1.8; }
  .course-prose h3 { font-size: 21px; }
}

/* ============== Bookmarks ============== */
.bm-box { margin-top: 16px; }
.bm-add { width: 100%; padding: 12px 14px; border: 1px dashed var(--hairline-strong); background: transparent; color: var(--ink); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; cursor: pointer; border-radius: 2px; }
.bm-add:hover { border-color: var(--accent); color: var(--accent); }
.bm-box.has-bm { border: 1px solid var(--accent); border-radius: 2px; padding: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.bm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bm-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--accent); }
.bm-time, .bm-at { font-family: var(--f-mono); font-size: 10px; color: var(--muted); }
.bm-at { margin-top: 4px; }
.bm-note { width: 100%; margin-top: 8px; padding: 7px 9px; border: 1px solid var(--hairline-strong); background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 13px; border-radius: 2px; box-sizing: border-box; }
.bm-note:focus { outline: none; border-color: var(--accent); }
.bm-actions { display: flex; gap: 6px; margin-top: 8px; }
.bm-actions button { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.04em; padding: 6px 8px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; border-radius: 1px; }
.bm-jump { flex: 1; background: var(--ink); color: var(--bg); }
.bm-jump:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.bm-upd { width: 34px; }
.bm-upd:hover, .bm-rm:hover { background: var(--surface); }
.bm-rm:hover { color: var(--accent); border-color: var(--accent); }

.bm-resume-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.bm-resume-card { padding: 18px 20px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); cursor: pointer; background: var(--bg); transition: background .15s; }
.bm-resume-card:hover { background: var(--surface); }
.brc-code { font-size: 10px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.brc-title { font-family: "Noto Serif SC", serif; font-size: 22px; font-weight: 500; margin-top: 8px; line-height: 1.2; }
.brc-note { font-size: 14px; color: var(--ink-soft); font-style: italic; margin-top: 8px; }
.brc-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; font-size: 10px; letter-spacing: 0.06em; color: var(--muted); }
.brc-go { color: var(--accent); }
@media (max-width: 900px) { .bm-resume-grid { grid-template-columns: 1fr; } }

/* Resource/paper entries without a verified URL — render as inert tile */
.resource-card.nolink,
.paper.nolink {
  cursor: default;
  opacity: 0.6;
}
.resource-card.nolink:hover,
.paper.nolink:hover {
  transform: none;
  background: inherit;
}
.paper.nolink:hover .pt { color: inherit; }
