@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Nunito+Sans:wght@400;600;700;800&display=swap');

:root {
    --bg: #f5f6f8;
    --bg-card: #ffffff;
    --bg-sidebar: #1b2a3d;
    --bg-sidebar-hover: #243548;
    --bg-sidebar-active: #2c4158;
    --bg-code: #0d1520;
    --bg-inline-code: #e8ecf1;
    --bg-tag: #e3f0ff;
    --text: #2c3e50;
    --text-secondary: #64748b;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #e2e8f0;
    --text-code: #c9d1d9;
    --accent: #2196F3;
    --accent-dark: #1976D2;
    --border: #e2e8f0;
    --red: #e74c3c;
    --green: #27ae60;
    --orange: #f39c12;
    --comment: #6a737d;
    --string: #a5d6ff;
    --keyword: #ff7b72;
    --number: #79c0ff;
    --prop: #f0883e;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.7;
    display: flex; min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 280px; min-height: 100vh; background: var(--bg-sidebar);
    position: fixed; top: 0; left: 0; overflow-y: auto; z-index: 100;
    transition: transform 0.3s;
}
.sidebar-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.sidebar-logo svg { flex-shrink: 0; }
.sidebar-logo-text { font-size: 1.05rem; font-weight: 800; color: #e2e8f0; letter-spacing: -0.02em; }
.sidebar-logo-text span { color: var(--accent); }
.sidebar-version {
    display: inline-block; background: rgba(33,150,243,0.15); color: var(--accent);
    font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 3px; margin-left: 0.4rem;
}
.sidebar-search { padding: 0.8rem 1.2rem; }
.sidebar-search input {
    width: 100%; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
    padding: 0.5rem 0.75rem 0.5rem 2.2rem; color: #e2e8f0;
    font-size: 0.85rem; font-family: inherit; outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 0.7rem center; transition: border-color 0.2s;
}
.sidebar-search input::placeholder { color: #64748b; }
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-nav { padding: 0.5rem 0 2rem; }
.nav-group { margin-bottom: 0.25rem; }
.nav-group-title {
    display: block; padding: 0.5rem 1.5rem 0.3rem; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em; color: #526580;
}
.nav-link {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 1.5rem 0.4rem 1.8rem; color: var(--text-sidebar);
    text-decoration: none; font-size: 0.87rem; font-weight: 400;
    transition: all 0.15s; border-left: 3px solid transparent;
}
.nav-link:hover { background: var(--bg-sidebar-hover); color: var(--text-sidebar-active); }
.nav-link.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); border-left-color: var(--accent); font-weight: 600; }
.nav-link .icon { font-size: 1rem; opacity: 0.6; width: 1.2rem; text-align: center; }

/* MAIN */
.main { margin-left: 280px; flex: 1; min-width: 0; }
.topbar {
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    padding: 0.6rem 2rem; display: flex; align-items: center;
    justify-content: space-between; position: sticky; top: 0; z-index: 50;
}
.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--text-secondary); }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #cbd5e1; }
.topbar-meta { font-size: 0.78rem; color: var(--text-secondary); }
.content-wrap { max-width: 860px; padding: 2rem 2.5rem 4rem; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; padding: 0.3rem; color: var(--text); }

/* CONTENT */
.page-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; color: #1a2332; margin-bottom: 0.3rem; }
.page-meta { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 1.8rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.page-meta .tag { background: var(--bg-tag); color: var(--accent-dark); padding: 0.15rem 0.55rem; border-radius: 4px; font-weight: 600; font-size: 0.75rem; }
h2 { font-size: 1.35rem; font-weight: 800; margin: 2.2rem 0 0.8rem; color: #1a2332; letter-spacing: -0.02em; padding-bottom: 0.4rem; border-bottom: 2px solid var(--border); }
h3 { font-size: 1.05rem; font-weight: 700; margin: 1.6rem 0 0.5rem; color: #2c3e50; }
h4 { font-size: 0.95rem; font-weight: 700; margin: 1.2rem 0 0.4rem; color: #334155; }
p { margin-bottom: 1rem; font-size: 0.94rem; }
a { color: var(--accent); }
ul, ol { margin: 0.5rem 0 1rem 1.5rem; font-size: 0.94rem; }
li { margin-bottom: 0.3rem; }

/* CALLOUTS */
.callout { border-radius: 8px; padding: 1rem 1.2rem; margin: 1.2rem 0; font-size: 0.88rem; display: flex; gap: 0.7rem; line-height: 1.6; }
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }
.callout-info { background: #eff8ff; border-left: 4px solid var(--accent); color: #1e3a5f; }
.callout-warning { background: #fff8eb; border-left: 4px solid var(--orange); color: #6b4c10; }
.callout-danger { background: #fef2f2; border-left: 4px solid var(--red); color: #7f1d1d; }
.callout-tip { background: #f0fdf4; border-left: 4px solid var(--green); color: #14532d; }

/* CODE */
pre { background: var(--bg-code); border-radius: 8px; padding: 1.1rem 1.3rem; overflow-x: auto; margin: 1rem 0 1.2rem; position: relative; border: 1px solid #1e293b; }
pre code { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; line-height: 1.65; color: var(--text-code); }
code { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; }
.inline-code { background: var(--bg-inline-code); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.82rem; color: #c7254e; }
.code-label { position: absolute; top: 0; right: 0; background: rgba(255,255,255,0.06); color: #64748b; font-size: 0.68rem; font-family: 'JetBrains Mono', monospace; padding: 0.25rem 0.7rem; border-radius: 0 8px 0 6px; }
.c { color: var(--comment); font-style: italic; }
.s { color: var(--string); }
.k { color: var(--keyword); }
.n { color: var(--number); }
.p { color: var(--prop); }

/* TABLE */
table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.88rem; }
th { background: #f1f5f9; font-weight: 700; text-align: left; padding: 0.6rem 1rem; border-bottom: 2px solid var(--border); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: #475569; }
td { padding: 0.55rem 1rem; border-bottom: 1px solid var(--border); }
tr:hover td { background: #f8fafc; }
.param-name { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; font-weight: 500; color: var(--accent-dark); }

/* TOC */
.toc { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.3rem; margin-bottom: 2rem; }
.toc-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 0.5rem; }
.toc-list { list-style: none; font-size: 0.87rem; margin: 0; padding: 0; }
.toc-list li { padding: 0.2rem 0; }
.toc-list a { color: var(--accent); text-decoration: none; }
.toc-list a:hover { text-decoration: underline; }

/* FOOTER */
.page-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.page-footer a { color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.page-footer a:hover { text-decoration: underline; }
.site-footer { text-align: center; padding: 1.5rem 2rem; font-size: 0.78rem; color: var(--text-secondary); border-top: 1px solid var(--border); }

/* RESPONSIVE */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: block; }
    .content-wrap { padding: 1.5rem 1.2rem 3rem; }
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
pre::-webkit-scrollbar { height: 4px; }
pre::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
