/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:        #0f1117;
  --bg2:       #161b27;
  --bg3:       #1e2535;
  --border:    #2a3245;
  --accent:    #5b8ef0;
  --accent2:   #3ecf8e;
  --text:      #e2e8f0;
  --text-muted:#8b96b0;
  --code-bg:   #0d1117;
  --tag-v:     #5b8ef0;
  --tag-q:     #a78bfa;
  --tag-c:     #3ecf8e;
  --radius:    10px;
  --sidebar-w: 270px;
}
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 600; }

/* ─── Layout ───────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  padding: 0 0 40px;
  z-index: 100;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img { height: 32px; width: auto; }
.sidebar-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: rgba(91,142,240,.18);
  color: var(--accent);
  border: 1px solid rgba(91,142,240,.35);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.nav-section {
  padding: 20px 12px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-item {
  display: block;
  padding: 7px 20px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-radius: 6px;
  margin: 1px 8px;
  transition: background .15s, color .15s;
}
.nav-item:hover, .nav-item.active {
  background: var(--bg3);
  color: var(--text);
  text-decoration: none;
}
.nav-item.active { color: var(--accent); font-weight: 500; }
.nav-sub { padding-left: 32px; font-size: 13px; }

/* ─── Main Content ─────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.content { max-width: 860px; margin: 0 auto; padding: 56px 48px 100px; }

/* ─── Hero ─────────────────────────────────────────────────── */
.hero { padding: 48px 48px 0; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(62,207,142,.1);
  border: 1px solid rgba(62,207,142,.3);
  color: var(--accent2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent2);
}
.hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #e2e8f0 0%, #8b96b0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: 17px; color: var(--text-muted); max-width: 620px; line-height: 1.6; }
.hero-divider { height: 1px; background: var(--border); margin: 36px 0 0; }

/* ─── Sections ─────────────────────────────────────────────── */
.section { margin-bottom: 64px; }
.section:first-child { padding-top: 48px; }
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .anchor { opacity: 0; font-size: 16px; color: var(--text-muted); transition: opacity .2s; }
.section-title:hover .anchor { opacity: 1; }
.section p, .section li { color: var(--text-muted); margin-bottom: 8px; }
.section p strong { color: var(--text); }
.sub-title { font-size: 16px; font-weight: 600; color: var(--text); margin: 28px 0 12px; }

/* ─── Code blocks ──────────────────────────────────────────── */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.code-header .lang { display: flex; align-items: center; gap: 6px; }
.code-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .7; }
.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { background: var(--bg); color: var(--text); }
.copy-btn.copied { color: var(--accent2); border-color: var(--accent2); }
pre {
  padding: 18px 20px;
  overflow-x: auto;
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #cdd9e5;
  white-space: pre;
}
code { font-family: inherit; }
.hl-key    { color: #79c0ff; }
.hl-str    { color: #a5d6ff; }
.hl-val    { color: #f47067; }
.hl-cmt    { color: #8b949e; font-style: italic; }
.hl-kw     { color: #ff7b72; }
.inline-code {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 12.5px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
}

/* ─── Tabs ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: -1px; flex-wrap: wrap; }
.tab-btn {
  background: none;
  border: 1px solid var(--border);
  border-bottom-color: transparent;
  border-radius: 7px 7px 0 0;
  color: var(--text-muted);
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.tab-btn.active {
  background: var(--code-bg);
  border-color: var(--border);
  border-bottom-color: var(--code-bg);
  color: var(--text);
  font-weight: 600;
}
.tab-btn:hover:not(.active) { color: var(--text); background: var(--bg3); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tabs-wrapper .code-block { border-radius: 0 var(--radius) var(--radius) var(--radius); margin-top: 0; }

/* ─── Info/Warning boxes ────────────────────────────────────── */
.info-box {
  border-left: 3px solid var(--accent);
  background: rgba(91,142,240,.08);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
}
.info-box strong { color: var(--text); }
.warn-box {
  border-left: 3px solid #f59e0b;
  background: rgba(245,158,11,.07);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
}
.warn-box strong { color: #fbbf24; }

/* ─── Endpoint pill ─────────────────────────────────────────── */
.endpoint-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 18px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
  margin: 12px 0 20px;
}
.method-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
}
.method-post { background: rgba(62,207,142,.15); color: var(--accent2); }
.endpoint-url { color: var(--text); }

/* ─── Tools table ───────────────────────────────────────────── */
.tools-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13.5px; }
.tools-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tools-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(42,50,69,.6);
  vertical-align: top;
  color: var(--text-muted);
}
.tools-table tr:last-child td { border-bottom: none; }
.tools-table tr:hover td { background: rgba(255,255,255,.02); }
.tool-name {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.category-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tag-v { background: rgba(91,142,240,.15); color: var(--tag-v); border: 1px solid rgba(91,142,240,.25); }
.tag-q { background: rgba(167,139,250,.15); color: var(--tag-q); border: 1px solid rgba(167,139,250,.25); }
.tag-c { background: rgba(62,207,142,.15); color: var(--tag-c); border: 1px solid rgba(62,207,142,.25); }

/* ─── Param table ───────────────────────────────────────────── */
.param-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.param-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.param-table td { padding: 8px 12px; border: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
.param-name { font-family: "JetBrains Mono", ui-monospace, monospace; color: var(--text); font-size: 12.5px; }
.req-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: rgba(244,112,103,.15);
  color: #f47067;
  border: 1px solid rgba(244,112,103,.3);
  border-radius: 3px;
  padding: 0 5px;
  margin-left: 4px;
}
.type-badge {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: #d2a8ff;
}

/* ─── Steps ─────────────────────────────────────────────────── */
.steps { counter-reset: step; }
.step-item { display: flex; gap: 18px; margin-bottom: 28px; }
.step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}
.step-body { flex: 1; }
.step-body h4 { font-size: 15px; margin-bottom: 6px; color: var(--text); }

/* ─── Grid cards ────────────────────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s;
}
.card:hover { border-color: var(--accent); }
.card-icon { font-size: 22px; }
.card-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.card-desc { font-size: 12px; color: var(--text-muted); }

/* ─── Misc ──────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

@media (max-width: 800px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .content { padding: 32px 20px 80px; }
  .hero { padding: 32px 20px 0; }
}

details { margin: 4px 0; }
details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 12.5px;
  user-select: none;
}
details summary::before { content: '▸'; font-size: 10px; transition: transform .15s; }
details[open] summary::before { transform: rotate(90deg); }
details .detail-body {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ─── Language dropdown ─────────────────────────────────────── */
.lang-mini {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}
.lang-mini-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: .75rem;
  color: var(--text-muted);
  box-shadow: 0 1px 6px rgba(0,0,0,.2);
  transition: box-shadow .2s, border-color .2s;
  user-select: none;
}
.lang-mini-toggle:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  border-color: var(--text-muted);
  color: var(--text);
}
.lang-mini-list {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 0;
  min-width: 140px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  list-style: none;
  margin: 0;
}
.lang-mini.open .lang-mini-list { display: block; }
.lang-mini-list li {
  padding: 7px 16px;
  font-size: .78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.lang-mini-list li:hover { background: var(--bg3); color: var(--text); }
.lang-mini-list li.active { font-weight: 600; color: var(--text); }
