:root {
  --bg: #ffffff;
  --sidebar-bg: #f6f8fb;
  --topbar-bg: #1e293b;
  --fg: #1e242c;
  --muted: #526071;
  --link: #155ec4;
  --border: #d4dce6;
  --th-bg: #edf2f8;
  --key-bg: #edf1f6;
  --note-bg: #eef5fd; --note-bd: #3478d6;
  --tip-bg: #edf8f1; --tip-bd: #2d9158;
  --warn-bg: #fdf5e7; --warn-bd: #d48618;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e2024;
    --sidebar-bg: #25282e;
    --topbar-bg: #15181d;
    --fg: #dde2ea;
    --muted: #9aa5b4;
    --link: #68aaff;
    --border: #3d4450;
    --th-bg: #2f343d;
    --key-bg: #343a45;
    --note-bg: #243347; --note-bd: #5898ee;
    --tip-bg: #21392e; --tip-bd: #4cb278;
    --warn-bg: #3e311e; --warn-bd: #e09c38;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--fg); line-height: 1.58; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 20px; background: var(--topbar-bg); color: #f8fafc; border-bottom: 1px solid var(--border); }
.topbar-brand a { color: #93c5fd; font-weight: 700; text-decoration: none; }
.topbar-brand .sep { opacity: 0.5; margin: 0 6px; }
.lang-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-pill { padding: 3px 9px; border-radius: 999px; font-size: 0.85rem; color: #cbd5e1; text-decoration: none; border: 1px solid rgba(255,255,255,0.18); }
.lang-pill:hover { background: rgba(255,255,255,0.1); color: #fff; }
.lang-pill.active { background: #3b82f6; border-color: #3b82f6; color: #fff; font-weight: 600; }
.layout { display: flex; min-height: calc(100vh - 50px); }
.sidebar { width: 280px; flex-shrink: 0; background: var(--sidebar-bg); border-right: 1px solid var(--border); padding: 16px 14px 28px; position: sticky; top: 50px; height: calc(100vh - 50px); overflow-y: auto; font-size: 0.92rem; }
.sidebar div.h2 { margin-top: 12px; font-weight: 700; }
.sidebar div.h3 { margin-left: 14px; margin-top: 3px; }
.sidebar a { color: var(--link); text-decoration: none; }
.sidebar a:hover { text-decoration: underline; }
.content { flex: 1; max-width: 960px; padding: 28px 36px 64px; min-width: 0; }
h1 { margin-top: 0; font-size: 1.9rem; }
h2 { margin-top: 2.2rem; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-size: 1.4rem; }
h3 { margin-top: 1.4rem; font-size: 1.12rem; }
a { color: var(--link); }
img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 4px; }
div.note, div.tip, div.warn { margin: 12px 0; padding: 10px 14px; border-radius: 4px; border-left: 4px solid; }
div.note { background: var(--note-bg); border-color: var(--note-bd); }
div.tip { background: var(--tip-bg); border-color: var(--tip-bd); }
div.warn { background: var(--warn-bg); border-color: var(--warn-bd); }
span.key { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; background: var(--key-bg); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); }
table.doc { border-collapse: collapse; margin: 14px 0 18px; width: auto; max-width: 100%; border: 1px solid var(--border); }
table.doc th, table.doc td { padding: 7px 11px; border: 1px solid var(--border); vertical-align: top; }
table.doc th { background: var(--th-bg); text-align: left; font-weight: 600; }
td.number { text-align: right; }
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .content { padding: 20px 18px 44px; }
}

