@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

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

:root {
  --ink: #172623;
  --soil: #241c15;
  --paper: #f6efe0;
  --paper-2: #e7dac2;
  --sand: #d4c4a8;
  --teal: #5cc6b0;
  --teal-d: #2c8271;
  --clay: #c67b5c;
  --line: #c9b895;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --body: 'VT323', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.nav-open { overflow: hidden; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.75;
  color: var(--ink);
  background: linear-gradient(180deg, #f8f1e2 0%, #f0e6d3 55%, #e6d8bf 100%);
  padding-bottom: 78px;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .42;
  mix-blend-mode: multiply;
  background-image: radial-gradient(rgba(23, 38, 35, .16) 1px, transparent 1px);
  background-size: 4px 4px;
}

a { color: var(--teal-d); }
img { max-width: 100%; display: block; }
figure { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }

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

.skip {
  position: absolute;
  top: -80px;
  left: 10px;
  z-index: 80;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transition: top .18s ease-out;
}
.skip:focus { top: 10px; }

/* ---------- 全屏抽屉导航 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 24px 104px;
  overflow-y: auto;
  color: var(--paper);
  background-color: var(--soil);
  background-image: repeating-linear-gradient(0deg, rgba(212, 196, 168, .07) 0 2px, transparent 2px 6px);
  transform: translateY(101%);
  transition: transform .38s cubic-bezier(.2, .72, .3, 1);
}
html.nav-open .drawer { transform: translateY(0); }

.drawer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: n;
  max-width: 560px;
  margin-inline: auto;
  width: 100%;
}
.drawer nav li { counter-increment: n; border-bottom: 1px solid rgba(212, 196, 168, .22); }
.drawer nav li:first-child { border-top: 1px solid rgba(212, 196, 168, .22); }
.drawer nav a {
  display: block;
  min-height: 48px;
  padding: 14px 4px;
  color: var(--paper);
  font-size: 20px;
  letter-spacing: .06em;
  text-decoration: none;
  transition: color .2s ease-out, padding-left .2s ease-out;
}
.drawer nav a::before {
  content: counter(n, decimal-leading-zero);
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--teal);
  margin-right: 14px;
  vertical-align: 2px;
}
.drawer nav a:hover,
.drawer nav a:focus { color: var(--teal); padding-left: 14px; }

/* ---------- 底部固定条 ---------- */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--ink);
  border-top: 4px solid var(--teal);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
}
.brand-pix { width: 40px; height: 40px; object-fit: cover; background: var(--teal); }
.brand-pix-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--ink);
  background: var(--teal);
}

.burger {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--sand);
  background: transparent;
  border: 2px solid var(--sand);
  border-radius: 0;
  cursor: pointer;
}
.burger:hover { color: var(--teal); border-color: var(--teal); }
html.nav-open .burger { color: var(--ink); background: var(--teal); border-color: var(--teal); }

/* ---------- 顶部大块 ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 70vh;
  padding: 56px 22px 0;
  text-align: right;
  border-bottom: 6px solid var(--teal);
  background-image: radial-gradient(rgba(23, 38, 35, .18) 1px, transparent 1px);
  background-size: 16px 16px;
}

.hero-copy { width: 100%; max-width: 760px; margin-left: auto; }

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 6.6vw, 50px);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: .01em;
}

.hero-sub {
  margin: 0 0 26px auto;
  max-width: 36ch;
  font-size: 17px;
  line-height: 1.7;
  color: #3b4a42;
}

.hero-fig {
  position: relative;
  height: clamp(168px, 30vh, 300px);
  margin: 0 -22px;
  border-top: 3px solid var(--clay);
  background-color: var(--paper-2);
  background-image: repeating-linear-gradient(45deg, rgba(23, 38, 35, .07) 0 6px, transparent 6px 12px);
}

.hero-fig img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .9s ease-out;
}
.hero-fig img.is-on { opacity: 1; }

/* ---------- 主体分栏 ---------- */
.grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 36px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 46px 22px 0;
}

.rail {
  position: sticky;
  top: 24px;
  align-self: start;
  padding-top: 12px;
  border-top: 4px solid var(--ink);
}

.rail-kicker {
  display: block;
  margin: 0 0 10px;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: .18em;
  color: var(--clay);
}

.rail-title {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: r;
}
.rail-list li { counter-increment: r; border-bottom: 1px dashed var(--line); }
.rail-list a {
  display: block;
  min-height: 40px;
  padding: 10px 0;
  font-size: 16px;
  color: #3a473f;
  text-decoration: none;
}
.rail-list a::before {
  content: counter(r, decimal-leading-zero);
  margin-right: 8px;
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--teal-d);
}
.rail-list a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- 正文 ---------- */
.stream { min-width: 0; }

.stream section {
  padding: 38px 0 34px;
  border-bottom: 4px solid var(--sand);
  scroll-margin-top: 22px;
}
.stream > section:first-child { padding-top: 0; border-top: 0; }

.stream h2 {
  margin: 0 0 14px;
  font-size: clamp(21px, 4.4vw, 28px);
  line-height: 1.36;
  font-weight: 800;
  padding-left: 12px;
  border-left: 5px solid var(--teal);
}

.stream h3 { margin: 26px 0 10px; font-size: 20px; line-height: 1.45; font-weight: 800; }

.stream p { max-width: 64ch; margin: 0 0 1.05em; }

.stream small {
  display: block;
  margin: 0 0 8px;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: .16em;
  color: var(--clay);
}

.stream a { color: var(--teal-d); text-decoration: underline; text-underline-offset: 3px; }

.stream ul, .stream ol { margin: 0 0 1.1em; padding-left: 1.2em; max-width: 62ch; }
.stream li { margin: .35em 0; }

.stream blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  background: rgba(212, 196, 168, .38);
  border-left: 5px solid var(--clay);
}
.stream blockquote p:last-child { margin-bottom: 0; }

.stream figure { margin: 22px 0; border-bottom: 4px solid var(--teal); }
.stream figcaption { padding: 8px 0 0; font-size: 15px; color: #4a574e; }

.stream img { width: 100%; height: auto; }

.stream table {
  width: 100%;
  margin: 0 0 1.2em;
  border-collapse: collapse;
  font-size: 17px;
}
.stream th, .stream td {
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.stream th { background: rgba(212, 196, 168, .42); }

.stream hr { border: 0; border-top: 2px dashed var(--line); margin: 26px 0; }

/* ---------- 页脚 ---------- */
.foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 56px;
  padding: 40px 22px 34px;
  color: var(--sand);
  background: var(--soil);
  border-top: 6px solid var(--teal);
}

.foot-giant {
  grid-column: 1 / -1;
  margin: 0 0 18px;
  font-family: var(--pixel);
  font-size: clamp(22px, 8vw, 56px);
  line-height: 1.2;
  letter-spacing: .02em;
  color: var(--paper);
}

.foot-cell {
  margin: 0;
  padding-top: 10px;
  font-size: 16px;
  color: var(--sand);
  border-top: 1px solid rgba(212, 196, 168, .3);
}

.foot-copy {
  grid-column: 1 / -1;
  display: block;
  margin-top: 16px;
  padding-top: 12px;
  font-size: 13px;
  color: #b6a68a;
  border-top: 1px solid rgba(212, 196, 168, .3);
}

/* ---------- 入场 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr; gap: 0; padding: 28px 18px 0; }
  .rail { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 18px; }
  .hero { min-height: 64vh; padding: 40px 16px 0; }
  .hero-sub { font-size: 16px; }
  .hero-fig { margin: 0 -16px; height: clamp(150px, 26vh, 210px); }
  .bar { padding: 8px 10px; }
  .drawer { padding: 64px 16px 100px; }
  .drawer nav a { font-size: 18px; }
  .foot { grid-template-columns: 1fr; padding: 32px 16px 28px; }
  .foot-giant { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .drawer, .hero-fig img, .drawer nav a, .skip { transition: none; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
