:root {
  --bg: #0a0b0a;
  --bg-elev: #121312;
  --border: #242624;
  --text: #e9ece9;
  --text-dim: #9aa39a;
  --text-faint: #6b746b;
  --accent: #39c175;
  --accent-dim: #1f6b40;
  --code-bg: #151715;
  --badge-get: #2563eb;
  --badge-post: #39c175;
  --badge-patch: #d4a72c;
  --badge-delete: #e5484d;
  --radius: 8px;
  --nav-h: 56px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--code-bg); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.88em; color: #b9f3cf; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; color: var(--text); }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
blockquote { border-left: 3px solid var(--accent-dim); margin: 0 0 1em; padding: 2px 16px; color: var(--text-dim); }
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.92em; }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg-elev); color: var(--text-dim); font-weight: 600; }
img { max-width: 100%; }

/* ---------- top nav ---------- */
.topnav {
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(10,11,10,0.92); backdrop-filter: blur(6px);
  z-index: 40;
}
.topnav .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--text); }
.topnav .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.topnav .links { display: flex; gap: 18px; color: var(--text-dim); font-size: 14px; flex: 1; }
.topnav .links a { color: var(--text-dim); }
.topnav .links a.active, .topnav .links a:hover { color: var(--text); text-decoration: none; }
.topnav .cta {
  background: var(--accent); color: #06130a; font-weight: 600; font-size: 13.5px;
  padding: 7px 14px; border-radius: 6px;
}
.topnav .cta:hover { text-decoration: none; filter: brightness(1.08); }
.topnav .menu-btn { display: none; background: none; border: none; color: var(--text); cursor: pointer; }

/* ---------- layout shell ---------- */
.shell { display: grid; grid-template-columns: 260px minmax(0,1fr) 230px; max-width: 1400px; margin: 0 auto; }
.shell.no-toc { grid-template-columns: 260px minmax(0,1fr); }

/* ---------- left sidebar ---------- */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  height: calc(100vh - var(--nav-h));
  position: sticky; top: var(--nav-h); overflow-y: auto;
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px;
  color: var(--text-faint); font-size: 13.5px; margin-bottom: 16px; cursor: pointer;
  background: var(--bg-elev);
}
.search-box kbd { margin-left: auto; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text-faint); }
.tabrow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 18px; }
.tabrow a {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); border-radius: 6px; padding: 9px 10px;
  font-size: 13px; color: var(--text-dim);
}
.tabrow a.active { background: var(--bg-elev); color: var(--text); border-color: var(--accent-dim); font-weight: 600; }
.navtree .section-label {
  text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; color: var(--text-faint);
  margin: 18px 0 6px; font-weight: 600;
}
.navtree ul { list-style: none; margin: 0; padding: 0; }
.navtree li a {
  display: block; padding: 6px 10px; border-radius: 6px; color: var(--text-dim); font-size: 13.5px;
}
.navtree li a:hover { background: var(--bg-elev); text-decoration: none; color: var(--text); }
.navtree li a.active { background: rgba(57,193,117,0.12); color: var(--accent); font-weight: 600; }

/* ---------- main content ---------- */
main { padding: 36px 48px 80px; min-width: 0; }
.breadcrumb { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 10px; }
.breadcrumb .current { color: var(--text-dim); font-weight: 700; }
main h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: -0.01em; }
.page-sub { color: var(--text-dim); font-size: 15.5px; margin-bottom: 18px; max-width: 760px; }
.page-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 12px;
  font-size: 13px; color: var(--text-dim); background: var(--bg-elev); cursor: pointer;
}
.btn:hover { color: var(--text); border-color: #3a3d3a; text-decoration: none; }
.updated { margin-left: auto; font-size: 12.5px; color: var(--text-faint); }
.content h2 { font-size: 22px; margin-top: 34px; border-top: 1px solid var(--border); padding-top: 28px; }
.content h2:first-child { border-top: none; padding-top: 0; }
.content h3 { font-size: 17px; margin-top: 24px; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin: 4px 0; }

/* ---------- right TOC ---------- */
.toc { padding: 36px 18px; position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); overflow-y: auto; }
.toc .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a { display: block; padding: 4px 0 4px 14px; font-size: 13px; color: var(--text-faint); border-left: 2px solid transparent; margin-left: -1px; }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); }
.toc li a:hover { color: var(--text); text-decoration: none; }

/* ---------- method badges ---------- */
.content table td:first-child code,
.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; }
.badge-get { background: rgba(37,99,235,0.18); color: #7fb0ff; }
.badge-post { background: rgba(57,193,117,0.18); color: #6ee0a0; }
.badge-patch { background: rgba(212,167,44,0.18); color: #e8c766; }
.badge-delete { background: rgba(229,72,77,0.18); color: #ff8e91; }

/* ---------- search modal ---------- */
.search-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: flex-start; justify-content: center; padding-top: 10vh; z-index: 100; }
.search-modal.open { display: flex; }
.search-panel { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; width: min(560px, 90vw); max-height: 60vh; overflow: hidden; display: flex; flex-direction: column; }
.search-panel input { background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text); padding: 14px 16px; font-size: 15px; outline: none; }
.search-results { overflow-y: auto; }
.search-results a { display: block; padding: 10px 16px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.search-results a:hover, .search-results a.sel { background: rgba(57,193,117,0.1); color: var(--text); text-decoration: none; }
.search-results .r-title { color: var(--text); font-size: 14px; font-weight: 600; }
.search-results .r-section { font-size: 11.5px; color: var(--text-faint); }

svg.icon { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 260px minmax(0,1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .topnav .links { display: none; }
  .topnav .menu-btn { display: block; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: var(--nav-h); bottom: 0; width: 260px; background: var(--bg); z-index: 50; transform: translateX(-100%); transition: transform 0.15s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.4); }
  main { padding: 28px 20px 60px; }
}
