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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --rail: 232px;
  --pad: 24px;
  --r: 18px;
  --line: rgba(0, 0, 0, 0.14);
  --pix: 'Press Start 2P', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'VT323', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.75;
  font-weight: 400;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
p, li, h1, h2, h3 { text-wrap: pretty; }

/* ---------- 左侧固定竖排导航 ---------- */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 26px 20px;
  background: var(--paper);
  border-right: 1px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--pix);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav summary { display: none; }

.nav-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: padding-left 0.22s ease, background 0.22s ease;
}

.nav-menu li:last-child a { border-bottom: 1px solid var(--ink); }
.nav-menu li a:hover { padding-left: 8px; background: #f4f4f4; }

/* ---------- 主区 ---------- */
main, .foot { margin-left: var(--rail); }

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

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  min-height: 100vh;
  padding: 64px 0;
}

.hero-figure {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--paper);
}

.hero-figure.is-empty::before {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.hero-figure.is-empty::after {
  content: "";
  position: absolute;
  inset: 14% 50%;
  border-left: 1px solid var(--ink);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-text {
  position: relative;
  overflow: hidden;
  text-align: right;
}

.hero-mark {
  position: absolute;
  top: -0.15em;
  right: 0;
  left: 0;
  font-family: var(--pix);
  font-size: clamp(32px, 5vw, 76px);
  line-height: 1.15;
  letter-spacing: 0.06em;
  color: var(--paper);
  -webkit-text-stroke: 1px var(--ink);
  white-space: nowrap;
  pointer-events: none;
}

.hero-text h1 {
  position: relative;
  margin: 1.5em 0 0;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.28;
  letter-spacing: 0.01em;
  font-weight: 700;
}

.hero-desc {
  max-width: 34ch;
  margin: 20px 0 0 auto;
  font-size: 17px;
  line-height: 1.8;
}

/* ---------- 正文：侧栏 + 正文 ---------- */
.board {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 48px;
  padding: 56px 0 88px;
  border-top: 1px solid var(--ink);
}

.side {
  position: sticky;
  top: 24px;
  align-self: start;
}

.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
}

.side-list li {
  counter-increment: s;
  border-top: 1px solid var(--line);
}

.side-list li:last-child { border-bottom: 1px solid var(--line); }

.side-list li a {
  position: relative;
  display: block;
  padding: 9px 0 9px 34px;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
}

.side-list li a::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 10px;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.08em;
}

.side-list li a:hover { text-decoration: underline; text-underline-offset: 3px; }

.doc {
  min-width: 0;
  max-width: 72ch;
}

.doc article[id] {
  margin: 0 0 32px;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--ink);
  border-radius: var(--r);
  scroll-margin-top: 104px;
}

.doc article[id]:last-child { margin-bottom: 0; }

.doc small {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0.16em;
}

.doc h2 {
  margin: 0 0 18px;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.36;
  letter-spacing: 0.01em;
}

.doc h3 {
  margin: 28px 0 12px;
  font-size: 20px;
  line-height: 1.5;
}

.doc p { margin: 0 0 16px; }
.doc p:last-child { margin-bottom: 0; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 1.3em; }
.doc li { margin-bottom: 6px; }
.doc a { text-decoration: underline; text-underline-offset: 3px; }

.doc blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--ink);
}

.doc img { border-radius: 12px; margin: 20px 0; }

/* ---------- 页脚 ---------- */
.foot {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px 48px;
  padding: 56px var(--pad) 24px;
  border-top: 1px solid var(--ink);
}

.foot-logo {
  margin: 0 0 12px;
  font-family: var(--pix);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}

.foot-desc {
  max-width: 44ch;
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.8;
}

.sub-label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  letter-spacing: 0.12em;
}

.sub-row { display: flex; flex-wrap: wrap; gap: 10px; }

.sub-row input {
  flex: 1 1 190px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.sub-row button {
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease;
}

.sub-row button:hover { background: var(--paper); color: var(--ink); }

.foot-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 24px;
}

.foot-menu li { break-inside: avoid; }

.foot-menu li a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 0;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
}

.foot-menu li a:hover { text-decoration: underline; text-underline-offset: 3px; }

.foot-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
  font-size: 16px;
}

.foot-bar p { margin: 0; }

.foot-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

/* ---------- 滚动显现 ---------- */
.rv { opacity: 0; transform: translateY(14px); }
.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .rail {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .brand { padding-bottom: 0; border-bottom: 0; }

  .nav { position: relative; }

  .nav summary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--ink);
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.4;
    cursor: pointer;
    list-style: none;
  }

  .nav summary::-webkit-details-marker { display: none; }

  .nav-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    width: min(76vw, 264px);
    max-height: 72vh;
    overflow: auto;
    padding: 4px 16px 10px;
    background: var(--paper);
    border: 1px solid var(--ink);
    border-radius: 12px;
  }

  .nav-menu li:last-child a { border-bottom: 0; }

  main, .foot { margin-left: 0; }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: 0;
    padding: 28px 0 44px;
  }

  .hero-text { order: -1; }
  .hero-text h1 { margin-top: 1.35em; }
  .hero-mark { font-size: clamp(26px, 9.5vw, 54px); }
  .hero-figure { aspect-ratio: 16 / 10; }

  .board {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 28px 0 56px;
  }

  .side { position: static; }

  .side-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }

  .side-list li:last-child { border-bottom: 0; }

  .foot { grid-template-columns: 1fr; padding-top: 40px; }
  .foot-menu { columns: 2; }
}

@media (max-width: 420px) {
  .side-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv, .rv.in { opacity: 1; transform: none; transition: none; }
  .nav-menu li a, .sub-row button { transition: none; }
}

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