:root {
  --bg: #f6f9fd;
  --surface: #ffffff;
  --text: #16263d;
  --muted: #52657e;
  --border: #dce6f4;
  --accent: #1555ce;
  --accent-soft: #edf4ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15.5px;
}

.wrap { width: min(1100px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  flex-wrap: wrap;
  padding-block: 8px;
}

.brand { font-weight: 750; font-size: 16px; color: var(--text); text-decoration: none; }

.site-nav { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 550; padding: 4px 2px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"] { font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav a.nav-cta { padding: 6px 13px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; }
.site-nav a.nav-cta:hover { background: #1045ad; color: #fff; }

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 24px;
  padding: 28px 0 56px;
  align-items: start;
}

.doc-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 38px;
  box-shadow: 0 8px 28px rgba(16, 39, 78, 0.04);
  min-width: 0;
}

.doc-article h1 { margin: 0 0 18px; font-size: clamp(22px, 3vw, 30px); line-height: 1.3; letter-spacing: -0.02em; }
.doc-article h2 { margin: 32px 0 14px; padding-bottom: 8px; border-bottom: 1px solid #ebf1f9; font-size: 20px; scroll-margin-top: 78px; }
.doc-article h3 { margin: 22px 0 10px; font-size: 17px; scroll-margin-top: 78px; }
.doc-article p { margin: 0 0 14px; }
.doc-article a { color: var(--accent); text-decoration: none; }
.doc-article a:hover { text-decoration: underline; }
.doc-article hr { border: 0; border-top: 1px solid #e7eef8; margin: 26px 0; }
.doc-article ul, .doc-article ol { margin: 0 0 16px; padding-left: 22px; }
.doc-article li { margin-bottom: 6px; }

.doc-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #eff4fb;
  color: #16376b;
  padding: 2px 6px;
  border-radius: 6px;
}

.code-block {
  margin: 14px 0 18px;
  padding: 14px 16px;
  background: #0f1b2e;
  color: #e6effc;
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 13.5px;
}
.code-block code { background: transparent; color: inherit; padding: 0; font-size: inherit; }

.table-wrap { width: 100%; overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
th, td { padding: 10px 12px; border-bottom: 1px solid #ebf1f8; text-align: left; vertical-align: top; }
th { background: #f5f9ff; color: #364b68; font-weight: 650; }
tr:last-child td { border-bottom: 0; }

blockquote { margin: 14px 0 18px; padding: 12px 16px; border-left: 3.5px solid var(--accent); background: #f6faff; border-radius: 0 10px 10px 0; color: #2f435d; }
blockquote > :last-child { margin-bottom: 0; }

.callout { margin: 16px 0 20px; padding: 14px 16px; border-radius: 12px; border: 1px solid #d5e4fa; background: #f5f9ff; }
.callout-title { font-weight: 700; margin-bottom: 6px; font-size: 14.5px; color: #13449e; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-tip { border-color: #bfe4ce; background: #f2fbf6; }
.callout-tip .callout-title { color: #166534; }
.callout-warning { border-color: #f4d6a8; background: #fffaf0; }
.callout-warning .callout-title { color: #9a5400; }
.callout-caution { border-color: #f5c2c2; background: #fff5f5; }
.callout-caution .callout-title { color: #b42318; }
.callout-important { border-color: #c9d8fb; background: #f3f6ff; }
.callout-important .callout-title { color: #1d4ed8; }

.doc-figure { margin: 16px 0 20px; text-align: center; }
.doc-figure img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(16, 39, 78, 0.06); }
.doc-figure figcaption { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

.doc-toc {
  position: sticky;
  top: 76px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.doc-toc-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #ebf1f8; }
.doc-toc nav { display: flex; flex-direction: column; gap: 6px; }
.doc-toc nav a { font-size: 13px; line-height: 1.45; color: #3e5472; text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.doc-toc nav a:hover { background: var(--accent-soft); color: var(--accent); }

.site-footer { border-top: 1px solid var(--border); background: #fff; padding: 20px 0 28px; font-size: 13.5px; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-inner a { color: var(--accent); text-decoration: none; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { position: static; max-height: none; order: -1; }
}
@media (max-width: 640px) {
  .doc-article { padding: 20px 18px; border-radius: 14px; }
}
