#toc {
    position: fixed;
    right: 3%;
    top: 150px;
    width: 260px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 14px;
    padding: 20px;
    background: #fff;
    border-left: 4px solid #66afef;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

/* 隐藏滚动条美化 */
#toc::-webkit-scrollbar {
    width: 6px;
}

#toc::-webkit-scrollbar-track {
    background: transparent;
}

#toc::-webkit-scrollbar-thumb {
    background: rgba(102, 175, 239, 0.3);
    border-radius: 3px;
}

#toc::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 175, 239, 0.6);
}

/* tocbot 列表样式 */
#toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

#toc ol ol {
    margin-left: 20px;
}

#toc li {
    margin: 8px 0;
    line-height: 1.6;
}

#toc a {
    color: #5c6b72;
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
    padding: 6px 8px;
    border-radius: 6px;
}

#toc a:hover {
    color: #66afef;
    background: rgba(102, 175, 239, 0.1);
}

/* 活跃链接样式 */
#toc .is-active-link {
    color: #66afef;
    font-weight: 600;
    background: rgba(102, 175, 239, 0.15);
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    #toc {
        background: rgba(30, 30, 30, 0.98);
        border-left-color: #66b3ff;
    }
    #toc a {
        color: #bbb;
    }
    #toc a:before {
        color: #66b3ff;
    }
    #toc a:hover {
        color: #66b3ff;
        background: rgba(102, 179, 255, 0.15);
    }
    #toc .is-active-link {
        color: #66b3ff;
        background: rgba(102, 179, 255, 0.2);
    }
}

/* 响应式设计 */
@media (max-width: 1400px) {
    #toc {
        right: 2%;
        width: 240px;
        font-size: 13px;
    }
}

@media (max-width: 1200px) {
    #toc {
        display: none;
    }
}