/* Brilliance 文章目录样式 */
.brilliance-toc {
    position: fixed;
    top: calc(var(--header-h) + 20px);
    right: 20px;
    width: 280px;
    max-height: calc(100vh - var(--header-h) - 100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    z-index: 100;
    display: none;
}

.brilliance-toc.active {
    display: block;
}

.brilliance-toc__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brilliance-toc__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.brilliance-toc__close {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background var(--transition), color var(--transition);
}

.brilliance-toc__close:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.brilliance-toc-scroll {
    max-height: calc(100vh - var(--header-h) - 150px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
}

.index-box {
    width: 100%;
    height: auto;
    background-color: transparent;
}

.index-box ul {
    padding: 0;
    list-style: none;
    margin: 0;
}

.index-box .index-subItem-box {
    display: none;
}

.index-box .index-item,
.index-box .index-link {
    width: 100%;
    display: block;
    text-decoration: none;
    box-sizing: border-box;
}

.index-box .index-link {
    padding: 6px 12px 6px 16px;
    cursor: pointer;
    transition: background-color var(--transition), border-left-color var(--transition);
    border-left: 3px solid transparent;
    word-break: break-all;
    color: var(--text-2);
    font-size: 0.9rem;
    line-height: 1.5;
}

.index-box .index-item.current > .index-link {
    background-color: var(--bg-hover);
    border-left-color: var(--accent);
    color: var(--text);
    font-weight: 500;
}

.index-box .index-link:hover {
    background-color: var(--bg-hover);
    color: var(--text);
}

.index-box .index-subItem-box .index-item {
    padding-left: 1em;
}

/* 移动端按钮和弹窗 */
.brilliance-toc-toggle {
    display: none;
    width: 44px;
    height: 44px;
    position: fixed;
    right: 16px;
    bottom: 80px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
    cursor: pointer;
    z-index: 101;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

.brilliance-toc-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.4);
}

.brilliance-toc-toggle svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 1280px) {
    .brilliance-toc {
        display: none !important;
    }
    
    .brilliance-toc-toggle {
        display: flex;
    }
    
    .brilliance-toc-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        display: none;
        align-items: flex-start;
        justify-content: center;
        padding: calc(var(--header-h) + 20px) 20px 20px;
        overflow-y: auto;
    }
    
    .brilliance-toc-modal.active {
        display: flex;
    }
    
    .brilliance-toc-modal .brilliance-toc {
        position: relative;
        top: 0;
        right: 0;
        display: block;
        max-width: 500px;
        width: 100%;
        max-height: 80vh;
        margin: 0 auto;
    }
    
    .brilliance-toc-modal .brilliance-toc-scroll {
        max-height: calc(80vh - 60px);
    }
}
