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

:root{
  --g:#87ff71;
  --y:#ffce5c;
  --ink:#192617;
  --card:#20301f;
  --fg:#e9ffe2;
  --dim:#a7c69c;
  --r:10px;
}

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

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

body{
  margin:0;
  padding:0 0 108px;
  background-color:var(--ink);
  background-image:radial-gradient(rgba(135,255,113,.16) 1.5px,transparent 1.5px);
  background-size:18px 18px;
  color:var(--fg);
  font-family:'VT323','PingFang SC','Hiragino Sans GB','Microsoft YaHei',system-ui,sans-serif;
  font-size:18px;
  line-height:1.75;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

img{max-width:100%;height:auto;display:block}
figure{margin:0}
menu{list-style:none;margin:0;padding:0}
ul,ol{padding-left:1.25em}

a{
  color:var(--y);
  text-decoration:underline;
  text-decoration-style:dotted;
  text-underline-offset:3px;
}
a:hover,a:focus-visible{color:var(--g)}
a:focus-visible{outline:3px dotted var(--y);outline-offset:2px}

.shell{
  max-width:1080px;
  margin:0 auto;
  padding:0 clamp(14px,4vw,32px);
}

main{padding-top:clamp(14px,3vw,26px)}

/* ---------- hero ---------- */
.hero{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
  align-items:center;
  gap:clamp(16px,3vw,32px);
  min-height:45vh;
  padding:6px 0 30px;
  position:relative;
}
.hero::before{
  content:"";
  position:absolute;
  right:6%;
  top:2px;
  width:26px;
  height:26px;
  background:var(--y);
  clip-path:polygon(50% 0,100% 100%,0 100%);
  transform:rotate(-12deg);
  pointer-events:none;
}
.hero-fig{
  position:relative;
  aspect-ratio:4/3;
  border:3px solid var(--g);
  border-radius:var(--r);
  overflow:hidden;
  background:
    repeating-linear-gradient(45deg,rgba(255,206,92,.18) 0 10px,transparent 10px 20px),
    var(--card);
}
.hero-fig::after{
  content:"";
  position:absolute;
  left:-18px;
  bottom:-18px;
  width:72px;
  height:72px;
  border-radius:50%;
  background:var(--y);
  mix-blend-mode:screen;
  pointer-events:none;
}
.hero-img{width:100%;height:100%;object-fit:cover}
.hero-txt{text-align:center;position:relative}
.hero-txt::before{
  content:"";
  display:block;
  margin:0 auto 14px;
  width:34px;
  height:34px;
  border:3px dashed var(--y);
  border-radius:var(--r);
  transform:rotate(14deg);
}
h1{
  margin:0;
  font-family:'Press Start 2P','VT323','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  font-size:clamp(1.35rem,4.6vw,2.15rem);
  line-height:1.5;
  color:var(--g);
  letter-spacing:.01em;
  overflow-wrap:break-word;
}

/* ---------- 双栏 ---------- */
.cols{
  display:grid;
  grid-template-columns:230px minmax(0,1fr);
  gap:clamp(18px,3vw,34px);
  align-items:start;
  padding:26px 0 10px;
  border-top:3px dotted rgba(135,255,113,.35);
}

.toc{
  position:sticky;
  top:16px;
  border:3px solid var(--g);
  border-radius:var(--r);
  background:var(--card);
  padding:14px 14px 18px;
}
.toc h2{
  margin:0 0 8px;
  font-family:'Press Start 2P','VT323','PingFang SC',sans-serif;
  font-size:1rem;
  letter-spacing:.06em;
  color:var(--y);
}
.toc hr{
  border:0;
  height:3px;
  margin:0 0 12px;
  background:repeating-linear-gradient(90deg,var(--g) 0 9px,transparent 9px 16px);
}
.toc-list{list-style:none;margin:0;padding:0}
.toc-list li+li{margin-top:4px}
.toc-list a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:6px 8px;
  border-radius:var(--r);
  border:2px dotted transparent;
  font-size:17px;
  text-decoration:none;
  color:var(--fg);
  overflow-wrap:break-word;
}
.toc-list a:hover,.toc-list a:focus-visible{
  border-color:var(--y);
  color:var(--g);
}

/* ---------- 正文 ---------- */
.prose{
  min-width:0;
  max-width:70ch;
  font-size:19px;
  overflow-wrap:break-word;
}
.prose section{
  padding:4px 0 26px;
  border-bottom:3px dotted rgba(135,255,113,.22);
  scroll-margin-top:20px;
}
.prose section:last-child{border-bottom:0;padding-bottom:8px}

.prose h2{
  position:relative;
  margin:1.6em 0 .55em;
  padding-left:26px;
  font-family:'Press Start 2P','VT323','PingFang SC','Hiragino Sans GB',sans-serif;
  font-size:clamp(1.1rem,3.2vw,1.42rem);
  line-height:1.65;
  color:var(--g);
}
.prose section:first-child h2{margin-top:.4em}
.prose h2::before{
  content:"";
  position:absolute;
  left:0;
  top:.5em;
  width:15px;
  height:15px;
  background:var(--y);
  clip-path:polygon(50% 0,100% 100%,0 100%);
}
.prose h3{
  margin:1.4em 0 .5em;
  font-size:1.12rem;
  line-height:1.6;
  color:var(--y);
  letter-spacing:.02em;
}
.prose p{margin:0 0 1.05em}
.prose ul,.prose ol{margin:0 0 1.1em}
.prose li{margin:.35em 0}
.prose strong{color:var(--g)}
.prose hr{
  border:0;
  height:4px;
  margin:1.5em 0;
  background:repeating-linear-gradient(90deg,var(--y) 0 12px,transparent 12px 22px);
}
.prose figure{margin:1.2em 0}
.prose img{
  border:3px solid var(--g);
  border-radius:var(--r);
  width:100%;
}
.prose figcaption{font-size:16px;color:var(--dim);margin-top:6px}
.prose blockquote{
  margin:1.2em 0;
  padding:12px 16px;
  border:3px dashed var(--y);
  border-radius:var(--r);
  background:rgba(255,206,92,.07);
}
.prose blockquote p:last-child{margin-bottom:0}
.prose table{
  width:100%;
  border-collapse:collapse;
  margin:1.2em 0;
  font-size:17px;
}
.prose th,.prose td{
  border:2px dotted var(--g);
  padding:8px 10px;
  text-align:left;
}
.prose th{color:var(--y)}
.prose code{
  font-family:'VT323',ui-monospace,monospace;
  background:rgba(135,255,113,.14);
  padding:1px 5px;
  border-radius:4px;
}

/* ---------- footer ---------- */
.foot{
  margin-top:44px;
  padding-top:26px;
  border-top:3px solid var(--g);
}
.foot-cta{
  border:3px dashed var(--y);
  border-radius:var(--r);
  padding:20px 18px 24px;
  background:
    radial-gradient(rgba(255,206,92,.22) 1.4px,transparent 1.4px) 0 0/14px 14px,
    rgba(255,206,92,.05);
}
.foot-cta h2{
  margin:0 0 10px;
  font-family:'Press Start 2P','VT323','PingFang SC',sans-serif;
  font-size:clamp(1rem,3.4vw,1.3rem);
  line-height:1.6;
  color:var(--g);
}
.foot-cta hr{
  border:0;
  height:4px;
  margin:0 0 16px;
  background:repeating-linear-gradient(90deg,var(--g) 0 12px,transparent 12px 22px);
}
.big-cta{
  display:inline-flex;
  align-items:center;
  min-height:48px;
  padding:10px 22px;
  border:3px solid var(--ink);
  border-radius:var(--r);
  background:var(--y);
  color:var(--ink);
  font-weight:700;
  font-size:17px;
  text-decoration:none;
}
.big-cta:hover,.big-cta:focus-visible{background:var(--g);color:var(--ink)}

.foot-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:10px 16px;
  padding:18px 0 6px;
}
.foot-mark{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border:3px solid var(--g);
  border-radius:var(--r);
  overflow:hidden;
  text-decoration:none;
}
.foot-nav{display:flex;flex-wrap:wrap;gap:2px 10px}
.foot-nav a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:4px 2px;
  font-size:16px;
  text-decoration:none;
}
.copy{margin:0;font-size:16px;color:var(--dim)}

/* ---------- 底部固定条 ---------- */
.bar{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:60;
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px clamp(10px,3vw,20px) calc(9px + env(safe-area-inset-bottom));
  background:rgba(25,38,23,.97);
  border-top:3px solid var(--g);
}
.mark{
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  flex:0 0 auto;
  border:3px solid var(--g);
  border-radius:var(--r);
  background:var(--card);
  overflow:hidden;
  text-decoration:none;
}
.mark img{width:100%;height:100%;object-fit:cover}
.mark-txt{
  font-family:'Press Start 2P','VT323',sans-serif;
  font-size:16px;
  color:var(--g);
  line-height:1;
}
.menu-wrap{position:relative;flex:0 0 auto}
.menu-wrap summary{
  list-style:none;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 14px;
  border:3px solid var(--g);
  border-radius:var(--r);
  background:var(--card);
  color:var(--fg);
  font-size:16px;
  font-weight:700;
  user-select:none;
}
.menu-wrap summary::-webkit-details-marker{display:none}
.menu-wrap summary::after{
  content:"";
  margin-left:8px;
  width:10px;
  height:10px;
  background:var(--y);
  clip-path:polygon(0 0,100% 0,50% 100%);
}
.menu-wrap[open] summary{background:var(--g);color:var(--ink)}
.menu-wrap[open] summary::after{background:var(--ink);clip-path:polygon(50% 0,100% 100%,0 100%)}
.menu-wrap menu{
  position:absolute;
  left:0;
  bottom:calc(100% + 12px);
  z-index:70;
  width:min(290px,calc(100vw - 28px));
  max-height:58vh;
  overflow:auto;
  padding:8px;
  border:3px dashed var(--g);
  border-radius:var(--r);
  background:var(--card);
}
.menu-wrap menu li+li{border-top:2px dotted rgba(135,255,113,.35)}
.menu-wrap menu a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:8px 10px;
  border-radius:var(--r);
  font-size:16px;
  text-decoration:none;
  color:var(--fg);
}
.menu-wrap menu a:hover,.menu-wrap menu a:focus-visible{background:rgba(135,255,113,.16);color:var(--g)}
.bar-cta{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 14px;
  border:3px solid var(--ink);
  border-radius:var(--r);
  background:var(--y);
  color:var(--ink);
  font-weight:700;
  font-size:16px;
  text-decoration:none;
  white-space:nowrap;
}
.bar-cta:hover,.bar-cta:focus-visible{background:var(--g);color:var(--ink)}

/* ---------- 动效 ---------- */
.js [data-reveal]{
  opacity:0;
  transform:translateY(16px);
  transition:opacity .5s ease,transform .5s ease;
}
.js [data-reveal].in{opacity:1;transform:none}

.js .toc-list li{
  opacity:0;
  transform:translateX(-8px);
  transition:opacity .35s ease,transform .35s ease;
  transition-delay:calc(var(--i,0) * 45ms);
}
.js .toc.in .toc-list li{opacity:1;transform:none}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js [data-reveal],
  .js .toc-list li{
    opacity:1!important;
    transform:none!important;
    transition:none!important;
  }
}

/* ---------- 断点 ---------- */
@media (max-width:820px){
  .cols{grid-template-columns:minmax(0,1fr)}
  .toc{position:static;order:-1}
  .toc-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px}
  .toc-list li+li{margin-top:0}
}

@media (max-width:760px){
  body{font-size:17px;padding-bottom:104px}
  .hero{
    grid-template-columns:minmax(0,1fr);
    gap:16px;
    padding-top:2px;
  }
  .hero-fig{aspect-ratio:16/10}
  .prose{max-width:none;font-size:18px}
  .foot-row{justify-content:flex-start}
  .copy{width:100%}
}

@media (max-width:400px){
  .toc-list{grid-template-columns:minmax(0,1fr)}
  .bar-cta{padding:8px 10px}
  .menu-wrap summary{padding:8px 10px}
}

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