/* SupDocD 文档系统样式文件 */

/* ============================================
   主题切换优化 - 禁用过渡动画
   ============================================ */
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
    transition: none !important;
    animation: none !important;
}

/* ============================================
   CSS 变量定义 - 亮色模式（默认）
   ============================================ */
:root {
    /* 布局尺寸 */
    --sidebar-width: 280px;
    --toc-width: 250px;
    --header-height: 60px;
    --top-nav-height: 50px;

    /* ========== 颜色系统 ========== */
    
    /* 主色调 */
    --docs-primary: #0d6efd;
    --docs-primary-hover: #0b5ed7;
    --docs-primary-active: #0a58ca;
    --docs-primary-light: rgba(13, 110, 253, 0.1);
    --docs-primary-lighter: rgba(13, 110, 253, 0.15);
    --docs-primary-rgb: 13, 110, 253;

    /* 背景色 */
    --docs-bg-body: #ffffff;
    --docs-bg-secondary: #f8f9fa;
    --docs-bg-tertiary: #f1f3f5;
    --docs-bg-hover: #e9ecef;
    --docs-bg-code: #f1f3f4;
    --docs-bg-code-block: #f8f9fa;
    --docs-bg-highlight: #e7f1ff;

    /* 边框色 */
    --docs-border-primary: #e9ecef;
    --docs-border-secondary: #dee2e6;
    --docs-border-light: #f1f3f5;

    /* 文本色 */
    --docs-text-primary: #212529;
    --docs-text-secondary: #495057;
    --docs-text-muted: #6c757d;
    --docs-text-light: #adb5bd;

    /* 链接色 */
    --docs-link: #0d6efd;
    --docs-link-hover: #0b5ed7;

    /* 代码相关 */
    --docs-code-text: #d73a49;
    --docs-code-bg: #f1f3f4;

    /* 状态色 */
    --docs-success: #28a745;
    --docs-success-bg: #d4edda;
    --docs-success-text: #155724;
    --docs-warning: #ffc107;
    --docs-warning-bg: #fff3cd;
    --docs-warning-text: #856404;
    --docs-danger: #dc3545;
    --docs-danger-bg: #f8d7da;

    /* 阴影 */
    --docs-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --docs-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --docs-shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
    --docs-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
    --docs-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.1);

    /* 滚动条 */
    --docs-scrollbar-track: #f2f2f2;
    --docs-scrollbar-thumb: rgba(0, 0, 0, 0.3);
    --docs-scrollbar-thumb-hover: #333;
    --docs-scrollbar-arrow: #767eea;

    /* 收藏按钮 */
    --docs-favorite: #ffc107;
    --docs-favorite-hover: #ffca2c;
}

/* ============================================
   CSS 变量定义 - 暗色模式
   ============================================ */
[data-theme="dark"] {
    /* 主色调 */
    --docs-primary: #6366f1;
    --docs-primary-hover: #818cf8;
    --docs-primary-active: #a5b4fc;
    --docs-primary-light: rgba(99, 102, 241, 0.1);
    --docs-primary-lighter: rgba(99, 102, 241, 0.15);
    --docs-primary-rgb: 99, 102, 241;

    /* 背景色 */
    --docs-bg-body: #0f172a;
    --docs-bg-secondary: #1e293b;
    --docs-bg-tertiary: #334155;
    --docs-bg-hover: #334155;
    --docs-bg-code: #1e293b;
    --docs-bg-code-block: #0f172a;
    --docs-bg-highlight: #1e3a5f;

    /* 边框色 */
    --docs-border-primary: #334155;
    --docs-border-secondary: #475569;
    --docs-border-light: #475569;

    /* 文本色 */
    --docs-text-primary: #cbd5e1;
    --docs-text-secondary: #b8c2d0;
    --docs-text-muted: #7c8ba0;
    --docs-text-light: #5a6b7f;

    /* 链接色 */
    --docs-link: #6366f1;
    --docs-link-hover: #818cf8;

    /* 代码相关 */
    --docs-code-text: #f87171;
    --docs-code-bg: #1e293b;

    /* 状态色（暗色模式调整） */
    --docs-success-bg: #155724;
    --docs-success-text: #d4edda;
    --docs-warning-bg: #856404;
    --docs-warning-text: #fff3cd;

    /* 阴影 */
    --docs-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --docs-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --docs-shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3);
    --docs-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
    --docs-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.3);

    /* 滚动条 */
    --docs-scrollbar-track: #1e293b;
    --docs-scrollbar-thumb: rgba(255, 255, 255, 0.3);
    --docs-scrollbar-thumb-hover: #94a3b8;
}

/* ============================================
   基础样式
   ============================================ */
* {
    box-sizing: border-box;
}
::-webkit-scrollbar-track-piece{width:12px;background-color:var(--docs-scrollbar-track)}
::-webkit-scrollbar{width:8px;height:6px}
::-webkit-scrollbar-thumb{height:50px;background-color:var(--docs-scrollbar-thumb); border-radius: 1000px;}
::-webkit-scrollbar-thumb:hover{background:var(--docs-scrollbar-thumb-hover)}
/* 显示滚动条的上下角标 */
::-webkit-scrollbar-button:single-button {
    display: block;
    background-color: var(--docs-bg-hover);
    border-radius: 1000px;
    height: 12px;
    width: 8px;
    border: none;
}
::-webkit-scrollbar-button:single-button:vertical:decrement {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="10"><polygon points="4,2 1,7 7,7" fill="%23767eea"/></svg>') center no-repeat;
    background-size: 60% 60%;
}
::-webkit-scrollbar-button:single-button:vertical:increment {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="10"><polygon points="1,3 7,3 4,8" fill="%23767eea"/></svg>') center no-repeat;
    background-size: 60% 60%;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--docs-scrollbar-thumb-hover);
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--docs-bg-body);
    margin: 0;
    padding: 0;
    color: var(--docs-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] {
    color-scheme: dark;
}

/* ============================================
   顶部全局导航栏
   ============================================ */
.docs-top-nav {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--top-nav-height);
    background: var(--docs-bg-body);
    border-bottom: 1px solid var(--docs-border-primary);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--docs-shadow-sm);
    transition: left 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.docs-top-nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.docs-top-nav-link {
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: color 0.15s ease;
}

.docs-top-nav-link:hover {
    color: var(--docs-primary);
}

.docs-top-nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.docs-quick-start {
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.docs-quick-start:hover {
    color: var(--docs-primary);
}

.docs-search-btn {
    background: var(--docs-bg-secondary);
    border: 1px solid var(--docs-border-primary);
    color: var(--docs-text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.docs-search-btn:hover {
    background-color: var(--docs-bg-hover);
    border-color: var(--docs-border-secondary);
    color: var(--docs-primary);
}

.docs-search-btn i {
    font-size: 1rem;
}

.search-btn-text {
    display: inline-block;
}

.search-btn-shortcut {
    display: inline-block;
    background: rgba(var(--docs-primary-rgb), 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--docs-text-muted);
}

.docs-theme-toggle,
.docs-code-toggle {
    background: none;
    border: none;
    color: var(--docs-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.docs-theme-toggle:hover,
.docs-code-toggle:hover {
    background-color: var(--docs-bg-secondary);
    color: var(--docs-primary);
}

.docs-user-center-btn {
    background: none;
    border: none;
    color: var(--docs-text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.docs-user-center-btn:hover {
    background-color: var(--docs-bg-secondary);
    color: var(--docs-primary);
}

.docs-user-center-btn i {
    font-size: 1rem;
}

/* 全宽版本的顶部导航栏（普通页面使用） */
.docs-top-nav.docs-top-nav-full {
    left: 0;
    padding: 0 2rem;
}

/* Logo 样式 */
.docs-top-nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--docs-text-primary);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    transition: color 0.15s ease;
}

.docs-top-nav-logo:hover {
    color: var(--docs-primary);
}

.docs-top-nav-logo i {
    font-size: 1.5rem;
    color: var(--docs-primary);
}

.docs-top-nav-logo span {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 普通页面的主内容区（使用全宽导航栏时） */
.docs-page-content {
    padding-top: var(--top-nav-height);
    min-height: 100vh;
}

/* 普通页面的页脚样式（全宽版本） */
.docs-page-footer {
    margin-top: auto;
    padding: 1rem 2rem;
    border-top: 1px solid var(--docs-border-primary);
    background-color: var(--docs-bg-secondary);
}

.docs-page-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   文档系统布局容器
   ============================================ */
.docs-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   文档系统基础样式
   ============================================ */
.docs-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--docs-bg-secondary);
    transition: background-color 0.3s ease;
}

/* ============================================
   左侧文档导航栏
   ============================================ */
.docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--docs-bg-body);
    border-right: 1px solid var(--docs-border-primary);
    z-index: 1003;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(var(--docs-primary-rgb), 0.05);
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.docs-sidebar.sidebar-collapsed {
    transform: translateX(-100%);
}

.docs-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--docs-border-primary);
    background: var(--docs-bg-body);
    position: sticky;
    top: 0;
    z-index: 1001;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: var(--docs-text-primary);
    transition: color 0.3s ease;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--docs-primary) 0%, var(--docs-primary-hover) 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--docs-text-primary);
    transition: color 0.3s ease;
}

.sidebar-search {
    margin-top: 1rem;
    position: relative;
}

/* 搜索框响应式样式 */
.sidebar-search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 0.75rem;
    border: 1px solid var(--docs-border-primary);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: var(--docs-bg-body);
    color: var(--docs-text-primary);
}

.sidebar-search-input:focus {
    outline: none;
    border-color: var(--docs-primary);
    box-shadow: 0 0 0 3px rgba(var(--docs-primary-rgb), 0.1);
}

.sidebar-search-input::placeholder {
    color: var(--docs-text-light);
}

/* 搜索浮窗（模态框） */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    animation: searchModalFadeIn 0.2s ease-out;
    backdrop-filter: blur(4px);
}

@keyframes searchModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.search-modal {
    background: var(--docs-bg-body);
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: searchModalSlideIn 0.3s ease-out;
    border: 1px solid var(--docs-border-primary);
}

@keyframes searchModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--docs-border-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-modal-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-modal-icon {
    position: absolute;
    left: 1rem;
    color: var(--docs-text-muted);
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 1;
}

.search-modal-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 3rem;
    border: 2px solid var(--docs-border-primary);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: var(--docs-bg-body);
    color: var(--docs-text-primary);
}

.search-modal-input:focus {
    outline: none;
    border-color: var(--docs-primary);
    box-shadow: 0 0 0 3px rgba(var(--docs-primary-rgb), 0.1);
}

.search-modal-shortcut {
    position: absolute;
    right: 0.75rem;
    font-size: 0.75rem;
    color: var(--docs-text-light);
    background: var(--docs-bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--docs-border-primary);
    font-family: monospace;
    pointer-events: none;
}

.search-modal-close {
    background: none;
    border: none;
    color: var(--docs-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.search-modal-close:hover {
    background-color: var(--docs-bg-secondary);
    color: var(--docs-text-primary);
}

.search-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.search-results-header {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--docs-border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--docs-bg-secondary);
    flex-shrink: 0;
}

.search-results-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--docs-text-secondary);
}

.search-results-count {
    font-size: 0.75rem;
    color: var(--docs-text-muted);
    background: var(--docs-bg-hover);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.search-results-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(80vh - 200px);
}

.search-result-item {
    border-bottom: 1px solid var(--docs-border-light);
    transition: background-color 0.15s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: var(--docs-bg-secondary);
}

.search-result-item.selected {
    background-color: var(--docs-bg-highlight);
}

.search-result-link {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.search-result-link:hover {
    text-decoration: none;
}

.search-result-icon {
    margin-right: 0.75rem;
    color: var(--docs-text-muted);
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 500;
    color: var(--docs-text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.4;
    font-size: 0.875rem;
}

.search-result-title mark {
    background: var(--docs-warning-bg);
    color: var(--docs-warning-text);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.search-result-desc {
    font-size: 0.75rem;
    color: var(--docs-text-muted);
    line-height: 1.4;
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-desc mark {
    background: var(--docs-warning-bg);
    color: var(--docs-warning-text);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.search-result-meta {
    font-size: 0.6875rem;
    color: var(--docs-text-light);
    margin-top: 0.375rem;
}

.search-results-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--docs-border-primary);
    background: var(--docs-bg-secondary);
    flex-shrink: 0;
}

.search-hint {
    font-size: 0.6875rem;
    color: var(--docs-text-muted);
}

.search-loading,
.search-empty,
.search-error {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--docs-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.search-loading i,
.search-empty i,
.search-error i {
    font-size: 1.5rem;
    color: var(--docs-text-light);
}

.search-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.search-error {
    color: var(--docs-danger);
}

.search-error i {
    color: var(--docs-danger);
}


/* 暗色主题搜索样式已通过 CSS 变量统一处理 */

/* 移动端响应式搜索 */
@media (max-width: 768px) {
    .docs-search-btn .search-btn-text {
        display: none;
    }
    
    .docs-search-btn .search-btn-shortcut {
        display: none;
    }
    
    .docs-search-btn {
        padding: 0.5rem;
        min-width: 2.5rem;
        justify-content: center;
    }
    
    .search-modal {
        width: 95%;
        max-height: 90vh;
        border-radius: 0.5rem;
    }
    
    .search-modal-header {
        padding: 1rem;
    }
    
    .search-modal-input {
        font-size: 0.875rem;
        padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    }
    
    .search-results-header,
    .search-results-footer {
        padding: 0.5rem 1rem;
    }
    
    .search-result-link {
        padding: 0.625rem 1rem;
    }
    
    .search-result-title {
        font-size: 0.875rem;
    }
    
    .search-result-desc {
        font-size: 0.6875rem;
    }
}


.sidebar-search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--docs-text-muted);
    font-size: 1rem;
}

.sidebar-search-shortcut {
    position: absolute;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--docs-text-light);
    background: var(--docs-bg-body);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    border: 1px solid var(--docs-border-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--docs-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--docs-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.15s ease;
}

.sidebar-toggle:hover {
    background-color: var(--docs-bg-hover);
    color: var(--docs-text-secondary);
}

/* ============================================
   导航菜单样式
   ============================================ */

.nav-item {
    position: relative;
}

.nav-item.category > .nav-link .arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: var(--docs-text-muted);
}

.nav-item.category.expanded > .nav-link .arrow {
    transform: rotate(90deg);
}

.nav-item.category > .nav-link {
    font-weight: 500;
}

.nav-item.doc > .nav-link {
    font-weight: 400;
}

/* 语言包项样式 */
.nav-item.language-package > .nav-link {
    font-weight: 600;
    color: var(--docs-text-primary);
}

.nav-item.language-package.expanded > .nav-link {
    background-color: var(--docs-primary-light);
    color: var(--docs-primary);
}

.nav-item.language-package > .nav-link .arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: var(--docs-text-muted);
}

.nav-item.language-package.expanded > .nav-link .arrow {
    transform: rotate(90deg);
}

/* 语言包展开后的子列表样式 */
.nav-item.language-package > .nav-sub-list {
    background-color: var(--docs-bg-secondary);
    border-left: 2px solid var(--docs-border-primary);
    margin-left: 0;
    padding-left: 0.5rem;
}

.nav-sub-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    overflow: hidden;
    background-color: var(--docs-bg-secondary);
    border-left: 2px solid var(--docs-border-primary);
    margin-left: 1rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 手风琴效果：确保子列表平滑展开/折叠 */
.nav-sub-list {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.nav-sub-list .nav-link {
    padding-left: 1.5rem;
    font-size: 0.85rem;
    color: var(--docs-text-muted);
    transition: color 0.3s ease, background-color 0.3s ease;
}

.nav-sub-list .nav-link:hover {
    color: var(--docs-primary);
    background-color: var(--docs-bg-highlight);
}

.nav-sub-list .nav-link.active {
    color: var(--docs-primary);
    background-color: var(--docs-bg-highlight);
    font-weight: 500;
}

.nav-loading, .nav-empty {
    padding: 0.5rem 1.5rem;
    color: var(--docs-text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--docs-text-secondary);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    background-color: var(--docs-bg-secondary);
    border-bottom: 1px solid var(--docs-border-primary);
    margin-bottom: 0.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.nav-section-title i {
    font-size: 1rem;
    color: var(--docs-text-muted);
    transition: color 0.3s ease;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 导航项之间的间距 */
.nav-list > .nav-item {
    margin-bottom: 0.125rem;
}

/* 分类和文档的视觉区分 */
.nav-item.category .nav-link {
    color: var(--docs-text-primary);
    transition: color 0.3s ease;
}

.nav-item.doc .nav-link {
    color: var(--docs-text-secondary);
    transition: color 0.3s ease, background-color 0.3s ease;
}

.nav-item.doc .nav-link:hover {
    background-color: var(--docs-bg-tertiary);
}



.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    border-radius: 0 0.375rem 0.375rem 0;
    margin-right: 0.5rem;
    cursor: pointer;
    position: relative;
    min-height: 2.25rem;
}

.nav-link:hover {
    background-color: var(--docs-bg-secondary);
    color: var(--docs-primary);
}

.nav-link.active {
    background-color: var(--docs-primary-light);
    color: var(--docs-primary);
    font-weight: 500;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--docs-primary);
    border-radius: 0 2px 2px 0;
}

/* 当前激活的文档项高亮 */
.nav-item.doc .nav-link.active {
    background-color: var(--docs-primary-lighter);
}

.nav-link i {
    margin-right: 0.2rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-link .nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link .nav-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.nav-link.expanded .nav-arrow {
    transform: rotate(90deg);
}

/* 旧版导航样式（兼容性保留） */
.nav-project {
    margin-bottom: 0.5rem;
}

.nav-project-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
    border-radius: 0 0.25rem 0.25rem 0;
    margin-right: 0.5rem;
}

.nav-project-link:hover {
    background-color: var(--docs-bg-secondary);
    color: var(--docs-primary);
    box-shadow: inset 3px 0 0 var(--docs-primary);
}

.nav-project-link i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.nav-docs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    background: var(--docs-bg-secondary);
    margin-left: 1rem;
    border-left: 1px solid var(--docs-border-primary);
    padding-left: 0.5rem;
}

.nav-doc {
    margin: 0.125rem 0;
}

.nav-doc-link {
    display: flex;
    align-items: center;
    padding: 0.2rem;
    padding-left: 1rem;
    color: var(--docs-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.15s ease;
    border-radius: 0 0.25rem 0.25rem 0;
    margin-right: 0.5rem;
}

.nav-doc-link:hover {
    background-color: var(--docs-bg-hover);
    color: var(--docs-primary);
    box-shadow: inset 3px 0 0 var(--docs-primary);
}

.nav-loading,
.nav-loading-small {
    padding: 1rem 1.5rem;
    color: var(--docs-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.nav-loading-small {
    padding: 0.5rem 1.5rem;
}

.nav-error,
.nav-error-small {
    padding: 1rem 1.5rem;
    color: var(--docs-danger);
    font-size: 0.875rem;
}

.nav-error-small {
    padding: 0.5rem 1.5rem;
}

/* ============================================
   主内容区
   ============================================ */
.docs-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-right: var(--toc-width);
    margin-top: var(--top-nav-height);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--top-nav-height));
    transition: margin-left 0.3s ease, margin-right 0.3s ease;
    /* 确保主内容区域不会超出页面宽度（有 TOC 时） */
    max-width: calc(100vw - var(--sidebar-width) - var(--toc-width));
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    min-width: 0;
}

/* 无 TOC 时的样式 */
.docs-layout.no-toc .docs-main {
    margin-right: 0;
    /* 即使没有 TOC，也要限制最大宽度，防止代码块撑开页面 */
    max-width: calc(100vw - var(--sidebar-width) - 2rem);
}

.docs-layout.no-toc .docs-toc {
    display: none;
}

.docs-content {
    flex: 1;
}

/* 无 TOC 时，确保代码块不会撑开页面 */
.docs-layout.no-toc .article-content,
.docs-layout.no-toc .article-content-rendered {
    max-width: 100%;
    overflow-x: hidden;
}

.docs-layout.no-toc .code-block-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

.docs-layout.no-toc .article-content pre {
    max-width: 100%;
    width: 100%;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    box-sizing: border-box;
}

.docs-layout.no-toc .article-content pre code {
    max-width: none;
    width: auto;
    min-width: 100%;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    box-sizing: content-box;
}

/* 文档头部样式 */
.docs-header {
    background: var(--docs-bg-body);
    border-bottom: 1px solid var(--docs-border-primary);
    padding: 1rem 0;
    position: sticky;
    top: 70px;
    z-index: 999;
    box-shadow: var(--docs-shadow-md);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.docs-actions {
    display: flex;
    gap: 0.5rem;
}

.docs-actions .btn {
    white-space: nowrap;
}

/* ============================================
   文档内容区
   ============================================ */
.docs-content {
    flex: 1;
    padding: 1rem 2rem;
    background: var(--docs-bg-body);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    /* 确保内部元素不会超出 */
    min-width: 0;
    transition: background-color 0.3s ease;
}

/* 面包屑导航样式 */
.breadcrumb-nav {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--docs-border-primary);
    transition: border-color 0.3s ease;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--docs-text-muted);
    line-height: 1.5;
    transition: color 0.3s ease;
}

.breadcrumb-item.active {
    color: var(--docs-text-primary);
}

.breadcrumb-item.active .breadcrumb-text {
    font-weight: 500;
    color: var(--docs-text-primary);
    padding-left: 0.5rem;
}

.breadcrumb-link {
    display: flex;
    align-items: center;
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    gap: 0.25rem;
    margin-left: 3px;
}

.breadcrumb-link:hover {
    color: var(--docs-primary);
    text-decoration: none;
}

.breadcrumb-link i {
    font-size: 1rem;
    margin-right: 0.125rem;
    flex-shrink: 0;
}

.breadcrumb-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    /* 保留原始名称，不转换为大写 */
    text-transform: none;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    font-size: 0.75rem;
    color: var(--docs-text-light);
    flex-shrink: 0;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .breadcrumb-nav {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .breadcrumb-item {
        font-size: 0.8125rem;
    }
    
    .breadcrumb-text {
        max-width: 120px;
    }
    
    .breadcrumb-separator {
        margin: 0 0.375rem;
        font-size: 0.6875rem;
    }
}

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

.article-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--docs-text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--docs-border-primary);
    flex-wrap: wrap;
    transition: border-color 0.3s ease;
}

.article-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--docs-text-muted);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.stat-item i {
    font-size: 1.1rem;
    color: var(--docs-text-muted);
    transition: color 0.3s ease;
}

.stat-value {
    font-weight: 500;
    color: var(--docs-text-primary);
    transition: color 0.3s ease;
}

.article-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--docs-border-secondary);
    background: var(--docs-bg-body);
    color: var(--docs-text-muted);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: var(--docs-bg-secondary);
    border-color: var(--docs-text-light);
    color: var(--docs-text-primary);
}

.btn-action i {
    font-size: 1rem;
}

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

.btn-action.active:hover {
    background: var(--docs-primary-hover);
    border-color: var(--docs-primary-active);
}

.btn-favorite.active {
    background: var(--docs-favorite);
    border-color: var(--docs-favorite);
    color: var(--docs-text-primary);
}

.btn-favorite.active:hover {
    background: var(--docs-favorite-hover);
    border-color: var(--docs-favorite-hover);
}

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

.btn-like.active:hover {
    background: var(--docs-primary-hover);
    border-color: var(--docs-primary-active);
}

/* 文章底部导航（上一个/下一个文档） */
.article-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--docs-border-primary);
}

.article-navigation .nav-item {
    flex: 1;
    display: block; /* 确保默认显示 */
}

.article-navigation .nav-item.nav-prev {
    text-align: left;
}

.article-navigation .nav-item.nav-next {
    text-align: right;
}

.article-navigation .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--docs-border-primary);
    border-radius: 0.5rem;
    background: var(--docs-bg-secondary);
    color: var(--docs-text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.article-navigation .nav-item.nav-prev .nav-link {
    flex-direction: row;
}

.article-navigation .nav-item.nav-next .nav-link {
    flex-direction: row-reverse;
}

.article-navigation .nav-link:hover {
    background: var(--docs-bg-hover);
    border-color: var(--docs-text-light);
    text-decoration: none;
    color: var(--docs-primary);
}

.article-navigation .nav-link i {
    font-size: 1.5rem;
    color: var(--docs-text-muted);
    flex-shrink: 0;
}

.article-navigation .nav-link:hover i {
    color: var(--docs-primary);
}

.article-navigation .nav-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.article-navigation .nav-label {
    font-size: 0.75rem;
    color: var(--docs-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-navigation .nav-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--docs-text-primary);
    line-height: 1.4;
}

.article-navigation .nav-link:hover .nav-title {
    color: var(--docs-primary);
}

.article-navigation .nav-item:empty {
    display: none;
}

/* 响应式：移动端导航样式 */
@media (max-width: 768px) {
    .article-navigation {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .article-navigation .nav-item {
        width: 100%;
    }
    
    .article-navigation .nav-item.nav-next {
        text-align: left;
    }
    
    .article-navigation .nav-link {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
    
    .article-navigation .nav-link i {
        font-size: 1.25rem;
    }
    
    .article-navigation .nav-title {
        font-size: 0.875rem;
    }
}

/* 暗色主题导航样式已通过 CSS 变量统一处理 */

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.article-content {
    line-height: 1.7;
    color: var(--docs-text-primary);
    max-width: 100%;
    width: 100%;
    /* 确保内容不会撑开容器 */
    box-sizing: border-box;
    /* 关键：隐藏横向溢出，防止页面出现横向滚动条 */
    overflow-x: hidden;
    overflow-y: visible;
    /* 确保内部元素不会超出 */
    min-width: 0;
    transition: color 0.3s ease;
}

/* 确保渲染后的内容也不会撑开 */
.article-content-rendered {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    /* 关键：隐藏横向溢出，防止页面出现横向滚动条 */
    overflow-x: hidden;
    overflow-y: visible;
    min-width: 0;
}

/* 标题样式 */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--docs-text-primary);
    line-height: 1.3;
    transition: color 0.3s ease;
}

.article-content h1 {
    font-size: 1.3rem;
    border-bottom: 2px solid var(--docs-border-primary);
    padding-bottom: 0.5rem;
    transition: border-color 0.3s ease;
}

.article-content h2 {
    font-size: 1.2rem;
    border-bottom: 1px solid var(--docs-border-primary);
    padding-bottom: 0.25rem;
    transition: border-color 0.3s ease;
}

.article-content h3 {
    font-size: 1.1rem;
}

.article-content h4 {
    font-size: 1.05rem;
}

.article-content h5 {
    font-size: 1.02rem;
}

.article-content h6 {
    font-size: 1rem;
}

/* 段落和文本样式 */
.article-content p {
    margin-bottom: 1rem;
    text-align: justify;
    color: inherit;
}

.article-content blockquote {
    border-left: 4px solid var(--docs-primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--docs-text-muted);
    font-style: italic;
    background: var(--docs-bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 0 0.25rem 0.25rem 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* 代码样式 */
.article-content code {
    background: var(--docs-code-bg);
    color: var(--docs-code-text);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    transition: background-color 0.2s ease, color 0.2s ease, border 0.2s ease;
}

/* 内联 code 标签复制功能样式 */
.article-content code.code-copy-enabled {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.article-content code.code-copy-enabled:hover {
    background-color: var(--docs-bg-highlight);
}

.article-content code.code-copy-copied {
    background-color: var(--docs-success-bg) !important;
    color: var(--docs-success-text) !important;
    border: 1px solid var(--docs-success);
}

.article-content pre {
    background: var(--docs-bg-code-block);
    border: 1px solid var(--docs-border-primary);
    padding: 1rem;
    padding-top: 2.5rem;
    border-radius: 0.5rem;
    /* 关键：代码块内部滚动，不超出容器 */
    overflow: hidden;
    /* 限制宽度，不超过容器 */
    max-width: 100%;
    width: 100%;
    /* 确保不会超出父容器 */
    min-width: 0;
    margin: 0;
    box-shadow: var(--docs-shadow-inset);
    line-height: 1.5;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    box-sizing: border-box;
    /* 确保滚动条在代码块内部显示 */
    -webkit-overflow-scrolling: touch;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    /* 代码内容可以超出，由 pre 标签处理滚动 */
    max-width: none;
    width: auto;
    min-width: 100%;
    white-space: pre;
    display: block;
    /* 不设置 overflow，让父元素 pre 处理滚动 */
    word-break: normal;
    overflow-wrap: normal;
    box-sizing: content-box;
}

/* 确保代码块内的所有元素都不会强制换行 */
.article-content pre code * {
    max-width: none;
    word-break: normal;
    overflow-wrap: normal;
    white-space: pre;
}

/* 代码块复制按钮 */
.code-block-wrapper {
    position: relative;
    z-index: 1;
    display: block;
    /* 限制宽度，不超过父容器 */
    width: 100%;
    max-width: 100%;
    margin: 1.5rem 0;
    /* 不在这里设置 overflow，让内部的 pre 标签处理滚动 */
    overflow: visible;
    /* 确保代码块容器不会撑开页面 */
    box-sizing: border-box;
    /* 确保内部元素不会超出容器 */
    min-width: 0;
}

/* 代码语言类型徽标 */
.code-lang-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    background: var(--docs-primary-light);
    color: var(--docs-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 5;
    pointer-events: none;
    user-select: none;
}

.code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--docs-bg-body);
    border: 1px solid var(--docs-border-primary);
    border-radius: 0.25rem;
    font-size: 0.8rem;
    color: var(--docs-text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    display: flex !important;
    align-items: center;
    gap: 0.25rem;
    z-index: 10000 !important;
    box-shadow: var(--docs-shadow-md);
    white-space: nowrap;
    pointer-events: auto;
    visibility: visible !important;
}

/* hover 时显示复制按钮 */
.code-block-wrapper.show-copy-btn .code-copy-btn,
.code-block-wrapper:hover .code-copy-btn {
    opacity: 1 !important;
}

/* 按钮自身 hover 时保持显示 */
.code-copy-btn:hover {
    opacity: 1 !important;
    background: var(--docs-bg-body);
    border-color: var(--docs-primary);
    color: var(--docs-primary);
}

.code-copy-btn.copied {
    background: var(--docs-success-bg);
    border-color: var(--docs-success);
    color: var(--docs-success-text);
}

.code-copy-btn i {
    font-size: 1rem;
}

/* 列表样式 */
.article-content ul,
.article-content ol {
    margin: 0.75rem 0;
    padding-left: 0;
    line-height: 1.5;
    list-style: none;
    font-size: 0.95rem;
    color: inherit;
}

.article-content li {
    margin-bottom: 0.2rem;
    padding-left: 0;
    position: relative;
    line-height: 1.5;
    color: inherit;
}

/* 嵌套列表样式 */
.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 0;
}

/* 表格样式 */
.article-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    border: 1px solid var(--docs-border-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--docs-shadow-md);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.article-content th,
.article-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--docs-border-primary);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    color: var(--docs-text-secondary);
}

.article-content th {
    background: var(--docs-bg-secondary);
    font-weight: 600;
    color: var(--docs-text-secondary);
}

.article-content tr:nth-child(even) {
    background: var(--docs-bg-secondary);
}

/* ============================================
   Bootstrap 表格暗色主题适配
   ============================================ */
.table {
    color: var(--docs-text-primary);
    border-color: var(--docs-border-primary);
}

.table > thead {
    color: var(--docs-text-primary);
}

.table > thead > tr > th {
    background-color: var(--docs-bg-tertiary);
    color: var(--docs-text-primary);
    border-color: var(--docs-border-primary);
}

.table > tbody > tr > td {
    color: var(--docs-text-secondary);
    border-color: var(--docs-border-primary);
    background-color: var(--docs-bg-body);
}

.table-bordered {
    border-color: var(--docs-border-primary);
}

.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tbody > tr > td {
    border-color: var(--docs-border-primary);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--docs-bg-body);
}

.table-striped > tbody > tr:nth-of-type(even) > td {
    background-color: var(--docs-bg-secondary);
}

/* 表格 hover 效果 */
.table-hover > tbody > tr:hover > td {
    background-color: var(--docs-bg-hover);
}

/* 表格内的强调文本 */
.table strong {
    color: var(--docs-text-primary);
}

/* 表格内的图标和 emoji */
.table td {
    vertical-align: middle;
}

/* 链接样式 */
.article-content a {
    color: var(--docs-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

.article-content a:hover {
    color: var(--docs-link-hover);
    text-decoration: underline;
}

/* 图片样式 */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

/* 页脚样式 */
.docs-article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    padding: 2rem 0;
}

.article-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tags-label {
    font-weight: 500;
    color: #495057;
    margin-right: 0.5rem;
}

.article-actions {
    display: flex;
    gap: 0.5rem;
}

/* 页脚样式 */
.docs-footer {
    margin-top: auto;
    padding: 0.5rem 0;
    border-top: 1px solid var(--docs-border-primary);
    background-color: transparent;
    transition: border-color 0.3s ease;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--docs-text-muted);
    font-size: 0.875rem;
    padding: 0 1rem;
    transition: color 0.3s ease;
}

.footer-left p {
    margin-bottom: 0;
}

.footer-link {
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--docs-primary);
}

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

.footer-divider {
    color: var(--docs-border-secondary);
    transition: color 0.3s ease;
}

.footer-version {
    background: var(--docs-bg-secondary);
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    border: 1px solid var(--docs-border-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ============================================
   右侧TOC导航栏
   ============================================ */
.docs-toc {
    position: fixed;
    top: var(--top-nav-height);
    right: 10px;
    width: var(--toc-width);
    min-width: 150px;
    max-width: 220px;
    height: calc(100vh - var(--top-nav-height));
    background: var(--docs-bg-body);
    border-left: 1px solid var(--docs-border-primary);
    z-index: 998;
    overflow-y: auto;
    padding: 1rem 0;
    box-shadow: -2px 0 4px rgba(var(--docs-primary-rgb), 0.05);
    transition: all 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.toc-header {
    padding: 0 0.5rem 0.5rem;
    border-bottom: 1px solid var(--docs-border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
}

.toc-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    color: var(--docs-text-secondary);
    flex: 1;
    transition: color 0.3s ease;
}

.toc-toggle-btn {
    background: none;
    border: none;
    color: var(--docs-text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toc-toggle-btn:hover {
    background-color: var(--docs-bg-secondary);
    color: var(--docs-primary);
}

/* TOC 最小化状态 */
.docs-toc.minimized {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.docs-toc.minimized .toc-nav {
    display: none;
}

.docs-toc.minimized .toc-header {
    padding: 0.5rem;
    border-bottom: none;
}

.docs-toc.minimized .toc-title {
    display: none;
}

.docs-toc.minimized .toc-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    z-index: 1000;
    pointer-events: auto;
    background: var(--docs-bg-body);
    border: 1px solid var(--docs-border-primary);
    box-shadow: var(--docs-shadow-md);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.docs-toc.minimized .toc-toggle-btn i {
    transform: rotate(180deg);
}

/* TOC 最小化后的浮动按钮 */
.toc-minimized-btn {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--docs-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: var(--docs-shadow-lg);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.toc-minimized-btn:hover {
    background: var(--docs-primary-hover);
    box-shadow: 0 6px 16px rgba(var(--docs-primary-rgb), 0.3);
    transform: scale(1.1);
}

.toc-minimized-btn:active {
    transform: scale(0.95);
}

/* 当 TOC 最小化时，调整主内容区域 */
.docs-layout.toc-minimized .docs-main {
    margin-right: 0;
}

/* 响应式：移动端隐藏最小化按钮 */
@media (max-width: 1200px) {
    .toc-toggle-btn {
        display: none;
    }
    
    .toc-minimized-btn {
        display: none !important;
    }
}


.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}


.toc-link {
    display: block;
    padding: 0.375rem 0;
    color: var(--docs-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    padding-left: 1rem;
    transition: all 0.15s ease;
    cursor: pointer;
    line-height: 1.5;
}

.toc-link:hover {
    color: var(--docs-primary);
    background-color: var(--docs-bg-secondary);
    border-left-color: var(--docs-primary);
}

.toc-link.active {
    color: var(--docs-primary);
    border-left-color: var(--docs-primary);
    background-color: var(--docs-primary-light);
    font-weight: 500;
}

/* TOC层级缩进 */
.toc-level-2 .toc-link { padding-left: 0.5rem; }
.toc-level-3 .toc-link { padding-left: 1rem; }
.toc-level-4 .toc-link { padding-left: 1.5rem; }
.toc-level-5 .toc-link { padding-left: 2rem; }
.toc-level-6 .toc-link { padding-left: 2.5rem; }

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1200px) {
    :root {
        --toc-width: 0px;
    }

    .docs-main {
        margin-right: 0;
    }

    .docs-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .docs-top-nav {
        left: 0;
        padding: 0 1rem;
    }

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        top: 0;
        height: 100vh;
        z-index: 1005;
    }

    .docs-sidebar.sidebar-collapsed {
        transform: translateX(-100%);
    }

    .docs-main {
        margin-left: 0;
    }

    .docs-header {
        padding: 0.75rem 0;
    }

    .docs-top-nav-left {
        gap: 1rem;
    }

    .docs-top-nav-link {
        font-size: 0.8rem;
    }

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

    .article-content {
        font-size: 0.95rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .article-footer-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .docs-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .docs-actions .btn {
        flex: 1;
        min-width: 120px;
    }

    /* 全宽导航栏移动端样式 */
    .docs-top-nav.docs-top-nav-full {
        padding: 0 1rem;
    }

    .docs-top-nav-logo span {
        display: none;
    }

    .docs-top-nav-logo i {
        font-size: 1.75rem;
    }
}

/* 暗色模式支持已通过 CSS 变量统一处理，无需 @media (prefers-color-scheme: dark) */

/* ============================================
   滚动进度条
   ============================================ */
.scroll-progress {
    position: fixed;
    top: calc(var(--top-nav-height) + 2.5rem);
    right: 10px;
    background: linear-gradient(135deg, var(--docs-primary) 0%, var(--docs-primary-hover) 100%);
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 1000px;
    font-size: 10px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(var(--docs-primary-rgb), 0.3);
    text-align: center;
}

.scroll-progress.visible {
    opacity: 0.5;
    transform: translateY(0);
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .scroll-progress {
        right: 1rem;
    }
}

@media (max-width: 768px) {
    .scroll-progress {
        top: calc(var(--top-nav-height) + 0.5rem);
        right: 0.5rem;
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        min-width: 50px;
    }
}

/* ============================================
   返回顶部按钮
   ============================================ */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--docs-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--docs-shadow-lg);
    transition: all 0.3s ease;
    z-index: 1001;
}

.scroll-to-top:hover {
    background: var(--docs-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--docs-primary-rgb), 0.3);
}

/* ============================================
   加载和错误状态
   ============================================ */
.article-loading,
.error-content,
.welcome-content {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.welcome-content h2 {
    color: var(--docs-text-primary);
    margin-bottom: 1rem;
}

.welcome-content .lead {
    color: var(--docs-text-secondary);
}

.welcome-content .bx {
    color: var(--docs-text-muted);
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* 暗色模式优化 */
[data-theme="dark"] .welcome-content h2 {
    color: var(--docs-text-primary);
}

[data-theme="dark"] .welcome-content .lead {
    color: var(--docs-text-secondary);
}

[data-theme="dark"] .welcome-content .bx {
    color: var(--docs-text-muted);
    opacity: 0.8;
}

.article-loading .spinner-border,
.error-content .bx {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-content {
    animation: fadeIn 0.3s ease-out;
}

/* 代码块滚动条样式 */
.article-content pre::-webkit-scrollbar {
    height: 8px;
}

.article-content pre::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.article-content pre::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.article-content pre::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 打印样式 */
@media print {
    .docs-sidebar,
    .docs-toc,
    .docs-header,
    .docs-article-footer,
    .scroll-to-top {
        display: none !important;
    }

    .docs-main {
        margin: 0 !important;
    }

    .docs-content {
        padding: 0 !important;
    }

    .article-content {
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }

    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4,
    .article-content h5,
    .article-content h6 {
        page-break-after: avoid;
    }
}