:root {
    --bg: #ffffff;
    --fg: #1a1a2e;
    --fg-muted: #656d76;
    --link: #0969da;
    --link-hover: #0550ae;
    --code-bg: #f6f8fa;
    --code-fg: #1f2328;
    --border: #d0d7de;
    --nav-bg: #f6f8fa;
    --nav-border: #d0d7de;
    --hover: #eef2f7;
    --active: #ddf4ff;
    --active-border: #54aeff;
    --badge-class: #8250df;
    --badge-interface: #0969da;
    --badge-enum: #bf8700;
    --badge-type: #1a7f37;
    --badge-function: #cf222e;
    --badge-variable: #656d76;
    --search-bg: #ffffff;
    --search-border: #d0d7de;
    --search-shadow: rgba(31, 35, 40, 0.12);
    --overlay: rgba(0, 0, 0, 0.3);
    --header-bg: #ffffff;
    --header-border: #d0d7de;
}
[data-theme="dark"] {
    --bg: #0d1117;
    --fg: #e6edf3;
    --fg-muted: #8b949e;
    --link: #58a6ff;
    --link-hover: #79c0ff;
    --code-bg: #161b22;
    --code-fg: #e6edf3;
    --border: #30363d;
    --nav-bg: #0d1117;
    --nav-border: #21262d;
    --hover: #1c2128;
    --active: #1a2332;
    --active-border: #388bfd;
    --badge-class: #bc8cff;
    --badge-interface: #58a6ff;
    --badge-enum: #e3b341;
    --badge-type: #3fb950;
    --badge-function: #f85149;
    --badge-variable: #8b949e;
    --search-bg: #161b22;
    --search-border: #30363d;
    --search-shadow: rgba(0, 0, 0, 0.3);
    --overlay: rgba(0, 0, 0, 0.6);
    --header-bg: #161b22;
    --header-border: #21262d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--fg); background: var(--bg); line-height: 1.6; }

/* Header */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--header-bg); border-bottom: 1px solid var(--header-border); height: 56px; display: flex; align-items: center; padding: 0 20px; }
.site-header .title { font-size: 16px; font-weight: 600; color: var(--fg); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.site-header .title:hover { color: var(--link); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger { display: flex; align-items: center; gap: 8px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; color: var(--fg-muted); cursor: pointer; font-size: 13px; min-width: 200px; }
.search-trigger:hover { border-color: var(--link); }
.search-trigger kbd { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 11px; font-family: inherit; margin-left: auto; }
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; cursor: pointer; color: var(--fg); font-size: 16px; display: flex; align-items: center; }
.theme-toggle:hover { background: var(--hover); }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; cursor: pointer; color: var(--fg); font-size: 18px; }

/* Layout */
.layout { display: flex; margin-top: 56px; min-height: calc(100vh - 56px); }

/* Sidebar */
.sidebar { width: 280px; min-width: 280px; background: var(--nav-bg); border-right: 1px solid var(--nav-border); position: fixed; top: 56px; bottom: 0; left: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 0; scrollbar-width: thin; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.nav-section { margin-bottom: 4px; }
.nav-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--fg-muted); padding: 8px 16px 4px; display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.nav-section-title:hover { color: var(--fg); }
.nav-section-title .count { font-size: 10px; background: var(--border); border-radius: 10px; padding: 0 6px; font-weight: 500; color: var(--fg-muted); }
.nav-section-title .chevron { margin-left: auto; transition: transform 0.15s; font-size: 10px; }
.nav-section.collapsed .chevron { transform: rotate(-90deg); }
.nav-section.collapsed .nav-items { display: none; }
.nav-items { list-style: none; }
.nav-items a { display: flex; align-items: center; gap: 8px; padding: 3px 16px 3px 20px; color: var(--fg); text-decoration: none; font-size: 13px; border-left: 2px solid transparent; transition: all 0.1s; }
.nav-items a:hover { background: var(--hover); color: var(--link); }
.nav-items a.active { background: var(--active); border-left-color: var(--active-border); color: var(--link); font-weight: 500; }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 3px; font-size: 10px; font-weight: 700; flex-shrink: 0; color: #fff; }
.nav-badge.class { background: var(--badge-class); }
.nav-badge.interface { background: var(--badge-interface); }
.nav-badge.enum { background: var(--badge-enum); }
.nav-badge.type { background: var(--badge-type); }
.nav-badge.function { background: var(--badge-function); }
.nav-badge.variable { background: var(--badge-variable); }

/* Content */
.content { margin-left: 280px; flex: 1; padding: 32px 48px; max-width: 960px; min-width: 0; }
.breadcrumb { font-size: 13px; color: var(--fg-muted); margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--link); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--border); }
h1 { font-size: 28px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h2 { font-size: 22px; margin: 32px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 18px; margin: 24px 0 8px; }
h4 { font-size: 16px; margin: 20px 0 8px; }
p { margin: 8px 0; }
code { background: var(--code-bg); color: var(--code-fg); padding: 2px 6px; border-radius: 4px; font-size: 85%; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }
pre { background: var(--code-bg); padding: 16px; border-radius: 8px; overflow-x: auto; margin: 0; border: 1px solid var(--border); }
pre code { background: none !important; padding: 0; color: var(--code-fg); }
.code-block { position: relative; margin: 12px 0; }
.copy-btn { position: absolute; top: 8px; right: 8px; background: var(--hover); border: 1px solid var(--border); border-radius: 4px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--fg-muted); opacity: 0; transition: opacity 0.15s; }
.code-block:hover .copy-btn { opacity: 1; }
.copy-btn.copied { color: #2da44e; border-color: #2da44e; }
.kw { color: #cf222e; }
.ty { color: #8250df; }
.str { color: #0a3069; }
.cm { color: #6e7781; font-style: italic; }
.num { color: #0550ae; }
[data-theme="dark"] .kw { color: #ff7b72; }
[data-theme="dark"] .ty { color: #d2a8ff; }
[data-theme="dark"] .str { color: #a5d6ff; }
[data-theme="dark"] .cm { color: #8b949e; }
[data-theme="dark"] .num { color: #79c0ff; }
table { border-collapse: collapse; width: 100%; margin: 12px 0; border-radius: 8px; overflow: hidden; }
th, td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; font-size: 14px; }
th { background: var(--code-bg); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.3px; }
td:first-child { font-weight: 500; }
tr:hover td { background: var(--hover); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--link-hover); }
blockquote { border-left: 3px solid var(--active-border); padding: 8px 16px; color: var(--fg-muted); margin: 12px 0; background: var(--code-bg); border-radius: 0 6px 6px 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* Parameter Details */
.param-details { margin: 16px 0 24px; }
.param-details h4 { font-size: 15px; margin-bottom: 8px; color: var(--fg-muted); }
.param-list { list-style: none; margin: 0; padding: 0; }
.param-list > li { padding: 10px 14px; border-left: 3px solid var(--border); margin-bottom: 8px; background: var(--code-bg); border-radius: 0 6px 6px 0; }
.param-list > li strong { color: var(--fg); }
.param-list > li em { color: var(--link); font-style: normal; }
.param-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-right: 4px; vertical-align: middle; }
.param-badge.optional { background: var(--badge-enum); color: #fff; }
.param-desc { margin: 4px 0 0; font-size: 14px; color: var(--fg-muted); }

/* Search Modal */
.search-overlay { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 200; justify-content: center; padding-top: 15vh; }
.search-overlay.active { display: flex; }
.search-modal { background: var(--search-bg); border: 1px solid var(--search-border); border-radius: 12px; width: 560px; max-height: 480px; box-shadow: 0 16px 48px var(--search-shadow); display: flex; flex-direction: column; overflow: hidden; }
.search-input-wrap { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 10px; }
.search-input-wrap svg { color: var(--fg-muted); flex-shrink: 0; }
.search-input { flex: 1; border: none; background: none; font-size: 16px; color: var(--fg); outline: none; font-family: inherit; }
.search-input::placeholder { color: var(--fg-muted); }
.search-results { overflow-y: auto; max-height: 380px; padding: 8px; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; color: var(--fg); text-decoration: none; font-size: 14px; }
.search-results a:hover, .search-results a.highlighted { background: var(--hover); }
.search-results .no-results { padding: 24px; text-align: center; color: var(--fg-muted); font-size: 14px; }
.search-footer { border-top: 1px solid var(--border); padding: 8px 16px; font-size: 12px; color: var(--fg-muted); display: flex; align-items: center; gap: 12px; }
.search-footer kbd { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 11px; }

/* Footer */
.site-footer { margin-left: 280px; padding: 24px 48px; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 13px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .sidebar.mobile-open { display: block; z-index: 150; width: 100%; }
    .content { margin-left: 0; padding: 20px; }
    .site-footer { margin-left: 0; padding: 20px; }
    .menu-toggle { display: flex; }
    .search-trigger { min-width: auto; }
    .search-trigger span { display: none; }
    .search-modal { width: calc(100% - 32px); }
}