:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f7f8fa;
  --ink: #0b0c0e;
  --muted: #60646c;
  --line: #d9dce1;
  --accent: #0957e8;
  --terminal: #101114;
  --terminal-ink: #e8ebef;
  --max: 1400px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --serif: "Noto Serif SC", "Songti SC", SimSun, serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f12;
  --surface: #15181d;
  --ink: #f2f3f5;
  --muted: #a4a9b2;
  --line: #30343b;
  --accent: #4d8dff;
  --terminal: #050608;
  --terminal-ink: #e8ebef;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  transition: background-color .2s ease, color .2s ease;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 4px; }
button { font: inherit; }

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

.site-header {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { font-size: 29px; font-weight: 800; letter-spacing: -.04em; }
.brand::before { content: ">_"; color: var(--accent); font-family: var(--mono); font-size: .72em; margin-right: 12px; }
.header-actions { display: flex; align-items: center; gap: 42px; }
.site-nav { display: flex; gap: 34px; font-weight: 650; }
.site-nav a { position: relative; padding: 8px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -27px; height: 3px; background: var(--accent); }

.theme-toggle {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease;
}
.theme-toggle:hover { transform: rotate(12deg); }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.hero {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(470px, .92fr);
  align-items: center;
  gap: 4vw;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(48px, 4.15vw, 64px);
  line-height: 1.16;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.hero-copy > p { max-width: 620px; margin: 34px 0; color: var(--muted); font-size: 21px; line-height: 1.8; }
.hero-link { display: inline-flex; align-items: center; gap: 12px; color: var(--accent); font-size: 20px; font-weight: 700; }
.hero-link:hover .arrow { transform: translateX(6px); }
.arrow { display: inline-block; transition: transform .2s ease; }
.hero-meta { margin-top: 54px; color: var(--ink); font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.hero-meta span + span::before { content: "·"; margin: 0 14px; color: var(--muted); }

.technical-figure { position: relative; min-height: 530px; isolation: isolate; }
.paper {
  position: absolute;
  inset: 32px 18px 10px 70px;
  border: 1px solid var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--line) .8px, transparent .8px);
  background-size: 12px 12px;
  clip-path: polygon(0 0, 88% 0, 100% 12%, 100% 100%, 0 100%);
  box-shadow: 16px 18px 0 color-mix(in srgb, var(--line) 48%, transparent);
  z-index: -2;
}
.paper::after { content: ""; position: absolute; right: 0; top: 0; width: 12%; aspect-ratio: 1; border-left: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.script-note { position: absolute; top: 80px; right: 70px; font: 12px/1.8 var(--mono); color: var(--muted); white-space: pre; }
.terminal {
  position: absolute;
  left: 18px;
  right: 46px;
  top: 176px;
  min-height: 265px;
  overflow: hidden;
  border: 1px solid #363941;
  border-radius: 8px;
  background: var(--terminal);
  color: var(--terminal-ink);
  box-shadow: 0 24px 44px rgba(0,0,0,.2);
}
.terminal-bar { height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid #363941; }
.terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: #9ca0a8; }
.terminal pre { margin: 0; padding: 22px 28px; font: 13px/1.8 var(--mono); white-space: pre-wrap; }
.prompt { color: #4d8dff; }
.blue-block { position: absolute; width: 58px; height: 40px; right: -2px; top: 142px; background: var(--accent); z-index: -1; }
.cross { position: absolute; left: 52px; top: 110px; width: 32px; height: 32px; }
.cross::before, .cross::after { content: ""; position: absolute; background: var(--ink); }
.cross::before { width: 100%; height: 1px; top: 50%; }
.cross::after { width: 1px; height: 100%; left: 50%; }

.section-heading { display: flex; align-items: center; gap: 18px; margin: 0 0 52px; font-size: 36px; letter-spacing: -.04em; }
.section-heading::before { content: ""; width: 7px; height: 40px; background: var(--accent); }
.section-heading::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.latest { padding: 86px 0 78px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 58px; }
.article-list { border-top: 1px solid var(--line); }
.article-row {
  display: grid;
  grid-template-columns: 92px 1fr 38px;
  gap: 28px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  transition: color .18s ease, padding-left .18s ease;
}
.article-row:hover { color: var(--accent); padding-left: 8px; }
.article-number { color: var(--accent); font: 500 42px/1 var(--mono); }
.article-copy { border-left: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); padding-left: 36px; }
.article-copy h3 { margin: 0 0 9px; font-family: var(--serif); font-size: 27px; line-height: 1.4; letter-spacing: -.02em; }
.article-copy p { margin: 0 0 10px; color: var(--muted); }
.article-meta { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.article-row > svg { align-self: center; width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.topic-rail { border-left: 1px solid var(--line); padding-left: 36px; }
.topic-rail h2 { margin: 3px 0 18px; padding-bottom: 18px; border-bottom: 2px solid var(--ink); font-size: 24px; }
.topic-rail h2::before { content: ">"; color: var(--accent); font-family: var(--mono); margin-right: 10px; }
.topic-link { display: flex; justify-content: space-between; gap: 12px; padding: 24px 0; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 18px; }
.topic-link:hover { color: var(--accent); }
.topic-count { color: var(--muted); font-family: var(--mono); font-size: 13px; white-space: nowrap; }

.site-footer { display: flex; justify-content: space-between; gap: 32px; padding: 32px 0 44px; border-top: 7px solid var(--ink); font-family: var(--mono); font-size: 13px; }
.footer-links { display: flex; gap: 0; }
.footer-links a:hover { color: var(--accent); }
.footer-links a + a::before { content: "/"; color: var(--accent); margin: 0 14px; }

.page-head { padding: 94px 0 64px; border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 920px; margin: 0; font-size: clamp(46px, 6vw, 78px); line-height: 1.12; letter-spacing: -.055em; }
.page-head p { max-width: 680px; margin: 24px 0 0; color: var(--muted); font-size: 19px; }

.article-shell { display: grid; grid-template-columns: 1fr minmax(0, 760px) 1fr; gap: 42px; padding: 72px 0 110px; }
.article-shell article { grid-column: 2; }
.article-kicker { color: var(--accent); font: 700 13px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.article-title { margin: 18px 0 22px; font-size: clamp(42px, 5vw, 67px); line-height: 1.15; letter-spacing: -.05em; text-wrap: balance; }
.article-dek { color: var(--muted); font-size: 20px; line-height: 1.75; }
.article-byline { display: flex; flex-wrap: wrap; gap: 12px 26px; padding: 24px 0; margin: 42px 0 54px; border-block: 1px solid var(--line); color: var(--muted); font: 13px/1.5 var(--mono); }
.prose { font-family: var(--serif); font-size: 18px; line-height: 1.95; }
.prose h2 { margin: 64px 0 18px; font-family: var(--sans); font-size: 31px; line-height: 1.3; letter-spacing: -.035em; }
.prose h3 { margin: 38px 0 12px; font-family: var(--sans); font-size: 22px; }
.prose p { margin: 0 0 22px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.prose code { padding: .12em .35em; border: 1px solid var(--line); background: var(--surface); font: .86em var(--mono); }
.prose pre { margin: 28px 0; padding: 24px; overflow-x: auto; border-left: 4px solid var(--accent); background: var(--terminal); color: var(--terminal-ink); font: 14px/1.75 var(--mono); }
.prose pre code { padding: 0; border: 0; background: transparent; font: inherit; }
.prose blockquote { margin: 30px 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--accent); color: var(--muted); font-size: 20px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 20px 0 26px; }
.prose li { margin: 8px 0; }
.article-nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 76px; padding-top: 26px; border-top: 1px solid var(--line); font-family: var(--sans); font-weight: 700; }
.article-nav a:hover { color: var(--accent); }

.topic-page { padding: 74px 0 110px; }
.topic-group { display: grid; grid-template-columns: 260px 1fr; gap: 60px; padding: 42px 0; border-top: 1px solid var(--line); }
.topic-group h2 { margin: 0; font-size: 28px; }
.topic-group p { margin: 8px 0 0; color: var(--muted); }
.topic-articles a { display: flex; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 19px; }
.topic-articles a:hover { color: var(--accent); }
.topic-articles time { color: var(--muted); font: 12px var(--mono); }

.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 90px; padding: 80px 0 120px; }
.about-copy { max-width: 760px; font-family: var(--serif); font-size: 19px; line-height: 1.95; }
.about-copy h2 { margin-top: 54px; font-family: var(--sans); font-size: 30px; }
.about-note { align-self: start; border-top: 4px solid var(--accent); padding: 26px 0; font: 13px/1.9 var(--mono); color: var(--muted); }

@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; padding: 90px 0; }
  .technical-figure { min-height: 500px; }
  .content-grid, .about-grid { grid-template-columns: 1fr; }
  .topic-rail { border-left: 0; padding-left: 0; margin-top: 24px; }
  .topic-group { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 720px) {
  .site-shell { width: min(100% - 34px, var(--max)); }
  .site-header { min-height: 78px; }
  .brand { font-size: 22px; }
  .brand::before { margin-right: 7px; }
  .header-actions { gap: 16px; }
  .site-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; justify-content: space-around; gap: 0; padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); font-size: 14px; }
  .site-nav a[aria-current="page"]::after { bottom: 1px; }
  .theme-toggle { width: 40px; height: 40px; }
  .hero { min-height: 0; padding: 68px 0 72px; gap: 48px; }
  .hero h1 { font-size: clamp(43px, 13vw, 62px); }
  .hero-copy > p { font-size: 17px; margin: 26px 0; }
  .hero-meta { margin-top: 38px; }
  .hero-meta span { display: block; }
  .hero-meta span + span::before { display: none; }
  .technical-figure { min-height: 370px; }
  .paper { inset: 10px 0 0 32px; }
  .terminal { left: 0; right: 15px; top: 116px; min-height: 220px; }
  .terminal pre { padding: 18px; font-size: 11px; }
  .script-note { top: 42px; right: 28px; font-size: 9px; }
  .cross { left: 16px; top: 68px; }
  .latest { padding: 64px 0 72px; }
  .section-heading { font-size: 29px; margin-bottom: 34px; }
  .article-row { grid-template-columns: 42px 1fr 0; gap: 14px; padding: 28px 0; }
  .article-number { font-size: 23px; }
  .article-copy { padding-left: 18px; }
  .article-copy h3 { font-size: 21px; }
  .article-copy p { font-size: 14px; }
  .article-row > svg { display: none; }
  .site-footer { flex-direction: column; padding-bottom: 98px; }
  .page-head { padding: 68px 0 48px; }
  .article-shell { display: block; padding: 54px 0 100px; }
  .article-title { font-size: 42px; }
  .article-dek { font-size: 17px; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 27px; }
  .topic-page { padding: 54px 0 100px; }
  .topic-articles a { display: block; }
  .topic-articles time { display: block; margin-top: 8px; }
  .about-grid { padding: 56px 0 100px; gap: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
