:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #101a2b;
  --muted: #4a5a75;
  --line: #d8e1f1;
  --brand: #0d3ea8;
  --soft: #e8efff;
  --shadow: 0 10px 28px rgba(13, 35, 75, 0.08);
  --radius: 14px;
  --maxw: 1200px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 360px at 90% -10%, #dce7ff 0%, transparent 62%),
    radial-gradient(700px 340px at -10% 10%, #eaf7ff 0%, transparent 58%),
    var(--bg);
  line-height: 1.68;
}
a { color: var(--brand); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
.topbar {
  width: min(var(--maxw), 94vw);
  margin: 0 auto;
  padding: 18px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lang-switch { color: var(--muted); }
.lang-switch a { font-weight: 600; color: #244271; }
.lang-switch a.active { text-decoration: underline; }
.layout {
  width: min(var(--maxw), 94vw);
  margin: 0 auto 36px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
}
.toc {
  position: sticky;
  top: 18px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.toc h2 { margin: 0 0 12px; font-size: 1rem; }
.toc nav { display: grid; gap: 6px; }
.toc a {
  display: block;
  padding: 8px 10px;
  border-radius: 9px;
  color: #244271;
  font-size: 0.92rem;
  line-height: 1.4;
}
.toc a.active { background: var(--soft); color: var(--brand); font-weight: 600; }
.toc a:hover { background: #f3f7ff; text-decoration: none; }
.content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #46689f;
  margin-bottom: 10px;
}
h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.45rem); line-height: 1.2; letter-spacing: -0.01em; }
.lead { margin: 14px 0 0; color: #2f4668; font-size: 1.02rem; }
h2 { margin: 22px 0 10px; font-size: 1.22rem; line-height: 1.28; }
p { margin: 0; }
p + p, ul + p, p + ul, table + p, p + table, ul + ul { margin-top: 12px; }
ul { margin: 0; padding-left: 20px; }
li { margin: 6px 0; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { border-bottom: 1px solid #e4ebf7; text-align: left; vertical-align: top; padding: 10px 8px; }
th { color: #28456f; width: 180px; }
.tip {
  margin-top: 14px;
  background: #f8fbff;
  border: 1px solid #dce6f8;
  border-radius: 12px;
  padding: 12px 14px;
  color: #2f4668;
  font-size: 0.94rem;
}
.topic-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.topic-card {
  background: #fbfdff;
  border: 1px solid #dce6f8;
  border-radius: 12px;
  padding: 12px;
}
.topic-card h3 { margin: 0 0 6px; font-size: 1rem; line-height: 1.35; }
.topic-card p { color: #2f4668; font-size: 0.92rem; }
.nav-pager { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.nav-pager a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #c9d7ee;
  color: #173f7d;
  font-weight: 600;
  font-size: 0.9rem;
}
.nav-pager a:hover { background: #f4f8ff; text-decoration: none; }
.page-footer {
  width: min(var(--maxw), 94vw);
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 0.88rem;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; order: -1; }
  .toc nav { grid-template-columns: 1fr 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .toc nav { grid-template-columns: 1fr; }
  .content { padding: 20px; }
}