:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fc;
  --ink: #17181d;
  --ink-soft: #3c4150;
  --muted: #8b909c;
  --line: #eceef3;
  --blue: #2f46c8;
  --blue-deep: #2437a6;
  --mark: #eef1f6;
  --mark-blue: #dbe4ff;
  --mark-ink: #2437a6;
  --chip: #f3f4f7;
  --btn: #2b3fbe;
  --btn-ink: #ffffff;
  --sheet: #f4f7ff;
  --sheet-line: #d7e0f6;
  --shadow: 0 18px 50px rgba(36, 55, 166, 0.08);
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --script: "Zhi Mang Xing", "Caveat", cursive;
  --mono: "DejaVu Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121318;
  --bg-soft: #1a1d27;
  --ink: #f4f5f8;
  --ink-soft: #d5d8e2;
  --muted: #9aa0ad;
  --line: #2a2e3a;
  --blue: #b7c4ff;
  --blue-deep: #d5ddff;
  --mark: #222633;
  --mark-blue: #2a3870;
  --mark-ink: #d7e2ff;
  --chip: #222632;
  --btn: #dbe3ff;
  --btn-ink: #172044;
  --sheet: #1c2233;
  --sheet-line: #334066;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

*,
*::before,
*::after { 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.7;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; }
a { color: inherit; }

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 80;
  background: var(--btn);
  color: var(--btn-ink);
  padding: 8px 12px;
  border-radius: 10px;
}
.skip:focus { top: 12px; }

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

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 72px;
}

.logo {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 550;
  font-size: 26px;
  letter-spacing: -0.03em;
  text-decoration: none;
  line-height: 1;
}

.search-pill,
.icon-btn,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink-soft);
  text-decoration: none;
}

.search-pill {
  padding: 0 10px 0 12px;
  min-width: 168px;
}

.search-pill svg,
.icon-btn svg,
.nav-toggle svg { display: block; }

.search-pill .label {
  font-size: 13px;
  color: var(--muted);
}

.search-pill kbd {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  background: transparent;
}

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

.top-nav a {
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  color: #667085;
}

:root[data-theme="dark"] .top-nav a { color: #b7bdca; }

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

.tools { display: flex; align-items: center; gap: 8px; }

.icon-btn,
.nav-toggle {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.nav-toggle { display: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  grid-template-areas:
    "copy art"
    "foot foot";
  gap: 12px 24px;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 48px 0 108px;
}

.hero-copy { grid-area: copy; }
.hero-art { grid-area: art; }
.hero-foot { grid-area: foot; }

.who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mark-blue);
  color: var(--mark-ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
}

.who strong { display: block; font-size: 15px; font-weight: 700; }
.who small { display: block; color: var(--muted); font-size: 13px; }

.who-note {
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 15px;
}

.poster { margin: 26px 0 22px; }

.poster .line {
  display: table;
  font-size: clamp(52px, 5.6vw, 78px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.045em;
  padding: 0 0.14em 0.02em;
  margin: 5px 0;
}

.line-ink { background: var(--mark); color: var(--ink); }
.line-blue { background: var(--mark-blue); color: var(--mark-ink); }

.subhead {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.dek {
  max-width: 460px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 650;
  font-size: 15px;
}

.btn svg { display: block; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--chip); color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); }

.hero-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-self: end;
  color: #b0b5c0;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.hero-foot span:last-child {
  letter-spacing: 0.08em;
  text-align: right;
}

.hero-art {
  position: relative;
}

.hero-art svg.scene { width: 100%; height: auto; display: block; }

.art-caption {
  position: absolute;
  left: 22%;
  right: 12%;
  bottom: 46px;
  text-align: left;
}

.script {
  font-family: var(--script);
  font-size: 40px;
  line-height: 1;
  color: var(--blue);
  font-weight: 400;
}

.art-index {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.art-index i {
  width: 42px;
  height: 1px;
  background: var(--line);
  display: block;
}

.art-caption p:last-child {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.band { padding: 72px 0 10px; }

.band-head {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px 32px;
  margin-bottom: 28px;
  align-items: end;
}

.index {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 650;
}

.band-head h2,
.page-intro h1,
.article-head h1 {
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.band-head h2 { font-size: clamp(36px, 4vw, 52px); }
.band-head .dek { grid-column: 2; }

.feature {
  display: block;
  text-decoration: none;
  padding: 28px 28px 24px;
  border: 1px solid #e5ebf8;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
}

:root[data-theme="dark"] .feature { border-color: var(--line); }

.feature:hover { border-color: #c9d4f5; }
.kicker { color: var(--blue); font-size: 13px; font-weight: 650; }
.feature h3 {
  margin: 12px 0 10px;
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -0.04em;
  line-height: 1.3;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feature p { color: var(--muted); max-width: 62ch; }
.feature .more {
  display: inline-flex;
  margin-top: 18px;
  color: var(--blue);
  font-weight: 650;
}

.post-list { margin-top: 8px; }

.post-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 8px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.post-list .post-row:first-child { border-top: 1px solid var(--line); }

.post-row time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.post-row strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.45;
  font-weight: 700;
}

.post-row em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
  line-height: 1.6;
}

.post-row:hover strong { color: var(--blue); }
.post-row-go { color: var(--muted); }

.more-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--blue);
  font-weight: 650;
  text-decoration: none;
}

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

.topic-grid a {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 140px;
  padding: 18px;
  border-radius: 18px;
  background: var(--bg-soft);
  text-decoration: none;
}

.topic-grid a:hover { background: var(--mark-blue); }
.topic-grid b { font-size: 20px; letter-spacing: -0.03em; }
.topic-grid span { color: var(--muted); margin-top: auto; }

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 40px;
  align-items: start;
}

.about-grid h2 { font-size: clamp(36px, 4vw, 52px); font-weight: 900; letter-spacing: -0.04em; }
.about-grid .dek { margin-top: 16px; font-size: 16px; max-width: 52ch; }

.stats { list-style: none; display: grid; gap: 12px; }
.stats li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.stats b { font-size: 28px; letter-spacing: -0.04em; }
.stats span { color: var(--muted); }

.dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.dock a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}

.dock a small {
  font-size: 11px;
  letter-spacing: 0.04em;
}

.dock a.is-current {
  background: var(--mark-blue);
  color: var(--mark-ink);
}

.page-intro { padding: 56px 0 12px; }
.page-intro h1 { font-size: clamp(44px, 6vw, 68px); margin: 10px 0; }
.page-intro .dek { font-size: 16px; }

.term-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 48px;
}

.term-grid a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px;
  border-radius: 16px;
  background: var(--bg-soft);
  text-decoration: none;
  font-weight: 700;
}

.term-grid a:hover { background: var(--mark-blue); }
.term-grid em { font-style: normal; color: var(--muted); font-weight: 500; }

.pager {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 0 10px;
}

.pager a { color: var(--blue); font-weight: 700; text-decoration: none; }
.pager span { color: var(--muted); }

.article { padding: 42px 0 20px; }

.back {
  display: inline-flex;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 18px;
}
.back:hover { color: var(--blue); }

.article-head h1 { font-size: clamp(34px, 4.4vw, 52px); margin: 8px 0 14px; }
.article-head .dek { font-size: 17px; max-width: 68ch; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips a {
  text-decoration: none;
  background: var(--chip);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}
.chips a:hover { background: var(--mark-blue); color: var(--mark-ink); }

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 42px;
  margin-top: 34px;
  align-items: start;
}

.prose {
  min-width: 0;
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.prose > * + * { margin-top: 1em; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -0.03em;
  font-weight: 800;
  scroll-margin-top: 90px;
}
.prose h1 { font-size: 1.7rem; margin-top: 1.6em; }
.prose h2 { font-size: 1.45rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.5em; }
.prose a { color: var(--blue); text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose h1:first-of-type { display: none; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 0.85em 1em;
  border-left: 3px solid var(--blue);
  border-radius: 0 14px 14px 0;
  background: var(--bg-soft);
  color: var(--ink-soft);
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose img { border-radius: 14px; }
.prose :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--mark-blue);
  color: var(--mark-ink);
  padding: 0.12em 0.38em;
  border-radius: 6px;
}
.prose pre,
.prose .highlight pre {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  line-height: 1.6;
  font-size: 13.5px;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { color: var(--ink); }

.toc {
  position: sticky;
  top: 92px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.toc p { letter-spacing: 0.14em; font-size: 11px; margin-bottom: 10px; }
.toc ul { list-style: none; }
.toc li { margin: 6px 0; }
.toc ul ul { padding-left: 12px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--blue); }

.end-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 36px;
}
.end-nav a {
  display: block;
  text-decoration: none;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--bg-soft);
}
.end-nav a:hover strong { color: var(--blue); }
.end-nav small { color: var(--muted); }
.end-nav strong { display: block; margin-top: 4px; }
.end-nav a:last-child { text-align: right; }

.related { margin: 28px 0 10px; }
.related h2 { font-size: 22px; margin-bottom: 8px; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
}
.is-home .site-footer { margin-top: 28px; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 28px 0 88px;
}
.signoff {
  font-family: var(--script);
  font-size: 36px;
  line-height: 1;
  color: var(--blue);
}
.footer-meta { color: var(--muted); font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.footer-meta a { color: var(--muted); }

.empty {
  color: var(--muted);
  padding: 28px 0 48px;
}

.search-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: start;
  justify-content: center;
  padding-top: 12vh;
}
.search-layer[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgba(18, 20, 28, 0.28); }
.search-panel {
  position: relative;
  width: min(640px, calc(100vw - 28px));
  background: var(--bg);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.search-panel input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 16px 18px;
  outline: none;
  font-size: 16px;
}
.search-results a {
  display: block;
  padding: 12px 18px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.search-results a:hover { background: var(--bg-soft); }
.search-results small { color: var(--muted); }
.search-results strong { display: block; }
.search-results .empty { padding: 18px; }

@media (max-width: 980px) {
  .hero, .about-grid, .article-grid, .band-head { grid-template-columns: 1fr; }
  .hero {
    grid-template-areas:
      "copy"
      "art"
      "foot";
    min-height: 0;
    padding: 36px 0 48px;
  }
  .band-head .dek { grid-column: auto; }
  .topic-grid, .term-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .shell { width: min(1120px, calc(100% - 28px)); }
  .nav-toggle { display: inline-flex; }
  .search-pill { min-width: 0; width: 36px; padding: 0; }
  .search-pill .label, .search-pill kbd { display: none; }
  .top-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 0;
    padding: 8px 18px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .top-nav.is-open { display: flex; }
  .poster .line { font-size: 42px; }
  .post-row { grid-template-columns: 1fr auto; }
  .post-row time { grid-column: 1 / -1; }
  .topic-grid, .term-grid, .end-nav { grid-template-columns: 1fr; }
  .end-nav a:last-child { text-align: left; }
  .hero-foot { flex-direction: column; }
  .footer-inner { flex-direction: column; align-items: flex-start; padding-bottom: 36px; }
  .dock { display: none; }
}

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