:root{
  --bg0:#05070c;
  --bg1:#070a12;
  --panel:#0b1020;
  --panel2:#0a0f1c;
  --stroke:rgba(255,255,255,.08);
  --stroke2:rgba(255,255,255,.12);
  --text:#e8eefc;
  --muted:rgba(232,238,252,.66);

  --lava:#ff4b2b;
  --ice:#22d3ee;

  --shadow: 0 18px 60px rgba(0,0,0,.62);
  --shadow2: 0 10px 30px rgba(0,0,0,.45);

  --r:18px;
  --r2:22px;

  --pad:18px;
  --pad2:22px;

  --wSide: 340px;
  --wToc: 260px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:radial-gradient(1200px 800px at 20% 10%, rgba(34,211,238,.12), transparent 50%),
             radial-gradient(1200px 800px at 85% 20%, rgba(255,75,43,.10), transparent 55%),
             linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow:hidden;
}

.bg{
  position:fixed; inset:0;
  pointer-events:none;
  background:
    radial-gradient(900px 600px at 20% 15%, rgba(34,211,238,.10), transparent 60%),
    radial-gradient(900px 600px at 90% 20%, rgba(255,75,43,.09), transparent 60%),
    radial-gradient(900px 900px at 50% 110%, rgba(255,255,255,.05), transparent 55%);
  filter:saturate(1.05);
}

.app{
  position:relative;
  height:100%;
  display:flex;
}

.sidebar{
  width:var(--wSide);
  border-right:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(11,16,32,.92), rgba(7,10,18,.90));
  box-shadow: var(--shadow2);
  padding:22px 18px 18px 18px;
  overflow:auto;
}

.brand{
  display:flex;
  gap:14px;
  align-items:center;
  padding:12px 12px;
  border:1px solid var(--stroke);
  border-radius:var(--r2);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}
.brandLogo{
  width:38px; height:38px; border-radius:12px;
  box-shadow:0 10px 25px rgba(0,0,0,.35);
}
.brandTitle{font-weight:800; letter-spacing:.2px}
.brandSub{font-size:12px; color:var(--muted); margin-top:2px}

.searchWrap{margin-top:14px}
.search{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--stroke);
  outline:none;
  color:var(--text);
  background:rgba(255,255,255,.03);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.search:focus{
  border-color:rgba(34,211,238,.35);
  box-shadow:0 0 0 4px rgba(34,211,238,.10);
  transform:translateY(-1px);
}

.nav{margin-top:16px; display:flex; flex-direction:column; gap:8px}

.scriptGroup{
  border:1px solid var(--stroke);
  border-radius:var(--r2);
  overflow:hidden;
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}

.groupHead{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 14px;
  cursor:pointer;
  user-select:none;
}
.groupHead:hover{background:rgba(255,255,255,.03)}
.groupMeta{display:flex; flex-direction:column; gap:2px}
.groupTitle{font-weight:780}
.groupSub{font-size:12px; color:var(--muted)}
.chev{
  width:26px; height:26px;
  border-radius:10px;
  border:1px solid var(--stroke);
  display:grid; place-items:center;
  background:rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.scriptGroup.open .chev{transform:rotate(180deg)}
.chev:before{
  content:"";
  width:0; height:0;
  border-left:6px solid transparent;
  border-right:6px solid transparent;
  border-top:7px solid rgba(232,238,252,.65);
  transform:translateY(1px);
}

.groupBody{
  max-height:0;
  overflow:hidden;
  transition:max-height .22s ease;
}
.scriptGroup.open .groupBody{max-height:520px}

.sectionLink{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px 12px 18px;
  text-decoration:none;
  color:rgba(232,238,252,.88);
  border-top:1px solid rgba(255,255,255,.06);
  transition: background .16s ease, transform .16s ease;
}
.sectionLink:hover{background:rgba(255,255,255,.03)}
.sectionLink.active{
  background:linear-gradient(90deg, rgba(34,211,238,.16), rgba(255,75,43,.10));
  box-shadow:inset 3px 0 0 rgba(34,211,238,.55);
}
.sectionLink .t{font-weight:650}
.sectionLink .k{font-size:12px; color:var(--muted)}

.sideFooter{margin-top:14px; padding:10px 12px}
.hint{font-size:12px; color:rgba(232,238,252,.48)}

.main{
  flex:1;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 22px;
  border-bottom:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(7,10,18,.60), rgba(7,10,18,.20));
}
.crumbs{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.crumbTitle{font-weight:900; letter-spacing:.2px; font-size:18px}
.crumbSub{font-size:12px; color:var(--muted)}
.topActions{display:flex; gap:10px}

.btn{
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover{transform:translateY(-1px); border-color:rgba(255,255,255,.14)}
.btn:active{transform:translateY(0px)}
.btn.ghost{background:transparent}

.contentWrap{
  position:relative;
  flex:1;
  display:flex;
  gap:18px;
  padding:22px;
  overflow:auto;
}

.card{
  flex:1;
  min-width:0;
  border-radius:24px;
  border:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(11,16,32,.82), rgba(10,15,28,.74));
  box-shadow:var(--shadow);
  overflow:hidden;
}
.cardInner{
  padding:28px 28px 26px 28px;
}

.doc{max-width:860px}
.doc h1{margin:0 0 10px 0; font-size:30px; letter-spacing:.2px}
.doc h2{margin:26px 0 10px 0; font-size:18px}
.doc h3{margin:22px 0 8px 0; font-size:15px}
.doc p{margin:0; line-height:1.65; color:rgba(232,238,252,.84)}
.doc ul{margin:10px 0 0 18px; padding:0}
.doc li{margin:8px 0; line-height:1.55; color:rgba(232,238,252,.84)}
.doc a{color:rgba(34,211,238,.92)}
.doc a:hover{color:rgba(255,75,43,.90)}

.sp{height:10px}

.inl{
  font-family:var(--mono);
  font-size:12px;
  padding:2px 6px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.22);
}

.codeblock{
  margin:14px 0;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.22));
  overflow:hidden;
}
.codeblock pre{
  margin:0;
  padding:14px 16px 16px 16px;
  overflow:auto;
}
.codeblock code{
  font-family:var(--mono);
  font-size:12px;
  line-height:1.55;
  color:rgba(232,238,252,.90);
  display:block;
  white-space:pre;
}
.copybtn{
  float:right;
  margin:10px 10px 0 0;
  border-radius:12px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.05);
  color:rgba(232,238,252,.88);
  cursor:pointer;
  transition: transform .16s ease, border-color .16s ease;
}
.copybtn:hover{transform:translateY(-1px); border-color:rgba(34,211,238,.35)}

.toc{
  width:var(--wToc);
  flex:0 0 var(--wToc);
  border-radius:22px;
  border:1px solid var(--stroke);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  padding:14px;
  height:fit-content;
  position:sticky;
  top:22px;
  box-shadow:var(--shadow2);
}
.toc.hidden{display:none}
.tocTitle{font-weight:800; font-size:12px; color:rgba(232,238,252,.72); margin-bottom:10px}
.toc a{
  display:block;
  text-decoration:none;
  color:rgba(232,238,252,.78);
  font-size:12px;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid transparent;
  transition: background .14s ease, border-color .14s ease;
}
.toc a:hover{
  background:rgba(255,255,255,.03);
  border-color:rgba(255,255,255,.06);
}
.toc a.active{
  background:rgba(34,211,238,.10);
  border-color:rgba(34,211,238,.22);
}

.fadeIn{
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn{
  from{opacity:0; transform:translateY(6px)}
  to{opacity:1; transform:translateY(0)}
}

@media (max-width: 1100px){
  .toc{display:none}
  :root{ --wSide: 320px; }
}
@media (max-width: 860px){
  body{overflow:auto}
  .app{flex-direction:column}
  .sidebar{
    width:100%;
    position:sticky;
    top:0;
    z-index:20;
    max-height:44vh;
  }
  .contentWrap{padding:16px}
  .cardInner{padding:22px}
}