@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;500;600;700&family=Varela+Round&display=swap');

:root{
  --green:#00ff80;
  --blue:#0000ff;
  --ink:#000000;
  --paper:#f4f6f2;
  --radius:18px;
  --edge:3px solid var(--ink);
  --sans:"Nunito Sans","Varela Round",system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
  --round:"Varela Round","Nunito Sans",system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
}

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

html{
  scroll-behavior:smooth;
  scroll-padding-bottom:120px;
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  padding-bottom:104px;
  background-color:var(--green);
  background-image:
    linear-gradient(to right,rgba(0,0,0,.14) 1px,transparent 1px),
    linear-gradient(to bottom,rgba(0,0,0,.14) 1px,transparent 1px);
  background-size:64px 64px;
  color:var(--ink);
  font-family:var(--sans);
  font-size:17px;
  line-height:1.62;
  overflow-x:hidden;
}

img{max-width:100%;height:auto;display:block}
a{color:inherit}
::selection{background:var(--blue);color:#fff}

:focus-visible{outline:4px solid var(--blue);outline-offset:3px}

h1,h2,h3,h4{
  font-family:var(--round);
  font-weight:700;
  line-height:1.16;
  letter-spacing:.01em;
  margin:0 0 .55em;
}
h1{font-size:clamp(2rem,5.6vw,3.9rem)}
h2{font-size:clamp(1.45rem,2.9vw,2.1rem)}
h3{font-size:1.22rem}

.skip{
  position:absolute;
  left:12px;
  top:-90px;
  z-index:80;
  background:var(--ink);
  color:var(--green);
  border:var(--edge);
  border-radius:var(--radius);
  padding:12px 18px;
  min-height:44px;
  font-weight:700;
  text-decoration:none;
}
.skip:focus{top:12px}

.wrap{
  width:100%;
  max-width:1160px;
  margin:0 auto;
  padding:18px clamp(14px,3vw,32px) 32px;
}

/* ---------- 首屏 ---------- */
.hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.03fr);
  align-items:center;
  gap:clamp(18px,3.5vw,40px);
  min-height:calc(100vh - 170px);
  min-height:calc(100svh - 170px);
  padding:22px 0 44px;
  border-bottom:6px solid var(--ink);
}

.hero-media{
  position:relative;
  border:4px solid var(--ink);
  border-radius:var(--radius);
  background:var(--blue);
  min-height:300px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:10px 10px 0 var(--ink);
}
.hero-media .hero-img{
  width:100%;
  height:100%;
  max-height:min(60vh,520px);
  object-fit:cover;
  border-radius:14px;
}
.hero-fallback{
  width:100%;
  min-height:300px;
  display:grid;
  place-items:center;
  padding:26px;
  background:
    repeating-linear-gradient(45deg,rgba(0,255,128,.18) 0 14px,transparent 14px 28px),
    var(--blue);
  color:var(--green);
  border-radius:14px;
  font-family:var(--round);
  font-size:clamp(1.5rem,4vw,2.4rem);
  text-align:center;
  word-break:break-word;
}
.badge{
  position:absolute;
  left:-12px;
  top:16px;
  background:var(--green);
  border:var(--edge);
  border-radius:var(--radius);
  padding:9px 15px;
  font-weight:700;
  font-size:.95rem;
  transform:rotate(-4deg);
  box-shadow:6px 6px 0 var(--ink);
}

.hero-text{text-align:center}
.hero-text h1{margin-bottom:.3em}
.hero-desc{
  font-size:1.05rem;
  max-width:40ch;
  margin:0 auto 1.5em;
}
.hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  justify-content:center;
  margin:0;
}

.btn-hero,
.btn-ghost{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:50px;
  padding:13px 26px;
  border:var(--edge);
  border-radius:var(--radius);
  font-family:var(--round);
  font-weight:700;
  font-size:1rem;
  text-decoration:none;
}
.btn-hero{
  background:var(--ink);
  color:var(--green);
  box-shadow:7px 7px 0 var(--blue);
}
.btn-hero:hover{background:var(--blue);color:#fff;box-shadow:7px 7px 0 var(--ink)}
.btn-ghost{background:#fff;color:var(--ink);box-shadow:7px 7px 0 var(--ink)}
.btn-ghost:hover{background:var(--green)}

/* ---------- 正文 + 侧栏 ---------- */
.body-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 292px;
  gap:clamp(18px,3vw,36px);
  align-items:start;
  padding-top:36px;
}

.prose{
  min-width:0;
  background:var(--paper);
  border:4px solid var(--ink);
  border-radius:var(--radius);
  padding:clamp(18px,3vw,34px);
  overflow-wrap:break-word;
}

.prose article[id]{
  padding:8px 0 30px;
  border-top:4px solid var(--ink);
  scroll-margin-top:24px;
}
.prose article[id]:first-child{border-top:0;padding-top:0}
.prose article[id]:last-child{padding-bottom:4px}

.prose h2{
  display:inline-block;
  background:var(--green);
  border:var(--edge);
  border-radius:14px;
  padding:7px 16px;
  margin-bottom:.7em;
  font-size:clamp(1.4rem,2.6vw,1.95rem);
}
.prose h3{margin-top:1.4em}
.prose p{margin:0 0 1.05em}
.prose ul,.prose ol{margin:0 0 1.1em;padding-left:1.35em}
.prose li{margin:.4em 0}
.prose a{color:var(--blue);font-weight:700;text-underline-offset:3px}
.prose strong{background:linear-gradient(transparent 60%,var(--green) 60%)}
.prose blockquote{
  margin:1.2em 0;
  padding:14px 18px;
  background:#fff;
  border-left:8px solid var(--blue);
  border-radius:12px;
}
.prose img{border:var(--edge);border-radius:12px;margin:1em 0}
.prose hr{border:0;border-top:4px dashed var(--ink);margin:1.6em 0}
.prose code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.94em;
  background:#fff;
  border:2px solid var(--ink);
  border-radius:8px;
  padding:1px 6px;
}

.side{
  display:flex;
  flex-direction:column;
  gap:12px;
  position:sticky;
  top:18px;
}
.side h2{
  align-self:flex-start;
  margin:0;
  font-size:1.08rem;
  background:var(--ink);
  color:var(--green);
  padding:9px 18px;
  border-radius:14px;
}
.side .subtitle{
  margin:0;
  font-size:.86rem;
  font-weight:700;
  letter-spacing:.16em;
}
.side-list{
  list-style:none;
  margin:2px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.sticker{
  background:#fff;
  border:var(--edge);
  border-bottom:8px solid var(--blue);
  border-radius:var(--radius);
}
.sticker:nth-child(even){border-bottom-color:var(--ink)}
.sticker a{
  display:block;
  min-height:46px;
  padding:13px 16px;
  font-weight:700;
  text-decoration:none;
  border-radius:14px;
}
.sticker a:hover{background:var(--blue);color:#fff}

/* ---------- 页脚 ---------- */
.foot{
  margin-top:52px;
  padding:clamp(24px,4vw,46px) clamp(16px,3vw,40px) 26px;
  background:var(--ink);
  color:var(--green);
  border-top:8px solid var(--blue);
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:18px clamp(14px,2.4vw,26px);
}
.foot-cta{
  grid-column:1/-1;
  margin:0 0 8px;
  font-family:var(--round);
  font-size:clamp(1.25rem,3vw,1.9rem);
  line-height:1.2;
}
.foot-cta .btn-hero{
  background:var(--green);
  color:var(--ink);
  box-shadow:7px 7px 0 var(--blue);
}
.foot-cta .btn-hero:hover{background:#fff;box-shadow:7px 7px 0 var(--green)}
.foot-brand{
  margin:0;
  font-family:var(--round);
  font-size:1.05rem;
  border-left:5px solid var(--green);
  padding-left:10px;
}
.foot-col{
  margin:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  font-weight:700;
}
.foot-col a{
  display:inline-block;
  min-height:42px;
  padding:11px 2px;
  text-decoration:none;
  border-bottom:2px dashed rgba(0,255,128,.55);
  font-size:.97rem;
}
.foot-col a:hover{background:var(--green);color:var(--ink);border-bottom-color:var(--ink)}
.foot-note{
  grid-column:1/-1;
  display:block;
  margin-top:6px;
  padding-top:16px;
  border-top:3px solid var(--green);
  text-align:center;
  font-size:.95rem;
}
.foot-note a{
  display:inline-block;
  min-height:42px;
  padding:11px 6px;
  font-weight:700;
  text-underline-offset:3px;
}

/* ---------- 底部固定导航 ---------- */
.bottom-bar{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:70;
  background:var(--ink);
  border-top:8px solid var(--green);
  padding:8px clamp(10px,2vw,20px) calc(8px + env(safe-area-inset-bottom));
}
.bottom{max-width:1160px;margin:0 auto}
.bar-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  align-items:center;
  gap:4px;
}
.nav-brand a{
  display:inline-block;
  min-height:44px;
  padding:11px 12px;
  font-family:var(--round);
  font-weight:700;
  font-size:1.03rem;
  color:var(--green);
  text-decoration:none;
  white-space:nowrap;
}
.bar-item{position:relative;flex:0 0 auto}
.bar-link{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:11px 11px;
  color:#fff;
  font-weight:700;
  font-size:.95rem;
  text-decoration:none;
  white-space:nowrap;
  border-bottom:4px solid transparent;
}
.bar-link:hover{color:var(--green);border-bottom-color:var(--green)}
.nav-cta{margin-left:auto;padding-left:8px;flex:0 0 auto}
.btn-cta{
  display:inline-flex;
  align-items:center;
  min-height:46px;
  padding:11px 18px;
  background:var(--green);
  border:var(--edge);
  border-radius:var(--radius);
  color:var(--ink);
  font-family:var(--round);
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}
.btn-cta:hover{background:var(--blue);border-color:var(--blue);color:#fff}

.dip{position:static;display:inline-block}
.dip summary{
  list-style:none;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:10px 13px;
  background:var(--blue);
  border:2px solid var(--green);
  border-radius:14px;
  color:#fff;
  font-weight:700;
  font-size:.9rem;
  white-space:nowrap;
}
.dip summary::-webkit-details-marker{display:none}
.dip summary::after{content:" ▾";font-size:.85em}
.dip[open] summary::after{content:" ▴"}
.dip-list{
  position:absolute;
  bottom:calc(100% + 10px);
  left:0;
  margin:0;
  padding:6px;
  min-width:158px;
  list-style:none;
  background:var(--ink);
  border:3px solid var(--green);
  border-radius:14px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.dip-list a{
  display:block;
  min-height:42px;
  padding:10px 12px;
  color:#fff;
  font-weight:700;
  font-size:.93rem;
  text-decoration:none;
  border-radius:10px;
}
.dip-list a:hover{background:var(--green);color:var(--ink)}

/* ---------- 动效 ---------- */
html.js .rv{opacity:0;transform:translateY(16px)}
html.js .rv.in{
  opacity:1;
  transform:none;
  transition:opacity .2s steps(3,end),transform .2s ease-out;
  transition-delay:calc(var(--i,0) * 55ms);
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  html.js .rv{opacity:1;transform:none;transition:none}
}

/* ---------- 断点 ---------- */
@media (max-width:900px){
  .body-grid{grid-template-columns:minmax(0,1fr)}
  .side{position:static;order:2;margin-top:6px}
  .side-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .hero{
    grid-template-columns:minmax(0,1fr);
    min-height:0;
    padding-top:14px;
    gap:20px;
  }
  .hero-text{order:-1}
  .hero-media{min-height:200px}
  .hero-media .hero-img{max-height:38vh}
  .hero-fallback{min-height:200px;font-size:1.3rem}
}

@media (max-width:760px){
  .bar-list{overflow-x:auto;scrollbar-width:none}
  .bar-list::-webkit-scrollbar{display:none}
  .dip{display:none}
  .foot{grid-template-columns:repeat(2,minmax(0,1fr))}
  .foot-brand{grid-column:1/-1}
}

@media (max-width:520px){
  body{font-size:16.5px}
  .wrap{padding-left:12px;padding-right:12px}
  .hero-actions{flex-direction:column;align-items:stretch}
  .btn-hero,.btn-ghost{width:100%}
  .foot{grid-template-columns:minmax(0,1fr)}
  .side-list{grid-template-columns:minmax(0,1fr)}
  .badge{left:8px;top:8px;transform:rotate(-2deg)}
  .hero-media{box-shadow:7px 7px 0 var(--ink)}
}

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