/**
 * 文章侧栏章节目录 — 样式移植自 b2child #b2-widget-toc-2
 */

.mytheme-sidebar-toc {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 18px 16px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 0;
    margin-top: 0;
}

.mytheme-sidebar-toc__title {
    font-size: 16px;
    font-weight: 600;
    color: #24292f;
    margin: 0 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eaecef;
    text-align: left;
}

.mytheme-sidebar-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mytheme-sidebar-toc__link {
    display: block;
    color: #57606a;
    font-size: 13px;
    line-height: 1.5;
    padding: 5px 0 5px 12px;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.mytheme-sidebar-toc__link:hover {
    color: #d32f2f;
    background-color: #f6f8fa;
    border-left-color: #d32f2f;
}

.mytheme-sidebar-toc__link--h2 {
    font-weight: 600;
    color: #24292f;
    padding-left: 10px;
}

.mytheme-sidebar-toc__list--sub {
    padding-left: 6px;
    border-left: 1px solid #e1e4e8;
    margin-top: 2px;
}

.mytheme-sidebar-toc__link--h3 {
    padding-left: 8px;
}

.mytheme-sidebar-toc__item {
    margin-bottom: 2px;
}

.mytheme-sidebar-toc__link.is-active {
    color: #d32f2f;
    background-color: transparent;
    border-left-color: #d32f2f;
    border-left-width: 3px;
    font-weight: 600;
}

.mytheme-sidebar-toc__footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 0 4px;
    margin-top: 10px;
    border-top: 1px solid #eaecef;
    color: #8b949e;
}

.mytheme-sidebar-toc__ring {
    position: relative;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.mytheme-sidebar-toc__ring svg {
    width: 30px;
    height: 30px;
    transform: rotate(-90deg);
    display: block;
}

.mytheme-sidebar-toc__ring .ring-bg {
    fill: none;
    stroke: #c8ccd0;
    stroke-width: 2.5;
}

.mytheme-sidebar-toc__ring .ring-fill {
    fill: none;
    stroke: #8b949e;
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.mytheme-sidebar-toc__ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.56);
    line-height: 1;
}

.mytheme-sidebar-toc__backtop {
    cursor: pointer;
    color: rgba(0, 0, 0, 0.56);
    font-size: 13px;
    transition: color 0.2s;
}

.mytheme-sidebar-toc__backtop:hover {
    color: #d32f2f;
}

/* 锚点跳转时预留顶栏高度，与 sidebar-toc.js 的 SCROLL_OFFSET 保持一致 */
.single .entry-content h2[id],
.single .entry-content h3[id] {
    scroll-margin-top: 90px;
}

/* 桌面端：大纲卡片顶部与左侧正文卡片顶部对齐 */
@media (min-width: 1024px) {
    .single .mytheme-single-grid {
        align-items: start;
    }

    .single .mytheme-single-grid > aside {
        align-self: start;
    }

    .single .mytheme-sidebar-toc {
        margin-top: 0;
    }
}
