/* 文档列表页面样式 */

body {
    margin: 0;
    padding: 0;
}

/* 顶部导航栏 */
.doc-top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.doc-top-nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.doc-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.doc-category-name {
    font-size: 16px;
    color: var(--text-secondary);
}

.doc-top-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.doc-search-input {
    width: 300px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.doc-search-input:focus {
    border-color: var(--accent);
}

.doc-layout {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* 左侧目录树 */
.doc-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
}

.doc-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.doc-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.doc-sidebar-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

.doc-tree-container {
    padding: 8px 12px;
}

/* 树形结构样式 */
.doc-tree-item {
    margin-bottom: 2px;
}

.doc-tree-node {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
    font-size: 14px;
}

.doc-tree-node:hover {
    background: var(--bg-hover);
}

.doc-tree-node.active {
    background: var(--bg-hover);
    color: var(--accent);
    font-weight: 500;
}

.doc-tree-toggle {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.doc-tree-toggle.collapsed {
    transform: rotate(-90deg);
}

.doc-tree-icon {
    font-size: 14px;
}

.doc-tree-content {
    flex: 1;
    font-size: 14px;
}

.doc-tree-children {
    padding-left: 20px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.doc-tree-children.expanded {
    max-height: 3000px;
    opacity: 1;
}

/* 中间内容区 */
.doc-preview-area {
    flex: 1;
    display: flex;
    justify-content: center;
    margin-left: 260px;
    background: var(--bg-primary);
    padding: 0 40px;
}

.doc-preview-wrapper {
    display: flex;
    max-width: 1200px;
    width: 100%;
    gap: 40px;
}

.doc-preview-main {
    flex: 1;
    max-width: 900px;
    min-width: 0;
}

.doc-preview-header {
    padding: 32px 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.doc-preview-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.doc-preview-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.doc-preview-body {
    padding: 32px 0 0;
}

/* 右侧目录栏 */
.doc-toc-sidebar {
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    padding: 24px 0;
    background: var(--bg-primary);
    position: sticky;
    top: 84px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.doc-toc-sidebar:hover {
    scrollbar-color: var(--border-color) transparent;
}

.doc-toc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.doc-toc-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.doc-toc-sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}

.doc-toc-sidebar:hover::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

.doc-toc-sidebar:hover::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.toc-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
}

.toc-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: block;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 0;
}

.toc-link {
    display: block;
    padding: 6px 0 6px 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    border-radius: 0;
    line-height: 1.5;
    border-left: 2px solid transparent;
}

.toc-link:hover {
    color: var(--text-primary);
    background: transparent;
    border-left-color: var(--text-tertiary);
}

.toc-link.active {
    color: var(--text-primary);
    background: transparent;
    font-weight: 500;
    border-left-color: var(--accent);
}

.toc-empty {
    color: var(--text-tertiary);
    font-size: 12px;
    padding: 16px 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 文档页页脚样式 */
.doc-layout ~ .site-footer {
    margin-left: 260px;
    margin-top: 0;
}

/* 文档内页脚 */
.doc-footer {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.doc-copyright {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.doc-copyright a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.doc-copyright a:hover {
    color: var(--text-primary);
}

/* 文档更新时间 */
.doc-update-time {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: left;
}

#updateTimeData {
    display: none;
}

/* 文档导航（上一页/下一页） */
.doc-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 48px;
}

.doc-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    flex: 1;
    max-width: 48%;
}

.doc-nav-link:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.doc-nav-prev {
    justify-content: flex-start;
}

.doc-nav-next {
    justify-content: flex-end;
    margin-left: auto;
}

.doc-nav-arrow {
    font-size: 20px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.doc-nav-link:hover .doc-nav-arrow {
    color: var(--accent);
}

.doc-nav-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-nav-prev .doc-nav-content {
    align-items: flex-start;
}

.doc-nav-next .doc-nav-content {
    align-items: flex-end;
}

.doc-nav-label {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-nav-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* 响应式 */
@media (max-width: 768px) {
    .doc-navigation {
        flex-direction: column;
        gap: 12px;
    }
    
    .doc-nav-link {
        max-width: 100%;
    }
    
    .doc-nav-next {
        margin-left: 0;
    }
}
