:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #d7dde5;
  --text: #151a22;
  --text-muted: #697386;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #15803d;
  --danger: #b91c1c;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

header {
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
header .logo {
  font-weight: 700; font-size: 16px;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
}
header .logo svg { color: var(--primary); }
header .links { display: flex; gap: 20px; align-items: center; }
header .links a {
  color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: color 0.15s;
}
header .links a:hover,
header .links a.active { color: var(--primary); }

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 128px);
}
.sidebar {
  padding: 32px 0 32px 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.doc-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 80px; }
.doc-nav a {
  display: block;
  padding: 10px 24px 10px 22px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all 0.12s;
}
.doc-nav a:hover { color: var(--text); background: var(--bg); }
.doc-nav a.active {
  color: var(--primary);
  background: #eff6ff;
  font-weight: 600;
  border-left-color: var(--primary);
}

.content {
  padding: 40px 48px 60px;
  max-width: 800px;
}
.content h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: -0.02em; }
.content h1 + p { color: var(--text-muted); margin-bottom: 32px; }
.content h2 { font-size: 20px; margin: 36px 0 12px; }
.content h3 { font-size: 16px; margin: 24px 0 8px; }
.content p, .content li { color: #1e293b; }
.content ul, .content ol { padding-left: 20px; }
.content li { margin-bottom: 4px; }
.content a { color: var(--primary); text-decoration: none; }
.content a:hover { text-decoration: underline; }
.content img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }

.code-block {
  background: var(--code-bg);
  border-radius: 8px;
  margin: 16px 0;
  overflow-x: auto;
}
.code-block pre { margin: 0; padding: 16px 20px; }
.code-block code {
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  color: var(--code-text);
  line-height: 1.5;
}
:not(pre) > code {
  background: #eef1f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
th, td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
th { background: #eef1f5; font-weight: 600; }
tr:nth-child(even) { background: #fafbfc; }

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.footer a { color: var(--primary); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .links { display: flex; gap: 16px; justify-content: center; margin-top: 8px; }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 24px; }
}
