/* ========================================
   侧边栏样式文件
   包含目录侧边栏和文件列表侧边栏的所有样式
   ======================================== */

/* 侧边栏基础样式 */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(229, 231, 235, 0.3);
    border-radius: 0 16px 16px 0;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@media (min-width: 481px) {
    .sidebar {
        top: 43px; /* 紧贴顶部工具栏（高度43px） */
    }
}

.sidebar.hidden {
    margin-left: -280px;
}

/* 目录头部样式 */
.toc-header-fixed {
    flex-shrink: 0;
    padding: 6px 12px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(249, 250, 251, 0.8) 100%);
    border-bottom: 1px solid rgba(229, 231, 235, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    min-height: 36px;
    position: relative;
    border-radius: 0 16px 0 0;
}

.toc-title {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.toc-collapse-btn {
    display: none; /* 隐藏展开/收起按钮 */
}

/* 目录容器样式 */
.toc-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 12px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
}

.toc-container::-webkit-scrollbar {
    width: 6px;
}

.toc-container::-webkit-scrollbar-track {
    background: transparent;
}

.toc-container::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 3px;
}

.toc-container::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.5);
}

/* 目录列表基础样式 */
.toc {
    list-style: none;
}

.toc li {
    margin: 1px 0;
}

.toc a {
    display: block;
    padding: 5px 8px;
    color: var(--text);
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.4;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.toc a:hover {
    background: var(--hover);
    border-left-color: var(--primary);
}

.toc a.active {
    background: var(--primary);
    color: white;
    border-left-color: var(--primary);
    font-weight: 500;
}

/* 移除固定缩进，使用树形结构的自然缩进 */
.toc .level-1,
.toc .level-2,
.toc .level-3,
.toc .level-4,
.toc .level-5,
.toc .level-6 {
    padding-left: 0;
}

/* 折叠目录功能样式 - 树形结构 */
.toc-item {
    position: relative;
    overflow: hidden;
}

.toc-item-header {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 0;
}

.toc-collapse-toggle {
    display: none !important; /* 隐藏三角形折叠按钮 */
}

.toc-item.has-children > .toc-item-header > .toc-collapse-toggle {
    opacity: 0.7;
    cursor: pointer;
}

.toc-item.has-children > .toc-item-header > .toc-collapse-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.1);
}

.toc-collapse-toggle.expanded::before {
    content: '▼';
}

.toc-collapse-toggle.collapsed::before {
    content: '▶';
}

/* 树形连线样式 - 移除父级垂直线 */
.toc-item.has-children::before {
    display: none;
}

.toc-children {
    margin-left: 14px;
    position: relative;
    /* 移除折叠动画，始终展开 */
    max-height: none !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible;
}

.toc-children::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.12);
    z-index: 1;
}

.toc-children .toc-item::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 10px;
    width: 8px;
    height: 1px;
    background: rgba(0, 0, 0, 0.12);
    z-index: 1;
}

.toc-children .toc-item:last-child::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 10px;
    bottom: 0;
    width: 1px;
    background: var(--sidebar-bg);
    z-index: 2;
}

/* 折叠状态已禁用 - 始终展开 */
.toc-children.collapsed,
.toc-children.expanded {
    max-height: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.toc-item-header a {
    flex: 1;
    display: block;
    padding: 4px 0;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    z-index: 3;
    font-size: 13px;
    line-height: 1.4;
}

.toc-item-header a:hover {
    color: #2563eb;
}

.toc-item-header a.active {
    color: #ffffff;
    font-weight: 500;
}

/* 通过伪元素创建背景，不影响文本位置 */
.toc-item-header a:hover::before {
    content: '';
    position: absolute;
    left: -6px;
    right: -6px;
    top: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 4px;
    z-index: -1;
}

.toc-item-header a.active::before {
    content: '';
    position: absolute;
    left: -6px;
    right: -6px;
    top: 0;
    bottom: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 4px;
    z-index: -1;
    border: 1px solid #1d4ed8;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.2);
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .toc-item.has-children > .toc-item-header > .toc-collapse-toggle:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .toc-item-header a {
        color: #e5e7eb;
    }

    .toc-item-header a:hover {
        color: #60a5fa;
    }

    .toc-item-header a.active {
        color: #ffffff;
    }

    .toc-item-header a:hover::before {
        background: rgba(59, 130, 246, 0.2);
    }

    .toc-item-header a.active::before {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        border: 1px solid #1e40af;
        box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
    }

    .toc-children::before,
    .toc-children .toc-item::before {
        background: rgba(255, 255, 255, 0.2);
    }

    .toc-children .toc-item:last-child::after {
        background: var(--sidebar-bg);
    }

    .file-list-header-fixed {
        background: linear-gradient(135deg, rgba(31, 41, 55, 0.85) 0%, rgba(17, 24, 39, 0.85) 100%);
        border-bottom: 1px solid rgba(75, 85, 99, 0.6);
        box-shadow:
            0 1px 3px rgba(0, 0, 0, 0.3),
            0 1px 2px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    /* 平板和移动端暗色模式超高透明效果 */
    @media (prefers-color-scheme: dark) and (max-width: 768px) {
        .sidebar,
        .file-list-sidebar {
            background: rgba(17, 24, 39, 0.25);
            backdrop-filter: blur(30px) saturate(160%);
            -webkit-backdrop-filter: blur(30px) saturate(160%);
            box-shadow:
                0 20px 60px rgba(0, 0, 0, 0.4),
                0 8px 30px rgba(0, 0, 0, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.25),
                inset 0 0 0 1px rgba(255, 255, 255, 0.15);
            border-right: 1px solid rgba(255, 255, 255, 0.3);
        }

        .toc-header-fixed,
        .file-list-header-fixed {
            background: rgba(31, 41, 55, 0.4);
            backdrop-filter: blur(20px) saturate(160%);
            -webkit-backdrop-filter: blur(20px) saturate(160%);
            border-bottom: 1px solid rgba(75, 85, 99, 0.8);
            box-shadow:
                0 1px 3px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
        }
    }

    .file-action-btn:hover {
        background: rgba(156, 163, 175, 0.15);
    }

    .file-action-btn:active {
        background: rgba(156, 163, 175, 0.25);
    }

    /* 文件管理器暗色模式适配 */
    .file-tree-item.has-children > .file-tree-header > .file-collapse-toggle:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .file-item {
        color: #e5e7eb;
    }

    .file-item:hover {
        color: #60a5fa;
    }

    .file-item.active {
        color: #ffffff;
    }

    .file-item:hover::before {
        background: rgba(59, 130, 246, 0.2);
    }

    .file-item.active::before {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        border: 1px solid #1e40af;
        box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
    }

    .folder-item {
        color: #e5e7eb;
    }

    .file-tree-item.has-children .folder-item:hover {
        color: #a78bfa;
    }

    .file-tree-item.has-children .folder-item:hover::before {
        background: rgba(124, 58, 237, 0.2);
    }

    .file-tree-item.has-children .folder-item::after {
        border-top-color: rgba(167, 139, 250, 0.8);
    }

    /* 暗色模式下载图标 */
    .file-item .file-download-icon {
        color: #d1d5db;
    }

    .file-item .file-download-icon:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .file-item.active .file-download-icon:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* 文件列表侧边栏样式 */
.file-list-sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(229, 231, 235, 0.3);
    border-radius: 0 20px 20px 0;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.1),
        0 4px 20px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.file-list-sidebar.hidden {
    margin-left: -300px;
}

@media (min-width: 481px) {
    .file-list-sidebar {
        top: 43px; /* 紧贴顶部工具栏（高度43px） */
    }
}

/* 文件列表头部固定样式 */
.file-list-header-fixed {
    flex-shrink: 0;
    padding: 8px 20px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(249, 250, 251, 0.8) 100%);
    border-bottom: 1px solid rgba(229, 231, 235, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    min-height: 40px;
    position: relative;
    border-radius: 0 20px 0 0;
    z-index: 10;
}

.file-list-title {
    font-weight: 500;
    color: var(--text);
    font-size: 15px;
    letter-spacing: -0.01em;
    line-height: 1.3;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.file-list-title:hover {
    opacity: 1;
}

.file-list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 24px;
    flex-shrink: 0;
}

.file-action-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 450;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.5;
}

.file-action-btn:hover {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text);
}

.file-action-btn:active {
    background: rgba(107, 114, 128, 0.15);
}

.file-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 8px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
}

.file-list-container::-webkit-scrollbar {
    width: 6px;
}

.file-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.file-list-container::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 3px;
}

.file-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.5);
}

/* 文件输入框样式 */
.file-input {
    display: none;
}

/* 文件列表为空时的样式 */
.file-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.file-list-empty p {
    margin-bottom: 16px;
    font-size: 16px;
}

/* 树形文件管理器样式 */
.file-tree-item {
    position: relative;
    overflow: hidden;
}

.file-tree-header {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 0;
    user-select: none; /* 防止双击选中文本 */
}

.file-collapse-toggle {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    background: none;
    border: none;
    cursor: default;
    color: var(--text);
    opacity: 0; /* 默认透明占位符 */
    transition: all 0.2s ease;
    border-radius: 2px;
    font-size: 10px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* 隐藏所有折叠按钮 */
.file-collapse-toggle {
    display: none !important;
}

.file-tree-item.has-children > .file-tree-header > .file-collapse-toggle {
    opacity: 0.7;
    cursor: pointer;
}

.file-tree-item.has-children > .file-tree-header > .file-collapse-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.1);
}

.file-collapse-toggle.expanded::before {
    content: '▼';
}

.file-collapse-toggle.collapsed::before {
    content: '▶';
}

.file-tree-children {
    margin-left: 20px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    /* 默认折叠状态 */
    max-height: 0;
    opacity: 0;
    transform: translateY(-5px);
}

.file-tree-children.collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-5px);
}

.file-tree-children.expanded {
    max-height: 50000px;
    opacity: 1;
    transform: translateY(0);
}

/* 文件项样式 */
.file-item {
    flex: 1;
    display: block;
    padding: 6px 0;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    z-index: 3;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.file-item:hover {
    color: #2563eb;
}

.file-item.active {
    color: #ffffff;
    font-weight: 500;
}

.file-item:hover::before {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    top: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 4px;
    z-index: -1;
}

.file-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    top: 0;
    bottom: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 4px;
    z-index: -1;
    border: 1px solid #1d4ed8;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.25);
}

/* 文件图标和下载图标控制 */
.file-item .file-icon {
    display: inline;
}

.file-item .file-download-icon {
    display: none;
    color: #374151;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-size: 12px;
    line-height: 1;
}

.file-item .file-download-icon:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.file-item.active .file-icon {
    display: none;
}

.file-item.active .file-download-icon {
    display: inline;
    color: #ffffff;
}

.file-item.active .file-download-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 文件夹样式 */
.folder-item {
    flex: 1;
    display: block;
    padding: 6px 0;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    z-index: 3;
    cursor: default;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

/* 可折叠的文件夹样式 */
.file-tree-item.has-children .folder-item {
    cursor: pointer;
}

.file-tree-item.has-children .folder-item:hover {
    color: #7c3aed;
}

.file-tree-item.has-children .folder-item:hover::before {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    top: 0;
    bottom: 0;
    background: rgba(124, 58, 237, 0.08);
    border-radius: 4px;
    z-index: -1;
}

.file-tree-item.has-children .folder-item:active {
    transform: scale(0.98);
}

/* 可折叠文件夹的视觉提示 */
.file-tree-item.has-children .folder-item::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid rgba(124, 58, 237, 0.6);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-tree-item.has-children .folder-item:hover::after {
    opacity: 1;
}

/* 🔥 欢迎页面时侧边栏使用超高透明毛玻璃效果（桌面端+移动端通用） */
body.welcome-page-active .sidebar,
body.welcome-page-active .file-list-sidebar {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(30px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(160%) !important;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 8px 30px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.7) !important;
}

body.welcome-page-active .toc-header-fixed,
body.welcome-page-active .file-list-header-fixed {
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(20px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* 平板适配 (最大宽度768px) - 超高透明毛玻璃效果 */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        border-radius: 0 16px 16px 0;
        background: rgba(255, 255, 255, 0.25);
        backdrop-filter: blur(30px) saturate(160%);
        -webkit-backdrop-filter: blur(30px) saturate(160%);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.12),
            0 4px 16px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            inset 0 0 0 1px rgba(255, 255, 255, 0.5);
        border-right: 1px solid rgba(255, 255, 255, 0.7);
    }

    .sidebar.hidden {
        margin-left: -260px;
    }

    .file-list-sidebar {
        width: 260px;
        border-radius: 0 16px 16px 0;
        background: rgba(255, 255, 255, 0.25);
        backdrop-filter: blur(30px) saturate(160%);
        -webkit-backdrop-filter: blur(30px) saturate(160%);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.12),
            0 4px 16px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            inset 0 0 0 1px rgba(255, 255, 255, 0.5);
        border-right: 1px solid rgba(255, 255, 255, 0.7);
    }

    .file-list-sidebar.hidden {
        margin-left: -260px;
    }

    /* 平板端标题区域半透明增强 */
    .toc-header-fixed,
    .file-list-header-fixed {
        background: rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(20px) saturate(160%);
        -webkit-backdrop-filter: blur(20px) saturate(160%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.8);
        box-shadow:
            0 1px 3px rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .toc-container {
        padding: 0 10px 10px 10px;
    }

    .file-list-container {
        padding: 0 10px 8px 10px;
    }

    .toc a {
        padding: 5px 8px;
        font-size: 13px;
        min-height: 32px;
    }

    .toc-collapse-toggle {
        width: 12px;
        height: 12px;
        font-size: 8px;
        margin-right: 3px;
        min-height: 32px;
    }

    .file-item, .folder-item {
        padding: 5px 8px;
        font-size: 13px;
        min-height: 32px;
    }

    .file-collapse-toggle {
        width: 12px;
        height: 12px;
        font-size: 8px;
        margin-right: 3px;
        min-height: 32px;
    }
}

/* 手机适配 (最大宽度480px) - 紧凑设计 */
@media (max-width: 480px) {
    /* ========== 侧边栏容器 ========== */
    .sidebar {
        width: 260px !important;
        border-radius: 0 16px 16px 0 !important;
    }

    .sidebar.hidden {
        margin-left: -260px !important;
    }

    .file-list-sidebar {
        width: 260px !important;
        border-radius: 0 16px 16px 0 !important;
    }

    .file-list-sidebar.hidden {
        margin-left: -260px !important;
    }

    /* ========== 头部区域 - 紧凑设计 ========== */
    .toc-header-fixed,
    .file-list-header-fixed {
        padding: 6px 12px !important;
        min-height: 32px !important;
        border-radius: 0 16px 0 0 !important;
    }

    .toc-title,
    .file-list-title {
        font-size: 13px !important;
        font-weight: 600 !important;
    }

    /* ========== 目录容器 ========== */
    .toc-container {
        padding: 4px 8px 8px 8px !important;
    }

    .file-list-container {
        padding: 4px 8px 8px 8px !important;
    }

    /* ========== 目录项 - 紧凑设计 ========== */
    .toc li {
        margin: 1px 0 !important;
    }

    .toc a {
        padding: 5px 8px !important;
        font-size: 13px !important;
        min-height: 28px !important;
        line-height: 1.3 !important;
        border-radius: 4px !important;
    }

    .toc-item-header {
        min-height: 28px !important;
    }

    .toc-item-header a {
        padding: 4px 0 !important;
        min-height: 28px !important;
        font-size: 13px !important;
    }

    /* 目录项背景效果 */
    .toc-item-header a:hover::before,
    .toc-item-header a.active::before {
        left: -6px !important;
        right: -6px !important;
        border-radius: 4px !important;
    }

    /* ========== 折叠按钮 ========== */
    .toc-collapse-toggle {
        min-height: 28px !important;
        width: 12px !important;
        height: 12px !important;
        font-size: 8px !important;
        margin-right: 3px !important;
    }

    /* ========== 树形结构缩进优化 ========== */
    .toc-children {
        margin-left: 14px !important;
    }

    .toc-children::before {
        left: -10px !important;
    }

    .toc-children .toc-item::before {
        left: -10px !important;
        width: 8px !important;
        top: 10px !important;
    }

    .toc-children .toc-item:last-child::after {
        left: -10px !important;
        top: 10px !important;
    }

    /* ========== 文件列表 - 紧凑设计 ========== */
    .file-item {
        padding: 5px 8px !important;
        font-size: 13px !important;
        min-height: 28px !important;
        margin-bottom: 1px !important;
    }

    .folder-item {
        padding: 5px 8px !important;
        font-size: 13px !important;
        min-height: 28px !important;
        font-weight: 600 !important;
    }

    .file-collapse-toggle {
        width: 14px !important;
        height: 14px !important;
        font-size: 9px !important;
        margin-right: 4px !important;
        min-height: 28px !important;
    }

    .file-tree-header .file-item,
    .file-tree-header .folder-item {
        min-height: 28px !important;
    }

    .file-tree-children {
        margin-left: 14px !important;
    }

    /* ========== 侧边栏覆盖模式 ========== */
    .sidebar {
        position: fixed;
        top: 33px;
        left: 0;
        bottom: 0;
        width: 75vw;
        max-width: 280px;
        z-index: 1100;
        background: rgba(255, 255, 255, 0.35);
        backdrop-filter: blur(30px) saturate(160%);
        -webkit-backdrop-filter: blur(30px) saturate(160%);
        border-radius: 0 16px 16px 0;
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.1),
            0 4px 20px rgba(0, 0, 0, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
        border-right: 1px solid rgba(255, 255, 255, 0.6);
    }

    .sidebar:not(.hidden) {
        transform: translateX(0);
    }

    .sidebar.hidden {
        margin-left: 0;
        transform: translateX(-100%);
    }

    /* 头部样式覆盖 - 紧凑 */
    .toc-header-fixed,
    .file-list-header-fixed {
        padding: 6px 12px !important;
        min-height: 32px !important;
        background: rgba(255, 255, 255, 0.5);
        backdrop-filter: blur(20px) saturate(160%);
        -webkit-backdrop-filter: blur(20px) saturate(160%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.7);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    /* 容器样式覆盖 - 紧凑 */
    .toc-container {
        padding: 4px 8px 8px 8px !important;
    }

    .file-list-container {
        padding: 4px 8px 8px 8px !important;
    }

    /* 目录项样式覆盖 - 紧凑 */
    .toc a {
        padding: 5px 8px !important;
        font-size: 13px !important;
        min-height: 28px !important;
        display: flex;
        align-items: center;
    }

    .toc .level-1,
    .toc .level-2,
    .toc .level-3,
    .toc .level-4,
    .toc .level-5,
    .toc .level-6 {
        padding-left: 0;
    }

    .toc-collapse-toggle {
        min-height: 28px !important;
        width: 14px !important;
        height: 14px !important;
        font-size: 9px !important;
        margin-right: 4px !important;
    }

    .toc-item.has-children > .toc-item-header > .toc-collapse-toggle:active {
        transform: scale(0.95);
    }

    /* 移动端文件管理器优化 - 紧凑 */
    .file-collapse-toggle {
        width: 14px !important;
        height: 14px !important;
        font-size: 9px !important;
        margin-right: 4px !important;
        min-height: 28px !important;
    }

    .file-tree-header .file-item,
    .file-tree-header .folder-item {
        min-height: 28px !important;
        display: flex;
        align-items: center;
    }

    /* 移动端隐藏悬停提示箭头 */
    .file-tree-item.has-children .folder-item::after {
        display: none;
    }

    /* 移动端点击反馈 */
    .file-tree-item.has-children .folder-item:active {
        background: rgba(124, 58, 237, 0.15);
        transform: scale(0.98);
    }

    /* 移动端下载图标 */
    .file-item .file-download-icon {
        padding: 3px 5px;
        font-size: 12px;
        min-width: 18px;
        min-height: 18px;
    }

    .toc-item-header a {
        min-height: 28px !important;
        display: flex;
        align-items: center;
    }

    .toc-item.has-children::before {
        display: none;
    }

    .toc-children::before {
        left: -10px !important;
    }

    .toc-children .toc-item::before {
        left: -10px !important;
        width: 8px !important;
    }

    .toc-children .toc-item:last-child::after {
        left: -10px !important;
    }

    /* 文件列表侧边栏 - 紧凑 */
    .file-list-sidebar {
        position: fixed;
        top: 33px;
        left: 0;
        bottom: 0;
        width: 75vw;
        max-width: 280px;
        z-index: 1100;
        background: rgba(255, 255, 255, 0.35);
        backdrop-filter: blur(30px) saturate(160%);
        -webkit-backdrop-filter: blur(30px) saturate(160%);
        border-radius: 0 16px 16px 0;
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.1),
            0 4px 20px rgba(0, 0, 0, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
        border-right: 1px solid rgba(255, 255, 255, 0.6);
    }

    .file-list-sidebar:not(.hidden) {
        transform: translateX(0);
    }

    .file-list-sidebar.hidden {
        margin-left: 0;
        transform: translateX(-100%);
    }
}

/* 超小屏幕适配 (最大宽度320px) - 更紧凑 */
@media (max-width: 320px) {
    .sidebar {
        width: 85vw;
        max-width: 260px;
    }

    .toc-container {
        padding: 2px 6px 6px 6px !important;
    }

    .file-list-container {
        padding: 2px 6px 6px 6px !important;
    }

    .toc a {
        padding: 4px 6px !important;
        font-size: 12px !important;
        min-height: 24px !important;
        line-height: 1.2 !important;
    }

    .toc-collapse-toggle {
        width: 12px !important;
        height: 12px !important;
        font-size: 8px !important;
        margin-right: 3px !important;
        min-height: 24px !important;
    }

    .toc li {
        margin: 0 !important;
    }

    .file-item, .folder-item {
        padding: 4px 6px !important;
        font-size: 12px !important;
        min-height: 24px !important;
    }

    .file-collapse-toggle {
        width: 12px !important;
        height: 12px !important;
        font-size: 8px !important;
        margin-right: 3px !important;
        min-height: 24px !important;
    }

    .toc-header-fixed,
    .file-list-header-fixed {
        padding: 5px 10px !important;
        min-height: 28px !important;
    }

    .toc-title,
    .file-list-title {
        font-size: 12px !important;
    }

    .toc-item-header a {
        min-height: 24px !important;
        font-size: 12px !important;
    }

    .toc-children {
        margin-left: 12px !important;
    }
}
