/* 侧边目录外层容器 */
.toc-container {
    position: fixed;
    right: 25px;
    top: 140px;
    width: 260px;
    max-height: 65vh;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8e8e8;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止内容溢出圆角 */
    transition: box-shadow 0.3s;
}

/* 拖拽手柄栏（顶部标题栏） */
.toc-header {
    background: #f7f9fa;
    color: #333;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: bold;
    border-bottom: 1px solid #eceeef;
    cursor: move; /* 鼠标悬浮时变为十字移动图标 */
    user-select: none; /* 防止拖拽时误选中文字 */
}

/* 实际放目录的滚动区域 */
.js-toc {
    padding: 12px 14px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
}

/* 优化 Tocbot 的自带样式（使其更紧凑漂亮） */
.toc-list {
    padding-left: 14px !important;
    list-style: none !important;
}
.toc-list .toc-list {
    padding-left: 16px !important;
}
.toc-link {
    color: #555 !important;
    text-decoration: none !important;
    display: block;
    padding: 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 文字过长显示省略号 */
    border-left: 2px solid transparent;
}

/* 当前阅读章节的高亮样式 */
.is-active-link {
    color: #00a1d6 !important; /* 哔哩哔哩蓝，你也可以改成你喜欢的颜色 */
    font-weight: bold;
    border-left-color: #00a1d6 !important;
    padding-left: 4px;
}

/* 窄屏幕（如手机端）自动隐藏目录，防止遮挡正文 */
@media (max-width: 1200px) {
    .toc-container { display: none !important; }
}