/* TOC 目录样式 - 左侧目录优化 */

/* 目录容器 */
.toc-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.875rem;
}

/* 目录标题 */
.toc-container h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.75rem;
}

/* 目录导航链接 */
#toc {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#toc ul ul {
    padding-left: 1rem;
}

#toc li {
    margin-bottom: 0.25rem;
}

#toc a {
    color: #6c757d;
    text-decoration: none;
    display: block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1.4;
    border-left: 2px solid transparent;
}

#toc a:hover {
    color: #0d6efd;
    background: #e9ecef;
}

#toc a.active {
    color: #0d6efd;
    background: #dbeaff;
    border-left-color: #0d6efd;
    font-weight: 500;
}

/* 二级目录缩进 */
#toc ul a {
    font-size: 0.8rem;
    padding-left: 1rem;
}

/* 三级目录缩进 */
#toc ul ul a {
    font-size: 0.75rem;
    padding-left: 1.5rem;
}

/* 隐藏 Mermaid 生成的 TOC（避免重复） */
#toc .mermaid {
    display: none !important;
}

/* 目录滚动条 */
.toc-container::-webkit-scrollbar {
    width: 3px;
}

.toc-container::-webkit-scrollbar-track {
    background: transparent;
}

.toc-container::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.toc-container::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* 移动端隐藏目录 */
@media (max-width: 991.98px) {
    .toc-container {
        display: none !important;
    }
}
