
:root{
  --c1:#ff8f52; --c2:#3fc9bb; --bg:#070a0f;
  --grid:rgba(255,255,255,0.032);
  --muted:#8b96a6; --line:rgba(255,143,82,0.26);
  --ok:#22d39a; --warn:#ffcf4d; --bad:#ff5d6c; --q:#8fa7c8;
  --ink:#e9edf4; --ink2:#dfe4ec; --warm:#ffcd9e; --cool:#8fe6dc;
  --surf:rgba(14,18,25,0.72);
}
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg); color:var(--ink); position:relative;
  font-family:"PingFang SC","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  line-height:1.85; font-size:16px;
}
body::before{
  content:""; position:fixed; inset:0; z-index:0;
  background-image:linear-gradient(var(--grid) 1px,transparent 1px),
                   linear-gradient(90deg,var(--grid) 1px,transparent 1px);
  background-size:44px 44px; pointer-events:none;
}
body::after{
  content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(880px 620px at 8% 5%,rgba(255,143,82,0.135),transparent 62%),
             radial-gradient(820px 600px at 94% 88%,rgba(63,201,187,0.115),transparent 62%),
             radial-gradient(1100px 520px at 52% 106%,rgba(255,205,158,0.045),transparent 70%);
}
.wrap{position:relative; z-index:1; display:flex; max-width:1340px; margin:0 auto; padding:0 20px;}

/* ---------- 侧边目录 ---------- */
#toc{
  position:sticky; top:0; align-self:flex-start; width:300px; flex:0 0 300px;
  height:100vh; overflow-y:auto; padding:34px 16px 40px 0; font-size:13.5px;
}
#toc .brand{font-size:12px; color:var(--muted); letter-spacing:.6px; margin-bottom:6px;}
#toc .brand2{font-size:11.5px; color:#616c7d; margin-bottom:16px; letter-spacing:.2px;}
#toc .grp{font-size:11.5px; color:#737e90; letter-spacing:.8px; margin:18px 0 6px 12px;}
#toc a{display:block; color:var(--muted); text-decoration:none; padding:6px 12px; border-left:2px solid transparent;
  border-radius:0 6px 6px 0; transition:all .2s; line-height:1.45;}
#toc a:hover{color:#ffe4d2; background:rgba(255,143,82,0.075);}
#toc a.on{color:#fff; border-left-color:var(--c1); background:rgba(255,143,82,0.13);}
#toc a.hidden{display:none;}
#toc .num{color:var(--c2); font-weight:700; margin-right:7px; font-variant-numeric:tabular-nums;}
#toc::-webkit-scrollbar{width:6px;}
#toc::-webkit-scrollbar-track{background:transparent;}
#toc::-webkit-scrollbar-thumb{background:rgba(255,143,82,0.22); border-radius:3px;}
#toc::-webkit-scrollbar-thumb:hover{background:rgba(255,143,82,0.38);}
::selection{background:rgba(255,143,82,0.30); color:#fff;}

/* 目录内搜索框 */
.searchwrap{margin:0 0 6px 10px;}
#qsearch{
  width:100%; padding:7px 11px; font-size:13px; color:var(--ink);
  background:rgba(255,255,255,0.045); border:1px solid rgba(255,255,255,0.13);
  border-radius:8px; outline:none; transition:border-color .2s, background .2s;
  font-family:inherit;
}
#qsearch::placeholder{color:#5f6a7a;}
#qsearch:focus{border-color:rgba(255,143,82,0.55); background:rgba(255,143,82,0.06);}
.searchinfo{font-size:11.5px; color:#66717f; margin-top:5px; min-height:16px;}

/* ---------- 内容 ---------- */
main{flex:1; min-width:0; padding:40px 0 100px 34px; border-left:1px solid rgba(255,255,255,0.06);}
.hero{padding:16px 0 26px;}
.hero .kicker{display:inline-block; font-size:12px; letter-spacing:1.4px; color:var(--c1);
  border:1px solid var(--line); border-radius:20px; padding:3px 14px; margin-bottom:16px;}
.hero h1{font-size:clamp(26px,3.2vw,40px); font-weight:800; line-height:1.24; margin-bottom:14px;
  background:linear-gradient(95deg,var(--c1),var(--c2)); -webkit-background-clip:text; background-clip:text; color:transparent;}
.hero .meta{color:var(--muted); font-size:14px; margin-bottom:4px;}
.hero .lede{margin-top:18px; color:#cfe0ff; font-size:15.5px; border-left:3px solid var(--c2);
  padding:12px 18px; background:rgba(63,201,187,0.075); border-radius:0 8px 8px 0;}
.herostat{display:flex; flex-wrap:wrap; gap:10px; margin-top:20px;}
.herostat span{font-size:12.5px; color:var(--muted); border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.028); border-radius:9px; padding:6px 14px;}
.herostat b{color:var(--c2); font-size:15px; margin-right:4px; font-variant-numeric:tabular-nums;}
section{padding:32px 0 10px; border-top:1px solid rgba(255,255,255,0.06); scroll-margin-top:16px;}
section h2{position:relative; font-size:clamp(20px,2.5vw,27px); font-weight:800;
  margin-bottom:6px; padding-bottom:15px;
  background:linear-gradient(95deg,var(--c1),var(--c2)); -webkit-background-clip:text; background-clip:text; color:transparent;}
section h2::after{content:""; position:absolute; left:0; bottom:0; width:74px; height:3px;
  border-radius:2px; background:linear-gradient(90deg,var(--c1),var(--c2));}
section h2 .h2sub{display:block; font-size:13px; color:var(--muted); font-weight:400; margin-top:8px;
  -webkit-text-fill-color:var(--muted);}
h3{font-size:17.5px; color:var(--warm); margin:26px 0 10px; font-weight:700;}
h4{font-size:15.5px; color:var(--cool); margin:20px 0 8px; font-weight:700;}
p{margin:11px 0; color:var(--ink2);}
b,strong{color:#fff; font-weight:700;}
ul,ol{margin:10px 0 10px 22px; color:var(--ink2);}
li{margin:6px 0;}
.hl{color:var(--c1); font-weight:700;}
.hl2{color:#7fe0d4; font-weight:700;}
.kw{color:#ffd7b8; background:rgba(255,143,82,0.10); border-radius:4px; padding:0 5px; font-weight:600;}
/* 正文内链接（限定在 main 内，#toc 的链接已有自己的样式，不受影响） */
main a{color:var(--c1); text-decoration:none; border-bottom:1px solid rgba(255,143,82,0.30);}
main a:hover{color:#ffb083; border-bottom-color:rgba(255,176,131,0.65);}
code{font-family:"SFMono-Regular",Consolas,Menlo,monospace; font-size:13.5px;
  background:rgba(63,201,187,0.11); color:#93e8dd; padding:1px 6px; border-radius:4px;}

/* 章节导语 */
.lede2{margin:14px 0 18px; padding:12px 18px; color:#cfe0ff; font-size:14.8px;
  border-left:3px solid var(--c2); background:rgba(63,201,187,0.075); border-radius:0 8px 8px 0;}

/* ---------- 卡片 / 表格 ---------- */
.card{margin:16px 0; padding:16px 20px; background:var(--surf);
  border:1px solid rgba(255,143,82,0.17); border-radius:12px;}
.card.alt{border-color:rgba(63,201,187,0.30); background:rgba(63,201,187,0.055);}
.card .ct{font-size:14.5px; font-weight:700; color:#ffd7b8; margin-bottom:8px;}
table{width:100%; border-collapse:collapse; margin:16px 0; font-size:13.8px;}
th,td{border:1px solid rgba(255,255,255,0.12); padding:9px 11px; text-align:left; vertical-align:top;}
th{background:rgba(255,143,82,0.14); color:#ffe9dc; font-weight:700; white-space:nowrap;}
td{color:var(--ink2);}
tr:nth-child(even) td{background:rgba(255,255,255,0.022);}
.tw{overflow-x:auto; margin:16px 0;}
.tw table{margin:0;}

/* 判定标签 */
.tag{display:inline-block; font-size:12px; font-weight:700; padding:2px 9px;
  border-radius:6px; white-space:nowrap; line-height:1.6;}
.t-ok{color:#0b1a14; background:linear-gradient(135deg,#57f2b8,#22d39a);}
.t-warn{color:#241a05; background:linear-gradient(135deg,#ffe07a,#ffcf4d);}
.t-bad{color:#2a0a0f; background:linear-gradient(135deg,#ff8b96,#ff5d6c);}
.t-q{color:#f0f4fa; background:linear-gradient(135deg,#9db3d4,#6b7f9e);}
.t-info{color:#fff2e8; background:rgba(255,143,82,0.20); border:1px solid var(--line);}

/* 问答块 */
.qa{margin:18px 0; border:1px solid rgba(255,255,255,0.09); border-radius:12px; overflow:hidden;
  background:rgba(13,17,24,0.58);}
.qa .q{padding:12px 18px; background:rgba(255,143,82,0.075); border-left:3px solid var(--c1);
  font-weight:700; color:#ffeede; font-size:15px;}
.qa .q .qt{font-size:12px; color:#8a94a6; font-weight:400; margin-left:8px;}
.qa .body{padding:14px 18px;}
.qa .orig{margin:8px 0 12px; padding:10px 14px; border-left:2px solid rgba(143,167,200,0.55);
  background:rgba(143,167,200,0.055); border-radius:0 8px 8px 0; color:#d5dbe4; font-size:14.2px;}
.qa .orig .lab{display:block; font-size:12px; color:#8fa7c8; margin-bottom:4px; letter-spacing:.4px;}
.qa.hide{display:none;}
.vd{margin:10px 0; padding:11px 14px; border-radius:9px; font-size:14.2px;
  border:1px solid rgba(255,255,255,0.10); background:rgba(255,255,255,0.025);}
.vd.ok{border-color:rgba(34,211,154,0.35); background:rgba(34,211,154,0.06);}
.vd.warn{border-color:rgba(255,207,77,0.36); background:rgba(255,207,77,0.07);}
.vd.bad{border-color:rgba(255,93,108,0.35); background:rgba(255,93,108,0.06);}
.vd .vt{font-weight:700; margin-right:8px;}
.ext{margin:10px 0; padding:12px 16px; border-radius:9px; font-size:14.2px;
  border:1px dashed rgba(63,201,187,0.38); background:rgba(63,201,187,0.05);}
.ext .et{font-weight:700; color:var(--c2); margin-right:8px;}

.pill{display:inline-block; font-size:12px; padding:2px 10px; border-radius:20px;
  border:1px solid var(--line); color:var(--c1); margin:0 6px 4px 0;}
.mono{font-family:"SFMono-Regular",Consolas,Menlo,monospace; font-size:13.5px; color:#93e8dd;}
.note{font-size:13px; color:var(--muted); margin-top:8px;}
.warnbox{margin:16px 0; padding:14px 18px; border-radius:10px;
  border:1px solid rgba(255,93,108,0.4); background:rgba(255,93,108,0.07); color:#ffd9de;}
.warnbox b{color:#ffb3bb;}
hr{border:none; border-top:1px solid rgba(255,255,255,0.07); margin:28px 0;}
footer{margin-top:40px; padding-top:22px; border-top:1px solid rgba(255,255,255,0.08);
  color:#66717f; font-size:12.5px; line-height:1.9;}

/* ---------- 插图 ---------- */
figure.figure{margin:22px 0; padding:14px 14px 10px; border-radius:12px;
  border:1px solid rgba(63,201,187,0.22); background:rgba(13,17,24,0.62);}
figure.figure img{display:block; width:100%; height:auto; border-radius:8px;}
figure.figure figcaption{margin-top:10px; font-size:13px; color:var(--muted); text-align:center; line-height:1.7;}
figure.figure figcaption b{color:#ffd7b8;}

/* ---------- 公式 ---------- */
.formula{margin:14px 0; padding:13px 18px; border-radius:0 8px 8px 0;
  border-left:3px solid var(--c2); background:rgba(63,201,187,0.075);
  font-family:"SFMono-Regular",Consolas,Menlo,monospace; font-size:14px; line-height:2.05; color:#c8f5ee;}
.formula .fm{display:block;}
.formula .fx{color:#8b96a6; font-size:12.5px;}

/* ---------- 步骤流 ---------- */
.steps{counter-reset:st; margin:16px 0;}
.steps .st{position:relative; padding:10px 16px 10px 48px; margin:8px 0;
  background:rgba(255,255,255,0.025); border:1px solid rgba(255,255,255,0.08); border-radius:10px;
  font-size:14.3px; color:var(--ink2);}
.steps .st::before{counter-increment:st; content:counter(st); position:absolute; left:13px; top:11px;
  width:22px; height:22px; line-height:22px; text-align:center; border-radius:50%;
  font-size:12px; font-weight:700; color:#0b1a14;
  background:linear-gradient(135deg,#ffd7a8,#ff8f52);}
.steps .st b{color:#ffd7b8;}

/* ---------- 两列网格 ---------- */
.cols{display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:14px 0;}
.cols > *{margin:0;}

/* ---------- 提示块 / 踩坑块 ---------- */
.callout{margin:16px 0; padding:13px 18px; border-radius:10px; font-size:14.3px;
  border:1px solid rgba(143,167,200,0.30); background:rgba(143,167,200,0.07); color:#d6dEEB;}
.callout b{color:#c7d7f0;}
.trap{margin:16px 0; padding:13px 18px; border-radius:10px; font-size:14.3px;
  border:1px solid rgba(255,93,108,0.38); background:rgba(255,93,108,0.065); color:#ffd9de;}
.trap b{color:#ffb3bb;}

/* ---------- 表注 / 小字说明 ---------- */
.table-note{margin:10px 0 14px; padding:10px 15px; border-radius:0 8px 8px 0;
  border-left:2px solid rgba(255,207,77,0.55); background:rgba(255,207,77,0.055);
  font-size:13.6px; color:#e8dfc8; line-height:1.8;}
.table-note b{color:#ffe6a8;}
.table-note code{background:rgba(255,207,77,0.12); color:#ffe6a8;}

/* ---------- 返回顶部 ---------- */
#top{position:fixed; right:26px; bottom:26px; z-index:20; width:42px; height:42px; line-height:40px;
  text-align:center; border-radius:50%; cursor:pointer; font-size:17px; color:var(--c1);
  border:1px solid var(--line); background:rgba(10,14,20,0.86); opacity:0; pointer-events:none;
  transition:opacity .25s, transform .25s; transform:translateY(8px);}
#top.show{opacity:1; pointer-events:auto; transform:translateY(0);}
#top:hover{background:rgba(255,143,82,0.16);}

/* ---------- 响应式 ---------- */
@media (max-width:1000px){
  .wrap{flex-direction:column; padding:0 14px;}
  #toc{width:100%; flex:none; height:auto; max-height:none; position:static; overflow:visible;
    border-bottom:1px solid rgba(255,255,255,0.08); padding:18px 0 12px;
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:10px; align-content:start;}
  #toc .brand,#toc .brand2,#toc .grp{grid-column:1/-1;}
  #toc .brand{padding-left:12px;}
  #toc .brand2{margin-bottom:8px; padding-left:12px;}
  #toc .grp{margin:12px 0 4px;}
  .searchwrap{grid-column:1/-1; margin:0 0 4px 0;}
  .searchinfo{grid-column:1/-1; padding-left:2px;}
  #toc a{padding:5px 10px; font-size:13px;}
  main{border-left:none; padding:28px 0 70px;}
}
@media (max-width:820px){
  .cols{grid-template-columns:1fr;}
  .hero h1{font-size:clamp(23px,6.6vw,30px);}
  main{padding-top:22px;}
}
/* 更窄时才退回单列目录；两列能放下就别堆成 19 行 */
@media (max-width:620px){
  #toc{grid-template-columns:1fr;}
  #toc a{padding:4px 10px; font-size:12.5px;}
}
