:root {
  --bg: #1c2228;
  --bg-raise: #242b33;
  --bg-raise-2: #2c343d;
  --line: rgba(232, 228, 218, 0.1);
  --text: #e8e4da;
  --text-2: #b7b2a6;
  --text-3: #8a867c;
  --accent: #3a8f5c;
  --accent-deep: #2d7349;
  --amber: #c9a227;
  --amber-bg: #2a2618;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --num: Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t: 150ms;
  --t2: 250ms;
  --max: 1280px;
  --rail: 260px;
}

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

html { font-size: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.75;
  min-height: 100dvh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { color: #4eaa70; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 12px;
}

p { margin: 0 0 16px; }

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

.head-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex-shrink: 0;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.brand span {
  font-size: 16px;
  font-weight: 500;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--bg-raise);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  min-height: 40px;
  cursor: pointer;
}

.site-nav {
  display: flex;
  gap: 8px 20px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-2);
  font-size: 14px;
  padding: 8px 0;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.scoreboard-date {
  display: inline-block;
  background: var(--amber-bg);
  color: var(--amber);
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 4px;
  margin: 0 0 12px;
}

.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 32px 32px 48px;
  color: var(--text-3);
  font-size: 13px;
}

.foot-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.foot-name {
  color: var(--text-2);
  margin-bottom: 8px;
}

.site-foot p { margin: 0 0 8px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 32px 0;
}

/* Home: 看台侧栏长卷 */
.home-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 32px 0;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 32px;
}

.rail {
  position: sticky;
  top: 88px;
  align-self: start;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px;
}

.rail h2 {
  font-size: 15px;
  margin-bottom: 16px;
}

.rail-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.rail-item:first-of-type { border-top: 0; padding-top: 0; }

.rail-item time {
  font-family: var(--num);
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.rail-item span { color: var(--text-2); }

.mast {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 40px;
}

.mast h1 {
  font-size: 32px;
  max-width: 16em;
}

.lede {
  color: var(--text-2);
  font-size: 15px;
  max-width: 36em;
}

.mast img,
.note img,
.stack img,
.drill img {
  width: 100%;
  border-radius: var(--radius-m);
  object-fit: cover;
  max-height: 420px;
}

.board {
  margin-bottom: 40px;
  background: var(--bg-raise);
  border-radius: var(--radius-l);
  padding: 24px;
  border: 1px solid var(--line);
}

.board h2 { font-size: 20px; }

.board-list {
  display: grid;
  gap: 0;
}

.board-list a {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
}

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

.board-list time {
  font-family: var(--num);
  color: var(--amber);
  font-size: 13px;
}

.note {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 40px;
}

.stack {
  display: grid;
  gap: 20px;
  margin-bottom: 40px;
}

.stack-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  background: var(--bg-raise);
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
}

.stack-card img {
  height: 160px;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
}

.stack-card .pad { padding: 16px 16px 16px 0; }

.stack-card h3 { font-size: 18px; }

.stack-card p {
  color: var(--text-2);
  font-size: 14px;
  margin: 0;
}

.drill {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
}

.drill-copy {
  background: var(--bg-raise-2);
  border-radius: var(--radius-m);
  padding: 24px;
}

.crumbs {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 24px;
}

.crumbs a { color: var(--text-2); }

.cat-hero {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  margin-bottom: 32px;
  align-items: center;
}

.cat-list {
  display: grid;
  gap: 16px;
}

.cat-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.cat-item time {
  font-family: var(--num);
  color: var(--amber);
  font-size: 13px;
}

.article-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}

.article-page.with-side {
  grid-template-columns: minmax(0, 1fr);
}

.art-head { margin-bottom: 24px; }

.art-head h1 { font-size: 28px; max-width: 18em; }

.byline {
  color: var(--text-3);
  font-size: 14px;
  margin: 0;
}

article .lead {
  font-size: 17px;
  color: var(--text-2);
}

article h2 {
  font-size: 20px;
  margin: 28px 0 12px;
}

article figure {
  margin: 24px 0;
}

article figcaption {
  color: var(--text-3);
  font-size: 13px;
  margin-top: 8px;
}

.layout-top figure:first-of-type img { max-height: 420px; width: 100%; object-fit: cover; border-radius: var(--radius-m); }

.layout-mid .split-fig {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

.layout-inset .float-fig {
  float: left;
  width: min(42%, 320px);
  margin: 4px 24px 16px 0;
}

.layout-inset-r .float-fig {
  float: right;
  width: min(42%, 320px);
  margin: 4px 0 16px 24px;
}

.layout-wide .wide-fig img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius-m);
}

.faq {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.faq h2 { font-size: 18px; }

.back-cat { margin-top: 32px; clear: both; }

aside.related {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px;
}

aside.related h2 { font-size: 16px; }

aside.related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

aside.related li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

aside.related li:first-child { border-top: 0; padding-top: 0; }

aside.related a { color: var(--text); }

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

.related-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.related-row.as-aside {
  background: transparent;
  border: 0;
  padding: 0;
}

.related-row li {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 16px;
  background: var(--bg-raise);
}

@media (max-width: 1024px) {
  .home-shell {
    grid-template-columns: 1fr;
  }
  .rail { position: static; }
  .mast,
  .note,
  .drill,
  .cat-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .head-inner { padding: 0 16px; min-height: 64px; }
  .wrap, .home-shell, .site-foot { padding-left: 16px; padding-right: 16px; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--bg-raise);
    flex-direction: column;
    padding: 12px 16px 20px;
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 8px; min-height: 44px; }
  .stack-card,
  .cat-item,
  .board-list a,
  .layout-mid .split-fig,
  .related-row {
    grid-template-columns: 1fr;
  }
  .layout-inset .float-fig,
  .layout-inset-r .float-fig {
    float: none;
    width: 100%;
    margin: 0 0 16px;
  }
  .mast h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

.site-nav a,
.brand,
button {
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease), border-color var(--t) var(--ease);
}
