:root{
  --lime:#87ff71;
  --sun:#ffce5c;
  --ink:#192617;
  --ink2:#2a3d22;
  --paper:#f4f5e8;
  --rail:88px;
  --radius:4px;
}
*,*::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:"Roboto","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  font-size:17px;
  line-height:1.78;
  font-weight:400;
  letter-spacing:.005em;
}
a{color:inherit}
img{max-width:100%;height:auto;display:block}
:focus-visible{outline:3px solid var(--sun);outline-offset:3px}

/* ---------- 左侧竖排导航条 ---------- */
.rail{
  position:fixed;
  top:0;left:0;bottom:0;
  width:var(--rail);
  z-index:80;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  padding:20px 0 24px;
  background:var(--ink) radial-gradient(rgba(135,255,113,.22) 1px,transparent 1px);
  background-size:16px 16px;
  border-right:3px solid var(--lime);
}
.rail-brand{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
  padding:8px 4px;
  min-height:44px;
  text-decoration:none;
}
.rail-mark{
  width:26px;height:26px;
  background:var(--sun);
  clip-path:polygon(50% 0,100% 100%,0 100%);
  transform:rotate(-8deg);
  transition:transform .35s ease;
}
.rail-brand:hover .rail-mark,
.rail-brand:focus-visible .rail-mark{transform:rotate(14deg) scale(1.12)}
.rail-name{
  writing-mode:vertical-rl;
  font-size:16px;
  font-weight:700;
  letter-spacing:.22em;
  color:var(--lime);
}
.burger{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  min-height:56px;
  padding:10px 4px;
  background:none;
  border:0;
  cursor:pointer;
  color:var(--lime);
  font:inherit;
  font-size:16px;
}
.burger-box{position:relative;display:block;width:28px;height:20px}
.burger-box i{
  position:absolute;left:0;
  width:100%;height:3px;
  background:var(--sun);
  transition:transform .3s ease,opacity .3s ease;
}
.burger-box i:nth-child(1){top:0}
.burger-box i:nth-child(2){top:8.5px}
.burger-box i:nth-child(3){top:17px}
.nav-open .burger-box i:nth-child(1){transform:translateY(8.5px) rotate(45deg)}
.nav-open .burger-box i:nth-child(2){opacity:0}
.nav-open .burger-box i:nth-child(3){transform:translateY(-8.5px) rotate(-45deg)}
.burger-label{letter-spacing:.18em;white-space:nowrap}

/* ---------- 全屏遮罩菜单 ---------- */
.drawer{
  position:fixed;
  inset:0;
  z-index:70;
  display:flex;
  align-items:center;
  padding:96px 7vw 96px calc(var(--rail) + 7vw);
  background:var(--ink);
  background-image:repeating-linear-gradient(-45deg,rgba(135,255,113,.07) 0 14px,transparent 14px 28px);
  color:var(--lime);
  overflow-y:auto;
  opacity:0;
  visibility:hidden;
  transition:opacity .35s ease,visibility .35s ease;
}
.nav-open .drawer{opacity:1;visibility:visible}
.drawer-list{
  list-style:none;
  margin:0;padding:0;
  width:100%;
  display:flex;
  flex-direction:column;
}
.drawer-list li{
  border-bottom:1px dashed rgba(135,255,113,.3);
  opacity:0;
  transform:translateX(-22px);
  transition:opacity .4s ease,transform .4s ease;
}
.nav-open .drawer-list li{opacity:1;transform:none}
.nav-open .drawer-list li:nth-child(1){transition-delay:.04s}
.nav-open .drawer-list li:nth-child(2){transition-delay:.08s}
.nav-open .drawer-list li:nth-child(3){transition-delay:.12s}
.nav-open .drawer-list li:nth-child(4){transition-delay:.16s}
.nav-open .drawer-list li:nth-child(5){transition-delay:.2s}
.nav-open .drawer-list li:nth-child(6){transition-delay:.24s}
.nav-open .drawer-list li:nth-child(7){transition-delay:.28s}
.drawer-list a{
  display:block;
  min-height:48px;
  padding:16px 8px;
  font-size:clamp(20px,3vw,30px);
  font-weight:500;
  text-decoration:none;
  color:var(--lime);
  overflow-wrap:anywhere;
  transition:padding-left .2s ease,background .2s ease,color .2s ease;
}
.drawer-list a:hover,
.drawer-list a:focus-visible{background:var(--lime);color:var(--ink);padding-left:20px}

/* ---------- 主体 ---------- */
.page{margin-left:var(--rail)}

.hero{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:clamp(22px,5vh,54px);
  min-height:100vh;
  min-height:100svh;
  padding:120px 6vw 0;
  overflow:hidden;
  text-align:right;
  background:var(--ink);
  background-image:radial-gradient(rgba(135,255,113,.16) 1.5px,transparent 1.5px);
  background-size:26px 26px;
  color:var(--lime);
}
.hero::after{
  content:"";
  position:absolute;left:0;right:0;bottom:0;
  height:14px;
  background:repeating-linear-gradient(90deg,var(--sun) 0 18px,var(--lime) 18px 36px);
}
.hero-num{
  position:absolute;
  left:-.05em;bottom:-.24em;
  margin:0;
  font-size:clamp(150px,32vw,380px);
  line-height:1;
  font-weight:700;
  letter-spacing:-.05em;
  color:transparent;
  -webkit-text-stroke:2px rgba(135,255,113,.34);
  pointer-events:none;
  user-select:none;
}
.hero-copy{position:relative;z-index:2;max-width:min(760px,92%);margin-left:auto}
.hero-title{
  margin:0;
  font-size:clamp(32px,6vw,70px);
  line-height:1.16;
  font-weight:700;
  color:var(--lime);
  text-shadow:4px 4px 0 rgba(255,206,92,.85);
}
.hero-lead{
  margin:22px 0 0 auto;
  max-width:50ch;
  font-size:clamp(16px,1.3vw,19px);
  line-height:1.85;
  color:var(--sun);
}
.hero-art{
  position:relative;
  z-index:1;
  width:calc(100% + 6vw);
  margin:0 -6vw 0 0;
  height:clamp(170px,30vh,300px);
  border-top:3px dashed rgba(135,255,113,.45);
  overflow:hidden;
}
.hero-shapes{display:block;width:100%;height:100%;will-change:transform}
.hero-photo{
  position:absolute;inset:0;
  width:100%;height:100%;
  object-fit:cover;
  mix-blend-mode:screen;
  opacity:.5;
}

/* ---------- 正文栅格 ---------- */
.body-grid{
  max-width:1280px;
  margin:0 auto;
  padding:clamp(36px,6vw,76px) clamp(18px,5vw,60px) clamp(48px,7vw,90px);
  display:grid;
  grid-template-columns:230px minmax(0,1fr);
  gap:clamp(24px,4vw,64px);
  align-items:start;
}
.side-note{
  position:sticky;
  top:28px;
  align-self:start;
  padding:18px 16px 14px;
  border:2px solid var(--ink);
  border-radius:var(--radius);
  background:#fff;
  background-image:repeating-linear-gradient(0deg,rgba(25,38,23,.055) 0 1px,transparent 1px 22px);
}
.side-note h2{
  margin:0;
  font-size:16px;
  font-weight:700;
  letter-spacing:.3em;
  color:var(--ink2);
}
.side-note .subtitle{
  margin:8px 0 14px;
  padding-bottom:10px;
  font-size:16px;
  line-height:1.55;
  color:var(--ink2);
  border-bottom:3px solid var(--sun);
}
.toc{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.toc a{
  display:block;
  min-height:40px;
  padding:9px 8px;
  font-size:16px;
  line-height:1.5;
  text-decoration:none;
  border-left:3px solid transparent;
  transition:border-color .2s ease,background .2s ease;
}
.toc a:hover,
.toc a:focus-visible{border-left-color:var(--lime);background:rgba(135,255,113,.24)}

.prose{min-width:0;max-width:840px}
.prose > section{
  padding:clamp(32px,4vw,54px) 0;
  border-top:3px dashed rgba(25,38,23,.24);
  scroll-margin-top:24px;
}
.prose > section:first-child{border-top:0;padding-top:0}
.prose > section:last-child{padding-bottom:0}

.prose h2{
  position:relative;
  display:inline-block;
  isolation:isolate;
  margin:0 0 20px;
  font-size:clamp(23px,2.6vw,32px);
  line-height:1.4;
  font-weight:700;
}
.prose h2::before{
  content:"";
  position:absolute;
  z-index:-1;
  left:-.16em;right:-.34em;top:.16em;bottom:.04em;
  background:var(--lime);
  clip-path:polygon(0 14%,100% 0,98% 88%,2% 100%);
}
.prose h3{
  display:flex;
  align-items:baseline;
  gap:10px;
  margin:28px 0 12px;
  font-size:19px;
  line-height:1.5;
  font-weight:700;
}
.prose h3::before{
  content:"";
  flex:none;
  width:12px;height:12px;
  background:var(--sun);
  clip-path:polygon(50% 0,100% 100%,0 100%);
  transform:rotate(-8deg);
}
.prose p{margin:0 0 16px}
.prose ul,.prose ol{margin:0 0 18px;padding-left:1.4em}
.prose li{margin:0 0 8px}
.prose li::marker{color:#3f7a30;font-weight:700}
.prose a{
  color:#1c3d14;
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-decoration-color:var(--sun);
  text-underline-offset:3px;
}
.prose a:hover{background:var(--sun)}
.prose strong{font-weight:700;background:linear-gradient(transparent 62%,rgba(255,206,92,.85) 62%)}
.prose blockquote{
  margin:22px 0;
  padding:10px 18px;
  border-left:6px solid var(--sun);
  background:#fff;
  border-radius:0 var(--radius) var(--radius) 0;
}
.prose blockquote p:last-child{margin-bottom:0}
.prose figure{margin:22px 0}
.prose figcaption{font-size:16px;color:#40542f;margin-top:8px}
.prose img{border:3px solid var(--ink);border-radius:var(--radius);margin:18px 0}
.prose hr{border:0;border-top:3px dotted rgba(25,38,23,.35);margin:28px 0}
.prose code{
  font-family:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  font-size:16px;
  background:#fff;
  border:1px solid rgba(25,38,23,.3);
  border-radius:var(--radius);
  padding:1px 5px;
}
.prose table{width:100%;border-collapse:collapse;margin:18px 0;font-size:16px}
.prose th,.prose td{border:2px solid var(--ink);padding:9px 12px;text-align:left}
.prose th{background:var(--sun)}

/* ---------- 页脚 ---------- */
.foot{
  margin-left:var(--rail);
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  gap:10px 22px;
  padding:20px clamp(18px,5vw,60px);
  background:var(--ink);
  color:var(--lime);
  border-top:4px solid var(--lime);
}
.foot p{margin:0;font-size:16px;letter-spacing:.04em}
.foot small{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:16px}
.foot small a{
  display:inline-block;
  min-height:44px;
  padding:10px 2px;
  text-decoration:none;
  border-bottom:2px solid transparent;
}
.foot small a:hover,
.foot small a:focus-visible{border-bottom-color:var(--sun);color:var(--sun)}

/* ---------- 进场动画 ---------- */
html.js .reveal{opacity:0;transform:translateY(20px);transition:opacity .6s ease,transform .6s ease}
html.js .reveal.in{opacity:1;transform:none}

/* ---------- 窄屏 ---------- */
@media (max-width:860px){
  :root{--rail:0px}
  .rail{
    width:100%;height:64px;bottom:auto;right:0;
    flex-direction:row;
    padding:0 14px;
    border-right:0;
    border-bottom:3px solid var(--lime);
  }
  .rail-brand{flex-direction:row;gap:10px;padding:6px}
  .rail-name{writing-mode:horizontal-tb;letter-spacing:.08em;font-size:16px}
  .burger{flex-direction:row;gap:9px;padding:8px 4px;min-height:44px}
  .drawer{padding:84px 22px 40px;align-items:flex-start}
  .page,.foot{margin-left:0}
  .hero{padding:98px 20px 0;gap:20px}
  .hero-copy{max-width:100%}
  .hero-art{width:calc(100% + 40px);margin-right:-20px;height:clamp(150px,24vh,220px)}
  .body-grid{grid-template-columns:1fr;padding:28px 18px 48px;gap:26px}
  .side-note{position:static}
  .toc{flex-direction:row;flex-wrap:wrap;gap:4px 8px}
  .toc a{padding:8px 10px;border:2px solid rgba(25,38,23,.25);border-radius:var(--radius);min-height:40px}
  .toc a:hover,.toc a:focus-visible{border-color:var(--ink)}
  .prose > section{scroll-margin-top:78px}
  .foot{flex-direction:column;align-items:flex-start}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  html.js .reveal{opacity:1;transform:none;transition:none}
  .hero-shapes{transform:none!important}
  .drawer,.drawer-list li,.burger-box i{transition:none}
}

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