/**
 * 详情页动态目录（static/js/detail-toc.js 生成的 #detail-toc）。
 *
 * 位置口径：正文容器 .container-xxl（max-width 1400px）居中，只有视口够宽时
 * 左侧才有真实空白。目录宽 160px + 12px 间距，需 1400 + 2×172 = 1744px，
 * 故 min-width 取 1760px；以下宽度一律隐藏，避免盖住正文。
 */

/* 正文 h2 作为锚点目标：跳转让开固定导航栏 */
#wiki_cnt h2 {
    scroll-margin-top: 76px;
}

#detail-toc {
    display: none;
    position: fixed;
    top: 96px;
    right: calc(50% + 712px); /* 容器左缘往左 12px（700 + 12） */
    width: 160px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.5rem 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    z-index: 1020; /* 低于 fixed-top 导航(1030) */
}

@media (min-width: 1760px) {
    #detail-toc {
        display: block;
    }
}

#detail-toc .detail-toc-title {
    margin: 0 0 0.5rem 0.5rem;
    font-weight: 600;
    color: #495057;
}

#detail-toc .detail-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

#detail-toc .detail-toc-list a {
    display: block;
    padding: 0.25rem 0.5rem;
    color: #6c757d;
    text-decoration: none;
    border-left: 2px solid transparent;
    /* 长标题省略，避免目录过宽 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#detail-toc .detail-toc-list a:hover {
    color: #0d6efd;
}

#detail-toc .detail-toc-list a.is-active {
    color: #0d6efd;
    border-left-color: #0d6efd;
    font-weight: 600;
}
