:root {
    --bg-page: #0b0d10;
    --bg-sidebar: #0e1217;
    --bg-card: #13171f;
    --bg-card-hover: #19202b;
    --bg-input: #121720;
    --bg-code: #090c10;
    --border-color: #1e2633;
    --border-hover: #2d3748;
    --border-focus: #6366f1;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-cyan: #38bdf8;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --font-heading: 'Syne', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    --header-height: 64px;
    --sidebar-width: 290px;
    --toc-width: 240px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-page);
    color: var(--text-primary);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.docs-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    background: rgba(11, 13, 16, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    box-shadow: 0 0 12px var(--accent-glow);
}

.brand-pill {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-center {
    flex: 1;
    max-width: 480px;
    margin: 0 1.5rem;
}

.search-trigger-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.9rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-trigger-btn:hover {
    border-color: var(--border-focus);
    color: var(--text-secondary);
    background: var(--bg-card-hover);
}

.search-trigger-content {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.kbd-shortcut {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    background: #1e2633;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.72rem;
    color: #94a3b8;
    font-family: var(--font-mono);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-nav-link {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.header-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.header-btn-primary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    border: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.header-btn-primary:hover {
    opacity: 0.92;
    color: #fff;
    text-decoration: none;
}

.menu-toggle-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.docs-layout {
    display: flex;
    flex: 1;
    width: 100%;
    min-height: calc(100vh - var(--header-height));
}

.docs-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    overflow-y: auto;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

.sidebar-category {
    margin-bottom: 1.5rem;
}

.sidebar-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
}

.sidebar-category-header:hover {
    color: var(--text-secondary);
}

.sidebar-category-header svg {
    transition: transform 0.2s ease;
}

.sidebar-category.collapsed .sidebar-category-header svg {
    transform: rotate(-90deg);
}

.sidebar-category.collapsed .sidebar-links {
    display: none;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.4rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.sidebar-link.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.12);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

.sidebar-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    background: #1e2633;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.sidebar-link.active .sidebar-badge {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}

.docs-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 2.5rem 2rem 4rem 2rem;
    min-width: 0;
}

.docs-content-container {
    width: 100%;
    max-width: 820px;
    min-width: 0;
}

.docs-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.docs-breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.docs-breadcrumbs a:hover {
    color: var(--text-secondary);
}

.breadcrumb-separator {
    opacity: 0.5;
}

.article-header {
    margin-bottom: 2.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.article-meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.article-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--accent-cyan);
}

.read-time-pill {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.article-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.article-summary {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.docs-prose {
    font-size: 1rem;
    color: #cbd5e1;
    line-height: 1.75;
}

.docs-prose h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.01em;
}

.docs-prose h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 1.75rem 0 0.75rem 0;
}

.docs-prose h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 1.25rem 0 0.5rem 0;
}

.docs-prose p {
    margin-bottom: 1.25rem;
}

.docs-prose ul,
.docs-prose ol {
    margin: 0 0 1.25rem 1.5rem;
}

.docs-prose li {
    margin-bottom: 0.4rem;
}

.docs-prose strong {
    color: #fff;
}

.docs-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.docs-prose th,
.docs-prose td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.docs-prose th {
    background: #161c26;
    color: #e2e8f0;
    font-family: var(--font-heading);
    font-weight: 600;
}

.docs-prose tr:last-child td {
    border-bottom: none;
}

.docs-prose code:not(pre code) {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.code-block-wrapper {
    position: relative;
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #0f1319;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.copy-btn {
    background: transparent;
    border: 1px solid #2d3748;
    color: #94a3b8;
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: #4a5568;
}

.docs-prose pre {
    padding: 1.1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.callout {
    margin: 1.75rem 0;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border-left: 4px solid var(--accent-primary);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.callout-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.callout-info {
    border-left-color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.05);
}

.callout-info .callout-header {
    color: var(--accent-cyan);
}

.callout-warning {
    border-left-color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.05);
}

.callout-warning .callout-header {
    color: var(--accent-amber);
}

.callout-important {
    border-left-color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.05);
}

.callout-important .callout-header {
    color: var(--accent-rose);
}

.callout-tip {
    border-left-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.05);
}

.callout-tip .callout-header {
    color: var(--accent-emerald);
}

.callout p:last-child {
    margin-bottom: 0;
}

.command-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.25rem 0;
    transition: border-color 0.15s ease;
}

.command-card:hover {
    border-color: #2d3748;
}

.command-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.command-name {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.command-category-pill {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.command-syntax {
    background: #090c10;
    border: 1px solid #1a222f;
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #f1f5f9;
    margin: 0.6rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.command-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.pagination-footer {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.pagination-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    flex: 1;
    transition: all 0.15s ease;
}

.pagination-card:hover {
    border-color: var(--border-focus);
    background: var(--bg-card-hover);
    text-decoration: none;
}

.pagination-card.next {
    text-align: right;
}

.pagination-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.pagination-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.docs-toc {
    width: var(--toc-width);
    flex-shrink: 0;
    padding: 2.5rem 1.25rem;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.toc-header {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-left: 1px solid var(--border-color);
    padding-left: 0.75rem;
}

.toc-link {
    font-size: 0.825rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.4;
    display: block;
}

.toc-link:hover {
    color: var(--text-secondary);
    text-decoration: none;
}

.toc-link.active {
    color: var(--accent-cyan);
    font-weight: 600;
}

.search-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal-backdrop.open {
    display: flex;
}

.search-modal {
    width: 100%;
    max-width: 620px;
    background: #11151c;
    border: 1px solid #2d3748;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: #141922;
}

.search-input-wrapper svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 1rem;
    color: #fff;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-results-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    text-decoration: none;
}

.result-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

.result-category-badge {
    font-size: 0.7rem;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.2);
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
}

.result-excerpt {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.search-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #0d1117;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.search-shortcut-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-shortcut-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

@media (max-width: 1120px) {
    .docs-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .menu-toggle-btn {
        display: flex;
    }

    .header-center {
        display: none;
    }

    .docs-sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        bottom: 0;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-main {
        padding: 1.5rem 1rem 3rem 1rem;
    }

    .article-title {
        font-size: 1.75rem;
    }

    .pagination-footer {
        flex-direction: column;
    }

    .pagination-card.next {
        text-align: left;
    }
}

