*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --sidebar-bg: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --code-comment: #64748b;
  --code-keyword: #7dd3fc;
  --code-string: #86efac;
  --code-number: #fda4af;
  --code-func: #c4b5fd;
  --code-type: #fde68a;
  --tag-bg: #eff6ff;
  --tag-text: #1d4ed8;
  --tag-get: #dcfce7;
  --tag-get-text: #15803d;
  --tag-post: #fef3c7;
  --tag-post-text: #b45309;
  --sidebar-width: 260px;
  --content-max: 780px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.65; display: flex; min-height: 100vh; }

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.sidebar-logo span { color: var(--accent); }

.sidebar-version {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

nav { padding: 16px 0 32px; }

.nav-group { margin-bottom: 4px; }

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 10px 20px 4px;
}

nav a {
  display: block;
  padding: 6px 20px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.12s, background 0.12s;
  border-radius: 0;
}

nav a:hover { color: var(--text); background: #f1f3f5; }
nav a.active { color: var(--accent); font-weight: 500; background: #eff6ff; }

nav a.sub {
  padding-left: 32px;
  font-size: 13px;
}

/* ── Main content ── */
#main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 0 48px 80px;
  max-width: calc(var(--sidebar-width) + var(--content-max) + 96px);
}

/* ── Sections ── */
.section {
  padding-top: 56px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 48px;
}

.section:last-child { border-bottom: none; }

h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 12px; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.3px; margin: 40px 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 28px 0 8px; color: var(--text); }

p { margin-bottom: 14px; color: #374151; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 20px; margin-bottom: 14px; color: #374151; }
li { margin-bottom: 4px; }

strong { font-weight: 600; color: var(--text); }

/* ── Lead paragraph ── */
.lead { font-size: 16px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.7; }

/* ── HTTP method badges ── */
.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  vertical-align: middle;
  margin-right: 6px;
}

.badge-get  { background: var(--tag-get);  color: var(--tag-get-text); }
.badge-post { background: var(--tag-post); color: var(--tag-post-text); }
.badge-put  { background: #ede9fe; color: #6d28d9; }
.badge-del  { background: #fee2e2; color: #b91c1c; }

/* ── Endpoint row ── */
.endpoint {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 0 8px;
}

.endpoint code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 5px;
}

/* ── Code blocks ── */
.code-block {
  position: relative;
  background: var(--code-bg);
  border-radius: 10px;
  margin: 16px 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #1e293b;
}

.code-lang {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-tabs { display: flex; gap: 2px; }

.code-tab {
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  color: #64748b;
  background: transparent;
  border: none;
  transition: background 0.12s, color 0.12s;
}

.code-tab:hover { background: #1e293b; color: #94a3b8; }
.code-tab.active { background: #1e293b; color: #e2e8f0; }

.code-copy {
  background: transparent;
  border: 1px solid #334155;
  color: #64748b;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  font-family: var(--font);
}

.code-copy:hover { border-color: #475569; color: #94a3b8; }
.code-copy.copied { border-color: #15803d; color: #4ade80; }

pre {
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--code-text);
  tab-size: 2;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Inline code ── */
code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: #f3f4f6;
  color: #1e40af;
  padding: 1.5px 5px;
  border-radius: 4px;
}

.code-block code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

/* syntax */
.kw  { color: var(--code-keyword); }
.st  { color: var(--code-string); }
.nu  { color: var(--code-number); }
.fn  { color: var(--code-func); }
.ty  { color: var(--code-type); }
.cm  { color: var(--code-comment); font-style: italic; }
.op  { color: #94a3b8; }

/* ── Param table ── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 12px 0 20px;
}

.param-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar-bg);
}

.param-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

.param-table tr:last-child td { border-bottom: none; }

.param-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.param-type {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #7c3aed;
  white-space: nowrap;
}

.param-req {
  font-size: 10.5px;
  font-weight: 600;
  color: #dc2626;
  background: #fee2e2;
  padding: 1px 5px;
  border-radius: 3px;
}

.param-opt {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 3px;
}

.param-desc { color: #374151; }

/* ── Callout ── */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.6;
}

.callout-info  { background: #eff6ff; border-left: 3px solid #2563eb; color: #1e40af; }
.callout-warn  { background: #fffbeb; border-left: 3px solid #d97706; color: #92400e; }
.callout-tip   { background: #f0fdf4; border-left: 3px solid #16a34a; color: #14532d; }

.callout-icon { font-size: 15px; flex-shrink: 0; padding-top: 1px; }

/* ── Type ref ── */
.type-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.type-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #f3f4f6;
  color: #1e40af;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
}

/* ── Divider ── */
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ── Scrollbar ── */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  :root { --sidebar-width: 220px; }
  #main { padding: 0 24px 60px; }
}

/* ── Downloads ── */
.download-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.download-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--sidebar-bg);
}

.download-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
}

.download-info {
  flex: 1;
  min-width: 0;
}

.download-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: .2rem;
}

.download-meta {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.download-desc {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.download-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: .55rem 1.1rem;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}

.download-btn:hover {
  background: var(--accent-hover);
}

@media (max-width: 640px) {
  #sidebar { display: none; }
  #main { margin-left: 0; padding: 0 16px 60px; }
}
