:root{
  --ink:#000;
  --paper:#fff;
  --pad:clamp(18px,4vw,58px);
  --rail:268px;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;overflow-x:clip}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:"Space Mono",ui-monospace,SFMono-Regular,Menlo,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:17px;
  line-height:1.72;
  overflow-x:clip;
}
img{max-width:100%;height:auto;display:block}
a{color:inherit}
:focus-visible{outline:3px solid currentColor;outline-offset:3px}

/* ---------- 外框：左栏 + 主区 ---------- */
.frame{display:grid;grid-template-columns:var(--rail) minmax(0,1fr);min-height:100vh}

.rail{
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  gap:20px;
  padding:26px 16px 22px;
  border-right:3px solid var(--ink);
  background:var(--paper);
  overflow-y:auto;
}
.brand{
  display:block;
  text-align:center;
  padding-bottom:16px;
  border-bottom:3px solid var(--ink);
  font-family:Syncopate,"PingFang SC","Microsoft YaHei",sans-serif;
  font-weight:700;
  font-size:17px;
  line-height:1.25;
  letter-spacing:.03em;
  text-decoration:none;
}
.rail-nav{flex:1}
.rail-nav ul{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.rail-nav li{
  animation:pop .42s cubic-bezier(.22,.9,.3,1) both;
  animation-delay:calc(var(--i,0) * 45ms);
}
.rail-nav a{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:8px 4px;
  border:2px solid var(--ink);
  border-radius:999px;
  font-size:16px;
  line-height:1.15;
  text-align:center;
  text-decoration:none;
  transition:background .18s ease,color .18s ease;
}
.rail-nav a:hover,
.rail-nav a:focus-visible{background:var(--ink);color:var(--paper)}
.cta{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  border:2px solid var(--ink);
  border-radius:999px;
  background:var(--ink);
  color:var(--paper);
  font-size:16px;
  font-weight:700;
  letter-spacing:.16em;
  text-decoration:none;
  transition:background .18s ease,color .18s ease;
}
.cta:hover,.cta:focus-visible{background:var(--paper);color:var(--ink)}

/* ---------- 主区 ---------- */
main{min-width:0}
section{max-width:940px;margin:0 auto}

.hero{
  min-height:45vh;
  display:grid;
  place-items:center;
  padding:clamp(30px,7vw,66px) var(--pad);
  border-bottom:3px solid var(--ink);
  text-align:center;
}
.hero h1{
  margin:0;
  font-family:Syncopate,"PingFang SC","Microsoft YaHei",sans-serif;
  font-weight:700;
  font-size:clamp(34px,7.2vw,72px);
  line-height:1.04;
  letter-spacing:-.02em;
  text-wrap:balance;
  animation:rise .6s cubic-bezier(.22,.9,.3,1) both;
}

/* ---------- 正文区块 ---------- */
section > div{
  padding:clamp(30px,4.6vw,58px) var(--pad);
  border-bottom:3px solid var(--ink);
  scroll-margin-top:18px;
}
section > div:nth-of-type(even){background:var(--ink);color:var(--paper)}
section > div:last-child{border-bottom:0}

.reveal{opacity:0;transform:translateY(18px);transition:opacity .62s ease,transform .62s ease}
.reveal.in{opacity:1;transform:none}

section > div > :first-child{margin-top:0}
section > div > :last-child{margin-bottom:0}

section p{margin:0 0 1.05em}
section > div > p:first-of-type::first-letter{
  float:left;
  font-family:Syncopate,"PingFang SC","Microsoft YaHei",sans-serif;
  font-weight:700;
  font-size:3.1em;
  line-height:.78;
  padding:.06em .12em 0 0;
}

section small{
  display:block;
  margin-bottom:.55em;
  font-size:16px;
  letter-spacing:.2em;
  opacity:.6;
}

section h2,
section h3{
  margin:0 0 .6em;
  font-family:Syncopate,"PingFang SC","Microsoft YaHei",sans-serif;
  font-weight:700;
  line-height:1.14;
  letter-spacing:-.01em;
  text-wrap:balance;
}
section h2{font-size:clamp(24px,3.7vw,38px)}
section h3{font-size:clamp(20px,2.6vw,26px);margin-top:1.5em}

section a{text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:2px}
section a:hover{background:currentColor}
section a:hover > span{color:var(--paper)}

section ul,section ol{padding-left:1.2em;margin:0 0 1.1em}
section li{margin:.4em 0}
section li::marker{font-weight:700}

section blockquote{
  margin:1.6em 0;
  padding:.15em 0 .15em 1.05em;
  border-left:6px solid currentColor;
  font-size:1.1em;
  line-height:1.55;
}
section blockquote p:last-child{margin-bottom:0}

section figure{margin:1.6em 0;border-bottom:3px solid currentColor;padding-bottom:.55em}
section figcaption{font-size:16px;opacity:.72;padding-top:.55em}

section table{width:100%;border-collapse:collapse;margin:1.4em 0;font-size:16px}
section th,
section td{border:2px solid currentColor;padding:.5em .65em;text-align:left;vertical-align:top}
section th{font-weight:700}

section hr{border:0;border-top:3px solid currentColor;margin:1.8em 0}
section code{
  font-family:"Space Mono",ui-monospace,monospace;
  font-size:.94em;
  border:2px solid currentColor;
  padding:0 .3em;
}

/* ---------- 页脚 ---------- */
.foot{
  border-top:3px solid var(--ink);
  padding:clamp(30px,5vw,58px) var(--pad) 22px;
  background:var(--paper);
}
.fcols{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:26px;
  max-width:940px;
  margin:0 auto;
}
.foot dl{margin:0}
.foot dt{
  font-size:16px;
  letter-spacing:.22em;
  padding-bottom:9px;
  margin-bottom:6px;
  border-bottom:2px solid var(--ink);
}
.foot dd{margin:0}
.foot dd a{
  display:inline-block;
  min-height:40px;
  padding:9px 0;
  line-height:1.35;
  text-decoration:none;
  border-bottom:2px solid transparent;
}
.foot dd a:hover,
.foot dd a:focus-visible{border-bottom-color:var(--ink)}
.fbar{
  max-width:940px;
  margin:26px auto 0;
  padding-top:16px;
  border-top:2px solid var(--ink);
  text-align:center;
  font-size:16px;
  letter-spacing:.08em;
}

@keyframes pop{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:none}}
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

/* ---------- 断点 ---------- */
@media (max-width:900px){
  .frame{grid-template-columns:1fr}
  .rail{
    position:static;
    height:auto;
    border-right:0;
    border-bottom:3px solid var(--ink);
    padding:16px 16px 18px;
    gap:14px;
  }
  .brand{border-bottom-width:2px;padding-bottom:12px;font-size:16px}
  .rail-nav ul{gap:7px}
  .cta{min-height:44px;letter-spacing:.12em}
  .hero{min-height:42vh}
  section > div{scroll-margin-top:12px}
}
@media (max-width:760px){
  .fcols{grid-template-columns:1fr 1fr}
  .foot dl:last-child{grid-column:1 / -1}
}
@media (max-width:420px){
  .rail-nav a{font-size:16px;padding:8px 2px}
  section{font-size:17px}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .rail-nav li,.hero h1{animation:none}
  .reveal{opacity:1;transform:none;transition:none}
}

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