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

:root{
  --black:#000000;
  --panel:#0a0a0a;
  --panel-2:#121212;
  --line:#232323;
  --line-hot:#3d3d3d;
  --txt:#eaeaea;
  --dim:#9a9a9a;
  --neon:#7cf86b;
  --gold:#ffd166;
  --blue:#4fc3ff;
  --r:10px;
  color-scheme:dark;
  --slice:#121826;
}

*{box-sizing:border-box}
[hidden]{display:none !important}

html{
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
  overflow-x:hidden;
  max-width:100%;
}

body{
  margin:0;
  background:var(--black);
  color:var(--txt);
  font-family:'VT323','PingFang SC','Hiragino Sans GB','Microsoft YaHei',system-ui,sans-serif;
  font-size:18px;
  line-height:1.75;
  letter-spacing:.01em;
  overflow-x:hidden;
  max-width:100%;
}

h1,h2,h3{
  font-family:'Press Start 2P','VT323','PingFang SC','Microsoft YaHei',system-ui,sans-serif;
  font-weight:400;
  letter-spacing:.02em;
}

a{color:var(--txt);text-decoration:none}
img{max-width:100%;height:auto;display:block}
hr{border:0;height:1px;background:var(--line)}
:focus-visible{outline:2px solid var(--neon);outline-offset:3px}

.sr{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}

/* ---------- 左侧固定竖排栏 ---------- */
main{margin-left:268px;min-width:0}

.masthead{
  position:fixed;
  top:0;bottom:0;left:0;
  width:268px;
  z-index:60;
  display:flex;
  flex-direction:column;
  gap:20px;
  padding:26px 20px 30px;
  background:#050505;
  border-right:1px solid var(--line);
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
}

.brand{
  display:flex;align-items:center;
  min-height:46px;
  padding:4px 0;
  font-family:'Press Start 2P','VT323','PingFang SC','Microsoft YaHei',system-ui,sans-serif;
  font-size:15px;
  line-height:1.55;
  letter-spacing:.04em;
  color:#ffffff;
  text-shadow:0 0 14px rgba(124,248,107,.5);
}
.brand:hover{color:var(--neon)}

.find{display:block;min-width:0}
.find input{
  width:100%;
  min-height:44px;
  padding:10px 12px;
  background:#000000;
  border:1px solid var(--line);
  border-radius:var(--r);
  color:var(--txt);
  font-family:inherit;
  font-size:16px;
  line-height:1.4;
}
.find input::placeholder{color:#6b6b6b}
.find input:focus{border-color:var(--neon);outline:none}

.tabs{flex:1 1 auto;min-width:0}

.tabs-list{
  list-style:none;
  margin:0;padding:0;
  display:flex;
  flex-direction:column;
  gap:2px;
  counter-reset:t;
  max-width:100%;
}
.tabs-list li{counter-increment:t;display:block}
.tabs-list li a{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:10px 10px;
  border:1px solid transparent;
  border-radius:var(--r);
  font-size:17px;
  line-height:1.4;
  transition:background .18s ease,border-color .18s ease,color .18s ease;
}
.tabs-list li a::before{
  content:counter(t,decimal-leading-zero);
  font-family:'VT323',monospace;
  font-size:15px;
  letter-spacing:.1em;
  color:#5d5d5d;
}
.tabs-list li a:hover,
.tabs-list li a:focus-visible{
  background:#0d0d0d;
  border-color:var(--line-hot);
  color:#ffffff;
}
.tabs-list li a[aria-current="true"]{
  color:var(--neon);
  border-color:var(--neon);
  background:#060d05;
  text-shadow:0 0 10px rgba(124,248,107,.45);
}

/* ---------- 首屏 ---------- */
.hero{
  position:relative;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:20px;
  padding:92px 42px 70px;
  overflow:hidden;
  border-bottom:1px solid var(--line);
}
.hero::after{
  content:"";
  position:absolute;
  inset:auto 0 0 0;
  height:1px;
  background:linear-gradient(90deg,var(--neon),transparent 65%);
}

.ghost{
  position:absolute;
  left:-1vw;
  top:50%;
  transform:translateY(-50%);
  font-family:'Press Start 2P','VT323','PingFang SC','Microsoft YaHei',system-ui,sans-serif;
  font-size:clamp(58px,13vw,196px);
  line-height:1;
  letter-spacing:.02em;
  white-space:nowrap;
  color:transparent;
  -webkit-text-stroke:1px #1d1d1d;
  pointer-events:none;
  user-select:none;
  max-width:none;
}

.hero h1{
  position:relative;
  margin:0;
  max-width:22ch;
  font-size:clamp(30px,5.4vw,66px);
  line-height:1.24;
  color:#ffffff;
  text-shadow:0 0 26px rgba(124,248,107,.35);
  overflow-wrap:anywhere;
}

.hero-sub{
  position:relative;
  margin:0;
  max-width:54ch;
  font-size:17px;
  color:var(--dim);
  overflow-wrap:anywhere;
}

@keyframes rise{
  from{opacity:0;transform:translateY(14px)}
  to{opacity:1;transform:none}
}
.hero h1,.hero-sub{animation:rise .7s ease both}

/* ---------- 正文 + 右侧栏 ---------- */
.body{
  display:grid;
  grid-template-columns:minmax(0,1fr) 292px;
  gap:34px;
  align-items:start;
  max-width:1180px;
  margin:0 auto;
  padding:56px 42px 84px;
  min-width:0;
}

.prose{min-width:0;max-width:100%}
.prose *{max-width:100%}

.prose div{
  border:1px solid var(--line);
  border-radius:var(--r);
  background:var(--panel);
  padding:26px 24px;
  margin:0 0 24px;
  min-width:0;
}
.prose div:last-child{margin-bottom:0}
.prose div[id]{scroll-margin-top:28px}

.prose h2{
  margin:0 0 8px;
  font-size:22px;
  line-height:1.38;
  color:#ffffff;
  overflow-wrap:anywhere;
}
.prose h3{
  margin:24px 0 6px;
  font-size:18px;
  line-height:1.45;
  color:var(--gold);
  overflow-wrap:anywhere;
}
.prose hr{
  height:1px;
  margin:0 0 16px;
  background:linear-gradient(90deg,var(--neon),rgba(124,248,107,0) 72%);
}
.prose p{margin:0 0 14px}
.prose p:last-child{margin-bottom:0}
.prose p,.prose li,.prose td,.prose th,.prose blockquote,.prose figcaption{
  overflow-wrap:anywhere;
  word-break:normal;
}
.prose a{
  color:var(--neon);
  text-decoration:underline;
  text-underline-offset:3px;
  overflow-wrap:anywhere;
}
.prose a:hover{color:#ffffff}
.prose ul,.prose ol{margin:0 0 16px;padding-left:1.35em}
.prose li{margin:0 0 8px}
.prose strong{color:#ffffff}
.prose blockquote{
  margin:0 0 16px;
  padding:12px 16px;
  border-left:2px solid var(--gold);
  border-radius:0 var(--r) var(--r) 0;
  background:#0e0e0e;
  color:#d8d8d8;
}

/* 宽内容自适应：表格 / 代码 / 嵌入播放器 */
.prose table{
  display:block;
  width:100%;
  max-width:100%;
  overflow-x:auto;
  border-collapse:collapse;
  margin:0 0 16px;
  font-size:16px;
  -webkit-overflow-scrolling:touch;
}
.prose th,.prose td{border:1px solid var(--line);padding:8px 10px;text-align:left}
.prose th{background:#101010;color:var(--gold)}
.prose pre{
  display:block;
  max-width:100%;
  overflow-x:auto;
  margin:0 0 16px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:var(--r);
  background:#0d0d0d;
  font-size:15px;
  line-height:1.6;
  -webkit-overflow-scrolling:touch;
}
.prose code{
  font-family:'VT323',ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:16px;
  overflow-wrap:anywhere;
}
.prose iframe,.prose video,.prose embed,.prose object{
  display:block;
  width:100%;
  max-width:100%;
  border:0;
  border-radius:var(--r);
  background:#0b0b0b;
  aspect-ratio:16 / 9;
}
.prose figure{margin:0 0 16px;min-width:0}
.prose figcaption{font-size:15px;color:var(--dim);margin-top:6px}
.prose img{border:1px solid var(--line);border-radius:var(--r)}
.prose time{color:var(--gold);font-size:15px}

.side{
  position:sticky;
  top:26px;
  border:1px solid var(--line);
  border-radius:var(--r);
  background:#070707;
  padding:20px 18px;
  min-width:0;
}
.side-title{margin:0 0 8px;font-size:15px;line-height:1.5;color:#ffffff}
.side hr{height:1px;margin:0 0 10px;background:linear-gradient(90deg,var(--blue),rgba(79,195,255,0) 72%)}
.side-list{list-style:none;margin:0;padding:0}
.side-list li a{
  display:block;
  min-height:42px;
  padding:10px 6px;
  border-bottom:1px dashed #1a1a1a;
  font-size:16px;
  line-height:1.4;
  color:var(--dim);
  overflow-wrap:anywhere;
  transition:color .18s ease,padding-left .18s ease;
}
.side-list li:last-child a{border-bottom:0}
.side-list li a:hover{color:var(--neon);padding-left:12px}

/* ---------- 页脚 ---------- */
.foot{
  display:flex;
  flex-wrap:wrap;
  gap:30px;
  align-items:flex-start;
  justify-content:space-between;
  padding:52px 42px 34px;
  border-top:1px solid var(--line);
  background:#050505;
  min-width:0;
}

.foot-brand{
  flex:1 1 240px;
  display:flex;
  flex-direction:column;
  gap:16px;
  max-width:340px;
  min-width:0;
}
.foot-logo{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  font-family:'Press Start 2P','VT323','PingFang SC','Microsoft YaHei',system-ui,sans-serif;
  font-size:14px;
  line-height:1.5;
  letter-spacing:.04em;
  color:#ffffff;
  overflow-wrap:anywhere;
}
.foot-logo:hover{color:var(--neon)}

.cta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-height:66px;
  padding:18px 20px;
  border:1px solid var(--neon);
  border-radius:var(--r);
  background:#060d05;
  color:var(--neon);
  font-size:18px;
  letter-spacing:.06em;
  transition:background .2s ease,color .2s ease,box-shadow .2s ease;
}
.cta::after{
  content:"↑";
  font-family:'VT323',monospace;
  font-size:24px;
  line-height:1;
}
.cta:hover{
  background:var(--neon);
  color:#001a00;
  box-shadow:0 0 22px rgba(124,248,107,.28);
}

.foot-nav{flex:1 1 260px;min-width:0}
.foot-list{
  list-style:none;
  margin:0;padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:6px 10px;
  max-width:100%;
}
.foot-list li{display:block}
.foot-list a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:6px 12px;
  border:1px solid var(--line);
  border-radius:var(--r);
  font-size:16px;
  color:var(--dim);
  transition:color .18s ease,border-color .18s ease;
}
.foot-list a:hover{color:#ffffff;border-color:var(--line-hot)}

.foot-legal{
  flex:0 0 auto;
  align-self:flex-end;
  font-size:15px;
  color:#6a6a6a;
  letter-spacing:.04em;
  overflow-wrap:anywhere;
}

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

/* ---------- 窄屏 ---------- */
@media (max-width:1080px){
  .body{grid-template-columns:minmax(0,1fr);gap:26px}
  .side{position:static}
}

@media (max-width:900px){
  main{margin-left:0}
  .masthead{
    position:sticky;
    top:0;left:0;right:0;bottom:auto;
    width:auto;
    max-width:100%;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    gap:10px;
    padding:10px 14px;
    border-right:0;
    border-bottom:1px solid var(--line);
    overflow:visible;
  }
  .brand{font-size:13px;min-height:40px;flex:1 1 auto;min-width:0}
  .find{flex:0 0 138px;max-width:138px}
  .find input{min-height:40px;font-size:15px;padding:8px 10px}
  .tabs{flex:1 0 100%;max-width:100%;overflow:hidden}
  .tabs-list{
    flex-direction:row;
    gap:6px;
    overflow-x:auto;
    max-width:100%;
    padding-bottom:4px;
    scrollbar-width:thin;
    -webkit-overflow-scrolling:touch;
  }
  .tabs-list li{flex:0 0 auto}
  .tabs-list li a{
    white-space:nowrap;
    min-height:40px;
    padding:8px 12px;
    border-color:var(--line);
    font-size:16px;
  }
  .tabs-list li a::before{display:none}
  .hero{min-height:calc(100svh - 132px);padding:44px 18px 40px}
  .ghost{font-size:clamp(48px,17vw,110px)}
  .hero h1{font-size:clamp(28px,8vw,44px)}
  .body{padding:32px 16px 56px}
  .prose div{padding:20px 16px}
  .prose div[id]{scroll-margin-top:140px}
  .prose h2{font-size:20px}
  .prose h3{font-size:17px}
  .prose table{font-size:15px}
  .prose pre{font-size:14px}
  .foot{padding:34px 16px 26px;gap:22px}
  .foot-brand{max-width:none}
  .foot-legal{align-self:flex-start}
}

@media (max-width:420px){
  .body{padding:26px 12px 48px}
  .prose div{padding:18px 13px}
  .prose h2{font-size:19px}
  .prose blockquote{padding:10px 12px}
  .foot{padding:30px 12px 24px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js [data-reveal]{opacity:1;transform:none;transition:none}
  .hero h1,.hero-sub{animation:none}
  *{transition-duration:.01ms !important}
}
</style>

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