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

:root {
  --bg-body: #151617;
  --bg-sidebar: #111;
  --bg-card: #1e1e1e;
  --bg-code: #111;
  --bg-input: #222;
  --bg-hover: #282828;
  --border: #282828;
  --border-light: #393939;

  --text: #fff;
  --text-muted: #a9a9a9;
  --text-dim: #777;

  --accent: #94f9c3;
  --accent-dim: rgba(148,249,195,0.41);
  --accent-bg: rgba(148,249,195,0.08);

  --yellow: #fff867;
  --yellow-dim: rgba(255,248,103,0.15);
  --red: #f0496b;
  --red-dim: rgba(240,73,107,0.15);
  --purple: #8591d5;
  --purple-dim: rgba(133,145,213,0.15);
  --teal: #64dec1;

  --mono: 'SF Mono','Cascadia Code','Fira Code','JetBrains Mono','Menlo',monospace;
  --sans: 'Montserrat',-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;

  --sw: 260px;
  --radius: 8px;
}

html { scroll-padding-top: 24px; }
body {
  font-family: var(--sans); background: var(--bg-body); color: var(--text);
  line-height: 1.6; font-size: 14px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.sidebar {
  position: fixed; top: 0; left: 0; width: var(--sw); height: 100vh;
  background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 200;
  transition: transform 0.25s ease;
}
.sidebar-hdr {
  padding: 20px 18px 16px; border-bottom: 1px solid var(--border);
}
.sidebar-hdr h1 {
  font-size: 18px; font-weight: 700; color: var(--accent);
  letter-spacing: -0.3px;
}
.sidebar-hdr h1 span { color: var(--text-dim); font-weight: 400; font-size: 13px; margin-left: 6px; }
.search-wrap { padding: 10px 14px; }
.search-wrap input {
  width: 100%; padding: 7px 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text);
  font-size: 13px; font-family: var(--sans); outline: none;
  transition: border-color 0.15s;
}
.search-wrap input::placeholder { color: var(--text-dim); }
.search-wrap input:focus { border-color: var(--accent); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 0 24px; }
.nav-cat {
  padding: 14px 18px 4px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim);
}
.nav-link {
  display: flex; align-items: center; padding: 5px 18px 5px 24px;
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  border-left: 2px solid transparent; transition: all 0.1s;
}
.nav-link.guide-link { font-family: var(--sans); }
.nav-link:hover {
  color: var(--text); background: var(--bg-hover); text-decoration: none;
}
.nav-link.active {
  color: var(--accent); border-left-color: var(--accent);
  background: var(--accent-bg);
}
.nav-badge {
  margin-left: auto; font-size: 9px; padding: 1px 6px; border-radius: 10px;
  font-family: var(--sans); font-weight: 600;
}
.badge-w { background: var(--yellow-dim); color: var(--yellow); }
.badge-ow { background: var(--purple-dim); color: var(--purple); }
.badge-ix { background: rgba(100,222,193,0.15); color: var(--teal); }
.badge-oix { background: rgba(100,222,193,0.10); color: var(--teal); }
.nav-divider { border-top: 1px solid var(--border); margin: 10px 18px; }
.hidden { display: none !important; }

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.menu-btn {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 300;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); width: 40px; height: 40px; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 0;
  align-items: center; justify-content: center;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 150;
}

.main { margin-left: var(--sw); max-width: 820px; padding: 40px 48px 120px; }

.guide { padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--border); }
.guide h2 {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin: 48px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 15px; font-weight: 600; margin: 24px 0 8px; color: var(--text); }
.guide p { color: var(--text-muted); font-size: 14px; line-height: 1.7; margin: 6px 0; }
.guide ul, .guide ol {
  color: var(--text-muted); font-size: 14px; line-height: 1.7;
  padding-left: 22px; margin: 6px 0;
}
.guide li { margin: 3px 0; }
.guide code {
  font-family: var(--mono); font-size: 12px; background: var(--bg-card);
  padding: 2px 6px; border-radius: 4px; color: var(--accent);
}
.guide strong { color: var(--text); }
.guide table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 14px; }
.guide th {
  text-align: left; font-weight: 600; color: var(--text-dim); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--border);
}
.guide td {
  padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border);
  vertical-align: top; color: var(--text-muted);
}
.guide td code { font-size: 12px; }
.guide tr:last-child td { border-bottom: none; }

.codeblk {
  position: relative;
  background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.6;
  overflow-x: auto; margin: 8px 0 14px; white-space: pre; color: var(--text-muted);
}
.copy-btn {
  position: absolute; top: 6px; right: 6px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-dim); cursor: pointer; padding: 4px 6px;
  opacity: 0; transition: opacity 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1; font-size: 0;
}
.codeblk:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--border-light); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); opacity: 1; }
.copy-btn svg { width: 14px; height: 14px; }
.anchor-link {
  margin-left: 8px; color: var(--text-dim); opacity: 0;
  transition: opacity 0.15s, color 0.15s; vertical-align: middle;
}
.anchor-link svg { width: 16px; height: 16px; vertical-align: -2px; }
*:hover > .anchor-link { opacity: 1; }
.anchor-link:hover { color: var(--accent); text-decoration: none; }
.codeblk .cm { color: var(--text-dim); }
.codeblk .cmd { color: var(--yellow); }
.codeblk .flag { color: var(--accent); }
.codeblk .val { color: var(--purple); }
.codeblk .str { color: var(--accent); }
.codeblk .key { color: var(--teal); }

.sk { color: var(--teal); }
.ss { color: var(--accent); }
.snum { color: var(--purple); }
.sb { color: var(--yellow); }
.sn { color: var(--red); }

.note, .guide .note {
  font-size: 13px; color: var(--text-muted); margin: 10px 0; padding: 10px 14px;
  background: var(--accent-bg); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; line-height: 1.6;
}
.note code {
  font-family: var(--mono); font-size: 12px; background: rgba(255,255,255,0.06);
  padding: 1px 5px; border-radius: 3px;
}

.category { margin-bottom: 48px; }
.cat-hdr {
  font-size: 18px; font-weight: 700; color: var(--text);
  padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.cat-desc { font-size: 13px; color: var(--text-muted); margin: -12px 0 18px; }

.method {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
  transition: border-color 0.15s;
}
.method.active { border-color: var(--accent); }
.method-hdr {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
}
.method-name {
  font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text);
}
.method-tags { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.tag { font-size: 9px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.tag-w { background: var(--yellow-dim); color: var(--yellow); }
.tag-ow { background: var(--purple-dim); color: var(--purple); }
.tag-ix { background: rgba(100,222,193,0.15); color: var(--teal); }
.tag-oix { background: rgba(100,222,193,0.10); color: var(--teal); }
.method-body {
  padding: 0 16px 16px; border-top: 1px solid var(--border);
}
.method-desc { font-size: 13px; color: var(--text-muted); margin: 12px 0; line-height: 1.6; }

.sec-lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim); margin: 16px 0 6px;
}

.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable th {
  text-align: left; font-weight: 600; color: var(--text-dim); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.3px; padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--border);
}
.ptable td {
  padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.ptable tr:last-child td { border-bottom: none; }
.pname { font-family: var(--mono); color: var(--accent); white-space: nowrap; font-size: 12px; }
.ptype { font-family: var(--mono); color: var(--purple); font-size: 11px; }
.preq { color: var(--red); font-size: 10px; font-weight: 700; }
.popt { color: var(--text-dim); font-size: 10px; }
.pdesc { color: var(--text-muted); }
.pdef { color: var(--text-dim); font-size: 12px; }

.method-body .codeblk { margin: 4px 0 8px; }

@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .menu-btn { display: flex; }
  .main { margin-left: 0; padding: 60px 20px 80px; }
}
