﻿:root{
  --bg1:#f7f3ff;
  --bg2:#efe8ff;
  --card:rgba(255,255,255,.84);
  --card2:rgba(251,249,255,.92);
  --text:#2e2a4d;
  --muted:#6f6a95;
  --line:#e7ddff;
  --accent:#8b5cf6;
  --accent2:#a78bfa;
  --ok:#16a34a;
  --warn:#f59e0b;
  --bad:#ef4444;
  --shadow:0 10px 30px rgba(139,92,246,.12);
  --shadow2:0 6px 16px rgba(17,24,39,.08);
  --radius:16px;
  --maxw:1380px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:
    radial-gradient(1200px 520px at 10% -10%, rgba(167,139,250,.45), transparent 60%),
    radial-gradient(900px 420px at 92% 0%, rgba(139,92,246,.18), transparent 55%),
    radial-gradient(900px 520px at 70% 95%, rgba(236,72,153,.08), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  line-height:1.65;
  overflow:hidden;
}

a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background: rgba(246,242,255,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  padding:10px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  min-height:68px;
}

.brand{display:flex; align-items:center; gap:10px; min-width:0; flex:1 1 auto}
.logo{
  width:28px;
  height:28px;
  border-radius:10px;
  background: linear-gradient(135deg, rgba(139,92,246,.95), rgba(167,139,250,.75));
  box-shadow: 0 8px 18px rgba(139,92,246,.16);
  flex:0 0 auto;
}
.brand .t{min-width:0; width:100%}
.brand h1{
  margin:0;
  font-size:13px;
  font-weight:850;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.brand .sub{
  margin:0;
  font-size:11px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:860px;
}

.actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.lang-switch{
  display:flex;
  align-items:center;
  gap:8px;
  padding-right:4px;
  margin-right:4px;
  border-right:1px solid var(--line);
}

.btn{
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  padding:9px 12px;
  border-radius:12px;
  cursor:pointer;
  font-size:13px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  box-shadow: var(--shadow2);
  user-select:none;
  transition:.15s ease;
  white-space:nowrap;
}
.btn:hover{transform: translateY(-1px)}
.btn.primary{
  background: linear-gradient(135deg, rgba(139,92,246,.95), rgba(167,139,250,.85));
  color:#fff;
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(139,92,246,.22);
}
.btn.ghost{
  background: rgba(255,255,255,.65);
  box-shadow:none;
}
.btn.lang-btn.active{
  background: linear-gradient(135deg, rgba(139,92,246,.95), rgba(167,139,250,.85));
  color:#fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(139,92,246,.16);
}

.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 16px 16px;
  height: calc(100vh - 68px);
  display:grid;
  grid-template-rows: auto 1fr;
  gap:10px;
  min-height:0;
}

.hero{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 20px 8px;
  text-align:center;
  min-height:0;
}

.hero .title{
  margin:0;
  font-size:26px;
  line-height:1.25;
  letter-spacing:.2px;
}

.brand-main{
  display:block;
  font-size:28px;
  font-weight:800;
  letter-spacing:.5px;
}

.brand-sub{
  display:block;
  font-size:20px;
  font-weight:600;
  color:#6f6a95;
}

#heroNote{display:none !important}

.pill{
  border:1px solid var(--line);
  background: rgba(255,255,255,.76);
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
}

.note{
  border-left:4px solid var(--accent2);
  background: rgba(139,92,246,.06);
  padding:10px 12px;
  border-radius:12px;
  margin:12px 0;
  font-size:13px;
}
.note.ok{border-left-color: rgba(22,163,74,.8); background: rgba(22,163,74,.06)}
.note.warn{border-left-color: rgba(245,158,11,.8); background: rgba(245,158,11,.07)}
.note.bad{border-left-color: rgba(239,68,68,.8); background: rgba(239,68,68,.06)}

.grid{
  display:grid;
  grid-template-columns:360px minmax(0,1fr);
  gap:16px;
  min-height:0;
  overflow:hidden;
}

.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  min-height:0;
}
.card .hd{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background: var(--card2);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.card .hd h2{margin:0; font-size:14px; letter-spacing:.2px}
.card .bd{padding:16px; min-height:0}

.toc{
  display:flex;
  flex-direction:column;
  min-height:0;
}
.toc .bd{overflow:auto}

.toc-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.toc-btn{
  width:100%;
  text-align:left;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid transparent;
  color:var(--text);
  background:transparent;
  cursor:pointer;
  font-size:13px;
  transition:.15s ease;
  font-family:inherit;
}
.toc-btn:hover{
  background: rgba(139,92,246,.07);
  border-color: var(--line);
}
.toc-btn.active{
  background: linear-gradient(135deg, rgba(139,92,246,.14), rgba(167,139,250,.12));
  border-color: rgba(139,92,246,.25);
  color:#5b35b5;
  font-weight:700;
}

.content-shell{
  min-height:0;
  display:flex;
  flex-direction:column;
}

.section{
  display:none;
  padding:18px 18px 6px;
  height:100%;
  overflow:auto;
}
.section.active{
  display:block;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn{
  from{opacity:0; transform:translateY(4px)}
  to{opacity:1; transform:none}
}

.section h3{margin:0 0 6px; font-size:18px; letter-spacing:.2px}
.section h4{margin:10px 0 6px; font-size:15px}
.section .desc{margin:0 0 12px; color:var(--muted); font-size:13px}

.klist{margin:0; padding-left:18px}
.klist li{margin:4px 0}

.path{
  font-family: var(--mono);
  font-size:12px;
  background: rgba(139,92,246,.06);
  border:1px solid var(--line);
  padding:10px 12px;
  border-radius:12px;
  overflow:auto;
  margin: 8px 0 10px;
}

.fields{
  display:grid;
  gap:10px;
  grid-template-columns: 1fr;
  margin: 10px 0 14px;
}
@media (min-width:700px){
  .fields{grid-template-columns: 1fr 1fr}
}

.field{
  border:1px solid var(--line);
  background: rgba(255,255,255,.75);
  border-radius:12px;
  padding:10px 12px;
}
.field b{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:4px;
}
.field span{font-size:13px}

table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  margin:10px 0 14px;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background: rgba(255,255,255,.75);
}
th, td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  font-size:13px;
}
th{
  background: rgba(139,92,246,.06);
  text-align:left;
  color:var(--muted);
  font-weight:750;
}
tr:last-child td{border-bottom:0}

.flow{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin:10px 0 18px;
}
.node{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.8);
  font-size:13px;
  box-shadow: var(--shadow2);
}
.arrow{color:var(--muted)}

.section-footer{
  margin-top:22px;
  padding-top:14px;
  border-top:1px solid var(--line);
  display:flex;
  gap:10px;
  justify-content:space-between;
  flex-wrap:wrap;
}

.footer{
  margin-top:18px;
  color:var(--muted);
  font-size:12px;
  text-align:center;
}

/* 单列正文插图 */
.step-image{
  display:block;
  width:100%;
  max-width:600px;
  margin:10px 0 14px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#fff;
  box-shadow: var(--shadow2);
  cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease;
}

.step-image:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 26px rgba(17,24,39,.12);
}

/* 图片放大 */
.img-expanded-overlay{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  background:rgba(0,0,0,.92);
  z-index:9999;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:20px;
}

.img-expanded-wrap{
  position:relative;
  width:100%;
  height:100%;
  display:flex;
  justify-content:center;
  align-items:center;
}

.img-expanded{
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  object-fit:contain;
  border-radius:8px;
}

.img-close{
  position:absolute;
  top:12px;
  right:12px;
  width:48px;
  height:48px;
  border:none;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:28px;
  cursor:pointer;
  backdrop-filter:blur(4px);
}

@media (max-width:980px){
  body{overflow:auto}
  .wrap{
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 22px 16px 80px;
    height:auto;
    display:block;
  }
  .grid{
    grid-template-columns: 1fr;
    min-height:auto;
    overflow:visible;
  }
  .card,.content-shell,.section,.toc .bd{
    min-height:auto;
  }
  .section{
    height:auto;
    overflow:visible;
  }
  .toc .bd{
    overflow:visible;
  }
  .hero{
    padding:22px 20px;
  }
  #heroNote{display:none !important}
}

@media (max-width:860px){
  .hero .title{font-size:24px}
  .lang-switch{
    border-right:none;
    padding-right:0;
    margin-right:0;
  }
  .brand .sub{max-width:100%}
}

@media print{
  body{background:#fff; overflow:visible}
  .topbar,.toc,.section-footer,.footer,.lang-switch,#btnTop,#btnPdf,#btnHtml,.img-close{display:none !important}
  .wrap{max-width:100%; padding:0; height:auto; display:block}
  .hero,.card{box-shadow:none}
  .hero{margin:0 0 16px; border-radius:0}
  .section{display:block !important; height:auto; overflow:visible; page-break-inside:avoid}
  .img-expanded-overlay{display:none !important}
}