:root{
  --ink:#192617;
  --lime:#87ff71;
  --sun:#ffce5c;
  --paper:#eeffe1;
  --milk:#f7fff4;
  --line:rgba(25,38,23,.3);
  --nav-h:66px;
}

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

html{scroll-behavior:smooth;scroll-padding-top:calc(var(--nav-h) + 12px)}

body{
  margin:0;
  background-color:var(--paper);
  background-image:radial-gradient(circle,rgba(25,38,23,.16) 1.2px,transparent 1.4px);
  background-size:18px 18px;
  color:var(--ink);
  font-family:"Space Mono",ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  font-size:17px;
  line-height:1.65;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

a{color:inherit}
a:focus-visible,button:focus-visible{outline:3px solid var(--ink);outline-offset:2px}
img{max-width:100%;height:auto}

p{margin:0}

/* ---------- 头部 ---------- */
.masthead{
  position:sticky;
  top:0;
  z-index:60;
  background:var(--ink);
  border-bottom:3px dashed var(--sun);
}

.strip{
  margin:0;
  padding:7px 14px;
  background:var(--sun);
  color:var(--ink);
  font-size:14px;
  letter-spacing:.22em;
  text-align:center;
  border-bottom:2px dotted var(--ink);
  text-transform:none;
}

.bar{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:10px;
  padding:9px clamp(10px,3vw,26px);
}

.nav{
  display:flex;
  flex-wrap:wrap;
  gap:2px 4px;
  align-items:center;
}
.nav-left{justify-content:flex-end}
.nav-right{justify-content:flex-start}

.nav-link{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:44px;
  padding:8px 9px;
  font-size:16px;
  line-height:1.2;
  color:var(--lime);
  text-decoration:none;
  border:2px solid transparent;
  transition:background .18s ease,color .18s ease,border-color .18s ease;
}
.nav-link::before{
  content:"";
  width:10px;
  height:10px;
  flex:none;
  background:var(--sun);
  clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);
  transform:rotate(0deg);
  transition:background .18s ease,transform .25s ease;
}
.nav-link:hover,.nav-link:focus-visible{
  background:var(--lime);
  color:var(--ink);
  border-color:var(--sun);
}
.nav-link:hover::before,.nav-link:focus-visible::before{
  background:var(--ink);
  transform:rotate(90deg);
}

.brand{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:6px 14px;
  font-size:21px;
  font-weight:700;
  letter-spacing:.08em;
  color:var(--sun);
  text-decoration:none;
  border:2px dashed var(--lime);
  white-space:nowrap;
  background:rgba(135,255,113,.08);
}
.brand:hover{background:var(--lime);color:var(--ink)}

/* ---------- 首屏 ---------- */
.hero{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
  align-items:center;
  gap:18px;
  min-height:100vh;
  padding:clamp(30px,6vw,70px) clamp(18px,5vw,64px);
  background:var(--ink);
  color:var(--milk);
  overflow:hidden;
  border-bottom:5px solid var(--lime);
}

.hero::before{
  content:"";
  position:absolute;
  left:-70px;
  bottom:-80px;
  width:240px;
  height:240px;
  background:var(--lime);
  opacity:.85;
  clip-path:polygon(50% 0,100% 34%,82% 100%,18% 100%,0 34%);
  transform:rotate(14deg);
}
.hero::after{
  content:"";
  position:absolute;
  top:16%;
  left:46%;
  width:118px;
  height:118px;
  border:5px dotted var(--sun);
  border-radius:50%;
  mix-blend-mode:screen;
  opacity:.8;
}

.hero-num{
  position:absolute;
  right:1%;
  top:2%;
  margin:0;
  font-size:clamp(120px,29vw,330px);
  font-weight:700;
  line-height:.8;
  letter-spacing:-.04em;
  color:transparent;
  -webkit-text-stroke:2px rgba(135,255,113,.4);
  pointer-events:none;
  z-index:0;
  user-select:none;
}

.hero-copy{
  position:relative;
  z-index:2;
  max-width:36ch;
}

h1{
  margin:0 0 18px;
  font-size:clamp(29px,5vw,58px);
  line-height:1.16;
  letter-spacing:-.01em;
  color:var(--lime);
}

.lead{
  margin:0;
  font-size:16px;
  line-height:1.7;
  color:#dbffd0;
  max-width:40ch;
  padding-left:14px;
  border-left:4px solid var(--sun);
}

.shot{
  position:relative;
  z-index:1;
  grid-column:2;
  grid-row:1;
  margin:0;
  min-height:190px;
  border:3px dashed var(--sun);
  background:rgba(135,255,113,.14);
  clip-path:polygon(0 0,100% 4%,96% 100%,4% 96%);
  overflow:hidden;
}
.shot-img{
  display:block;
  width:100%;
  height:100%;
  min-height:190px;
  object-fit:cover;
}
.shot-a{
  width:min(100%,330px);
  justify-self:start;
  align-self:center;
  transform:rotate(-5deg) translateX(-10px);
  transition:transform .3s ease;
}
.shot-b{
  width:min(100%,280px);
  justify-self:end;
  align-self:center;
  transform:rotate(6deg) translate(30px,64px);
  border-style:dotted;
  transition:transform .3s ease;
}
.shot-a:hover{transform:rotate(-2deg) translateX(-10px) scale(1.03)}
.shot-b:hover{transform:rotate(3deg) translate(30px,64px) scale(1.03)}

/* ---------- 正文骨架 ---------- */
.article-shell{
  display:grid;
  grid-template-columns:minmax(0,1fr) 290px;
  align-items:start;
  gap:clamp(20px,4vw,46px);
  max-width:1180px;
  margin:0 auto;
  padding:clamp(26px,5vw,60px) clamp(14px,5vw,56px) clamp(40px,6vw,72px);
}

.prose{
  min-width:0;
  padding:clamp(16px,3vw,34px);
  background:rgba(255,255,255,.66);
  -webkit-backdrop-filter:blur(9px);
  backdrop-filter:blur(9px);
  border:2px dashed var(--line);
  box-shadow:9px 9px 0 rgba(25,38,23,.86);
}

.prose > *:first-child{margin-top:0}
.prose div{
  scroll-margin-top:calc(var(--nav-h) + 22px);
  padding-top:10px;
  margin-top:34px;
  border-top:2px dotted var(--line);
}
.prose div:first-child{border-top:0;margin-top:0;padding-top:0}

.prose h2{
  position:relative;
  margin:0 0 12px;
  padding-left:19px;
  font-size:clamp(21px,3vw,29px);
  line-height:1.28;
  color:var(--ink);
}
.prose h2::before{
  content:"";
  position:absolute;
  left:0;
  top:.34em;
  width:12px;
  height:12px;
  background:var(--lime);
  clip-path:polygon(0 0,100% 0,50% 100%);
}

.prose h3{
  margin:24px 0 8px;
  font-size:19px;
  line-height:1.4;
}
.prose h3::before{content:"◆"; color:var(--sun); margin-right:8px; font-size:13px; vertical-align:2px}

.prose p{margin:0 0 14px}
.prose ul,.prose ol{margin:0 0 16px;padding-left:24px}
.prose li{margin:0 0 7px}
.prose a{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-color:var(--sun);
  text-decoration-thickness:3px;
  text-underline-offset:3px;
}
.prose a:hover{background:var(--sun)}
.prose blockquote{
  margin:18px 0;
  padding:12px 18px;
  border-left:6px solid var(--lime);
  background:rgba(255,206,92,.3);
}
.prose blockquote p:last-child{margin:0}
.prose img{display:block;margin:16px 0;border:2px solid var(--ink)}
.prose table{width:100%;border-collapse:collapse;font-size:16px;margin:0 0 16px}
.prose th,.prose td{border:1px dotted var(--line);padding:8px 10px;text-align:left}
.prose th{background:rgba(135,255,113,.35)}
.prose code{background:rgba(25,38,23,.1);padding:1px 5px;font-size:15px}
.prose pre{overflow-x:auto;padding:14px;background:var(--ink);color:var(--lime)}
.prose hr{border:0;border-top:2px dotted var(--line);margin:24px 0}

/* ---------- 右栏 ---------- */
.rail{
  position:sticky;
  top:calc(var(--nav-h) + 18px);
  padding:18px;
  background:rgba(255,206,92,.42);
  -webkit-backdrop-filter:blur(9px);
  backdrop-filter:blur(9px);
  border:2px solid var(--ink);
  box-shadow:7px 7px 0 var(--ink);
}

.rail h2{
  margin:0 0 6px;
  font-size:20px;
  letter-spacing:.05em;
  line-height:1.3;
}

.rail .subtitle{
  margin:0 0 14px;
  padding-bottom:12px;
  font-size:16px;
  color:#3c4d38;
  border-bottom:2px dotted var(--ink);
}

.rail-list{
  list-style:none;
  margin:0;
  padding:0;
  counter-reset:rail;
}
.rail-list li{counter-increment:rail}
.rail-list a{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:40px;
  padding:4px 0;
  font-size:16px;
  line-height:1.3;
  color:var(--ink);
  text-decoration:none;
  border-bottom:1px dotted rgba(25,38,23,.35);
  transition:transform .18s ease,background .18s ease;
}
.rail-list a::before{
  content:counter(rail,decimal-leading-zero);
  font-size:12px;
  letter-spacing:.06em;
  color:#546a4f;
  flex:none;
}
.rail-list a:hover{transform:translateX(5px);background:rgba(255,255,255,.55)}

/* ---------- 页脚 ---------- */
.foot{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px 28px;
  padding:22px clamp(14px,5vw,48px);
  background:var(--ink);
  color:var(--lime);
  border-top:5px solid var(--sun);
}

.foot dl{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:2px 13px;
  margin:0;
}
.foot dt{
  font-size:13px;
  letter-spacing:.08em;
  color:var(--sun);
  opacity:.85;
}
.foot dd{margin:0}
.foot dd a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  font-size:16px;
  color:var(--lime);
  text-decoration:none;
}
.foot dd a:hover,.foot dd a:focus-visible{color:var(--sun);text-decoration:underline;text-underline-offset:4px}

.foot-copy{
  display:flex;
  align-items:center;
  gap:16px;
  font-size:16px;
}
.top-link{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 12px;
  color:var(--ink);
  background:var(--lime);
  text-decoration:none;
  border:2px solid var(--sun);
}
.top-link:hover{background:var(--sun)}

/* ---------- 动效 ---------- */
.fx{opacity:0;transform:translateY(16px)}
.fx.in{
  opacity:1;
  transform:none;
  transition:opacity .5s ease,transform .55s cubic-bezier(.2,.8,.3,1);
}

/* ---------- 断点 ---------- */
@media (max-width:900px){
  .article-shell{grid-template-columns:1fr;gap:28px}
  .rail{position:static;order:2}
  .hero::after{left:auto;right:8%;top:auto;bottom:12%}
}

@media (max-width:720px){
  html{scroll-padding-top:12px}
  .masthead{position:static}
  .strip{font-size:13px;letter-spacing:.1em;padding:6px 10px}
  .bar{grid-template-columns:1fr;justify-items:center;gap:0;padding:8px 8px 12px}
  .brand{order:-1;font-size:19px;margin-bottom:2px}
  .nav{width:100%;justify-content:center}
  .nav-left,.nav-right{justify-content:center}
  .nav-link{padding:6px 8px;min-height:42px}
  .hero{
    grid-template-columns:1fr;
    min-height:0;
    padding:42px 18px 58px;
    gap:28px;
  }
  .hero-num{font-size:clamp(88px,32vw,150px);top:0;right:5%}
  .hero::before{width:150px;height:150px;left:-56px;bottom:-56px}
  .hero::after{width:78px;height:78px;border-width:4px}
  .shot{grid-column:1;grid-row:auto;width:100%;max-width:420px;min-height:150px}
  .shot-img{min-height:150px}
  .shot-a{transform:rotate(-3deg);justify-self:start}
  .shot-b{transform:rotate(3deg) translate(0,0);justify-self:end}
  .shot-a:hover{transform:rotate(-1deg) scale(1.02)}
  .shot-b:hover{transform:rotate(1deg) scale(1.02)}
  .article-shell{padding:26px 13px 40px}
  .prose{padding:17px;box-shadow:6px 6px 0 rgba(25,38,23,.86)}
  .foot{flex-direction:column;align-items:flex-start;gap:10px}
}

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

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