@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');

:root{
  --ink:#080d0b;
  --surf:#12201a;
  --deep:#192617;
  --green:#87ff71;
  --cyan:#01cdfe;
  --txt:#cbe8db;
  --dim:#8fb6a5;
  --edge:4px;
}

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

html{
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
  background:var(--ink);
}

body{
  margin:0;
  min-height:100vh;
  font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:17px;
  line-height:1.78;
  color:var(--txt);
  background:
    radial-gradient(900px 520px at 78% -8%,rgba(1,205,254,.16),transparent 62%),
    radial-gradient(760px 460px at -6% 4%,rgba(135,255,113,.12),transparent 60%),
    linear-gradient(180deg,var(--ink) 0%,#0b1410 46%,#070b09 100%);
  background-attachment:fixed;
  overflow-x:hidden;
}

body::before{
  content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background-image:
    linear-gradient(rgba(1,205,254,.07) 1px,transparent 1px),
    linear-gradient(90deg,rgba(1,205,254,.07) 1px,transparent 1px);
  background-size:56px 56px;
  -webkit-mask-image:linear-gradient(180deg,#000 0%,rgba(0,0,0,.34) 54%,transparent 92%);
  mask-image:linear-gradient(180deg,#000 0%,rgba(0,0,0,.34) 54%,transparent 92%);
  opacity:.9;
}

body::after{
  content:"";position:fixed;inset:0;z-index:70;pointer-events:none;
  background:repeating-linear-gradient(180deg,rgba(0,0,0,0) 0 2px,rgba(0,0,0,.22) 2px 4px);
  opacity:.38;
}

a{color:var(--cyan);text-decoration:none}
a:hover{color:var(--green);text-shadow:0 0 10px rgba(135,255,113,.55)}
a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(--green);outline-offset:3px}

.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* ---- 顶栏 ---- */
header.top{
  position:sticky;top:0;z-index:40;
  background:#070c0a;
  border-bottom:1px solid rgba(135,255,113,.22);
  box-shadow:0 14px 34px -26px #000;
}

.topbar{
  position:relative;z-index:52;
  display:flex;align-items:center;gap:10px;
  max-width:1180px;margin:0 auto;padding:8px 16px;
}

.brand{
  flex:0 1 auto;min-width:0;
  display:inline-flex;align-items:center;min-height:44px;
  padding-right:6px;
  font-size:16px;font-weight:500;letter-spacing:.02em;
  color:var(--green);
  text-shadow:0 0 16px rgba(135,255,113,.45);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

.find{position:relative;flex:1 1 auto;min-width:0;display:flex}

.find input{
  width:100%;height:40px;
  border:1px solid rgba(1,205,254,.34);
  border-radius:var(--edge);
  background:rgba(25,38,23,.6);
  color:var(--txt);
  font:inherit;font-size:16px;
  padding:0 10px;
  -webkit-appearance:none;appearance:none;
}
.find input::placeholder{color:#77998a}

.burger{
  flex:0 0 auto;min-width:62px;min-height:44px;padding:0 12px;
  border:1px solid rgba(135,255,113,.46);
  border-radius:var(--edge);
  background:linear-gradient(180deg,rgba(135,255,113,.16),rgba(1,205,254,.12));
  color:var(--green);
  font:inherit;font-size:16px;letter-spacing:.06em;
  cursor:pointer;
  transition:background .18s,color .18s;
}
.burger:hover{background:var(--green);color:#06140f}

/* ---- 锚点条 ---- */
.anchors{
  border-top:1px solid rgba(1,205,254,.16);
  background:linear-gradient(90deg,rgba(135,255,113,.08),rgba(1,205,254,.08));
}

.anchors p{
  display:flex;align-items:stretch;gap:2px;
  max-width:1180px;margin:0 auto;padding:0 8px;
  overflow-x:auto;
  scrollbar-width:none;
}
.anchors p::-webkit-scrollbar{display:none}

.anchors a{
  display:inline-flex;align-items:center;min-height:42px;
  padding:0 11px;
  font-size:16px;color:#a8d6c5;white-space:nowrap;
  border-bottom:2px solid transparent;
  border-radius:var(--edge) var(--edge) 0 0;
  transition:color .18s,background .18s,border-color .18s,text-shadow .18s;
}
.anchors a:hover,.anchors a:focus-visible{
  color:#06140f;background:var(--green);
  border-bottom-color:var(--cyan);
  text-shadow:none;
}

body.menu-open{overflow:hidden}
body.menu-open .anchors{
  position:fixed;inset:0;z-index:50;
  overflow-y:auto;
  border:0;
  padding:88px 18px 44px;
  background:rgba(6,11,9,.985);
}
body.menu-open .anchors p{
  flex-direction:column;gap:0;
  max-width:720px;margin:0 auto;overflow:visible;
}
body.menu-open .anchors a{
  width:100%;min-height:56px;padding:0 8px;
  font-size:18px;color:var(--green);
  border-bottom:1px solid rgba(1,205,254,.18);
  border-radius:0;
}

/* ---- 主区网格 ---- */
main.page{
  position:relative;z-index:1;
  max-width:1180px;margin:0 auto;
  padding:0 16px 76px;
  display:grid;
  grid-template-columns:232px minmax(0,1fr);
  column-gap:40px;
}

.hero{
  grid-column:1/-1;
  position:relative;
  min-height:45vh;
  display:flex;flex-direction:column;justify-content:flex-end;
  padding:44px 0 42px;
}

.hero h1{
  margin:0;
  font-size:clamp(28px,6.6vw,62px);
  line-height:1.12;
  font-weight:500;
  letter-spacing:-.012em;
  color:#eafff2;
  text-shadow:0 0 26px rgba(1,205,254,.45),0 0 64px rgba(135,255,113,.3);
  word-break:break-word;
}

.hero::before{
  content:"";position:absolute;left:0;right:0;bottom:14px;height:5px;
  background:linear-gradient(90deg,var(--green),var(--cyan) 58%,rgba(1,205,254,0));
  transform:skewY(-1.4deg);
  box-shadow:0 0 24px rgba(1,205,254,.5);
}

@media (prefers-reduced-motion:no-preference){
  .hero h1{animation:flick 7s linear infinite}
  @keyframes flick{
    0%,96%,100%{opacity:1}
    97%{opacity:.78}
    98.5%{opacity:.94}
  }
}

/* ---- 侧栏 ---- */
.rail{padding-top:6px}

.rail-h{
  margin:0 0 12px;
  font-size:16px;font-weight:500;letter-spacing:.14em;
  color:var(--cyan);
}
.rail-h span{
  display:inline-block;padding-bottom:6px;
  border-bottom:2px solid rgba(1,205,254,.4);
}
.rail-h--b{margin:22px 0 10px}

.rail-list{list-style:none;margin:0 0 6px;padding:0}
.rail-list li{border-bottom:1px dashed rgba(1,205,254,.14)}
.rail-list a{
  display:flex;align-items:center;min-height:42px;
  padding:0 2px;
  font-size:16px;color:#b6dfd0;
  transition:color .18s,transform .18s;
}
.rail-list a:hover{color:var(--green);transform:translateX(4px)}

.rail-top{
  display:inline-flex;align-items:center;min-height:42px;
  padding:0 12px;
  border:1px solid rgba(135,255,113,.36);
  border-radius:var(--edge);
  background:rgba(135,255,113,.07);
  color:var(--green);font-size:16px;
}

/* ---- 正文 ---- */
.doc{min-width:0;padding-top:6px}

.doc section{padding:2px 0 6px}
.doc section:first-child{padding-top:0}
.doc section:last-child{padding-bottom:24px}
.doc section + section{
  margin-top:46px;padding-top:38px;
  border-top:1px dashed rgba(1,205,254,.16);
}
.doc section[id]{scroll-margin-top:130px}

.doc h2{
  position:relative;
  margin:1.9em 0 .7em;
  font-size:clamp(22px,3.2vw,30px);
  line-height:1.36;font-weight:500;
  color:var(--green);
  text-shadow:0 0 20px rgba(135,255,113,.3);
}
.doc h2::before{
  content:"";display:block;width:46px;height:3px;margin-bottom:14px;
  background:linear-gradient(90deg,var(--cyan),transparent);
}
.doc h3{
  margin:1.6em 0 .55em;
  font-size:19px;font-weight:500;color:#d4ffe2;
  border-left:3px solid var(--cyan);
  padding-left:10px;
}

.doc p{margin:0 0 1.15em;max-width:68ch}
.doc ul,.doc ol{margin:0 0 1.2em;padding-left:1.4em}
.doc li{margin-bottom:.5em}
.doc li::marker{color:var(--cyan)}
.doc strong{color:#eafff2;font-weight:500}
.doc em{color:#d7f6ff}
.doc a{text-decoration:underline;text-decoration-color:rgba(1,205,254,.45);text-underline-offset:3px}

.doc blockquote{
  margin:0 0 1.2em;padding:12px 16px;
  border-left:3px solid var(--green);
  background:rgba(25,38,23,.62);
  border-radius:0 var(--edge) var(--edge) 0;
  color:#d9f2e6;
}

.doc code,.doc pre{
  font-family:inherit;
  background:rgba(1,205,254,.1);
  border-radius:var(--edge);
}
.doc code{padding:1px 5px;font-size:.94em}
.doc pre{padding:14px;overflow-x:auto;max-width:100%}

.doc img{max-width:100%;height:auto;border-radius:var(--edge);display:block;margin:0 0 1.2em}

.doc table{width:100%;border-collapse:collapse;margin:0 0 1.2em;font-size:16px}
.doc th,.doc td{border:1px solid rgba(1,205,254,.18);padding:8px 10px;text-align:left}
.doc th{background:rgba(1,205,254,.09);color:#d9ffe8}

.doc hr{border:0;border-top:1px dashed rgba(1,205,254,.24);margin:2em 0}

/* ---- 页脚 ---- */
footer.base{
  position:relative;z-index:1;
  max-width:1180px;margin:0 auto;
  padding:18px 16px 44px;
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;
  border-top:1px solid rgba(135,255,113,.2);
  font-size:16px;color:var(--dim);
}
footer.base p{margin:0}
footer.base small{font-size:16px}
footer.base small a{display:inline-flex;align-items:center;min-height:44px;padding:0 4px}

/* ---- 滚动显现 ---- */
.rv{opacity:0;transform:translateY(16px);transition:opacity .55s ease,transform .55s ease}
.rv.is-in{opacity:1;transform:none}

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

/* ---- 窄屏 ---- */
@media (max-width:880px){
  main.page{
    grid-template-columns:minmax(0,1fr);
    padding:0 16px 56px;
  }
  .hero{min-height:42vh;padding:36px 0 34px}
  .doc{order:1}
  .rail{
    order:2;margin-top:44px;padding-top:24px;
    border-top:1px dashed rgba(1,205,254,.16);
  }
  .doc section[id]{scroll-margin-top:112px}
  .topbar{gap:8px;padding:8px 12px}
  .burger{min-width:56px}
}

@media (max-width:400px){
  .find input{padding:0 8px}
  .rail-list a,.rail-top{font-size:16px}
}

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