/* ============ 基础重置 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --border: #e2e5ec;
    --text: #1a1a2e;
    --text-muted: #8a8d99;
    --primary: #4f6df5;
    --primary-hover: #3b5de7;
    --success: #2dce89;
    --success-hover: #26b878;
    --warning: #ffa726;
    --danger: #f56565;
    --tag-bg: #eef2ff;
    --tag-text: #4f6df5;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 4px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

/* ============ 头部导航 ============ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    margin: 0;
}
.logo-mark {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(128,82,255,.25), 0 2px 8px rgba(43,27,107,.25);
}
.logo-mark svg { display: block; width: 28px; height: 28px; }

.tabs {
    display: flex;
    gap: 4px;
}

.tab {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.tab:hover { background: var(--bg); color: var(--text); }
.tab.active { background: var(--primary); color: white; font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 12px; }

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: #e6f9f1; color: var(--success); }
.badge-warning { background: #fff5e6; color: var(--warning); }

/* ============ Tab 内容 ============ */
.tab-content { display: none; padding: 20px; }
.tab-content.active { display: block; }

/* ============ 抓取管理布局 ============ */
.extract-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    height: calc(100vh - 56px - 40px);
}

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header h2 { font-size: 15px; font-weight: 600; }

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* ============ 小说列表项 ============ */
.novel-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
    margin-bottom: 4px;
}
.novel-item:hover { background: var(--bg); }
.novel-item.active { background: var(--tag-bg); border-color: var(--primary); }
.novel-item .novel-name { font-weight: 600; font-size: 14px; }
.novel-item .novel-author { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.novel-item .novel-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: flex; gap: 10px; }
.novel-item .novel-actions { margin-top: 8px; }
.novel-item .novel-actions .btn { margin-right: 4px; }

/* ============ 章节列表 ============ */
.chapter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-all {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 13px;
}

.chapter-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    cursor: pointer;
}
.chapter-item:hover { background: var(--bg); }

.chapter-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.chapter-info { flex: 1; min-width: 0; }
.chapter-info .ch-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-info .ch-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.ch-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-left: 8px;
}
.ch-status-pending { background: #f0f0f0; color: #999; }
.ch-status-done { background: #e6f9f1; color: var(--success); }
.ch-status-screened { background: #eef2ff; color: var(--primary); }
.ch-status-processing { background: #fff5e6; color: var(--warning); }
.ch-status-no_knowledge { background: #f5f5f5; color: #aaa; }
.ch-status-failed { background: #fef0f0; color: var(--danger); }

/* ============ 知识库章节导航 ============ */
.chapter-nav-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.12s;
    cursor: pointer;
    gap: 8px;
}
.chapter-nav-item:hover { background: var(--bg); }
.chapter-nav-item.active {
    background: var(--tag-bg);
    border: 1px solid var(--primary);
}
.chapter-nav-item .cn-title {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chapter-nav-item .cn-count {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    flex-shrink: 0;
    background: var(--tag-bg);
    padding: 1px 6px;
    border-radius: 8px;
}
.chapter-nav-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============ 提取日志 ============ */
.extraction-log {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background: #fafbfc;
    max-height: 200px;
    overflow-y: auto;
}
.log-entry {
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px dashed var(--border);
}
.log-entry:last-child { border-bottom: none; }
.log-success { color: var(--success); }
.log-error { color: var(--danger); }
.log-info { color: var(--text-muted); }

/* ============ 知识库布局 ============ */
.knowledge-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    height: calc(100vh - 56px - 40px);
}

.panel-chapter-nav {
    max-height: 100%;
}

.panel-chapter-nav .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.panel-chapter-nav .panel-header h2 {
    font-size: 14px;
}

.select-novel-mini {
    width: 100%;
    max-width: none;
    font-size: 13px;
    padding: 6px 8px;
}

.knowledge-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    min-width: 0;
}

.search-bar {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* 筛选主逻辑一行：滑块 + 五类 chips + 搜索居右窄条 */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    padding: 8px 0 2px;
}
.filter-bar .class-slider { flex: none; }
.filter-bar .cat-tabs {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    min-width: 0;
}
.filter-bar .search-box {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.filter-bar .input-search {
    width: 180px;
    padding: 7px 12px;
    font-size: 13px;
}
.filter-bar .btn-search {
    padding: 7px 14px;
    font-size: 13px;
    white-space: nowrap;
}

.input-search {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.input-search:focus { border-color: var(--primary); }

.select-filter {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface);
    cursor: pointer;
    min-width: 120px;
    max-width: 180px;
}

/* ============ 标签云 ============ */
.tag-cloud-area {
    background: var(--surface);
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex-shrink: 0;
    max-height: 140px;
    overflow-y: auto;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.tag-item:hover { background: var(--primary); color: white; }
.tag-item.active { background: var(--primary); color: white; }
.tag-item .tag-count { font-size: 11px; opacity: 0.7; }

/* ============ 知识列表（单行） ============ */
.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.knowledge-row {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    min-height: 36px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
    gap: 8px;
}
.knowledge-row:last-child { border-bottom: none; }
.knowledge-row:hover { background: var(--bg); }

.knowledge-row .class-badge {
    flex: none;
    width: 26px;
    text-align: center;
    line-height: 1.4;
}

.kr-type {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--tag-bg);
    color: var(--primary);
    font-weight: 600;
    flex: none;
    width: 124px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    line-height: 1.5;
}

.kr-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}
.kr-status-pending {
    background: #fff5e6;
    color: var(--warning);
    animation: pulse-pending 2s ease-in-out infinite;
}
@keyframes pulse-pending {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.kr-source {
    font-size: 10.5px;
    color: var(--text-muted);
    flex: none;
    width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.kr-tags {
    display: flex;
    gap: 3px;
    flex: none;
    width: 200px;
    overflow: hidden;
    align-items: center;
    max-height: 22px;
}
.kr-tag {
    font-size: 10px;
    padding: 0 5px;
    background: var(--bg);
    color: var(--text-muted);
    border-radius: 8px;
    white-space: nowrap;
    line-height: 1.5;
}

/* 列表正文：更小两行，尽量显示全段（截断由 clamp 兜底） */
.kr-text {
    flex: 1;
    min-width: 0;
    font-size: 9.5px;
    line-height: 1.28;
    color: var(--text-muted);
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: calc(9.5px * 1.28 * 2);
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-bottom: 20px;
}
.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ 统计 ============ */
.stats-layout { width: 100%; padding: 0 8px; }
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: none;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}
.stat-card .stat-value { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.stat-detail {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    grid-column: span 2;
}
.stat-detail h3 { font-size: 15px; margin-bottom: 12px; }
.stat-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stat-bar .bar-label { width: 80px; font-size: 13px; text-align: right; }
.stat-bar .bar-track { flex: 1; height: 20px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.stat-bar .bar-fill { height: 100%; background: var(--primary); border-radius: 10px; transition: width 0.5s; }
.stat-bar .bar-value { width: 40px; font-size: 13px; font-weight: 600; }

/* ============ 设置页面 ============ */
.settings-layout {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.settings-subtabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    position: sticky;
    top: 56px;
    z-index: 10;
    background: var(--bg);
    padding: 8px 0 4px;
}
.ss-tab {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: 9999px;
    padding: 7px 16px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
}
.ss-tab:hover { border-color: var(--primary); color: var(--text); }
.ss-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
.ss-pane { display: none; flex-direction: column; gap: 16px; }
.ss-pane.active { display: flex; }

.settings-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.settings-card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.settings-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.settings-test-result {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.settings-test-result.success { background: #e6f9f1; color: var(--success); }
.settings-test-result.error { background: #fef0f0; color: var(--danger); }

/* Prompt 编辑区 */
.textarea-prompt {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    outline: none;
    transition: border-color 0.2s;
}
.textarea-prompt:focus { border-color: var(--primary); }

/* ============ 按钮 ============ */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: var(--success-hover); }
.btn-success:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-default { background: var(--bg); color: var(--text); }
.btn-default:hover { background: var(--border); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }

/* ============ 模态框 ============ */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; }
.modal-overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.4); }
.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    max-width: 500px;
    margin: 80px auto;
    box-shadow: var(--shadow-lg);
}
.modal-large { max-width: 800px; margin: 40px auto; max-height: 85vh; display: flex; flex-direction: column; }
/* 详情弹窗：占满视口高度但整体不滚动，滚动只发生在四区内部 */
.modal-xlarge {
    max-width: 1280px; width: 96vw;
    margin: 2vh auto; height: 96vh;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.modal-xlarge .modal-body {
    flex: 1; min-height: 0; overflow: hidden;
    display: flex; flex-direction: column;
    padding: 12px 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 4px;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group .input-full {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.form-group .input-full:focus { border-color: var(--primary); outline: none; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ============ 知识详情：左右布局 ============ */
.detail-meta-bar {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-split {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 24px;
    min-height: 400px;
}

.detail-left {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow-y: auto;
    max-height: 65vh;
}

.detail-left h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-original-text {
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    color: var(--text);
}

.detail-original-text mark {
    background: rgba(255, 235, 59, 0.45);
    border-radius: 3px;
    padding: 1px 2px;
    color: inherit;
    transition: background 0.15s, box-shadow 0.15s;
}

.detail-original-text mark.active-highlight {
    background: rgba(255, 193, 7, 0.85);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.4);
}

.detail-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 65vh;
    overflow: hidden;
}

.detail-right-top {
    flex-shrink: 0;
    max-height: 45%;
    overflow-y: auto;
}

.detail-right-bottom {
    flex: 1;
    overflow-y: auto;
}

.detail-right h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 条目式对照表 */
.detail-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}
.detail-items-table tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
    cursor: default;
}
.detail-items-table tr:last-child { border-bottom: none; }
.detail-items-table tr:hover { background: var(--bg); }
.detail-items-table td {
    padding: 10px 8px;
    vertical-align: top;
    word-break: break-word;
}
.detail-items-table .item-label {
    color: var(--text-muted);
    width: 18%;
}
.detail-items-table .item-value {
    color: var(--text);
    font-weight: 500;
    width: auto;
}
.detail-items-table .item-arrow {
    color: var(--primary);
    font-weight: 700;
    width: 8%;
    text-align: center;
    white-space: nowrap;
}

/* 无条目时 */
.detail-items-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 12px;
    text-align: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

/* 整体分析 */
.detail-analysis-text {
    background: #eef5ff;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 2.0;
    white-space: pre-wrap;
    border-left: 4px solid var(--primary);
    color: var(--text);
}

/* 标签栏：默认在底部；.detail-tags-bar.in-header 挂在标题区 */
.detail-tags-bar {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.detail-tags-bar.in-header {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    margin-left: auto;
}
/* 黑话原句在原文区的高亮 */
.jargon-mark {
    background: #fff3bf;
    box-shadow: inset 0 -1px 0 #e67700;
    border-radius: 2px;
    padding: 0 2px;
    color: inherit;
}
.detail-tags-bar .tags-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 4px;
}
.detail-tag {
    padding: 4px 12px;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 14px;
    font-size: 13px;
}

/* ============ 通用 ============ */
.placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 14px;
}
.text-muted { color: var(--text-muted); font-size: 12px; }

/* loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 滚动条 */
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.panel-body::-webkit-scrollbar-thumb:hover { background: #ccc; }

/* ============ 分级流水线 v2 ============ */
.class-badge {
    display: inline-block; padding: 1px 7px; border-radius: 10px;
    font-size: 11px; font-weight: 700; line-height: 1.6;
}
.class-A { background: #fde8e8; color: #c53030; }
.class-B { background: #fef3d6; color: #b7791f; }
.class-none { background: var(--bg); color: var(--text-muted); }

.four-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;   /* 固定弹窗高度下，两行均分剩余空间 */
    gap: 10px;
    margin-top: 0;
    flex: 1; min-height: 0;        /* 关键：让grid成为滚动边界，页面整体不滚 */
}
.fp {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px 12px;
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 0;                 /* 允许子元素正确收缩出滚动 */
}
/* 四区标题：浅底色快速区分（原文=红调/逻辑=蓝调/黑话=绿调/案例=橙调） */
.fp h4 {
    margin: -10px -14px 8px; padding: 6px 14px;
    font-size: 13px; flex: none;
    border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
}
.fp-original h4 { background: #fdf1f1; color: #a03030; }
.fp-logic h4    { background: #eef3fd; color: #33529c; }
.fp-jargon h4   { background: #eef8f2; color: #2c7a52; }
.fp-cases h4    { background: #fdf5ec; color: #996533; }
.fp-original { grid-column: 1; grid-row: 1; }
.fp-logic { grid-column: 2; grid-row: 1; }
.fp-jargon { grid-column: 1; grid-row: 2; }
.fp-cases { grid-column: 2; grid-row: 2; }

.chap-scroll, .logic-scroll, .cases-scroll, .jargon-scroll {
    overflow-y: auto; flex: 1; min-height: 0; padding-right: 6px;
}
.chap-para { font-size: 13px; line-height: 1.7; margin-bottom: 4px; color: var(--text); }
.para-num {
    display: inline-block; min-width: 26px; margin-right: 6px;
    font-size: 11px; color: var(--text-muted); opacity: .6; text-align: right;
}
.para-hl { color: var(--text); border-radius: 4px; padding: 2px 4px; }
.para-hl-A { background: #fde8e8; box-shadow: inset 3px 0 0 #c53030; }
.para-hl-B { background: #fef3d6; box-shadow: inset 3px 0 0 #b7791f; }

/* ---- 结构化文本渲染（逻辑解释/案例描述） ---- */
.logic-text { font-size: 13.5px; line-height: 1.8; }
.rich-p { margin: 0 0 8px; }
.rich-p strong, .case-desc strong, .rich-list strong {
    background: linear-gradient(transparent 62%, #fdeec3 62%);
    font-weight: 700; padding: 0 1px;
}
.rich-list { margin: 0 0 8px; padding-left: 20px; }
.rich-list li { margin-bottom: 4px; }

/* ---- 黑话表：极窄原文列 + 极窄箭头列，空间留给解读 ---- */
.detail-items-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    table-layout: fixed;
}
.detail-items-table td { padding: 6px 4px; border-bottom: 1px dashed var(--border); vertical-align: top; }
.detail-items-table .item-label {   /* 原文说法：更窄，把空间让给右侧解读 */
    width: 16%; color: var(--text); font-weight: 600; word-break: break-word;
}
.detail-items-table .item-arrow {   /* 箭头：最小化功能列 */
    width: 18px; text-align: center; color: var(--primary); white-space: nowrap; padding: 6px 0;
}
.detail-items-table .item-value {   /* 现实对象+依据：占满剩余 */
    width: auto; word-break: break-word;
}
.item-note { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.manual-badge {
    display: inline-block; font-size: 10px; font-weight: 400; color: #2b5cd9;
    background: #e8f0fe; border-radius: 6px; padding: 0 5px; margin-left: 4px; vertical-align: middle;
}

.case-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; }
.case-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.case-src { font-size: 11px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
.case-src-own { background: #e6f6ee; color: #1f7a4d; }
.case-src-add { background: #e8f0fe; color: #2b5cd9; }
.case-conf { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--bg); color: var(--text-muted); }
.conf-高 { background: #e6f6ee; color: #1f7a4d; }
.conf-中 { background: #fef3d6; color: #b7791f; }
.conf-低 { background: #fde8e8; color: #c53030; }
.case-period { font-size: 11px; color: var(--text-muted); }
.case-desc { font-size: 13px; line-height: 1.75; }
.case-note { font-size: 12px; color: #b7791f; margin-top: 4px; }

.detail-meta-bar { flex: none; }
.detail-tags-bar { flex: none; }

.screen-reason {
    max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-muted); font-size: 12px; display: inline-block; vertical-align: middle;
}
.detail-actions { margin-left: auto; display: inline-flex; gap: 6px; }
.settings-collapse summary { cursor: pointer; }
.settings-collapse .form-group { margin-top: 12px; }

/* ============ 划选补录黑话弹层 ============ */
#jargon-popover {
    position: absolute; z-index: 9999;
    width: 320px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 12px;
}
.jp-quote {
    font-size: 12px; color: var(--text); background: var(--bg);
    border-left: 3px solid var(--primary); padding: 6px 8px; border-radius: 4px;
    margin-bottom: 8px; max-height: 60px; overflow-y: auto; word-break: break-all;
}
.jp-input {
    width: 100%; padding: 6px 8px; margin-bottom: 6px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; box-sizing: border-box;
}
.jp-input:focus { border-color: var(--primary); outline: none; }
.jp-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* ============ 批量进度条 + 结果弹窗表格 ============ */
.batch-progress { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.bp-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bp-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s ease; }
.bp-text { font-size: 13px; font-weight: 600; color: var(--primary); min-width: 70px; text-align: right; }

.batch-summary { font-size: 14px; margin-bottom: 12px; padding: 8px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.batch-summary .cls-a { color: #c53030; }
.batch-summary .err-cnt { color: var(--danger); font-weight: 600; }
.batch-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.batch-table th { text-align: left; padding: 6px 10px; background: var(--bg); border-bottom: 1px solid var(--border); color: var(--text-muted); }
.batch-table td { padding: 6px 10px; border-bottom: 1px dashed var(--border); }
.batch-table .bt-title { max-width: 380px; }
.batch-table .cls-a { color: #c53030; font-weight: 700; }
.batch-table .bt-err { color: var(--danger); font-size: 12px; }
.batch-table .row-err { background: #fff5f5; }

/* ============ 知识库两栏布局（分类移到顶部tab） ============ */
.knowledge-layout { grid-template-columns: 260px 1fr; }
.panel-cat-nav { display: none; }
.vol-group { margin-bottom: 2px; }
.vol-head {
    display: flex; align-items: stretch;
    border-radius: var(--radius-sm);
    font-size: 12.5px; font-weight: 600; user-select: none;
    overflow: hidden;
}
.vol-head:hover { background: var(--bg); }
/* #2 整块可点：卷名占满左侧（选中整卷），计数占右侧（折叠） */
.vol-head .vol-name {
    flex: 1; display: flex; align-items: center;
    padding: 6px 8px; cursor: pointer; min-width: 0;
}
.vol-head .vol-name:hover { background: var(--tag-bg); color: var(--primary); }
.vol-head .vol-name.vol-active {
    background: linear-gradient(135deg, rgba(79,109,245,.18), rgba(79,109,245,.08));
    color: var(--primary);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(79,109,245,.28);
    backdrop-filter: blur(6px);
}
.vol-head .vol-count {
    flex: none; display: flex; align-items: center;
    padding: 6px 10px; cursor: pointer; white-space: nowrap;
    font-size: 11px; color: var(--text-muted); font-weight: 400;
    border-left: 1px solid var(--border);
}
.vol-head .vol-count:hover { background: var(--bg); color: var(--text); }
/* #1 卷分析进度配色 */
.vp-done { color: var(--success); font-weight: 700; }
.vp-num { color: var(--danger); font-weight: 700; }
.vp-den { color: var(--text-muted); }
.vol-count { font-size: 11px; color: var(--text-muted); font-weight: 400; white-space: nowrap; }
.cat-sub {
    display: flex; justify-content: space-between; align-items: center;
    padding: 3px 10px 3px 18px; font-size: 12px; color: var(--text-muted); cursor: pointer;
    border-radius: var(--radius-sm);
}
.cat-sub:hover { background: var(--bg); color: var(--text); }
.cat-sub.active { background: var(--tag-bg); color: var(--tag-text); font-weight: 600; }
.cat-head.active .cat-name { color: var(--tag-text); }
.cat-clear { padding: 6px 8px; font-size: 12px; color: var(--danger); cursor: pointer; text-align: center; border-top: 1px dashed var(--border); margin-top: 6px; }
.cat-clear.hidden { display: none; }
.vol-group .chapter-nav-item { padding-left: 14px; }

/* ============ A/B 滑块 ============ */
.class-slider {
    display: flex; align-items: center; background: var(--bg);
    border: 1px solid var(--border); border-radius: 16px; overflow: hidden; flex: none;
}
.cs-opt {
    border: none; background: transparent; padding: 4px 14px; font-size: 12.5px;
    color: var(--text-muted); cursor: pointer; font-weight: 500;
}
.cs-opt.active { background: var(--primary); color: #fff; font-weight: 700; }
.cs-opt.active[data-val="A"] { background: #c53030; }
.cs-switch { width: 1px; height: 16px; background: var(--border); }

/* ============ 顶部大分类 tab + 子tag芯片 ============ */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.cat-tab {
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    padding: 5px 14px; border-radius: 18px; font-size: 13px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
}
.cat-tab:hover { border-color: var(--primary); }
.cat-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.ct-count { font-size: 11px; background: rgba(0,0,0,.08); border-radius: 8px; padding: 0 6px; }
.cat-tab.active .ct-count { background: rgba(255,255,255,.25); }
.cat-subs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 2px; }
.cs-label { font-size: 12px; color: var(--text-muted); margin-right: 2px; }
.cat-chip {
    border: 1px dashed var(--border); background: var(--bg); color: var(--text-muted);
    padding: 2px 10px; border-radius: 12px; font-size: 12px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
}
.cat-chip:hover { color: var(--tag-text); border-color: var(--primary); }
.cat-chip.active { background: var(--tag-bg); color: var(--tag-text); border-style: solid; border-color: var(--primary); font-weight: 600; }
.cc-count { font-size: 10px; opacity: .7; }
.cat-chip-clear { border: none; background: none; color: var(--danger); font-size: 12px; cursor: pointer; text-decoration: underline; }

/* ============ 章节行：选中态 + 拖拽防误选 ============ */
.chapter-item { cursor: pointer; user-select: none; }
.chapter-item.selected { background: var(--tag-bg); box-shadow: inset 3px 0 0 var(--primary); }
#chapter-list { user-select: none; }

/* ============ 抓取管理：分卷 + 整卷勾选 ============ */
.vol-block { margin-bottom: 6px; }
.vol-select {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; margin: 4px 0; cursor: pointer;
    background: var(--bg); border-radius: var(--radius-sm);
    border: 1px solid var(--border); user-select: none;
}
.vol-select:hover { border-color: var(--primary); }
.vol-select.all-selected { background: var(--tag-bg); border-color: var(--primary); }
.vol-sel-name { font-size: 13px; font-weight: 700; color: var(--text); }
.vol-sel-count { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.vol-block .chapter-item { margin-left: 8px; }

/* ============ 全局浮动进度条 ============ */
.float-progress {
    position: fixed; right: 20px; bottom: 20px; z-index: 9998;
    display: none; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 30px; box-shadow: var(--shadow-lg); padding: 10px 16px;
    min-width: 260px;
}
.fp-icon { font-size: 18px; animation: spin 2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fp-body { flex: 1; }
.fp-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.fp-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.fp-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .5s ease; }
.fp-count { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 42px; text-align: right; }

/* ============ 章节右键菜单 ============ */
.ctx-menu {
    position: fixed; z-index: 9999; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 4px; min-width: 180px;
}
.ctx-title { font-size: 12px; color: var(--text-muted); padding: 6px 10px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.ctx-item { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; font-size: 13px; cursor: pointer; border-radius: var(--radius-sm); }
.ctx-item:hover { background: var(--tag-bg); color: var(--tag-text); }

/* ============ 抓取管理卷折叠 ============ */
.vol-select { cursor: default; }
.vol-caret { font-size: 10px; color: var(--text-muted); width: 12px; cursor: pointer; }
.vol-sel-name { cursor: pointer; }
.vol-sel-name:hover { color: var(--primary); }
.vol-block.collapsed .vol-chapters { display: none; }

/* ============ 三级标签行（更紧凑） ============ */
.l3-row { margin-top: 2px; }
.l3-row .cs-label { color: var(--tag-text); }
.l3-chip { font-size: 11.5px; padding: 1px 8px; background: var(--surface); border-style: solid; }

/* ============ 统计页 一级/二级分布 ============ */
.tax-cat-block { margin-bottom: 14px; }
.stat-bar.cat .cat-label { font-weight: 700; font-size: 13px; min-width: 90px; }
.cat-fill { background: var(--primary); }
.cat-value { font-weight: 700; color: var(--primary); }
.tax-subs { margin: 4px 0 0 90px; }
.stat-bar.sub .bar-label { font-size: 12px; color: var(--text-muted); min-width: 120px; }
.sub-fill { background: #9db2f7; }
.hint-inline { font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* ============ 知识库卷导航：卷名可点选中 ============ */
.vol-head .vol-name { cursor: pointer; }
.vol-head .vol-name:hover { color: var(--primary); }
.vol-head .vol-name.vol-active {
    background: linear-gradient(135deg, rgba(79,109,245,.18), rgba(79,109,245,.08));
    color: var(--primary);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(79,109,245,.28);
    backdrop-filter: blur(6px);
}
.vol-head .vol-count { cursor: pointer; }

/* ============ 统计看板（多库，横向拉满 + 纵轴从0） ============ */
.dash-wrap { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.dash-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    width: 100%;
    overflow: hidden;
}
.dash-block.is-collapsed .dash-body { display: none; }
.dash-header {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 14px 18px;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.dash-header:hover { background: rgba(79,109,245,.04); }
.dash-caret {
    display: inline-block;
    width: 1em;
    color: var(--text-muted);
    font-size: 12px;
    margin-right: 2px;
}
.dash-body { width: 100%; padding: 0 18px 16px; }
.dash-overview {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 28px;
}
.dash-name { font-size: 16px; font-weight: 700; margin-right: 8px; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dash-name.is-all { color: var(--primary); }
.dash-novels {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    border-radius: 9999px;
    padding: 2px 10px;
    margin-left: 6px;
}
.dash-novel-list {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 8px;
}
.dash-metric { display: inline-flex; align-items: baseline; gap: 8px; font-size: 13px; }
.dm-label { color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.dm-val { font-weight: 700; }
.dm-val.a { color: #c53030; }
.dm-val.b { color: #2b6cb0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-a { background: var(--class-a, #e05252); }
.dot-b { background: var(--class-b, #7fa8e8); }
.dash-charts {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    width: 100%;
    min-height: 260px;
}
.dash-charts.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}
.dash-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    padding: 10px 8px 8px;
}
.dash-col-head {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-col-head b { color: var(--primary); font-weight: 700; }
.dash-col-body {
    position: relative;
    flex: 1;
    display: flex;
    min-height: 240px;
    padding-left: 32px;
}
.dash-axis {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 56px;
    width: 32px;
}
.dash-tick {
    position: absolute;
    right: 4px;
    transform: translateY(50%);
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1;
}
.dash-col-bars {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 4px;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    /* 水平网格线：5 刻度从 0 起；标签区 56px 不计入绘图高 */
    background-image: repeating-linear-gradient(
        to top,
        transparent 0,
        transparent calc(25% - 1px),
        rgba(0,0,0,.06) calc(25% - 1px),
        rgba(0,0,0,.06) 25%
    );
    background-size: 100% calc(100% - 56px);
    background-repeat: no-repeat;
    background-position: top left;
    padding: 0 2px;
    min-height: 240px;
}
.vbar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    max-width: 48px;
}
.vbar-track {
    flex: 1;
    width: 100%;
    max-width: 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 0;
}
.vbar-fill {
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 3px 3px 0 0;
    overflow: hidden;
    min-height: 0;
}
.vbar-a,
.vbar-b {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
    position: relative;
}
.vbar-a { background: var(--class-a, #e05252); }
.vbar-b { background: var(--class-b, #7fa8e8); }
/* 柱体内部 A/B 数字：比原顶部数字再小两号 */
.vbar-in-num {
    font-size: 9px;
    line-height: 1;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 0 2px rgba(0,0,0,.25);
    pointer-events: none;
}
.vbar-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
    flex: none;
    height: 48px;
    line-height: 1.25;
    word-break: break-all;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.badge-info { background: #e8f0fe; color: #2b5cd9; }

/* 统计可点击 */
.clickable { cursor: pointer; }
.clickable:hover { filter: brightness(0.96); }
.dash-col-head.clickable:hover b,
.dash-col-head.clickable:hover { color: var(--primary); }
.dash-link {
    border: none; background: none; padding: 0;
    color: var(--text); font: inherit; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: var(--border);
}
.dash-link:hover { color: var(--primary); text-decoration-color: var(--primary); }
.top-tags-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.top-tags-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.top-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.top-tag {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
.top-tag b { color: var(--text-muted); font-weight: 600; margin-left: 2px; font-size: 10px; }
.top-tag:hover { border-color: var(--primary); color: var(--primary); }
.vbar.clickable .vbar-label:hover { color: var(--primary); font-weight: 600; }

/* 详情：同章/同二级/同标签 */
.related-jumps {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px dashed var(--border);
    flex: none;
}
.related-jumps .btn { font-size: 12px; padding: 4px 10px; }

/* ============ display 模式：隐藏写操作入口 ============ */
body.display-mode .cn-reanalyze,
body.display-mode #btn-pipeline,
body.display-mode #btn-classify,
body.display-mode #btn-add-novel,
body.display-mode #btn-save-settings,
body.display-mode #btn-test-settings,
body.display-mode #btn-gen-taxonomy,
body.display-mode #btn-build-taglib,
body.display-mode #btn-build-taglib-forced,
body.display-mode #btn-build-taglib-script,
body.display-mode #btn-taglib-apply,
body.display-mode #btn-taglib-dry,
body.display-mode #btn-jargon-cleanup,
body.display-mode #btn-split-sub,
body.display-mode #btn-run-novel,
body.display-mode #btn-resume-batch,
body.display-mode .related-jumps [data-jump],
body.display-mode .detail-actions { display: none !important; }
body.display-mode .local-only { display: none !important; }
/* display：对外五页；隐藏黑话分析（设置走 .local-only） */
body.display-mode .tab[data-tab="jargon-dim"],
body.display-mode #tab-jargon-dim { display: none !important; }

/* 设置内嵌抓取 */
.settings-extract {
    height: calc(100vh - 200px);
    min-height: 480px;
}

/* ============ 主题切换器 ============ */
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: var(--bg);
}
.theme-opt {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 9999px;
    cursor: pointer;
    line-height: 1.4;
}
.theme-opt:hover { color: var(--text); }
.theme-opt.active {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow);
}

/* ============ 方案2 · Seline（暖石纸面 + 单一青强调） ============ */
/* 参考：Seline Analytics / Plausible 风格。不改交互结构，只换皮肤。 */
:root {
    --class-a: #e05252;
    --class-b: #7fa8e8;
    --class-a-bg: #fde8e8;
    --class-a-text: #c53030;
    --class-b-bg: #eef2ff;
    --class-b-text: #2b6cb0;
    --chip-active-bg: var(--primary);
    --chip-active-fg: #fff;
}

[data-theme="seline"] {
    --bg: #fafaf9;
    --surface: #ffffff;
    --border: #e8e6e5;
    --text: #0c0a09;
    --text-muted: #78716c;
    --primary: #3ba6f1;
    --primary-hover: #3398e1;
    --success: #57534e;
    --success-hover: #44403c;
    --warning: #a8a29e;
    --danger: #9f1239;
    --tag-bg: #c1e1f7;
    --tag-text: #3398e1;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 12px 45px rgba(17, 12, 46, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --class-a: #1c1917;
    --class-b: #3ba6f1;
    --class-a-bg: #f5f5f4;
    --class-a-text: #1c1917;
    --class-b-bg: #c1e1f7;
    --class-b-text: #3398e1;
    --chip-active-bg: #1c1917;
    --chip-active-fg: #ffffff;
}

/* 字体：标题近 Roobert 气质（用系统 geometric + 负字距），正文 Inter 优先 */
[data-theme="seline"] body,
[data-theme="seline"] {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.004em;
}
[data-theme="seline"] .logo {
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.02em;
}
[data-theme="seline"] .panel-header h2,
[data-theme="seline"] .dash-name,
[data-theme="seline"] .settings-card h2 {
    font-weight: 400;
    letter-spacing: -0.02em;
}

/* 导航：无填充链接式 +  active 用 soot 填充胶囊 */
[data-theme="seline"] .tab {
    border-radius: 9999px;
    padding: 6px 14px;
    font-weight: 400;
    height: 32px;
}
[data-theme="seline"] .tab.active {
    background: #1c1917;
    color: #ffffff;
    font-weight: 500;
}
[data-theme="seline"] .tab:hover:not(.active) {
    background: transparent;
    color: #0c0a09;
}

/* 按钮：胶囊形，主按钮仅青色填充 */
[data-theme="seline"] .btn {
    border-radius: 9999px;
    padding: 8px 16px;
    font-weight: 500;
    border: 1px solid transparent;
}
[data-theme="seline"] .btn-sm { padding: 5px 12px; font-size: 12px; }
[data-theme="seline"] .btn-primary {
    background: #3ba6f1;
    border-color: #3398e1;
    color: #ffffff;
}
[data-theme="seline"] .btn-primary:hover { background: #3398e1; }
[data-theme="seline"] .btn-default {
    background: transparent;
    border-color: #e8e6e5;
    color: #0c0a09;
    font-weight: 400;
}
[data-theme="seline"] .btn-default:hover { background: #fafaf9; }
[data-theme="seline"] .btn-success {
    background: #1c1917;
    border-color: #1c1917;
    color: #fff;
}
[data-theme="seline"] .btn-success:hover { background: #0c0a09; }

/* 卡片/面板：白底 + 1px 石色描边为主结构 */
[data-theme="seline"] .panel,
[data-theme="seline"] .settings-card,
[data-theme="seline"] .stat-card,
[data-theme="seline"] .stat-detail,
[data-theme="seline"] .dash-block {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e6e5;
    border-radius: 10px;
}
[data-theme="seline"] .modal-content {
    border: 1px solid #e8e6e5;
    border-radius: 10px;
    box-shadow: 0 12px 45px rgba(17, 12, 46, 0.12);
}

/* 输入框 */
[data-theme="seline"] .input-search,
[data-theme="seline"] .input-full,
[data-theme="seline"] .select-filter,
[data-theme="seline"] .textarea-prompt,
[data-theme="seline"] #novel-file-path,
[data-theme="seline"] #novel-encoding {
    border-radius: 6px;
    border-color: #d6d3d1;
}
[data-theme="seline"] .input-search:focus,
[data-theme="seline"] .input-full:focus {
    border-color: #3ba6f1;
    box-shadow: 0 0 0 2px rgba(59, 166, 241, 0.25);
}

/* 分类 chips / 标签：石色胶囊，激活用 soot 或 cyan 高亮字 */
[data-theme="seline"] .cat-tab {
    border-radius: 9999px;
    background: #ffffff;
    border-color: #e8e6e5;
    color: #0c0a09;
    font-weight: 400;
}
[data-theme="seline"] .cat-tab:hover { border-color: #a8a29e; }
[data-theme="seline"] .cat-tab.active {
    background: #1c1917;
    border-color: #1c1917;
    color: #ffffff;
    font-weight: 500;
}
[data-theme="seline"] .cat-tab.active .ct-count { background: rgba(255,255,255,.18); }
[data-theme="seline"] .cat-chip {
    border-radius: 9999px;
    border-style: solid;
}
[data-theme="seline"] .cat-chip.active {
    background: #c1e1f7;
    color: #3398e1;
    border-color: #3ba6f1;
}
[data-theme="seline"] .tag-item {
    border-radius: 9999px;
    background: #f5f5f4;
    color: #0c0a09;
}
[data-theme="seline"] .tag-item:hover,
[data-theme="seline"] .tag-item.active {
    background: #c1e1f7;
    color: #3398e1;
}
[data-theme="seline"] .kr-tag,
[data-theme="seline"] .kr-type {
    border-radius: 9999px;
    background: #f5f5f4;
    color: #78716c;
    border: 1px solid #e8e6e5;
}
[data-theme="seline"] .kr-type {
    background: #ffffff;
    color: #0c0a09;
}

/* A/B 滑块：soot 激活，不强调红色 */
[data-theme="seline"] .class-slider { border-radius: 9999px; }
[data-theme="seline"] .cs-opt { border-radius: 9999px; }
[data-theme="seline"] .cs-opt.active {
    background: #1c1917;
    color: #ffffff;
}
[data-theme="seline"] .cs-opt.active[data-val="A"] {
    background: #1c1917;
}

/* 知识行 / 卷导航玻璃选中改为石色淡洗 */
[data-theme="seline"] .vol-head .vol-name.vol-active {
    background: #f5f5f4;
    color: #0c0a09;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px #e8e6e5;
    backdrop-filter: none;
}
[data-theme="seline"] .vol-head .vol-name:hover { color: #0c0a09; background: #f5f5f4; }
[data-theme="seline"] .chapter-nav-item.active {
    background: #f5f5f4;
    box-shadow: inset 3px 0 0 #1c1917;
}
[data-theme="seline"] .knowledge-row:hover { background: #fafaf9; }

/* 徽章 / 状态：中性石色，去掉彩色绿黄 */
[data-theme="seline"] .badge-success { background: #f5f5f4; color: #1c1917; }
[data-theme="seline"] .badge-warning { background: #f5f5f4; color: #78716c; }
[data-theme="seline"] .badge-info { background: #c1e1f7; color: #3398e1; }
[data-theme="seline"] .class-A,
[data-theme="seline"] .class-badge.class-A {
    background: #1c1917;
    color: #ffffff;
}
[data-theme="seline"] .class-B,
[data-theme="seline"] .class-badge.class-B {
    background: #c1e1f7;
    color: #3398e1;
}
[data-theme="seline"] .para-hl-A {
    background: #f5f5f4;
    box-shadow: inset 3px 0 0 #1c1917;
}
[data-theme="seline"] .conf-高 { background: #f5f5f4; color: #1c1917; }
[data-theme="seline"] .conf-低 { background: #fafaf9; color: #78716c; }
[data-theme="seline"] .dm-val.a { color: #1c1917; }
[data-theme="seline"] .dm-val.b { color: #3398e1; }
[data-theme="seline"] .dot-a { background: #1c1917; }
[data-theme="seline"] .dot-b { background: #3ba6f1; }
[data-theme="seline"] .vbar-a { background: #1c1917; }
[data-theme="seline"] .vbar-b { background: #3ba6f1; }
[data-theme="seline"] .vbar-in-num { text-shadow: none; }
[data-theme="seline"] .vp-num { color: #1c1917; }

/* 统计看板列卡片更扁、更“纸面” */
[data-theme="seline"] .dash-col {
    background: #fafaf9;
    border-color: #e8e6e5;
}
[data-theme="seline"] .dash-col-head b { color: #3398e1; font-weight: 500; }
[data-theme="seline"] .dash-header:hover { background: #fafaf9; }

/* 分页 */
[data-theme="seline"] .page-btn {
    border-radius: 9999px;
    border-color: #e8e6e5;
}
[data-theme="seline"] .page-btn.active {
    background: #1c1917;
    border-color: #1c1917;
    color: #fff;
}

/* 设置页结果条 */
[data-theme="seline"] .settings-test-result.success {
    background: #f5f5f4;
    color: #1c1917;
}
[data-theme="seline"] .settings-test-result.error {
    background: #fef1f2;
    color: #9f1239;
}

/* ============ 方案3 · ElevenReader（黑白编辑感 + 薄荷点缀） ============ */
/* 参考：ElevenReader。暖白纸面、近黑主按钮、浅灰次按钮、薄荷强调、大圆角卡片。 */
[data-theme="dimension"] {
    --bg: #f7f6f3;
    --surface: #ffffff;
    --border: #e8e6e1;
    --text: #111111;
    --text-muted: #6b6b66;
    --primary: #111111;
    --primary-hover: #2a2a2a;
    --success: #1a7a3c;
    --success-hover: #146330;
    --warning: #8a7340;
    --danger: #c23b3b;
    --tag-bg: #ecebe6;
    --tag-text: #111111;
    --shadow: 0 8px 28px rgba(17, 17, 17, 0.06);
    --shadow-lg: 0 16px 48px rgba(17, 17, 17, 0.1);
    --radius: 16px;
    --radius-sm: 12px;
    --class-a: #111111;
    --class-b: #7ec8a3;
    --class-a-bg: #111111;
    --class-a-text: #ffffff;
    --class-b-bg: #d8f3e4;
    --class-b-text: #1a7a3c;
    --chip-active-bg: #111111;
    --chip-active-fg: #ffffff;
    --mint: #d8f3e4;
    --mint-text: #1a7a3c;
    --soft-btn: #ecebe6;
}

[data-theme="dimension"] body,
[data-theme="dimension"] {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, sans-serif;
    letter-spacing: 0.004em;
}

/* 顶栏：干净白底，无重阴影 */
[data-theme="dimension"] .header {
    background: #ffffff;
    border-bottom: 1px solid #e8e6e1;
    box-shadow: none;
    height: 60px;
    padding: 0 28px;
}
[data-theme="dimension"] .logo {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
    color: #111111;
}

/* 页签：无填充，激活为近黑胶囊 */
[data-theme="dimension"] .tab {
    border-radius: 9999px;
    padding: 7px 16px;
    height: 34px;
    font-weight: 500;
    font-size: 13.5px;
    color: #6b6b66;
    letter-spacing: 0.01em;
}
[data-theme="dimension"] .tab:hover:not(.active) {
    background: #f0efeb;
    color: #111111;
}
[data-theme="dimension"] .tab.active {
    background: #111111;
    color: #ffffff;
    font-weight: 600;
}

/* 主题切换 */
[data-theme="dimension"] .theme-switch {
    background: #f0efeb;
    border-color: #e8e6e1;
}
[data-theme="dimension"] .theme-opt { color: #6b6b66; }
[data-theme="dimension"] .theme-opt:hover { color: #111111; }
[data-theme="dimension"] .theme-opt.active {
    background: #ffffff;
    color: #111111;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* 按钮：主=近黑胶囊；次=浅灰胶囊 */
[data-theme="dimension"] .btn {
    border-radius: 9999px;
    padding: 9px 18px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
[data-theme="dimension"] .btn-sm { padding: 6px 14px; font-size: 12px; }
[data-theme="dimension"] .btn-primary {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
}
[data-theme="dimension"] .btn-primary:hover { background: #2a2a2a; border-color: #2a2a2a; }
[data-theme="dimension"] .btn-default {
    background: #ecebe6;
    border-color: #ecebe6;
    color: #111111;
    font-weight: 600;
}
[data-theme="dimension"] .btn-default:hover { background: #e0dfd9; }
[data-theme="dimension"] .btn-success {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
}
[data-theme="dimension"] .btn-danger {
    background: transparent;
    color: #c23b3b;
    border-color: rgba(194, 59, 59, 0.35);
}
[data-theme="dimension"] .btn-danger:hover {
    background: rgba(194, 59, 59, 0.08);
}

/* 卡片：大圆角白卡 + 柔投影，暖白底衬托 */
[data-theme="dimension"] .panel,
[data-theme="dimension"] .settings-card,
[data-theme="dimension"] .stat-card,
[data-theme="dimension"] .stat-detail,
[data-theme="dimension"] .dash-block {
    background: #ffffff;
    border: 1px solid #e8e6e1;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(17, 17, 17, 0.05);
}
[data-theme="dimension"] .panel-header {
    border-bottom: 1px solid #f0efeb;
    padding: 16px 18px;
}
[data-theme="dimension"] .modal-content {
    background: #ffffff;
    border: 1px solid #e8e6e1;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(17, 17, 17, 0.12);
}
[data-theme="dimension"] .modal-header {
    border-bottom: 1px solid #f0efeb;
}
[data-theme="dimension"] .modal-footer {
    border-top: 1px solid #f0efeb;
}

/* 输入 */
[data-theme="dimension"] .input-search,
[data-theme="dimension"] .input-full,
[data-theme="dimension"] .select-filter,
[data-theme="dimension"] .textarea-prompt {
    background: #fafaf8;
    border-color: #e8e6e1;
    border-radius: 12px;
    color: #111111;
}
[data-theme="dimension"] .input-search::placeholder,
[data-theme="dimension"] .input-full::placeholder,
[data-theme="dimension"] .textarea-prompt::placeholder {
    color: #9a9a94;
}
[data-theme="dimension"] .input-search:focus,
[data-theme="dimension"] .input-full:focus,
[data-theme="dimension"] .textarea-prompt:focus {
    border-color: #111111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
    outline: none;
}

/* chips / 分类 */
[data-theme="dimension"] .cat-tab {
    background: #ffffff;
    border-color: #e8e6e1;
    color: #111111;
    border-radius: 9999px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
[data-theme="dimension"] .cat-tab:hover { border-color: #c9c7c0; }
[data-theme="dimension"] .cat-tab.active {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
    font-weight: 600;
}
[data-theme="dimension"] .cat-tab.active .ct-count { background: rgba(255,255,255,.18); }
[data-theme="dimension"] .ct-count { background: #f0efeb; }
[data-theme="dimension"] .cat-chip {
    border-radius: 9999px;
    border-style: solid;
    background: #fafaf8;
}
[data-theme="dimension"] .cat-chip.active {
    background: #d8f3e4;
    color: #1a7a3c;
    border-color: #9ed9b8;
}
[data-theme="dimension"] .tag-item {
    border-radius: 9999px;
    background: #ecebe6;
    color: #111111;
}
[data-theme="dimension"] .tag-item:hover,
[data-theme="dimension"] .tag-item.active {
    background: #111111;
    color: #ffffff;
}
[data-theme="dimension"] .kr-tag,
[data-theme="dimension"] .kr-type {
    border-radius: 9999px;
    background: #f0efeb;
    color: #4a4a46;
    border: 1px solid transparent;
}
[data-theme="dimension"] .kr-type {
    background: #ffffff;
    color: #111111;
    border-color: #e8e6e1;
    font-weight: 500;
}

/* A/B 滑块 */
[data-theme="dimension"] .class-slider {
    border-radius: 9999px;
    background: #f0efeb;
    border-color: #e8e6e1;
}
[data-theme="dimension"] .cs-opt { border-radius: 9999px; color: #6b6b66; }
[data-theme="dimension"] .cs-opt.active {
    background: #111111;
    color: #ffffff;
}
[data-theme="dimension"] .cs-opt.active[data-val="A"] {
    background: #111111;
    color: #ffffff;
}

/* 列表 / 卷导航 */
[data-theme="dimension"] .knowledge-row {
    border-bottom-color: #f0efeb;
}
[data-theme="dimension"] .knowledge-row:hover { background: #fafaf8; }
[data-theme="dimension"] .vol-head .vol-name.vol-active {
    background: #111111;
    color: #ffffff;
    font-weight: 600;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 8px;
}
[data-theme="dimension"] .vol-head .vol-name:hover:not(.vol-active) {
    color: #111111;
    background: #f0efeb;
}
[data-theme="dimension"] .chapter-nav-item.active {
    background: #f0efeb;
    box-shadow: inset 3px 0 0 #111111;
}
[data-theme="dimension"] .chapter-nav-item:hover { background: #fafaf8; }

/* 徽章 / A-B */
[data-theme="dimension"] .badge-success {
    background: #d8f3e4;
    color: #1a7a3c;
}
[data-theme="dimension"] .badge-warning {
    background: #f5f0e4;
    color: #8a7340;
}
[data-theme="dimension"] .badge-info {
    background: #ecebe6;
    color: #111111;
}
[data-theme="dimension"] .class-A,
[data-theme="dimension"] .class-badge.class-A {
    background: #111111;
    color: #ffffff;
}
[data-theme="dimension"] .class-B,
[data-theme="dimension"] .class-badge.class-B {
    background: #d8f3e4;
    color: #1a7a3c;
}
[data-theme="dimension"] .para-hl-A {
    background: #f7f6f3;
    box-shadow: inset 3px 0 0 #111111;
}
[data-theme="dimension"] .conf-高 { background: #d8f3e4; color: #1a7a3c; }
[data-theme="dimension"] .conf-低 { background: #f0efeb; color: #6b6b66; }

/* 统计 */
[data-theme="dimension"] .dash-col {
    background: #fafaf8;
    border-color: #e8e6e1;
    border-radius: 14px;
}
[data-theme="dimension"] .dash-col-head b { color: #111111; font-weight: 700; }
[data-theme="dimension"] .dash-header:hover { background: #fafaf8; }
[data-theme="dimension"] .dash-col-bars {
    border-left-color: #e8e6e1;
    border-bottom-color: #e8e6e1;
    background-image: repeating-linear-gradient(
        to top,
        transparent 0,
        transparent calc(25% - 1px),
        rgba(17, 17, 17, 0.06) calc(25% - 1px),
        rgba(17, 17, 17, 0.06) 25%
    );
}
[data-theme="dimension"] .dash-tick,
[data-theme="dimension"] .vbar-label,
[data-theme="dimension"] .dm-label { color: #6b6b66; }
[data-theme="dimension"] .dm-val.a { color: #111111; }
[data-theme="dimension"] .dm-val.b { color: #1a7a3c; }
[data-theme="dimension"] .dot-a { background: #111111; }
[data-theme="dimension"] .dot-b { background: #7ec8a3; }
[data-theme="dimension"] .vbar-a { background: #111111; }
[data-theme="dimension"] .vbar-b { background: #7ec8a3; }
[data-theme="dimension"] .vbar-a .vbar-in-num { color: #ffffff; }
[data-theme="dimension"] .vbar-b .vbar-in-num { color: #0f3d22; text-shadow: none; font-weight: 700; }
[data-theme="dimension"] .vp-num { color: #111111; }
[data-theme="dimension"] .dash-name.is-all { color: #111111; }

/* 分页 */
[data-theme="dimension"] .page-btn {
    border-radius: 9999px;
    border-color: #e8e6e1;
    background: #ffffff;
    color: #111111;
    font-weight: 500;
}
[data-theme="dimension"] .page-btn.active {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
}
[data-theme="dimension"] .page-btn:hover:not(:disabled):not(.active) {
    background: #f0efeb;
    border-color: #e8e6e1;
}

/* 设置结果 / 进度 */
[data-theme="dimension"] .settings-test-result.success {
    background: #d8f3e4;
    color: #1a7a3c;
}
[data-theme="dimension"] .settings-test-result.error {
    background: #fdeeee;
    color: #c23b3b;
}
[data-theme="dimension"] .fp-track,
[data-theme="dimension"] .bp-bar-track {
    background: #ecebe6;
}
[data-theme="dimension"] .fp-fill,
[data-theme="dimension"] .bp-bar-fill { background: #111111; }

[data-theme="dimension"] .placeholder,
[data-theme="dimension"] .text-muted,
[data-theme="dimension"] .form-hint { color: #6b6b66; }

/* 页面底：轻薄荷/淡蓝渐变晕（参考图底部氛围，仅方案3） */
[data-theme="dimension"] body {
    background:
        radial-gradient(1200px 480px at 85% 100%, rgba(126, 200, 163, 0.22), transparent 60%),
        radial-gradient(900px 360px at 15% 100%, rgba(180, 200, 255, 0.16), transparent 55%),
        #f7f6f3;
    background-attachment: fixed;
}

/* ============ 拖拽导入 ============ */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    outline: none;
}
.drop-zone:hover,
.drop-zone:focus { border-color: var(--primary); }
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--tag-bg);
}
.dz-icon { font-size: 28px; margin-bottom: 6px; }
.dz-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.dz-hint { font-size: 12px; color: var(--text-muted); }
.drop-file-list {
    list-style: none;
    margin: 10px 0 0;
    max-height: 160px;
    overflow-y: auto;
}
.drop-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.drop-file-item:hover { background: var(--bg); }
.df-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-size { color: var(--text-muted); font-size: 12px; flex: none; }
.df-remove {
    border: none; background: none; color: var(--text-muted);
    cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px;
}
.df-remove:hover { color: var(--danger); }
.import-progress {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

/* 统计：五类不等宽（按体量），柱宽全局统一 */
.dash-charts-flex {
    display: flex;
    gap: 12px;
    width: 100%;
    min-height: 260px;
    align-items: stretch;
}
.dash-charts-flex .dash-col { min-width: 120px; }
.dash-charts-flex .vbar {
    flex: 0 0 34px;
    width: 34px;
    max-width: 34px;
}
.dash-charts-flex .dash-col-bars {
    justify-content: flex-start;
    overflow-x: auto;
}
.dash-overview .dm-val.text-muted {
    font-size: 12px;
    font-weight: 500;
}

/* 概念页 */
.concept-layout {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.concept-head h2 { margin: 0 0 4px; font-size: 18px; }
.concept-body { display: flex; flex-direction: column; gap: 16px; }
.concept-sec {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.concept-sec h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.concept-sec h3 .text-muted { font-weight: 400; font-size: 12px; margin-left: 6px; }

/* 知识库：三级隐藏；二级由 JS 控制显示 */
#cat-l3 { display: none !important; }

/* 统计 A/B 数字列 */
.hbar-nums {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    min-width: 36px;
    font-variant-numeric: tabular-nums;
}
.hbar-nums .hn-a { color: var(--class-a, #e05252); }
.hbar-nums .hn-b { color: var(--class-b, #7fa8e8); }
.hbar-nums-head { gap: 2px; font-size: 10px; font-weight: 700; opacity: 0.85; }
.hbar-row.hbar-head {
    margin-bottom: 2px;
    opacity: 0.8;
}
.hbar-sec h3 .h3-total {
    margin-left: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* 概念页 Tab 与标签网格 */
.concept-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 120px;
    overflow: auto;
}

/* 时间轴：纵向中国/世界 */
.tl-axis { display: flex; flex-direction: column; gap: 8px; }
.tl-slot {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.tl-slot-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.tl-slot-name { font-weight: 700; font-size: 14px; flex: 1; }
.tl-slot-cnt { font-size: 12px; color: var(--text-muted); }
.tl-caret { color: var(--text-muted); width: 12px; }
.tl-slot-body {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid var(--border);
}
.tl-side { padding: 8px 10px; min-width: 0; }
.tl-side.tl-cn { border-right: 1px solid var(--border); }
.tl-side-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}
.tl-item {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    text-align: left;
    border: none;
    background: transparent;
    padding: 4px 2px;
    cursor: pointer;
    border-radius: 6px;
    font: inherit;
}
.tl-item:hover { background: var(--tag-bg); }
.tl-item .tl-title {
    font-size: 12px; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-item .tl-meta { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* 统计：左右双栏 + 横向柱 */
.stats-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}
.stats-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.stats-col-head { font-size: 14px; font-weight: 700; }
.stats-book-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.stats-book-picks .top-tag.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.stats-book-picks .top-tag.active b { color: rgba(255,255,255,.75); }

.hbar-groups { display: flex; flex-direction: column; gap: 18px; width: 100%; }
.hbar-sec h3 {
    margin: 0 0 8px; font-size: 13px; font-weight: 700;
}
.hbar-sec h3 b { color: var(--primary); margin-left: 6px; }
.hbar-sec h3.clickable:hover { color: var(--primary); }
.hbar-row {
    display: grid;
    grid-template-columns: minmax(120px, 220px) 1fr 72px;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}
.hbar-label {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hbar-row:hover .hbar-label { color: var(--primary); }
.hbar-track {
    height: 18px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.hbar-fill {
    height: 100%;
    display: flex;
    min-width: 2px;
}
.hbar-a { background: var(--class-a, #e05252); height: 100%; }
.hbar-b { background: var(--class-b, #7fa8e8); height: 100%; }
.hbar-num {
    font-size: 11px; font-weight: 600; text-align: right;
    color: var(--text-muted); font-variant-numeric: tabular-nums;
}

/* 概念页 */
.concept-tabs {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    margin-bottom: 4px;
}
.concept-sub-title {
    font-size: 11px; color: var(--text-muted); margin: 8px 0 4px;
}
.tl-list { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow: auto; }
.tl-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 8px;
    align-items: center;
    text-align: left;
    border: none;
    background: var(--bg);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}
.tl-item:hover { background: var(--tag-bg); }
.tl-year { font-weight: 700; color: var(--primary); font-size: 11px; }
.tl-title { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-meta { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.jp-chip {
    display: inline-flex; gap: 4px; align-items: center;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 9999px; padding: 2px 8px; font-size: 12px;
}

@media (max-width: 960px) {
    .stats-two-col { grid-template-columns: 1fr; }
    .hbar-row { grid-template-columns: 100px 1fr 60px; }
}

/* 统计：精简概览 + A/B 数字 */
.dash-block.flat {
    padding: 10px 12px;
    box-shadow: none;
}
.stats-col-head.sub {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}
.stat-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.stat-metrics b { color: var(--text); margin-left: 4px; font-variant-numeric: tabular-nums; }
.sm-item { display: inline-flex; align-items: center; gap: 4px; }
.ab-a { color: var(--class-a, #e05252); }
.ab-b { color: var(--class-b, #7fa8e8); }
.hbar-num .ab-a, .hbar-num .ab-b {
    font-size: 11px; margin-left: 4px; font-weight: 700;
}
.hbar-sec h3 .h3-ab { margin-left: 8px; font-weight: 600; font-size: 12px; }
.hbar-sec h3 .h3-ab b { margin-left: 6px; color: inherit; }

/* ============ 封面页签（iframe 全高） ============ */
.cover-tab {
    padding: 0 !important;
    height: calc(100vh - 56px);
    overflow: hidden;
}
.cover-tab.active { display: block; }
.cover-tab iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--bg);
}

/* 黑话滑块：与 A/B 滑块并列，略紧凑 */
.jargon-slider { flex: none; }
.filter-bar .jargon-slider .cs-opt { padding: 4px 10px; font-size: 12px; }




/* 统计：一行表头钉住 */
.stat-sticky {
    position: sticky;
    top: 56px;
    z-index: 12;
    background: var(--bg);
}
.stat-head-line {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    font-size: 13px; color: var(--text-muted);
    padding: 8px 0 6px;
    min-height: 36px;
    justify-content: flex-start; /* 表头内容居左，书名按钮点选时不漂移 */
}
.shl-name { font-size: 14px; color: var(--text); margin-right: 4px; }
.shl-item b { color: var(--text); margin-left: 3px; font-variant-numeric: tabular-nums; }
.shl-books {
    margin-left: 0 !important;
    margin-right: 4px;
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: flex-start; /* 书名选择固定在左侧 */
    flex: none;
}
.shl-books .top-tag { padding: 3px 10px; font-size: 12px; }
.shl-books .top-tag.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.shl-books .top-tag.active b { color: rgba(255,255,255,.8); }
.hbar-sec h3 { text-align: left; }
.hbar-sec h3 .h3-total { float: right; }
.hbar-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; min-width: 64px; }
.hbar-nums .hn-a { color: var(--class-a, #111); text-align: center; font-weight: 700; font-size: 11px; }
.hbar-nums .hn-b { color: var(--class-b, #7ec8a3); text-align: center; font-weight: 700; font-size: 11px; }
.hbar-nums-head .hn-a, .hbar-nums-head .hn-b { font-size: 10px; opacity: .9; }
[data-theme=dimension] .hbar-nums .hn-a { color: #111; }
[data-theme=dimension] .hbar-nums .hn-b { color: #0f3d22; }
.top-tag.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}
.top-tag.active b { color: rgba(255,255,255,.8) !important; }
.concept-l1-title { color: var(--text); }
.concept-layout { gap: 8px !important; }
.concept-sticky-head {
    position: sticky; top: 56px; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--bg);
    padding: 4px 0 2px;
    margin: 0;
    border-bottom: none;
}
.concept-sticky-mid {
    position: sticky; top: 86px; z-index: 15;
    background: var(--bg);
    padding: 2px 0 4px;
    margin: 0;
}
.concept-sticky-inner { gap: 2px; display: flex; flex-direction: column; }
.concept-tabs { margin: 0; padding: 0; gap: 6px; display: flex; flex-wrap: wrap; }
.concept-head.tight h2 { margin: 0; font-size: 15px; }
.concept-head.tight p { margin: 0; font-size: 11px; }
.concept-sec.tight { padding: 6px 10px; margin: 0; }
.concept-sec.tight h3 { margin: 0 0 6px; font-size: 13px; }
.concept-tags-body { gap: 8px; }
.concept-filter-right { gap: 6px; display: flex; align-items: center; }
.concept-filter-right .cs-opt { padding: 4px 10px; font-size: 12px; }
.concept-tag-grid { max-height: 88px; gap: 6px; }
.timeline-main { padding-top: 0; }

/* ========== 时间轴 v2：中西双泳道 + 事件页 ========== */
.tl2-toolbar {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    margin-bottom: 8px;
}
.tl2-board {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.tl2-board-head {
    display: grid;
    grid-template-columns: 1fr minmax(110px, 148px) 1fr;
    gap: 8px;
    padding: 8px 10px 6px;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
}
.tl2-board-head .cn { color: var(--class-a, #c45c26); text-align: right; }
.tl2-board-head .mid { text-align: center; color: var(--text); }
.tl2-board-head .world { color: var(--primary, #3b6cf0); }
.tl2-board-body { padding: 4px 6px 8px; }
.tl2-line { border-bottom: 1px dashed var(--border); }
.tl2-line:last-child { border-bottom: none; }
.tl2-line.open {
    border: 1px solid var(--primary);
    border-radius: 10px;
    margin: 4px 0;
    background: rgba(79, 109, 245, 0.04);
}
.tl2-row {
    display: grid;
    grid-template-columns: 1fr minmax(110px, 148px) 1fr;
    gap: 8px;
    align-items: start; /* 泳道与时期名贴顶 */
    padding: 5px 4px;
    cursor: pointer;
}
.tl2-lane {
    position: relative;
    height: 26px;
    background: var(--bg);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
    align-self: start; /* 贴上端对齐 */
}
.tl2-lane .bar {
    position: absolute; top: 0; bottom: 0;
    display: flex; align-items: center;
    padding: 0 6px; font-size: 10.5px; font-weight: 700; color: #fff;
    min-width: 2px; z-index: 1;
}
.tl2-lane.cn .bar { right: 0; background: #c45c26; justify-content: flex-start; }
.tl2-lane.world .bar { left: 0; background: var(--primary, #3b6cf0); justify-content: flex-end; }
.tl2-lane .stack { position: absolute; top: 0; bottom: 0; display: flex; z-index: 0; opacity: 0.4; }
.tl2-lane .stack i { display: block; height: 100%; min-width: 0; }
.tl2-mid {
    border: none; background: transparent; border-radius: 8px;
    padding: 4px 6px; display: flex; flex-direction: column; align-items: center;
    cursor: pointer; min-width: 0; align-self: start;
}
.tl2-line.open .tl2-mid { background: var(--surface); box-shadow: inset 0 0 0 1px var(--primary); }
.tl2-mid:hover { background: rgba(79, 109, 245, 0.1); }
.tl2-mid .caret { font-size: 10px; color: var(--primary); line-height: 1; }
.tl2-mid .name {
    font-size: 12.5px; font-weight: 700; color: var(--primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.tl2-mid .sub { font-size: 10px; color: var(--text-muted); }

/* 紧贴时代轴：泳道+五类同一网格 */
.tl2-axis-tight {
    display: grid;
    grid-template-columns: 1fr minmax(100px, 140px) 1fr;
    grid-template-rows: 28px auto;
    gap: 2px 8px;
    align-items: center;
    padding: 4px 4px 0;
    cursor: pointer;
}
.tl2-axis-tight .tl2-mid {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: stretch;
    min-height: 48px;
}
.tl2-axis-tight .tl2-lane { height: 26px; align-self: center; }
.tl2-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
    align-items: center;
}
.tl2-cats.side-cn { grid-column: 1; grid-row: 2; justify-content: flex-end; }
.tl2-cats.side-world { grid-column: 3; grid-row: 2; justify-content: flex-start; }
.tl2-cats-gap { grid-column: 2; grid-row: 2; min-height: 1px; }
.tl2-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    min-width: 0;
    margin-top: 4px;
    padding: 0 4px 6px;
}
.tl2-rail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0;
    min-width: 0;
    height: calc(12 * 32px + 8px);
    display: flex; flex-direction: column;
}
.tl2-rail.cn-rail { box-shadow: inset 3px 0 0 #c45c26; }
.tl2-rail.world-rail { box-shadow: inset -3px 0 0 var(--primary); }
.tl2-tab {
    border: 1px solid var(--border); background: var(--surface);
    border-radius: 9999px; padding: 2px 8px; font-size: 11px; cursor: pointer;
}
.tl2-tab b { margin-left: 3px; font-weight: 700; }
.tl2-tab.active { color: #fff !important; }
.tl2-list {
    flex: 1; min-height: 0; overflow: auto;
    overscroll-behavior: contain;
    display: flex; flex-direction: column; gap: 3px;
    padding: 6px;
}
.tl2-singles-head { margin: 4px 0 2px; }
.tl2-item .m { color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ev-hl {
    color: var(--primary);
    font-weight: 700;
}
.tl2-item.event .ev-hl { color: var(--primary); }

/* 事件弹层 */
.tl-event-title-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; }
.tl-event-head-wrap { min-width: 0; flex: 1; }
.tl-event-note { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tl2-hot-tags {
    display: flex; flex-wrap: nowrap; overflow: hidden; gap: 4px;
    margin-bottom: 8px; padding: 2px 0;
}
.tl2-ev-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tl2-ev-list {
    display: flex; flex-direction: column; gap: 4px;
    padding-bottom: 24px;
}
.tl2-ev-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden; flex: none;
}
.tl2-ev-item.open { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,109,245,.12); }
.tl2-ev-row {
    width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 7px 10px; border: none; background: var(--bg);
    text-align: left; cursor: pointer; font: inherit; font-size: 12.5px;
}
.tl2-ev-item.open .tl2-ev-row { background: rgba(79,109,245,.08); }
.tl2-ev-row:hover { background: rgba(79,109,245,.1); }
.tl2-ev-row .caret { width: 12px; color: var(--primary); font-size: 10px; }
.tl2-ev-row .book { font-weight: 700; }
.tl2-ev-row .chap { color: var(--text-muted); font-size: 12px; }
.tl2-ev-row .chip-cat {
    border: 1px solid; border-radius: 9999px; padding: 1px 6px; font-size: 11px;
    background: var(--surface);
}
.tl2-ev-row .chip-kt {
    background: var(--tag-bg, var(--bg)); border-radius: 9999px;
    padding: 1px 6px; font-size: 11px; color: var(--text-muted);
}
.tl2-ev-row .tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tl2-ev-row .tag {
    font-size: 10.5px; color: var(--text-muted);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 9999px; padding: 1px 6px;
}

/* 单条私货展开三栏：限高 320 */
.tl2-item-panel {
    display: grid;
    grid-template-columns: 1.25fr 0.72fr 1.15fr;
    border-top: 1px solid var(--border);
    height: 320px;
    max-height: 320px;
    overflow: hidden;
}
.eip {
    min-width: 0; min-height: 0; display: flex; flex-direction: column;
    border-right: 1px solid var(--border); background: var(--surface);
    overflow: hidden;
}
.eip:last-child { border-right: none; }
.eip h5 {
    margin: 0; padding: 6px 8px; font-size: 11.5px; font-weight: 700;
    border-bottom: 1px solid var(--border); flex: none; background: var(--bg);
}
.eip-original h5 { color: var(--primary); }
.eip-jargon h5 { color: var(--class-a, #e05252); }
.eip-logic h5 { color: #2f9e6b; }
.eip-body {
    flex: 1; min-height: 0; overflow: auto !important;
    overscroll-behavior: contain;
    padding: 8px;
    font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
    -webkit-overflow-scrolling: touch;
}
.eip-jargon .eip-body { font-size: 12px; white-space: normal; }
.eip-logic .eip-body { white-space: normal; }
.jargon-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.jargon-table td { padding: 6px 4px; vertical-align: top; border-bottom: 1px solid var(--border); }
.jargon-table td.arrow { width: 18px; color: var(--text-muted); text-align: center; }
.jargon-table .jn { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

#modal-timeline-event .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden;
    display: block;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* 折叠行间距收紧 */
.tl2-row { padding: 4px 4px 2px; align-items: center; }
.tl2-line.open {
    border: 1px solid var(--primary);
    border-radius: 10px;
    margin: 3px 0;
    background: rgba(79, 109, 245, 0.04);
}

/* 事件弹层：整表可滚 */
#modal-timeline-event .modal-xlarge,
#modal-timeline-event .modal-content.modal-xlarge {
    overflow: hidden;
}
#modal-timeline-event .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden;
    display: block;
    min-height: 0;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
#tl-event-body {
    overflow: visible;
}
.tl2-ev-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tl2-ev-list {
    display: flex; flex-direction: column; gap: 4px;
    padding-bottom: 24px; /* 底部留白便于滚完 */
}
.tl2-ev-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden; flex: none;
}
.tl2-ev-item.open { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,109,245,.12); }
.tl2-ev-row {
    width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 7px 10px; border: none; background: var(--bg);
    text-align: left; cursor: pointer; font: inherit; font-size: 12.5px;
}
.tl2-ev-item.open .tl2-ev-row { background: rgba(79,109,245,.08); }
.tl2-ev-row:hover { background: rgba(79,109,245,.1); }
.tl2-ev-row .caret { width: 12px; color: var(--primary); font-size: 10px; }
.tl2-ev-row .badge-cls {
    background: var(--class-a, #e05252); color: #fff;
    border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700;
}
.tl2-ev-row .book { font-weight: 700; }
.tl2-ev-row .chap { color: var(--text-muted); font-size: 12px; }
.tl2-ev-row .chip-cat {
    border: 1px solid; border-radius: 9999px; padding: 1px 6px; font-size: 11px;
    background: var(--surface);
}
.tl2-ev-row .chip-kt {
    background: var(--tag-bg, var(--bg)); border-radius: 9999px;
    padding: 1px 6px; font-size: 11px; color: var(--text-muted);
}
.tl2-ev-row .tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tl2-ev-row .tag {
    font-size: 10.5px; color: var(--text-muted);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 9999px; padding: 1px 6px;
}
.tl2-ev-row .kid { margin-left: auto; color: var(--text-muted); font-size: 11px; }

/* 单条私货展开三栏：限高约12行，栏内各自滚动 */
.tl2-item-panel {
    display: grid;
    grid-template-columns: 1.25fr 0.72fr 1.15fr;
    border-top: 1px solid var(--border);
    height: calc(12 * 30px); /* ~12行 */
    max-height: 400px;
    min-height: 240px;
    overflow: hidden;
}
.eip {
    min-width: 0; min-height: 0; display: flex; flex-direction: column;
    border-right: 1px solid var(--border); background: var(--surface);
    overflow: hidden;
}
.eip:last-child { border-right: none; }
.eip h5 {
    margin: 0; padding: 6px 8px; font-size: 11.5px; font-weight: 700;
    border-bottom: 1px solid var(--border); flex: none; background: var(--bg);
}
.eip-original h5 { color: var(--primary); }
.eip-jargon h5 { color: var(--class-a, #e05252); }
.eip-logic h5 { color: #2f9e6b; }
.eip-body {
    flex: 1; min-height: 0; overflow: auto !important;
    overscroll-behavior: contain;
    padding: 8px;
    font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
    -webkit-overflow-scrolling: touch;
}
.eip-jargon .eip-body { font-size: 12px; white-space: normal; }
.eip-logic .eip-body { white-space: normal; }
.jargon-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.jargon-table td { padding: 6px 4px; vertical-align: top; border-bottom: 1px solid var(--border); }
.jargon-table td.arrow { width: 18px; color: var(--text-muted); text-align: center; }
.jargon-table .jn { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.tl2-item {
    width: 100%; border: none; background: var(--bg);
    border-radius: 8px; padding: 6px 8px; cursor: pointer;
    display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px;
    text-align: left; font: inherit; font-size: 12px;
}
.tl2-item:hover { background: rgba(79, 109, 245, 0.08); }
.tl2-item.event { background: #f7f9ff; }
.tl2-item .t { display: flex; align-items: center; min-width: 0; gap: 6px; }
.tl2-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tl2-item .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl2-item .aln { color: var(--text-muted); font-weight: 400; font-size: 11px; }
.tl2-item .m { color: var(--text-muted); font-size: 10.5px; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.tl2-empty { color: var(--text-muted); font-size: 12px; padding: 8px 0; }

/* 事件页 */
.tl-event-head-wrap { min-width: 0; flex: 1; }
.tl-event-note { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tl2-ev-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tl2-ev-list { display: flex; flex-direction: column; gap: 4px; }
.tl2-ev-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
}
.tl2-ev-item.open { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,109,245,.12); }
.tl2-ev-row {
    width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 7px 10px; border: none; background: var(--bg);
    text-align: left; cursor: pointer; font: inherit; font-size: 12.5px;
}
.tl2-ev-item.open .tl2-ev-row { background: rgba(79,109,245,.08); }
.tl2-ev-row:hover { background: rgba(79,109,245,.1); }
.tl2-ev-row .caret { width: 12px; color: var(--primary); font-size: 10px; }
.tl2-ev-row .badge-cls {
    background: var(--class-a, #e05252); color: #fff;
    border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700;
}
.tl2-ev-row .book { font-weight: 700; }
.tl2-ev-row .chap { color: var(--text-muted); font-size: 12px; }
.tl2-ev-row .chip-cat {
    border: 1px solid; border-radius: 9999px; padding: 1px 6px; font-size: 11px;
    background: var(--surface);
}
.tl2-ev-row .chip-kt {
    background: var(--tag-bg, var(--bg)); border-radius: 9999px;
    padding: 1px 6px; font-size: 11px; color: var(--text-muted);
}
.tl2-ev-row .tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tl2-ev-row .tag {
    font-size: 10.5px; color: var(--text-muted);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 9999px; padding: 1px 6px;
}
.tl2-ev-row .kid { margin-left: auto; color: var(--text-muted); font-size: 11px; }
.tl2-item-panel {
    display: grid;
    grid-template-columns: 1.25fr 0.72fr 1.15fr;
    border-top: 1px solid var(--border);
    min-height: 220px; max-height: 420px;
}
@media (max-width: 900px) {
    .tl2-item-panel { grid-template-columns: 1fr; height: auto; max-height: none; }
    .eip { min-height: 140px; border-right: none; border-bottom: 1px solid var(--border); }
    .tl2-row, .tl2-board-head, .tl2-lists, .tl2-cats-row { grid-template-columns: 1fr; }
    .tl2-cats.side-cn { justify-content: flex-start; }
}
.eip {
    min-width: 0; min-height: 0; display: flex; flex-direction: column;
    border-right: 1px solid var(--border); background: var(--surface);
}
.eip:last-child { border-right: none; }
.eip h5 {
    margin: 0; padding: 6px 8px; font-size: 11.5px; font-weight: 700;
    border-bottom: 1px solid var(--border); flex: none; background: var(--bg);
}
.eip-original h5 { color: var(--primary); }
.eip-jargon h5 { color: var(--class-a, #e05252); }
.eip-logic h5 { color: #2f9e6b; }
.eip-body {
    flex: 1; min-height: 0; overflow: auto; padding: 8px;
    font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.eip-jargon .eip-body { font-size: 12px; white-space: normal; }
.eip-logic .eip-body { white-space: normal; }
.jargon-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.jargon-table td { padding: 6px 4px; vertical-align: top; border-bottom: 1px solid var(--border); }
.jargon-table td.arrow { width: 18px; color: var(--text-muted); text-align: center; }
.jargon-table .jn { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

.tl-axis-wrap {
    display: flex; flex-direction: column; align-items: stretch;
    gap: 0; max-width: 920px; margin: 0 auto; width: 100%;
}
.tl-arrow-top, .tl-arrow-bottom {
    text-align: center; font-size: 12px; font-weight: 700;
    color: var(--text-muted); padding: 4px 0; letter-spacing: .06em;
}
.tl-axis-body { display: flex; flex-direction: column; gap: 8px; }
.tl-period {
    background: var(--surface);
    border: 2px solid #4f6df5;
    border-radius: 12px;
    overflow: hidden;
}
[data-theme=dimension] .tl-period { border-color: #3ba6f1; }
[data-theme=seline] .tl-period { border-color: #3ba6f1; }
.tl-period-head {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(100px, 140px) 1fr auto 20px;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    border: none;
    background: rgba(79, 109, 245, 0.06);
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.tl-period-name { font-size: 14px; font-weight: 700; color: var(--primary); }
.tl-period-sum { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-muted); }
.tl-cat-sum b { color: var(--text); font-weight: 600; margin-right: 4px; }
.tl-period-cnt { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.tl-caret { color: var(--text-muted); text-align: center; }
.tl-period-body {
    display: none;
    border-top: 1px solid var(--border);
    padding: 8px 12px 10px;
}
.tl-period-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.tl-item {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    text-align: left;
    border: none;
    background: var(--bg);
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 8px;
    font: inherit;
}
.tl-item:hover { background: var(--tag-bg); }
.tl-item .tl-title {
    font-size: 12.5px; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-item .tl-snip { color: var(--text-muted); font-weight: 400; }
.tl-item .tl-meta { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }

/* ===== 裸组件页（时间轴/高频概念/黑话） ===== */
.concept-layout-bare { padding-top: 4px; }
.concept-filter-hidden { display: none !important; }

/* 高频概念：一级分类 sticky，不随列表被压掉 */
.concept-tabs-sticky,
#concept-tabs-host .concept-tabs {
    position: sticky;
    top: 56px;
    z-index: 22;
    background: var(--bg);
    padding: 6px 0 4px;
    margin: 0 0 4px;
}
.concept-sec-headrow {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.concept-sec-headrow .concept-l1-title { margin: 0; }
.concept-sec-headrow .concept-filter-right {
    margin-left: auto;
    display: flex;
    gap: 6px;
    align-items: center;
}
.tl2-board-head .mid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tl2-mode { display: inline-flex; gap: 4px; }
.tl2-mode .btn { padding: 2px 8px; font-size: 11px; }
.stat-head-line .shl-books { margin-left: 0 !important; margin-right: 10px; order: 0; justify-content: flex-start; }
.stat-head-line .shl-name { margin-left: 0; }
.stats-col .stat-head-line { justify-content: flex-start; text-align: left; }
.stats-col .hbar-sec h3 { text-align: left; }

/* 事件展开限高强制 */
.tl2-item-panel,
#modal-timeline-event .tl2-item-panel {
    height: 320px !important;
    max-height: 320px !important;
    overflow: hidden !important;
}
.tl2-item-panel .eip,
.tl2-item-panel .eip-body {
    overflow: auto !important;
    min-height: 0 !important;
}
.tl2-hot-tags {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 4px;
    margin-bottom: 6px;
}
.tl2-axis-tight {
    display: grid;
    grid-template-columns: 1fr minmax(100px, 140px) 1fr;
    grid-template-rows: 28px auto;
    gap: 2px 8px;
    align-items: center;
    padding: 4px 4px 0;
    cursor: pointer;
}
.tl2-axis-tight .tl2-mid {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: stretch;
    min-height: 48px;
}
.tl2-axis-tight .tl2-lane { height: 26px; align-self: center; }
.tl2-cats.side-cn { grid-column: 1; grid-row: 2; justify-content: flex-end; }
.tl2-cats.side-world { grid-column: 3; grid-row: 2; justify-content: flex-start; }
.tl2-cats-gap { grid-column: 2; grid-row: 2; }
.tl2-lists { margin-top: 4px; padding: 0 4px 6px; }
.tl2-rail { height: calc(12 * 32px + 8px); }
.tl2-rail-cap { display: none !important; }
.ev-hl { color: var(--primary); font-weight: 700; }
.tl-event-title-line { display: flex; flex-wrap: wrap; align-items: baseline; }
.tl2-hot-tags {
    display: flex; flex-wrap: nowrap; overflow: hidden; gap: 4px; margin-bottom: 8px;
}
.tl2-ev-row .badge-cls, .tl2-ev-row .kid { display: none !important; }
.tl2-ev-list { padding-bottom: 24px; }
#modal-timeline-event .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden;
    display: block;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.tl2-item-panel,
#modal-timeline-event .tl2-item-panel {
    display: grid !important;
    grid-template-columns: 1.25fr 0.72fr 1.15fr !important;
    height: 320px !important;
    max-height: 320px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-top: 1px solid var(--border);
}
.tl2-item-panel .eip {
    overflow: hidden !important;
}
.tl2-item-panel .eip-body {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
@media (max-width: 900px) {
    .tl2-item-panel, #modal-timeline-event .tl2-item-panel {
        grid-template-columns: 1fr !important;
        height: auto !important;
        max-height: none !important;
    }
    .tl2-axis-tight, .tl2-row, .tl2-board-head, .tl2-lists { grid-template-columns: 1fr !important; }
    .tl2-cats.side-cn { justify-content: flex-start; grid-column: 1; grid-row: auto; }
}
