@font-face {
  font-family: "Smiley Sans";
  src: url("./fonts/SmileySans.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --text: #111111;
  --muted: #666666;
  --muted-2: #969696;
  --line: #e4e4e4;
  --line-strong: #111111;
  --blue: #265bd3;
  --coral: #ff765f;
  --pink: #e72f73;
  --mint: #2aa66d;
  --sidebar: 252px;
  --top: 64px;
  --reading: 760px;
  --font-en: "GT Haptik", "Inter", "Helvetica Neue", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-cn: "Smiley Sans", "得意黑", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: var(--font-en), var(--font-cn);
  --font-mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.82;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 4px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; }

.progress-track {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: 2px;
  background: transparent;
}
.progress-bar { height: 100%; width: 0; background: var(--text); }

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: var(--sidebar);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font: 800 10px var(--font-mono);
}
.top-meta {
  margin-left: auto;
  color: var(--muted);
  font: 10px var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.home-link {
  color: var(--muted);
  font: 10px var(--font-mono);
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}
.home-link:hover { color: var(--text); }

.sidebar {
  position: fixed;
  z-index: 20;
  top: var(--top);
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  overflow: auto;
  padding: 30px 18px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.eyebrow {
  margin: 0 0 13px;
  padding: 0 4px;
  color: var(--muted);
  font: 800 10px var(--font-mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}
.toc {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.toc-link {
  display: block;
  padding: 6px 12px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
}
.toc-link:hover,
.toc-link.active {
  border-left-color: var(--text);
  background: var(--surface);
  color: var(--text);
}

.main {
  margin-left: var(--sidebar);
  padding: calc(var(--top) + 56px) clamp(26px, 6vw, 96px) 100px;
}
.article {
  max-width: var(--reading);
  margin: 0 auto;
}
.article-head { margin-bottom: 56px; }
.chapter-kicker {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
  color: var(--muted);
  font: 800 10px var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.chapter-kicker::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--coral);
}
h1, h2, h3, p { text-wrap: pretty; }
h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(45px, 6vw, 78px);
  font-weight: 700;
  letter-spacing: -.075em;
  line-height: 1.02;
}
.article-head h1 em { color: var(--blue); font-style: normal; }
.dek {
  max-width: 650px;
  margin: 24px 0 0;
  color: #3e3e3e;
  font-size: 21px;
  line-height: 1.65;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-top: 24px;
  color: var(--muted);
  font: 10px var(--font-mono);
  letter-spacing: .04em;
}
.meta-row span + span::before { content: "·"; margin-right: 18px; color: var(--muted-2); }

.hero-figure { margin: 0 0 64px; }
.article-intro { margin: 0 0 72px; }
.figure {
  margin: 42px 0;
}
.figure img,
.hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fafafa;
}
.figure--reference {
  max-width: 620px;
  margin-inline: auto;
}
.figure--reference img { max-height: 760px; object-fit: contain; }
.hero-figure img { border-color: #d7d7d7; }
figcaption {
  margin-top: 10px;
  color: var(--muted);
  font: 11px/1.6 var(--font-mono);
}

.chapter {
  margin-top: 72px;
  scroll-margin-top: calc(var(--top) + 24px);
}
.chapter:first-of-type { margin-top: 0; }
.chapter-label {
  margin-bottom: 12px;
  color: var(--coral);
  font: 10px var(--font-mono);
  letter-spacing: .12em;
}
.chapter h2 {
  margin: 0 0 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line-strong);
  font-size: clamp(28px, 3.5vw, 43px);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1.16;
}
.chapter h3 {
  margin: 34px 0 8px;
  font-size: 21px;
  letter-spacing: -.025em;
  line-height: 1.35;
}
.chapter p { margin: 1.1em 0; }
.chapter strong { font-weight: 800; }
.chapter a { text-decoration-thickness: 1px; }
.argument-list {
  margin: 20px 0;
  padding-left: 1.35em;
}
.argument-list li {
  margin: 7px 0;
  padding-left: .2em;
}

.lead-in {
  color: #252525;
  font-size: 20px;
  line-height: 1.75;
}
.pullquote {
  margin: 30px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--coral);
  background: var(--surface);
  font-size: 21px;
  letter-spacing: -.02em;
  line-height: 1.55;
}
.pullquote strong { font-weight: 800; }
.formula {
  overflow-x: auto;
  margin: 28px 0;
  padding: 20px 22px;
  background: #111;
  color: #fff;
  font: 15px/1.9 var(--font-mono);
  white-space: nowrap;
}
.formula span { color: #ff856e; }
.formula b { color: #5aa2ff; font-weight: 500; }

.signal-grid,
.verify-grid,
.bet-list {
  display: grid;
  gap: 10px;
  margin: 28px 0;
}
.signal-grid { grid-template-columns: repeat(3, 1fr); }
.verify-grid { grid-template-columns: repeat(3, 1fr); }
.signal-card,
.verify-card,
.bet-item {
  padding: 17px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.signal-card:nth-child(1),
.verify-card:nth-child(1) { border-top: 3px solid var(--coral); }
.signal-card:nth-child(2),
.verify-card:nth-child(2) { border-top: 3px solid var(--blue); }
.signal-card:nth-child(3),
.verify-card:nth-child(3) { border-top: 3px solid var(--pink); }
.signal-card b,
.verify-card b,
.bet-item b {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
  line-height: 1.3;
}
.signal-card p,
.verify-card p,
.bet-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.bet-list { grid-template-columns: 1fr; }
.bet-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 17px;
  align-items: start;
}
.bet-item b { color: var(--text); font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em; }

.mini-note {
  margin: 28px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  background: #f7f9ff;
  color: #454545;
  font-size: 14px;
  line-height: 1.75;
}
.mini-note strong { color: var(--text); }
.source-list {
  margin: 22px 0 0;
  padding-left: 1.25em;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.source-list li { margin: 5px 0; }
.essay-questions {
  margin: 28px 0;
  padding: 17px 22px 17px 42px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.essay-questions li { margin: 7px 0; padding-left: 4px; }
.essay-signature {
  margin: 32px 0 0;
  padding-top: 21px;
  border-top: 1px solid var(--line);
  font-size: 19px;
  line-height: 1.8;
}

.article-end {
  margin-top: 88px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}
.article-end-link {
  color: var(--muted);
  font: 11px/1.5 var(--font-mono);
  letter-spacing: .04em;
  text-decoration: none;
}
.article-end-link:hover { color: var(--text); }
.site-note {
  margin-top: 44px;
  color: var(--muted);
  font: 10px/1.7 var(--font-mono);
}

@media (max-width: 980px) {
  :root { --sidebar: 220px; }
  .brand { min-width: 190px; }
  .main { padding-inline: clamp(24px, 5vw, 68px); }
}

@media (max-width: 760px) {
  :root { --top: 58px; }
  .topbar { padding-inline: 17px; }
  .brand { min-width: auto; font-size: 12px; }
  .brand-mark { width: 25px; height: 25px; font-size: 9px; }
  .top-meta { display: none; }
  .home-link { margin-left: auto; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding: calc(var(--top) + 44px) 20px 72px; }
  .article-head { margin-bottom: 40px; }
  h1 { font-size: 46px; line-height: 1.06; }
  .dek { font-size: 18px; }
  .hero-figure { margin-bottom: 44px; }
  .article-intro { margin-bottom: 56px; }
  .chapter { margin-top: 56px; }
  .chapter h2 { font-size: 30px; }
  .lead-in, .pullquote { font-size: 18px; }
  .signal-grid, .verify-grid { grid-template-columns: 1fr; }
  .bet-item { grid-template-columns: 88px 1fr; gap: 12px; }
  .figure { margin: 32px -4px; }
  figcaption { padding-inline: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
