:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5e7eb;
  --line-soft: #eef2f7;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --warning: #fff7ed;
  --warning-line: #fed7aa;
  --info: #eff6ff;
  --info-line: #bfdbfe;
  --note: #f0fdf4;
  --note-line: #bbf7d0;
  --tip: #faf5ff;
  --tip-line: #e9d5ff;
  --sidebar-width: 292px;
  --rail-width: 218px;
  --topbar-height: 64px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-height) + 18px); }
body {
  margin: 0;
  background: radial-gradient(circle at 18% 0, rgba(37, 99, 235, .06), transparent 28rem), var(--bg);
  color: var(--text);
  font: 15.5px/1.75 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 230px;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand strong { display: block; line-height: 1.15; font-size: 16px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.search-pill,
.offline-badge,
.top-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.offline-badge { background: var(--primary-soft); color: var(--primary-dark); border-color: #dbeafe; }
.top-link:hover { border-color: #c7d2fe; color: var(--primary-dark); }
.site-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--rail-width);
  min-height: calc(100vh - var(--topbar-height));
}
.sidebar {
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
}
.sidebar-inner {
  height: 100%;
  overflow: auto;
  padding: 20px 18px 34px 22px;
}
.nav-section { margin-bottom: 22px; }
.nav-section h2 {
  margin: 16px 0 8px;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}
.nav-section ul { list-style: none; padding: 0; margin: 0; }
.nav-section li { margin: 1px 0; }
.nav-section a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: #64748b;
  font-size: 13.5px;
  line-height: 1.45;
  transition: background .15s ease, color .15s ease;
}
.nav-section a:hover { background: #f1f5f9; color: #0f172a; }
.nav-section a.active { background: #eff6ff; color: var(--primary-dark); font-weight: 650; }
.content {
  min-width: 0;
  padding: 40px 46px 88px;
}
.doc-card {
  max-width: 880px;
  margin: 0 auto;
}
.page-header {
  padding-bottom: 24px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line-soft);
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 14px;
}
.page-header h1 {
  margin: 0;
  color: #020617;
  font-size: 42px;
  line-height: 1.14;
  letter-spacing: -0.035em;
}
.doc-body { color: #334155; font-size: 15.5px; }
.doc-body h1 { display: none; }
.doc-body h2,
.doc-body h3,
.doc-body h4 { color: #0f172a; line-height: 1.32; letter-spacing: -0.018em; }
.doc-body h2 {
  margin: 42px 0 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  font-size: 25px;
}
.doc-body h3 { margin: 30px 0 12px; font-size: 20px; }
.doc-body h4 { margin: 24px 0 10px; font-size: 17px; }
.doc-body p,
.doc-body ul,
.doc-body ol,
.doc-body blockquote,
.doc-body pre,
.doc-body table { margin-top: 0; margin-bottom: 16px; }
.doc-body ul,
.doc-body ol { padding-left: 1.25rem; }
.doc-body li { margin: 4px 0; }
.doc-body strong { color: #111827; }
.doc-body blockquote {
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  padding: 12px 16px;
  border-radius: 10px;
  color: #1e3a8a;
}
code {
  background: #f1f5f9;
  color: #1e3a8a;
  padding: .12em .36em;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: .9em;
}
pre {
  overflow: auto;
  padding: 16px 18px;
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid #1e293b;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
pre code { background: transparent; color: inherit; border: 0; padding: 0; }
.table-wrap { overflow: auto; margin: 18px 0 22px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 10px 12px; vertical-align: top; }
th:last-child, td:last-child { border-right: 0; }
tr:last-child td { border-bottom: 0; }
th { background: #f8fafc; color: #0f172a; text-align: left; font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
img { max-width: 100%; border-radius: 12px; }
.mdx {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.mdx.info { background: var(--info); border-color: var(--info-line); color: #1e3a8a; }
.mdx.warning { background: var(--warning); border-color: var(--warning-line); color: #7c2d12; }
.mdx.note { background: var(--note); border-color: var(--note-line); color: #14532d; }
.mdx.tip { background: var(--tip); border-color: var(--tip-line); color: #581c87; }
.mdx.card-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}
.mdx.card,
.mdx.step,
.mdx.tab,
.mdx.accordion {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.mdx.card > strong,
.mdx.step > strong,
.mdx.tab > strong,
.mdx.accordion > strong { display: block; margin-bottom: 6px; color: #0f172a; }
.right-rail {
  position: sticky;
  top: calc(var(--topbar-height) + 28px);
  height: calc(100vh - var(--topbar-height) - 28px);
  align-self: start;
  padding: 0 22px 0 0;
  overflow: auto;
}
.rail-card {
  border-left: 1px solid var(--line);
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}
.rail-card h2 { margin: 0 0 14px; color: #0f172a; font-size: 13px; }
.rail-card p { margin: 0 0 12px; }
.rail-card span { display: block; color: var(--muted-2); }
.rail-card strong { display: block; margin-top: 2px; color: #334155; font-weight: 600; }
.toc-nav {
  border-left: 1px solid var(--line);
  padding-left: 16px;
  color: #6b7280;
  font-size: 12.5px;
  line-height: 1.45;
}
.toc-nav h2 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}
.toc-nav a,
.toc-empty {
  display: block;
  margin: 0;
  padding: 4px 0;
  color: #6b7280;
  line-height: 1.35;
}
.toc-nav a:hover { color: #111827; }
.toc-level-3 { padding-left: 10px; font-size: 12px; }
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.index-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.index-card:hover { border-color: #bfdbfe; box-shadow: 0 10px 28px rgba(37, 99, 235, .08); }
.index-card strong { display: block; margin-bottom: 4px; color: var(--text); }
.index-card span { color: var(--muted); font-size: 14px; }
@media (max-width: 1180px) {
  .site-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .right-rail { display: none; }
  .content { padding-right: 34px; }
}
@media (max-width: 860px) {
  .topbar { position: static; height: auto; padding: 14px 16px; align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: flex-start; overflow-x: auto; }
  .site-shell { display: block; }
  .sidebar { position: static; height: auto; max-height: 46vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-inner { padding: 12px 16px 18px; }
  .content { padding: 24px 18px 56px; }
  .page-header h1 { font-size: 31px; }
}
