:root {
  --brand: #1a5fb4;
  --brand-dark: #0d3d7a;
  --brand-soft: #e8f1fb;
  --accent: #0d9488;
  --accent-soft: #e6f7f5;
  --warn: #c2410c;
  --warn-soft: #fff4ed;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --sidebar-w: 280px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--brand-dark), #123a6b 55%, #0f2f57);
  color: #fff;
  padding: 24px 18px 40px;
  flex-shrink: 0;
}

.sidebar .brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 16px;
}
.sidebar .brand strong { font-size: 1.05rem; letter-spacing: 0.02em; }
.sidebar .brand span { font-size: 0.78rem; opacity: 0.8; }

.sidebar nav a {
  display: block;
  color: rgba(255,255,255,0.88);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 2px;
  text-decoration: none;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}
.sidebar nav .group {
  margin-top: 14px;
  padding: 0 12px 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 32px 40px 80px;
  max-width: 980px;
}

.hero {
  background:
    radial-gradient(circle at 20% 20%, rgba(26,95,180,0.18), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(13,148,136,0.16), transparent 40%),
    linear-gradient(135deg, #ffffff, #f1f7ff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 36px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.hero .eyebrow {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  color: var(--brand-dark);
  line-height: 1.25;
}
.hero p { margin: 0; color: var(--muted); max-width: 62ch; }
.hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: var(--ink);
}

section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  margin-bottom: 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}
section h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: var(--brand-dark);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-soft);
}
section h3 {
  margin: 22px 0 8px;
  font-size: 1.08rem;
  color: var(--ink);
}
section h4 {
  margin: 16px 0 6px;
  font-size: 0.98rem;
}
section > p.lead {
  color: var(--muted);
  margin-top: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.steps li {
  position: relative;
  padding: 14px 14px 14px 58px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fff;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.steps li strong { display: block; margin-bottom: 2px; }

.callout {
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
  border-left: 4px solid;
}
.callout.important {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.callout.tip {
  background: var(--ok-soft);
  border-color: var(--ok);
}
.callout.note {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.callout.warn {
  background: var(--warn-soft);
  border-color: var(--warn);
}
.callout .title {
  font-weight: 700;
  margin-bottom: 4px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}
.card h4 { margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card .icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
}
.card.teal .icon { background: var(--accent); }
.card.green .icon { background: var(--ok); }

.figure {
  margin: 18px 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
}
.figure img {
  display: block;
  width: 100%;
  height: auto;
}
.figure figcaption {
  padding: 10px 14px;
  font-size: 0.86rem;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid var(--line);
}

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}
.flow .box {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid #c9ddf5;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
}
.flow .arrow {
  color: var(--muted);
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 4px;
  font-size: 0.92rem;
}
th, td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
code, .mono {
  font-family: Consolas, "Courier New", monospace;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.link-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.link-box a {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.9rem;
}
.link-box a.secondary {
  background: #fff;
  color: var(--brand) !important;
  border: 1px solid var(--brand);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.checklist li {
  padding: 10px 12px 10px 40px;
  position: relative;
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
}
.checklist li::before {
  content: "☐";
  position: absolute;
  left: 12px;
  top: 8px;
  font-size: 1.15rem;
  color: var(--brand);
}

.toc-mini {
  columns: 2;
  column-gap: 24px;
  margin: 8px 0 0;
  padding-left: 18px;
}
.toc-mini li { break-inside: avoid; margin-bottom: 4px; }

.footer-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar {
    position: fixed;
    left: -100%;
    z-index: 40;
    transition: left 0.25s ease;
  }
  .sidebar.open { left: 0; }
  .menu-toggle { display: block; }
  .main { padding: 64px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .toc-mini { columns: 1; }
  .hero { padding: 24px 18px; }
  section { padding: 20px 16px; }
}

@media print {
  .sidebar, .menu-toggle { display: none !important; }
  .main { max-width: none; padding: 0; }
  section { break-inside: avoid; box-shadow: none; }
  .figure { break-inside: avoid; }
}
