/* ================================================================
   Wiki Viewer — 暗色冷色调设计系统
   ================================================================ */

:root {
    --bg-primary: #0b0d15;
    --bg-secondary: #0f111a;
    --bg-surface: #141622;
    --text-primary: #e2e6f0;
    --text-secondary: #8a90a8;
    --accent: #5b8af5;
    --accent-light: #7ba3ff;
    --border: #1e2238;
    --code-bg: #090b12;
    --sidebar-width: 280px;
    --transition-speed: 0.25s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
}

/* ================================================================
   Reading Progress Bar
   ================================================================ */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    z-index: 10000;
    transition: width 0.1s ease;
}

/* ================================================================
   Sidebar
   ================================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    z-index: 100;
    transition: transform var(--transition-speed) ease;
}

.sidebar h1 {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 1.25em;
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--accent);
}

.meta {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin-bottom: 20px;
}

.category {
    margin-bottom: 20px;
}

.category-title {
    color: var(--accent);
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 10px;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.subcategory-title {
    color: #b8bdd8;
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 6px;
    padding-left: 18px;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    cursor: pointer;
    user-select: none;
    padding-top: 6px;
    padding-right: 12px;
    padding-bottom: 6px;
    margin-top: 4px;
    border-radius: 4px;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-link {
    display: block;
    padding: 8px 12px;
    color: #b8bdd8;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 3px;
    font-size: 1em;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    transition: background var(--transition-speed) ease,
                color var(--transition-speed) ease;
    border-bottom: none;
}

.page-link:hover {
    background: var(--bg-surface);
    color: var(--accent-light);
}

/* ---- Sidebar Toggle Button ---- */
.sidebar-toggle {
    position: fixed;
    top: 12px;
    left: calc(var(--sidebar-width) + 12px);
    z-index: 10001;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    opacity: 0.7;
}

.sidebar-toggle:hover {
    opacity: 1;
    color: var(--accent-light);
    border-color: var(--accent);
    background: var(--bg-secondary);
}

/* ---- Sidebar Collapsed State ---- */
body.sidebar-collapsed .sidebar {
    transform: translateX(calc(var(--sidebar-width) * -1));
}

body.sidebar-collapsed .main {
    margin-left: 0;
}

body.sidebar-collapsed .sidebar-toggle {
    left: 12px;
}

body:not(.has-sidebar) .sidebar-toggle {
    display: none;
}

/* ================================================================
   Main Content Area
   ================================================================ */
.main {
    margin-left: var(--sidebar-width);
    padding: 50px 60px;
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--transition-speed) ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 0;
}

.article-container {
    max-width: 1040px;
    margin: 0 auto;
}

/* ---- FadeInUp Animation ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container, .main {
    animation: fadeInUp 0.35s ease;
}

/* ================================================================
   Headings
   ================================================================ */
.container h1,
.main h1 {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 700;
    font-size: 2.5em;
    color: var(--text-primary);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

h2 {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 600;
    font-size: 1.6em;
    color: var(--text-primary);
    margin-top: 40px;
    margin-bottom: 16px;
    line-height: 1.3;
}

h3 {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 600;
    font-size: 1.2em;
    color: var(--accent-light);
    margin-top: 28px;
    margin-bottom: 12px;
    line-height: 1.4;
}

h4, h5, h6 {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 10px;
}

/* ---- Page Title ---- */
.page-title {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 700;
    font-size: 2.5em;
    color: var(--text-primary);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

/* ================================================================
   Content (Markdown Rendered Area)
   ================================================================ */
.content {
    font-family: "Newsreader", "Noto Serif SC", Georgia, serif;
    font-size: 1.1em;
    line-height: 1.85;
    color: var(--text-primary);
}

.content p {
    font-family: "Newsreader", "Noto Serif SC", Georgia, serif;
    font-size: 1.1em;
    line-height: 1.85;
    margin-bottom: 1.5em;
    color: var(--text-primary);
}

.content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease, color 0.2s ease;
}

.content a:hover {
    border-bottom-color: var(--accent);
    color: var(--accent-light);
}

.content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}

.content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

p {
    font-size: 1.1em;
    line-height: 1.85;
    margin-bottom: 1.5em;
    color: var(--text-primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease, color 0.2s ease;
}

a:hover {
    border-bottom-color: var(--accent);
    color: var(--accent-light);
}

/* ================================================================
   Code
   ================================================================ */
code {
    background: var(--code-bg);
    color: var(--accent-light);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.85em;
}

pre {
    background: var(--code-bg);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border);
}

pre code {
    background: none;
    padding: 0;
    color: var(--accent-light);
    font-size: 0.9em;
    line-height: 1.6;
}

/* ================================================================
   Blockquote
   ================================================================ */
blockquote {
    border-left: 3px solid var(--accent);
    margin: 20px 0;
    padding: 15px 20px;
    background: var(--bg-surface);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* ================================================================
   Lists
   ================================================================ */
ul, ol {
    margin: 15px 0;
    padding-left: 30px;
}

li {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1.1em;
    line-height: 1.85;
}

/* ================================================================
   Tables
   ================================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--border);
}

th {
    background: var(--bg-surface);
    color: var(--accent-light);
    font-weight: 600;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 0.9em;
}

tr:nth-child(even) td {
    background: rgba(20, 22, 34, 0.5);
}

/* ================================================================
   Stats
   ================================================================ */
.stats {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 30px;
}

/* ================================================================
   Back Link
   ================================================================ */
.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 30px;
    font-size: 0.95em;
    padding: 10px 0;
    transition: transform 0.2s ease, color 0.2s ease;
    border-bottom: none;
}

.back-link:hover {
    color: var(--accent-light);
    transform: translateX(-4px);
    border-bottom: none;
}

.back-link::before {
    content: '\2190';
    margin-right: 8px;
    font-size: 1.1em;
    transition: transform 0.2s ease;
}

.back-link:hover::before {
    transform: translateX(-3px);
}

/* ================================================================
   Error Page (404)
   ================================================================ */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 40px;
    animation: fadeInUp 0.35s ease;
}

.error-page h1 {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 6em;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 20px;
    border-bottom: none;
    padding-bottom: 0;
}

.error-page p {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.error-page .back-link::before {
    content: none;
}

/* ================================================================
   Search Form
   ================================================================ */
.search-form {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9em;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 138, 245, 0.15);
}

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

/* ================================================================
   Search Results
   ================================================================ */
.search-result {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.search-result h2 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
}

.search-result h2 a {
    color: var(--accent);
    border-bottom: none;
}

.search-result h2 a:hover {
    color: var(--accent-light);
    border-bottom: none;
}

.result-meta {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-right: 10px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-surface);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.8em;
    margin-bottom: 8px;
}

.snippets {
    margin-top: 10px;
}

.snippet {
    padding: 8px 12px;
    background: var(--code-bg);
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
    line-height: 1.5;
}

.snippet mark {
    background: rgba(91, 138, 245, 0.3);
    color: var(--accent-light);
    padding: 0 2px;
    border-radius: 2px;
}

/* ================================================================
   Breadcrumb
   ================================================================ */
.breadcrumb {
    margin-bottom: 10px;
    font-size: 0.85em;
}

.crumb-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: none;
}

.crumb-link:hover {
    color: var(--accent-light);
    border-bottom: none;
}

.crumb-sep {
    color: var(--text-secondary);
    margin: 0 6px;
}

.crumb-current {
    color: var(--text-secondary);
}

/* ================================================================
   Page Meta
   ================================================================ */
.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.source-link {
    color: var(--accent);
    border-bottom: none;
}

.source-link:hover {
    color: var(--accent-light);
}

/* ================================================================
   Tags
   ================================================================ */
.page-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.tag-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-surface);
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8em;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag-badge:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ================================================================
   Edit Link
   ================================================================ */
.edit-link {
    color: var(--text-secondary);
    border-bottom: none;
    font-size: 0.95em;
    transition: color 0.2s ease;
}

.edit-link:hover {
    color: var(--accent-light);
    border-bottom: none;
}

/* ================================================================
   Edit Page
   ================================================================ */
.edit-container {
    max-width: min(95vw, 1400px);
    width: 100%;
}

.edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.edit-header h1 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 1.8em;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-wrapper {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-surface);
    transition: border-color 0.2s ease;
}

.editor-wrapper:focus-within {
    border-color: var(--accent);
}

.editor-textarea {
    width: 100%;
    min-height: 75vh;
    padding: 24px;
    background: var(--code-bg);
    color: var(--text-primary);
    font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 0.95em;
    line-height: 1.7;
    border: none;
    outline: none;
    resize: vertical;
    tab-size: 4;
}

.editor-textarea:focus {
    box-shadow: inset 0 0 0 1px var(--accent);
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    font-size: 0.85em;
    color: var(--text-secondary);
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.edit-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ================================================================
   Buttons
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    border-bottom: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    border-bottom: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    border-bottom: none;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border-bottom: none;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-cancel:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    border-bottom: none;
}

/* ================================================================
   File Grid / File Card (for directory listings)
   ================================================================ */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.file-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.file-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.file-card h3 {
    margin-top: 0;
    color: var(--accent-light);
}

/* ================================================================
   Responsive — 1024px
   ================================================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .main {
        padding: 40px 30px;
    }

    .container h1,
    .main h1 {
        font-size: 2em;
    }
}

/* ================================================================
   Responsive — 768px: Sidebar becomes overlay
   ================================================================ */
@media (max-width: 768px) {
    body {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: var(--sidebar-width);
        height: 100vh;
        z-index: 100;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(calc(var(--sidebar-width) * -1));
    }

    .main {
        margin-left: 0;
        padding: 60px 20px 30px;
    }

    .container {
        padding: 20px 0;
    }

    .container h1,
    .main h1 {
        font-size: 1.6em;
    }

    h2 {
        font-size: 1.3em;
    }

    p,
    li,
    .content p {
        font-size: 1em;
    }

    .breadcrumb {
        overflow-x: auto;
        white-space: nowrap;
    }

    .page-meta {
        flex-direction: column;
        gap: 8px;
    }

    .tag-badge {
        font-size: 0.75em;
        padding: 3px 10px;
    }

    .edit-container {
        max-width: 100%;
        padding: 0 12px;
    }

    .edit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .editor-textarea {
        min-height: 50vh;
        font-size: 0.85em;
    }

    .edit-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .edit-actions .btn {
        width: 100%;
    }

    .search-result h2 {
        font-size: 1.1em;
    }

    .snippet {
        font-size: 0.8em;
    }

    .back-link {
        font-size: 0.85em;
    }

    .file-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   Responsive — 480px
   ================================================================ */
@media (max-width: 480px) {
    :root {
        --sidebar-width: 260px;
    }

    .main {
        padding: 55px 14px 20px;
    }

    .container h1,
    .main h1 {
        font-size: 1.4em;
    }

    h2 {
        font-size: 1.15em;
    }

    .page-meta {
        font-size: 0.8em;
    }

    .editor-textarea {
        font-size: 0.8em;
        padding: 16px;
    }

    .sidebar-toggle {
        top: 8px;
        left: 8px;
        width: 30px;
        height: 30px;
    }
}

/* ================================================================
   Scrollbar
   ================================================================ */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(91, 138, 245, 0.3);
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(91, 138, 245, 0.5);
}

/* ================================================================
   Homepage Stats
   ================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}
.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: var(--accent-light);
    display: block;
}
.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 4px;
}
.home-section {
    margin-bottom: 32px;
}
.home-section h2 {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.recent-list li {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background 0.2s ease;
}
.recent-list li:hover {
    background: var(--bg-surface);
}
.recent-list a {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.recent-list a:hover {
    color: var(--accent-light);
}
.recent-time {
    font-size: 0.8em;
    color: var(--text-secondary);
    white-space: nowrap;
}
.category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.category-link {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s ease;
}
.category-link:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ================================================================
   Sidebar Subcategory Collapse
   ================================================================ */
.subcategory-title:hover {
    background: var(--bg-surface);
}
.subcategory-title:hover .subcat-count {
    color: var(--accent-light);
}
.collapse-indicator {
    font-size: 0.7em;
    transition: transform 0.2s ease;
    display: inline-block;
    width: 14px;
    flex-shrink: 0;
    color: var(--text-secondary);
}
.collapse-indicator.collapsed {
    transform: rotate(0deg);
}
.collapse-indicator:not(.collapsed) {
    transform: rotate(90deg);
}
.subcat-count {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-left: auto;
    font-weight: 400;
    transition: color 0.15s ease;
}
.subcategory-pages {
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}
.subcategory-pages.collapsed {
    max-height: 0;
    opacity: 0.6;
}
.subcategory-pages .page-link {
    padding-left: 32px;
    font-size: 0.85em;
}
