/**
 * 两不相伤 · 篇目页解读文章悬浮目录（配套 lbxs-chapter-toc.php）
 * 右侧悬浮面板：大屏（≥1820px）默认展开；中小屏收成右侧「解读目录」竖签
 * × 关闭（localStorage 记忆），竖签点击重新展开；− / + 折叠列表只留标题栏
 */

#lbxs-chapter-toc {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: min(320px, 88vw);
    max-height: 78vh;
    display: none;
    flex-direction: column;
    background: rgba(255, 253, 249, 0.98);
    border: 1px solid #e6dfd2;
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 6px 24px rgba(74, 60, 38, 0.16);
    z-index: 9990;
    font-size: 13px;
    line-height: 1.5;
}

#lbxs-chapter-toc.open {
    display: flex;
}

/* 超宽屏（≥2100px，右侧余量足以容纳面板）：离右缘一点距离，圆角四角 */
@media (min-width: 2100px) {
    #lbxs-chapter-toc {
        right: 20px;
        border-radius: 12px;
    }
}

.lbxs-toc-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #eee5d8;
    flex: none;
}

.lbxs-toc-title {
    flex: 1;
    font-weight: 600;
    color: #4a3c26;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lbxs-toc-count {
    font-weight: 400;
    font-size: 12px;
    color: #9a8b70;
    margin-left: 6px;
}

.lbxs-toc-toggle,
.lbxs-toc-close {
    flex: none;
    width: 26px;
    height: 26px;
    line-height: 1;
    border: 1px solid #e0d6c3;
    border-radius: 6px;
    background: #faf6ee;
    color: #7a6a4d;
    font-size: 15px;
    cursor: pointer;
}

.lbxs-toc-toggle:hover,
.lbxs-toc-close:hover {
    background: #f0e7d5;
    color: #8b5a2c;
}

.lbxs-toc-list {
    margin: 0;
    padding: 6px 0;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#lbxs-chapter-toc.collapsed .lbxs-toc-list {
    display: none;
}

.lbxs-toc-list li + li {
    border-top: 1px dashed #f0e9dc;
}

.lbxs-toc-list a {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 14px;
    color: #5c5240;
    text-decoration: none;
}

.lbxs-toc-list a:hover {
    background: #f6f0e4;
    color: #8b5a2c;
}

.lbxs-toc-list a:visited {
    color: #5c5240;
}

.lbxs-toc-n {
    flex: none;
    min-width: 1.5em;
    text-align: right;
    color: #b3a586;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.lbxs-toc-d {
    flex: none;
    color: #a09478;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.lbxs-toc-t {
    flex: 1;
}

.lbxs-toc-empty {
    padding: 12px 14px;
    color: #9a8b70;
}

/* 关闭后右侧的竖签 */
#lbxs-toc-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    letter-spacing: 0.35em;
    padding: 16px 9px;
    background: #8b5a2c;
    color: #fff;
    border: none;
    border-radius: 10px 0 0 10px;
    box-shadow: -3px 4px 14px rgba(74, 60, 38, 0.28);
    cursor: pointer;
    z-index: 9990;
    font-size: 13px;
    display: none;
}

#lbxs-toc-tab.show {
    display: block;
}

#lbxs-toc-tab:hover {
    background: #74491f;
}
