/* 目录小部件样式 */
.widget[data-type="toc"] {
    position: sticky;
    top: 20px;
    z-index: 10;
}

.toc-widget-content {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 自定义滚动条 */
.toc-widget-content::-webkit-scrollbar {
    width: 4px;
}

.toc-widget-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.toc-widget-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.toc-widget-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 目录列表样式 */
.toc-widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-widget-item {
    margin: 0;
    padding: 0;
}

.toc-widget-link {
    display: block;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
    border-left: 3px solid transparent;
}

.toc-widget-link:hover {
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
}

.toc-widget-link.active {
    background-color: #e3f2fd;
    color: #1976d2;
    border-left-color: #1976d2;
    font-weight: 500;
}

/* 不同级别的缩进 */
.toc-widget-item[data-level="1"] .toc-widget-link {
    padding-left: 12px;
    font-weight: 600;
}

.toc-widget-item[data-level="2"] .toc-widget-link {
    padding-left: 24px;
    font-size: 13px;
}

.toc-widget-item[data-level="3"] .toc-widget-link {
    padding-left: 36px;
    font-size: 12px;
    opacity: 0.8;
}

.toc-widget-item[data-level="4"] .toc-widget-link {
    padding-left: 48px;
    font-size: 12px;
    opacity: 0.7;
}

.toc-widget-item[data-level="5"] .toc-widget-link {
    padding-left: 60px;
    font-size: 11px;
    opacity: 0.6;
}

.toc-widget-item[data-level="6"] .toc-widget-link {
    padding-left: 72px;
    font-size: 11px;
    opacity: 0.6;
}

/* 加载状态 */
.toc-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.toc-loading i {
    margin-right: 8px;
}

/* 空状态 */
.toc-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* 目录统计 */
.toc-stats {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    padding: 0 12px;
}

/* 深色模式适配 */
body.dark-mode .toc-widget-link {
    color: #b0b0b0;
}

body.dark-mode .toc-widget-link:hover {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .toc-widget-link.active {
    background-color: #1a237e;
    color: #90caf9;
    border-left-color: #90caf9;
}

body.dark-mode .toc-widget-content::-webkit-scrollbar-track {
    background: #2a2a2a;
}

body.dark-mode .toc-widget-content::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark-mode .toc-widget-content::-webkit-scrollbar-thumb:hover {
    background: #777;
}

body.dark-mode .toc-loading,
body.dark-mode .toc-empty,
body.dark-mode .toc-stats {
    color: #888;
}





