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

:root{
  --paper:#fdfbf7;
  --paper-2:#f5f5f5;
  --ink:#1a1a1a;
  --line:#e0e0e0;
  --line-2:#cfcfcf;
  --r:28px;
}

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

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

body{
  margin:0;
  padding-bottom:104px;
  background:var(--paper);
  color:var(--ink);
  font-family:'VT323',ui-monospace,'Courier New','Songti SC','SimSun',serif;
  font-size:18px;
  line-height:1.8;
}

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

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

.grain{
  position:fixed;
  inset:0;
  z-index:9;
  pointer-events:none;
  opacity:.5;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
}

.skip{
  position:absolute;
  top:-76px;
  left:16px;
  z-index:70;
  padding:12px 18px;
  background:var(--ink);
  color:var(--paper);
  border-radius:10px;
  text-decoration:none;
  font-size:16px;
}
.skip:focus{top:12px}

/* 顶部 */
.hero{
  position:relative;
  overflow:hidden;
  min-height:45vh;
  display:flex;
  align-items:center;
  padding:34px 18px 30px;
  border-bottom:2px solid var(--ink);
  background:var(--paper);
}

.hero-bg{
  position:absolute;
  right:-2vw;
  bottom:-2vw;
  margin:0;
  z-index:0;
  font-family:'Press Start 2P','VT323',monospace;
  font-size:clamp(46px,13vw,132px);
  line-height:1;
  letter-spacing:-.03em;
  color:var(--paper-2);
  -webkit-text-stroke:1px var(--line-2);
  pointer-events:none;
  user-select:none;
}

.hero-in{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:18px;
  width:100%;
  max-width:1060px;
  margin:0 auto;
}

.hero-copy{flex:1 1 auto;min-width:0}

.hero-mark{margin:0 0 12px}

.glyph{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:30px;
  height:30px;
  padding:0 4px;
  border:2px solid var(--ink);
  border-radius:8px;
  font-family:'Press Start 2P','VT323',monospace;
  font-size:11px;
  line-height:1;
}

h1{
  margin:0 0 .35em;
  font-size:clamp(26px,4.6vw,44px);
  line-height:1.28;
  letter-spacing:.01em;
}

.hero-desc{
  margin:0;
  max-width:44ch;
  font-size:17px;
  line-height:1.8;
  color:#3a3a3a;
}

.hero-img{
  flex:none;
  width:min(34%,220px);
  border:1px solid var(--line-2);
  border-radius:var(--r);
  filter:grayscale(1);
}

/* 主体 */
main{padding:24px 16px 48px}

.wrap{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:22px;
  max-width:1060px;
  margin:0 auto;
}

.rail{
  order:-1;
  padding:16px;
  border:1px solid var(--line-2);
  border-radius:var(--r);
  background:rgba(255,255,255,.55);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
}

.rail-t{
  margin:0 0 12px;
  padding-bottom:10px;
  font-size:16px;
  font-weight:400;
  letter-spacing:.34em;
  border-bottom:1px solid var(--line-2);
}

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

.rail-list li + li{margin-top:2px}

.rail-list a,
.bar menu a{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:42px;
  padding:9px 10px;
  border-radius:12px;
  color:var(--ink);
  text-decoration:none;
  font-size:16px;
  line-height:1.4;
}

.num{
  font-family:'Press Start 2P',monospace;
  font-size:10px;
  letter-spacing:0;
  opacity:.55;
}

.rail-list a{
  animation:rail-turn 12.6s steps(1,end) infinite;
  animation-delay:calc(var(--i) * 1.8s);
}

@keyframes rail-turn{
  0%,13%{background:var(--paper-2)}
  14%,100%{background:transparent}
}

.rail-list a:hover,
.rail-list a:focus-visible{
  animation:none;
  background:var(--ink);
  color:var(--paper);
}

.paper{
  min-width:0;
  padding:22px 17px 28px;
  border:1px solid var(--line-2);
  border-radius:var(--r);
  background:rgba(255,255,255,.55);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
}

.body{
  font-family:'Songti SC','SimSun','VT323',serif;
  font-size:18px;
  line-height:1.95;
}

.body section{scroll-margin-top:20px}

.body section + section{
  margin-top:2.2em;
  padding-top:2.2em;
  border-top:1px dashed var(--line-2);
}

.body h2{
  margin:0 0 .7em;
  padding-bottom:.4em;
  font-size:clamp(20px,3.4vw,27px);
  line-height:1.42;
  letter-spacing:.01em;
  border-bottom:2px solid var(--ink);
}

.body h2 > span{display:inline-block}

.body h3{
  margin:1.7em 0 .55em;
  padding-left:11px;
  font-size:19px;
  line-height:1.45;
  border-left:4px solid var(--ink);
}

.body h3 > span{display:inline-block}

.body p{margin:0 0 1.15em}

.body ul,
.body ol{margin:0 0 1.2em;padding-left:1.35em}

.body li{margin:.35em 0}

.body a{
  color:var(--ink);
  text-decoration:underline;
  text-underline-offset:3px;
  text-decoration-thickness:1px;
}

.body a:hover{background:var(--ink);color:var(--paper);text-decoration:none}

.body blockquote{
  margin:1.4em 0;
  padding:14px 18px;
  background:var(--paper-2);
  border-left:4px solid var(--ink);
  border-radius:0 16px 16px 0;
}

.body blockquote p:last-child{margin-bottom:0}

.body code,
.body pre{
  font-family:ui-monospace,'Courier New',monospace;
  font-size:16px;
}

.body pre{
  padding:14px 16px;
  overflow-x:auto;
  background:var(--paper-2);
  border:1px solid var(--line-2);
  border-radius:14px;
}

.body table{
  width:100%;
  margin:1.2em 0;
  border-collapse:collapse;
  font-size:16px;
}

.body th,
.body td{
  padding:9px 10px;
  border:1px solid var(--line-2);
  text-align:left;
}

.body th{background:var(--paper-2)}

.body img{border-radius:14px;border:1px solid var(--line-2)}

.body time{font-size:16px;letter-spacing:.06em;color:#4a4a4a}

/* 页脚 */
.foot{
  max-width:1060px;
  margin:0 auto;
  padding:34px 18px 24px;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:26px;
  border-top:2px solid var(--ink);
}

.foot-brand{
  margin:0;
  font-size:clamp(38px,10vw,80px);
  line-height:1;
  letter-spacing:-.03em;
  word-break:break-all;
}

.foot-col h3{
  margin:0 0 10px;
  padding-bottom:8px;
  font-size:16px;
  font-weight:400;
  letter-spacing:.3em;
  border-bottom:1px solid var(--line-2);
}

.foot-links{
  margin:0;
  padding:0;
  list-style:none;
}

.foot-links a{
  display:block;
  padding:9px 0;
  min-height:42px;
  color:var(--ink);
  text-decoration:none;
  font-size:16px;
  line-height:1.5;
}

.foot-links a:hover{text-decoration:underline;text-underline-offset:4px}

.copy{
  grid-column:1 / -1;
  margin:0;
  padding-top:14px;
  font-size:16px;
  letter-spacing:.14em;
  border-top:1px solid var(--line-2);
}

/* 底部固定条 */
.bar{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:50;
  display:flex;
  align-items:center;
  gap:9px;
  padding:9px 14px calc(9px + env(safe-area-inset-bottom));
  background:var(--ink);
  color:var(--paper);
  border-top:2px solid var(--ink);
}

.bar-brand{
  display:flex;
  align-items:center;
  gap:8px;
  margin-right:auto;
  min-height:44px;
  padding:10px 2px;
  font-size:17px;
  letter-spacing:.04em;
  color:var(--paper);
  text-decoration:none;
  white-space:nowrap;
}

.bar-brand .glyph{border-color:var(--paper);color:var(--paper);flex:none}

.bar details{position:relative}

.bar summary{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:11px 15px;
  border:1px solid rgba(253,251,247,.55);
  border-radius:999px;
  font-size:16px;
  list-style:none;
  cursor:pointer;
}

.bar summary::-webkit-details-marker{display:none}

.bars{
  position:relative;
  width:14px;
  height:9px;
  border-top:1px solid currentColor;
  border-bottom:1px solid currentColor;
}

.bars::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:50%;
  border-top:1px solid currentColor;
}

.bar details[open] summary{background:var(--paper);color:var(--ink)}

.bar menu{
  position:absolute;
  right:0;
  bottom:calc(100% + 12px);
  margin:0;
  padding:9px;
  min-width:216px;
  max-height:62vh;
  overflow-y:auto;
  list-style:none;
  background:var(--paper);
  color:var(--ink);
  border:2px solid var(--ink);
  border-radius:18px;
  box-shadow:6px 6px 0 rgba(26,26,26,.16);
}

.bar menu li + li{margin-top:2px}

.bar menu a:hover,
.bar menu a:focus-visible{background:var(--ink);color:var(--paper)}

.bar-cta{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:11px 15px;
  border:1px solid rgba(253,251,247,.55);
  border-radius:999px;
  font-size:16px;
  color:var(--paper);
  text-decoration:none;
  white-space:nowrap;
}

.bar-cta:hover{background:var(--paper);color:var(--ink)}

/* 断点 */
@media (min-width:600px){
  .foot{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr)}
  .paper{padding:30px 26px 34px}
  main{padding:30px 20px 56px}
  .hero{padding:44px 24px 38px}
}

@media (min-width:900px){
  .wrap{grid-template-columns:200px minmax(0,1fr);gap:38px}
  .rail{position:sticky;top:22px;align-self:start}
  .paper{padding:40px 44px 46px}
}

@media (max-width:420px){
  .bar-brand{font-size:16px}
  .bar{gap:7px;padding-left:12px;padding-right:12px}
  .hero-img{width:36%}
}

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

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