/* rtl-claw-toc.css - 右侧目录专用样式 */

/* 双栏布局容器 */
.page-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* 右侧目录容器 */
.toc-container {
    width: 280px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    margin-left: 2rem;
    padding: 1rem 0 1rem 1rem;
    background-color: inherit;
    border-left: 1px solid #e1e4e8;
    font-size: 0.9rem;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* 目录标题 */
.toc-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* 目录列表基础样式 */
.toc-list {
    list-style: none;
    padding-left: 0;
}

.toc-list ul {
    list-style: none;
    padding-left: 1.2rem;
}

.toc-list li {
    margin: 0.4rem 0;
    line-height: 1.4;
}

.toc-list a {
    text-decoration: none;
    color: #0969da;
    display: block;
    padding: 0.2rem 0;
    transition: color 0.2s;
}

.toc-list a:hover {
    color: #1f7bc5;
    text-decoration: underline;
}

/* 当前激活的目录项 */
.toc-list .toc-active {
    color: #d73a49;
    font-weight: 500;
    border-left: 2px solid #d73a49;
    padding-left: 8px;
    margin-left: -8px;
}

/* 移动端适配：屏幕宽度 ≤768px 时目录移至顶部 */
@media (max-width: 768px) {
    .page-wrapper {
        flex-direction: column;
    }
    .toc-container {
        width: 100%;
        position: relative;
        top: 0;
        border-left: none;
        border-bottom: 1px solid #e1e4e8;
        margin-left: 0;
        padding: 1rem;
        max-height: 300px;
    }
}