/*
 * ========== Z-Index 层级规范 ==========
 * 1000 - 1999 : 底层弹窗 (传导推演、手动选择面板)
 * 2000 - 2999 : 浮层 (逻辑浮窗)
 * 3000 - 3999 : 中层弹窗 (核心催化弹窗)
 * 4000 - 4999 : 高层弹窗 (笔记弹窗)
 * 9999        : 全局通知 (Toast)
 * 遮罩层跟随弹窗层级
 */

/* ========== ChainTrade Dashboard 全局样式表 V3.4.1 ========== */
/* 包含：基础重置、布局、表格、弹窗、标签、右侧栏等 */
/* 文件：css/styles.css */
/* 最后更新：颜色变量化，为浅色主题做准备 */

/* ── 全局色彩变量 ── */
:root {
    /* 背景层级 */
    --bg-body: #0a0c10;
    --bg-panel: #0a0c10;
    --bg-card: #181b22;
    --bg-elevated: #1e2129;
    --bg-table-header: rgba(20, 24, 33, 0.95);
    --bg-sidebar-card: rgba(31, 41, 55, 0.5);
    --bg-tab-active: #141821;
    --bg-tab-hover: #1f2937;
    --bg-header: #141821;
    --bg-footer: rgba(15, 20, 25, 0.85);
    --bg-scrollbar: #374151;
    --bg-code: #1f2937;
    --bg-input: #1f2937;
    --bg-btn: #1e293b;
    --bg-btn-hover: #334155;
    --bg-tag: rgba(107, 114, 128, 0.1);
    --bg-modal-overlay: rgba(0, 0, 0, 0.6);
    --bg-transmission-overlay: rgba(0, 0, 0, 0.12);
    
    /* 边框 */
    --border-subtle: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.1);
    --border-table-row: rgba(31, 41, 55, 0.6);
    --border-standard: #1f2937;
    --border-section: #1f2937;
    --border-input: #374151;
    --border-btn: #334155;
    
    /* 文字三层 */
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-tertiary: #5f6368;
    --text-muted: #3c4043;
    --text-footer: #6b7280;
    --text-footer-note: #6b7280;
    --text-input-placeholder: var(--text-tertiary);
    
    /* 语义色彩 */
    --color-up: #ff3b30;
    --color-down: #00c853;
    --color-accent: #3b82f6;
    --color-warn: #f59e0b;
    --color-gold: #f59e0b;
    --color-purple: #8b5cf6;
    
    /* 标签色彩 */
    --tag-lhb-bg: rgba(139, 92, 246, 0.12);
    --tag-lhb-color: #8b5cf6;
    --tag-lhb-border: rgba(139, 92, 246, 0.25);
    --tag-lhb-active-bg: rgba(245, 158, 11, 0.25);
    --tag-lhb-active-color: #fbbf24;
    --tag-lhb-active-border: rgba(245, 158, 11, 0.45);
    
    --tag-guba-bg: rgba(59, 130, 246, 0.12);
    --tag-guba-color: #3b82f6;
    --tag-guba-border: rgba(59, 130, 246, 0.25);
    
    --tag-ds-bg: rgba(16, 185, 129, 0.12);
    --tag-ds-color: #10b981;
    --tag-ds-border: rgba(16, 185, 129, 0.25);
    
    --tag-core-bg: rgba(59, 130, 246, 0.15);
    --tag-core-color: #60a5fa;
    --tag-core-border: rgba(59, 130, 246, 0.3);
    
    /* 弹窗专用 */
    --accent-blue: #5b8bd4;
    --accent-blue-soft: rgba(91,139,212,0.12);
    --accent-blue-border: rgba(91,139,212,0.2);
    --accent-green: #5b9a6d;
    --accent-amber: #c9a227;
    --accent-amber-soft: rgba(201,162,39,0.12);
    --accent-red: #c45c5c;

    /* 分隔条 */
    --resizer-bg: #374151;
    --resizer-hover: #3b82f6;
    --resizer-active-bg: rgba(59, 130, 246, 0.12);

    /* 滚动条 */
    --scrollbar-thumb: #374151;

    /* 通用阴影 */
    --shadow-modal: 0 20px 40px rgba(0,0,0,0.6);
    --shadow-popup: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-core: 0 4px 24px rgba(0,0,0,0.4);

    /* 全站导航栏高度（单一权威值） */
    --nav-height: 40px;
}

/* ── 全局重置 ── */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    overflow: auto;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── 布局骨架 ── */
.resizable-container {
    display: flex;
    min-height: calc(100vh - 32px);
    width: 100%;
}

.panel-left {
    width: 15%;
    min-width: 185px;
    max-width: 30%;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-standard);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.panel-right {
    flex: 1;
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ── 分隔条（V3.0.0 优化，避免粗蓝块） ── */
.resizer {
    width: 6px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    z-index: 100;
    transition: background 0.2s;
}

/* 默认细线 */
.resizer::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: var(--resizer-bg);
    border-radius: 1px;
}

/* 悬停时细线变蓝 */
.resizer:hover::after {
    background: var(--resizer-hover);
}

/* 拖拽激活状态：淡蓝背景 + 蓝色细线 */
.resizer.resizing {
    background: var(--resizer-active-bg);
}

.resizer.resizing::after {
    background: var(--resizer-hover);
}

/* 拖拽提示文字 */
.resize-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-accent);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1000;
}
.resizer.resizing .resize-hint {
    opacity: 1;
}

/* ── 滚动条（通用） ── */
.scrollbar-thin::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 2px;
}
/* Firefox 滚动条 */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* ── 表格行状态 ── */
.stock-row:hover {
    background: rgba(59, 130, 246, 0.05);
}
.stock-row.chain-highlight {
    background: rgba(245, 158, 11, 0.12) !important;
    border-left: 3px solid var(--color-warn) !important;
}
.stock-row.catalyst-highlight {
    background: rgba(139, 92, 246, 0.12) !important;
    border-left: 3px solid var(--color-purple) !important;
}
.stock-row.dimmed {
    opacity: 0.25;
}

.chain-row:hover {
    background: rgba(59, 130, 246, 0.08);
}
.chain-row.active {
    background: rgba(59, 130, 246, 0.18) !important;
    border-left: 2px solid var(--color-accent) !important;
}

.catalyst-row:hover {
    background: rgba(139, 92, 246, 0.06);
}
.catalyst-row.active {
    background: rgba(139, 92, 246, 0.12) !important;
    border-left: 2px solid var(--color-purple) !important;
}

/* ── 区域标题 ── */
.section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    background: linear-gradient(90deg, rgba(31,41,55,0.9) 0%, rgba(20,24,33,0.5) 100%);
    border-bottom: 1px solid var(--border-standard);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── 表格 ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    table-layout: fixed;
}
.data-table th {
    background: var(--bg-table-header);
    color: var(--text-tertiary);
    font-weight: 500;
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-standard);
    white-space: nowrap;
    position: relative;
}
.data-table th.sortable {
    cursor: pointer;
}
.data-table th.sortable:hover {
    color: var(--text-primary);
}
.data-table td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--border-table-row);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.font-thin {
    font-weight: 250 !important;
}

/* ── 列拖拽调整器 ── */
.col-resizer {
    position: absolute;
    right: -3px;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    background: transparent;
    z-index: 9999;
    transition: background 0.2s;
}
.col-resizer:hover,
.col-resizer.resizing {
    background: var(--color-accent);
}

/* ── 标签系统 ── */
.tag-emotion {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.tag-logic {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-accent);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.tag-normal {
    background: rgba(107, 114, 128, 0.12);
    color: var(--text-secondary);
    border: 1px solid rgba(107, 114, 128, 0.25);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.tag-category-policy {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
}
.tag-category-tech {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-accent);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
}
.tag-category-product {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warn);
    border: 1px solid rgba(245, 158, 11, 0.25);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
}
.tag-category-risk {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.25);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
}

.tag-lhb {
    background: var(--tag-lhb-bg);
    color: var(--tag-lhb-color);
    border: 1px solid var(--tag-lhb-border);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
    margin-right: 4px;
}
.tag-lhb:hover {
    background: rgba(139, 92, 246, 0.2);
}
.tag-lhb.lhb-active {
    background: var(--tag-lhb-active-bg);
    color: var(--tag-lhb-active-color);
    border-color: var(--tag-lhb-active-border);
}
.tag-lhb.lhb-active:hover {
    background: rgba(245, 158, 11, 0.35);
}

.tag-guba {
    background: var(--tag-guba-bg);
    color: var(--tag-guba-color);
    border: 1px solid var(--tag-guba-border);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
    margin-right: 4px;
}
.tag-guba:hover {
    background: rgba(59, 130, 246, 0.2);
}
.tag-ds {
    background: var(--tag-ds-bg);
    color: var(--tag-ds-color);
    border: 1px solid var(--tag-ds-border);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
    margin-right: 4px;
}
.tag-ds:hover {
    background: rgba(16, 185, 129, 0.2);
}
.tag-core {
    background: var(--tag-core-bg);
    color: var(--tag-core-color);
    border: 1px solid var(--tag-core-border);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
    margin-right: 4px;
}
.tag-core:hover {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}
.tag-core-ready {
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
}
.tag-core-empty {
    opacity: 0.55;
    border-style: dashed;
}
.tag-core-locked {
    opacity: 0.65;
    color: var(--text-tertiary, #5f6368);
    border-color: rgba(95, 99, 104, 0.3);
    background: rgba(95, 99, 104, 0.12);
    cursor: pointer;
}
.tag-core-locked:hover {
    opacity: 0.85;
    color: var(--text-secondary, #9aa0a6);
    background: rgba(95, 99, 104, 0.18);
}
.pro-gate-lock {
    display: inline-block;
    font-size: 10px;
    color: var(--text-tertiary, #5f6368);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.tag-note {
    display: inline-block;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 0 1px;
    margin-right: 2px;
    color: #4b5563;
    transition: color 0.15s;
    vertical-align: middle;
    text-decoration: none;
    background: none;
    border: none;
}
.tag-note:hover {
    color: var(--text-secondary);
}

.tag-sector-chart {
    display: inline-block;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 0 2px;
    margin-right: 3px;
    color: #4b5563;
    transition: color 0.15s;
    vertical-align: middle;
    user-select: none;
}
.tag-sector-chart:hover {
    color: var(--color-accent, #3b82f6);
}

/* 代码列前自选标记（与笔记 + 风格统一） */
.wl-inline-toggle {
    display: inline-block;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #4b5563;
    transition: color 0.15s;
    vertical-align: middle;
}
.wl-inline-toggle:hover {
    color: var(--text-secondary);
}
.tag-note.has-note {
    color: var(--color-warn);
    font-size: 10px;
}
.tag-note.has-note:hover {
    color: #fbbf24;
}

/* 通用标签（额外补充） */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}
.tag-success {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}
.tag-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.tag-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.tag-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.star-filled {
    color: var(--color-warn);
}
.star-empty {
    color: #374151;
}

/* ── Markdown 内容样式 ── */
.markdown-content {
    color: var(--text-secondary);
    line-height: 1.6;
}
.markdown-content h1, .markdown-content h2, .markdown-content h3,
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
    color: var(--text-primary);
    margin: 12px 0 8px;
    font-weight: 600;
}
.markdown-content h1 { font-size: 14px; }
.markdown-content h2 { font-size: 13px; }
.markdown-content h3 { font-size: 12px; }
.markdown-content h4 { font-size: 11px; }
.markdown-content h5 { font-size: 10px; }
.markdown-content h6 { font-size: 9px; }
.markdown-content p { margin: 6px 0; }
.markdown-content ul, .markdown-content ol { margin: 6px 0; padding-left: 20px; }
.markdown-content li { margin: 3px 0; }
.markdown-content strong { color: #d1d5db; }
.markdown-content code {
    background: var(--bg-code);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}
.markdown-content pre {
    background: var(--bg-code);
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
}
.markdown-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: 10px;
    margin: 8px 0;
    color: var(--text-secondary);
}
.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 10px;
}
.markdown-content th, .markdown-content td {
    border: 1px solid #374151;
    padding: 4px 6px;
    text-align: left;
}
.markdown-content th {
    background: var(--bg-code);
}

/* ===== 弹窗通用入场动画 ===== */
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 通用关闭按钮 ===== */
.close-btn, .core-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}
.close-btn:hover, .core-close-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.close-btn svg, .core-close-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== 通用遮罩层 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: inherit;
}

/* ===== V2.8.0 传导推演弹窗 ===== */
#transmission-overlay {
    z-index: 1000;
    background: var(--bg-transmission-overlay) !important;
}
.transmission-card {
    position: relative;
    z-index: auto;
    width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-modal);
    font-size: 12px;
    animation: modalFadeIn 0.25s ease-out;
}

.card-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e293b 0%, #141821 100%);
    border-bottom: 1px solid var(--border-subtle);
}
.card-header .icon { font-size: 16px; margin-right: 8px; }
.card-header .title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    padding-left: 10px;
    border-left: 2px solid var(--color-accent);
}
.confidence-badge {
    background: var(--color-accent);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    margin-right: 8px;
}
.card-body { padding: 14px 18px; }
.phase { margin-bottom: 18px; }
.phase-title { font-weight: 600; margin-bottom: 10px; font-size: 12px; }
.phase.immediate .phase-title { color: #fbbf24; }
.phase.t1 .phase-title { color: #60a5fa; }
.phase.t3 .phase-title { color: #34d399; }
.phase ul { list-style: none; padding-left: 0; margin: 0; }
.phase li {
    display: flex;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px dashed #2a3441;
    cursor: pointer;
}
.phase li:hover { background: rgba(59,130,246,0.1); }
.expand-icon {
    display: inline-block;
    width: 16px;
    font-size: 10px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: transform 0.2s;
    margin-right: 4px;
}
.expand-icon.expanded { transform: rotate(90deg); }
.expand-placeholder { display: inline-block; width: 16px; margin-right: 4px; }
.sector-name { font-weight: 500; color: var(--text-primary); margin-right: 6px; }
.reason { color: var(--text-secondary); font-size: 11px; line-height: 1.7; }
.sub-sector-list { list-style: none; padding-left: 24px; margin: 4px 0; border-left: 1px dashed #334155; }
.sub-sector-list li { padding: 4px 0 4px 12px; border-bottom: none; }
.sub-sector-name { color: var(--text-secondary); font-size: 11px; line-height: 1.7; }
.sub-sector-name:hover { color: var(--text-primary); }
.card-footer {
    padding: 12px 18px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 8px;
}
.card-footer button {
    flex: 1;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    color: #cbd5e1;
    padding: 6px 0;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}
.card-footer button:hover { background: var(--bg-btn-hover); color: white; }

/* 手动选择面板 */
.manual-select-panel {
    position: absolute;
    z-index: 1100;
    width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--color-accent);
    border-radius: 8px;
}
.panel-header {
    padding: 10px 14px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}
.panel-body {
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}
.candidate-item {
    padding: 6px 10px;
    margin: 4px 0;
    background: #1a202c;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-secondary);
}
.candidate-item.selected { background: var(--color-accent); color: white; }
.panel-footer {
    padding: 10px 14px;
    border-top: 1px solid #334155;
    display: flex;
    gap: 8px;
}
.panel-footer button {
    flex: 1;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    color: #cbd5e1;
    padding: 6px 0;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}
.panel-footer button:hover { background: #2563eb; color: white; }

.hidden { display: none !important; }

/* ===== V2.8.0 逻辑弹窗 ===== */
.logic-popup {
    position: fixed;
    z-index: 2000;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: var(--shadow-popup);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 100ms ease, transform 100ms ease;
    pointer-events: none;
}
.logic-popup.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.logic-popup.hide { opacity: 0; transform: translateY(4px); transition: opacity 75ms ease, transform 75ms ease; }
.logic-popup-arrow {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--bg-card);
}
.logic-popup-arrow.bottom {
    top: auto;
    bottom: -6px;
    border-bottom: none;
    border-top: 6px solid var(--bg-card);
}
.logic-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-tab-active);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 8px 8px 0 0;
}
.logic-popup-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    padding-left: 8px;
    border-left: 2px solid var(--color-accent);
}
.logic-popup-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
}
.logic-popup-close:hover { background: #2a3441; color: var(--text-primary); }
.logic-popup-content {
    padding: 12px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
}
.logic-popup-content::-webkit-scrollbar { width: 4px; }
.logic-popup-content::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 2px; }
.logic-popup-footer {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
    border-radius: 0 0 8px 8px;
}
.logic-popup-copy {
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.15s;
}
.logic-popup-copy:hover { color: var(--text-secondary); }

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.toast.show { opacity: 1; }

/* Toast 增强样式 */
.toast-success {
    background-color: var(--toast-success-bg, #2c6e2c);
}
.toast-error {
    background-color: var(--toast-error-bg, #c24141);
}
.toast.fade-out {
    opacity: 0;
}

/* 逻辑单元格 */
.logic-cell { cursor: pointer; color: var(--text-secondary); transition: color 0.15s; }
.logic-cell:hover { color: var(--color-accent); }

.sort-arrow { font-size: 10px; margin-left: 2px; color: var(--color-accent); }
.stock-link { color: inherit; text-decoration: none; }
.stock-link:hover { color: var(--color-accent) !important; text-decoration: underline; }

.popularity-row { color: var(--text-secondary); }
.popularity-row a { color: var(--text-secondary); }
.popularity-row a:hover { color: var(--color-accent) !important; }
.chain-text-gray { color: var(--text-secondary); }
.catalyst-text-gray { color: var(--text-secondary); }

/* ===== V2.8.0 笔记弹窗 ===== */
#note-overlay { z-index: 4000; }
.note-modal {
    position: relative;
    z-index: auto;
    width: 520px;
    max-height: 80vh;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.25s ease-out;
}
.note-modal-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e293b 0%, #141821 100%);
    border-bottom: 1px solid var(--border-subtle);
}
.note-modal-header .icon { font-size: 16px; margin-right: 8px; }
.note-modal-header .title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    padding-left: 10px;
    border-left: 2px solid var(--color-accent);
}
.note-modal-body { padding: 16px 18px; overflow-y: auto; max-height: 50vh; }
.note-modal-body .markdown-content { line-height: 1.8; }
.note-modal-footer {
    padding: 12px 18px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.note-modal-footer button {
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}
.note-modal-footer button:hover { background: var(--bg-btn-hover); color: white; }
.note-modal textarea {
    width: 100%;
    min-height: 150px;
    background: #1a1d26;
    color: var(--text-primary);
    border: 1px solid var(--border-input);
    border-radius: 6px;
    padding: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    resize: vertical;
    outline: none;
}
.note-modal textarea:focus { border-color: var(--color-accent); }

/* ===== 核心催化弹窗 ===== */
#core-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4500;
}
.core-modal-card {
    position: relative;
    z-index: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-core);
    animation: modalFadeIn 0.25s ease-out;
}
.core-modal-card::-webkit-scrollbar { width: 6px; }
.core-modal-card::-webkit-scrollbar-track { background: transparent; }
.core-modal-card::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
.core-modal-card::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

.core-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}
.core-header-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.core-stock-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
    font-weight: 500;
}
.core-stock-name { font-size: 18px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.3px; }
.core-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    background: var(--accent-amber-soft);
    color: var(--accent-amber);
    border: 1px solid rgba(201,162,39,0.2);
}
.core-positioning {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.5;
    padding-left: 14px;
    border-left: 3px solid var(--accent-blue);
    margin-bottom: 8px;
}
.core-positioning-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    padding-left: 17px;
    letter-spacing: 0.3px;
    line-height: 1.4;
}
.core-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
}
.core-close-btn svg { width: 16px; height: 16px; }

.core-section { padding: 18px 24px; border-bottom: 1px solid var(--border-subtle); }
.core-section:last-of-type { border-bottom: none; }
.core-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.core-section-accent { width: 3px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.core-accent-catalyst { background: var(--accent-red); }
.core-accent-business { background: var(--accent-blue); }
.core-accent-growth { background: var(--accent-green); }
.core-accent-risk { background: var(--accent-amber); }
.core-section-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.core-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.core-body-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.85;
    text-align: justify;
    word-break: break-word;
}
.core-body-text strong,
.core-highlight { color: var(--text-primary); font-weight: 500; }
.core-highlight-data {
    color: var(--accent-green);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.core-logic-list { list-style: none; padding: 0; margin: 0; }
.core-logic-list li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-secondary);
    text-align: justify;
}
.core-logic-list li:last-child { margin-bottom: 0; }
.core-logic-list li .core-num {
    position: absolute;
    left: 0;
    top: 1px;
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    width: 20px;
    text-align: center;
}
.core-logic-list li strong { color: var(--text-primary); font-weight: 600; }

.core-tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 24px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
}
.core-tag {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--accent-blue-border);
    background: var(--accent-blue-soft);
    color: var(--accent-blue);
    cursor: default;
    transition: all 0.2s;
    line-height: 1.4;
}
.core-tag:hover { background: rgba(91,139,212,0.2); transform: translateY(-1px); }

.core-footer {
    padding: 12px 24px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.core-source-text { font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.2px; }
.core-source-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}
.core-close-footer-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 18px;
    border-radius: 6px;
    border: 1px solid var(--border-hover);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.core-close-footer-btn:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--text-tertiary); }

/* 搜索框 */
.search-input {
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    width: 140px;
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--color-accent); }
.search-input::placeholder { color: var(--text-input-placeholder); }

/* ========== V3.0.0 三栏布局 & 右侧栏 ========== */
.panel-center {
    flex: 1;
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 400px;
}

.panel-right-sidebar {
    width: 360px;
    min-width: 360px;
    max-width: 500px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-standard);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease, min-width 0.3s ease;
    position: relative;
    flex-shrink: 0;
}
.panel-right-sidebar.collapsed {
    width: 32px;
    min-width: 32px;
}

.right-sidebar-toggle {
    position: absolute;
    top: 8px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--bg-tab-hover);
    border: 1px solid var(--border-input);
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    font-size: 11px;
    line-height: 1;
}
.right-sidebar-toggle:hover {
    background: #374151;
    color: #f3f4f6;
}
.collapsed .right-sidebar-toggle .toggle-icon {
    transform: rotate(180deg);
}

/* 平行标签 */
.right-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border-standard);
    background: var(--bg-tab-active);
    padding-left: 32px;
    flex-shrink: 0;
}
.right-tab {
    flex: 1;
    text-align: center;
    padding: 7px 0;
    font-size: 10px;
    color: #6b7280;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    user-select: none;
}
.right-tab.active {
    color: #e5e7eb;
}
.right-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 2px;
    background: var(--color-accent);
}
.right-tab:hover {
    color: #9ca3af;
}

/* 右侧栏内容区 */
.right-tab-content {
    flex: 1;
    overflow-y: auto;
    transition: opacity 0.2s;
}
.right-tab-content.switching {
    opacity: 0.3;
}

/* 标签内容面板 */
.tab-pane { }
.tab-section {
    border-bottom: 1px solid var(--border-standard);
}
.tab-section .section-title {
    background: rgba(20, 24, 33, 0.5);
    font-size: 10px;
    padding: 5px 10px;
}
.tab-section .panel-body {
    padding: 6px 8px;
    font-size: 10px;
    color: #9ca3af;
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.tab-section .panel-body::-webkit-scrollbar {
    width: 4px;
}
.tab-section .panel-body::-webkit-scrollbar-track {
    background: transparent;
}
.tab-section .panel-body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 2px;
}

/* 催化传导标签页：两面板平分剩余高度 */
#tab-conduction-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#tab-conduction-content .tab-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: none;
}

#tab-conduction-content .tab-section .panel-body {
    flex: 1;
    overflow-y: auto;
    max-height: none;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

#tab-conduction-content .tab-section .panel-body::-webkit-scrollbar {
    width: 4px;
}
#tab-conduction-content .tab-section .panel-body::-webkit-scrollbar-track {
    background: transparent;
}
#tab-conduction-content .tab-section .panel-body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 2px;
}

/* WhaleEye 四阶段颜色 */
.phase-accumulation { color: #f59e0b; }
.phase-shakeout { color: #f97316; }
.phase-uptrend { color: #ef4444; }
.phase-distribution { color: #22c55e; }

/* FinSentinel 冲击力颜色 */
.impact-strong { color: #ef4444; }
.impact-medium { color: #f97316; }
.impact-weak { color: #9ca3af; }

/* 右侧面板股票条目 */
.whale-stock-row {
    cursor: pointer;
    transition: background 0.15s;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-table-row);
}
.whale-stock-row:hover {
    background: rgba(59, 130, 246, 0.08);
}
.whale-stock-row .stock-name {
    font-size: 11px;
    color: #d1d5db;
}
.whale-stock-row .phase-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 0 6px;
    border-radius: 3px;
    display: inline-block;
}
.whale-stock-row .signal-summary {
    font-size: 10px;
    color: #6b7280;
    margin-top: 2px;
}
.whale-stock-row .confidence {
    font-size: 9px;
    color: #4b5563;
    margin-top: 1px;
}

/* FinSentinel 事件卡片 */
.fin-event-row {
    padding: 8px;
    border-bottom: 1px solid var(--border-table-row);
    transition: background 0.15s;
}
.fin-event-row:hover {
    background: rgba(139, 92, 246, 0.05);
}
.fin-event-row .event-title {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 400;
    margin-bottom: 3px;
}
.fin-event-row .event-meta {
    font-size: 10px;
    color: #6b7280;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.fin-event-row .event-sectors {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ========== 催化面板右侧栏样式 V3.3.0（三行分离版） ========== */
.catalyst-item {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(31,41,55,0.4);
    font-size: 13px;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.catalyst-item:hover {
    background: rgba(59,130,246,0.05);
}

.catalyst-critical {
    border-left-color: #ef4444 !important;
}
.catalyst-normal {
    border-left-color: #4b5563 !important;
}

.catalyst-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.catalyst-stars {
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
    letter-spacing: 1px;
    display: flex;
    gap: 1px;
    user-select: none;
}

.star-filled {
    color: #fbbf24;
    transition: color 0.2s;
}
.catalyst-critical .star-filled {
    color: #f59e0b;
    text-shadow: 0 0 4px rgba(245,158,11,0.3);
}
.catalyst-normal .star-filled {
    color: #6b7280;
    opacity: 0.5;
}

.catalyst-tag {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    font-weight: 500;
    background: var(--bg-tag) !important;
    color: #9ca3af !important;
    border: 1px solid rgba(107,114,128,0.15) !important;
}

.catalyst-expand-btn {
    font-size: 9px;
    color: #60a5fa;
    cursor: pointer;
    flex-shrink: 0;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(59,130,246,0.08);
    transition: all 0.15s;
    user-select: none;
    line-height: 1;
    opacity: 0.7;
    margin-left: auto;
}
.catalyst-expand-btn:hover {
    opacity: 1;
    background: rgba(59,130,246,0.2);
}
.catalyst-expand-btn.expanded {
    color: #f59e0b;
    background: rgba(245,158,11,0.15);
}

.catalyst-conduction-btn {
    font-size: 11px;
    color: #f59e0b;
    cursor: pointer;
    flex-shrink: 0;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(245,158,11,0.1);
    transition: all 0.15s;
    user-select: none;
    line-height: 1;
    margin-left: 2px;
}
.catalyst-conduction-btn:hover {
    background: rgba(245,158,11,0.25);
    color: #fbbf24;
}

.catalyst-title {
    color: #d1d5db !important;
    font-weight: 400 !important;
    font-size: 13px !important;
    line-height: 1.6;
    margin-bottom: 8px;
    word-break: break-word;
}

.catalyst-detail {
    color: #9ca3af !important;
    font-size: 12px !important;
    line-height: 1.8;
    word-break: break-word;
    white-space: pre-line;
}

.panel-right-sidebar.collapsed .right-tab-bar,
.panel-right-sidebar.collapsed .right-tab-content {
    display: none;
}
.panel-right-sidebar.collapsed .right-sidebar-toggle {
    position: absolute;
    left: 5px;
}

/* ========== 页面锁定布局 ========== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.resizable-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    width: 100%;
    min-height: 0;
}

.site-footer {
    flex-shrink: 0;
}

.panel-left {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    height: 100%;
}

.panel-center {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    height: 100%;
}

.panel-right-sidebar {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    height: 100%;
}

.right-tab-content {
    overscroll-behavior-y: contain;
}

.tab-section .panel-body {
    overscroll-behavior-y: contain;
}

#tab-signal-content .tab-section .panel-body {
    overscroll-behavior-y: contain;
}

#tab-conduction-content .tab-section .panel-body {
    overscroll-behavior-y: contain;
}

/* ========== 面板标题增强样式 ========== */
.section-title-wrapper {
    padding: 8px 10px 6px;
    background: rgba(20, 24, 33, 0.5);
    border-bottom: 1px solid var(--border-standard);
}

.section-title-main {
    font-size: 11px;
    font-weight: 600;
    color: #e5e7eb;
    letter-spacing: 0.5px;
}

.section-title-sub {
    font-size: 9px;
    font-weight: 400;
    color: #6b7280;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.section-title-divider {
    height: 1px;
    background: rgba(59, 130, 246, 0.25);
    margin-top: 6px;
}

/* ========== Synapse AI 分析师面板样式 ========== */
.synapse-block {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(31,41,55,0.4);
}

.synapse-block-title {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.synapse-block-warn {
    background: rgba(239,68,68,0.05);
    border-left: 2px solid rgba(239,68,68,0.3);
}

.synapse-macro-regime {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.synapse-macro-summary {
    font-size: 11px;
    color: #d1d5db;
    margin-bottom: 2px;
}

.synapse-macro-indicators {
    font-size: 9px;
    color: #6b7280;
}

.synapse-contradiction-item {
    margin-bottom: 6px;
}

.synapse-contradiction-sector {
    font-size: 11px;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 2px;
}

.synapse-contradiction-row {
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 1px;
}

.synapse-contradiction-row .label {
    color: #6b7280;
}

.synapse-contradiction-risk {
    font-size: 10px;
    color: #f59e0b;
    margin-top: 2px;
}

.synapse-strategy-row {
    font-size: 10px;
    margin-bottom: 3px;
    padding: 3px 6px;
    border-radius: 3px;
}

.synapse-strategy-row .strategy-label {
    font-weight: 600;
}

.synapse-offensive {
    background: rgba(34,197,94,0.08);
    color: #4ade80;
}

.synapse-defensive {
    background: rgba(59,130,246,0.08);
    color: #60a5fa;
}

.synapse-avoid {
    background: rgba(107,114,128,0.08);
    color: #9ca3af;
}

.synapse-risk-event {
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 2px;
}

.synapse-risk-event .risk-date {
    display: inline-block;
    padding: 0px 4px;
    background: rgba(107,114,128,0.15);
    border-radius: 2px;
    margin-right: 4px;
    font-size: 9px;
    color: #d1d5db;
}

.synapse-analysts {
    border-bottom: none;
}

.synapse-analyst-row {
    font-size: 9px;
    color: #4b5563;
}

/* ========== 底部数据源声明样式 ========== */
.site-footer {
    background: var(--bg-footer);
    backdrop-filter: blur(4px);
    border-top: 1px solid var(--border-standard);
    padding: 4px 12px calc(6px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    font-size: 10px;
    color: var(--text-footer);
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1.45;
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-separator {
    color: #4b5563;
    font-weight: 300;
}

.footer-note {
    font-size: 9px;
    color: var(--text-footer-note);
}

.site-footer:hover {
    background: rgba(20, 24, 33, 0.9);
    border-top-color: var(--color-accent);
}

.site-footer:hover .footer-icon {
    opacity: 1;
}

/* ========== V3.4.1 滚动条精致化修复（最优先） ========== */

/* 右侧栏：市场异动 & 催化传导 主容器 */
#rightTabContent,
.right-tab-content {
    scrollbar-width: thin !important;
    scrollbar-color: #374151 transparent !important;
}

/* 右侧栏：各独立面板内容区 */
#fin-sentinel-panel .panel-body,
#whale-eye-panel .panel-body,
#synapse-panel .panel-body,
#prediction-panel-body,
#us-catalyst-panel .panel-body,
#cn-catalyst-panel .panel-body,
.tab-section .panel-body {
    scrollbar-width: thin !important;
    scrollbar-color: #374151 transparent !important;
}

/* 左侧栏 */
.panel-left {
    scrollbar-width: thin !important;
    scrollbar-color: #374151 transparent !important;
}

/* 中间栏（个股表格、产业链列表） */
.panel-center,
.panel-center .overflow-auto {
    scrollbar-width: thin !important;
    scrollbar-color: #374151 transparent !important;
}

/* WebKit 浏览器（Chrome/Edge）的细滚动条强制定义 */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* ========== 导航栏样式（V4.0 与看板内联 nav 一致） ========== */
.top-navbar {
    display: flex;
    align-items: center;
    height: var(--nav-height);
    min-height: var(--nav-height);
    box-sizing: border-box;
    padding: 4px 12px 0;
    background: #141821;
    border-bottom: 1px solid #1f2937;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 24px;
}
.nav-brand .brand-link,
.brand-link {
    font-size: 14px;
    font-weight: 600;
    color: #e8eaed;
    letter-spacing: -0.2px;
    text-decoration: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.brand-link:hover { opacity: 0.8; }
.brand-link .brand-cn { color: #e8eaed; font-weight: 600; }
.brand-link .brand-sep { color: #6b7280; font-weight: 400; }
.brand-link .brand-en { color: #3b82f6; font-weight: 600; }
.brand-link .brand-chain { color: #e8eaed; }

/* Brand utilities: 产棱 · IndPrism（IndPrism 品牌蓝） */
.brand-cn { color: var(--text-primary); font-weight: 600; }
.brand-sep { color: var(--text-muted, #6b7280); font-weight: 400; }
.brand-en { color: var(--color-accent); font-weight: 600; }
.brand-chain { color: var(--text-primary); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-link {
    font-size: 11px;
    color: #9ca3af;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.nav-link:hover {
    color: #e5e7eb;
    background: rgba(255,255,255,0.04);
}
.nav-link.active {
    color: #e5e7eb;
    background: rgba(59, 130, 246, 0.12);
}

.nav-user {
    display: flex;
    align-items: center;
    margin-left: auto;
}
.user-dropdown {
    position: relative;
}
.user-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.user-trigger:hover {
    color: #e5e7eb;
    background: rgba(255,255,255,0.04);
}
.user-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 150px;
    background: #181b22;
    border: 1px solid #1f2937;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 1001;
    padding: 4px 0;
}
.menu-item {
    display: block;
    padding: 7px 14px;
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.1s ease;
    white-space: nowrap;
}
.menu-item:hover {
    background: rgba(255,255,255,0.04);
    color: #e5e7eb;
}
.menu-item-logout:hover {
    color: #ef4444;
}
.menu-divider {
    height: 1px;
    background: #1f2937;
    margin: 4px 0;
}
.nav-auth {
    display: flex;
    align-items: center;
    gap: 2px;
}
.auth-divider {
    color: #374151;
    font-size: 11px;
    user-select: none;
}

/* ========== 新增表格空状态 ========== */
.table-empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 32px 0;
}

/* ========== 排序指示器 ========== */
.sort-asc::after {
    content: ' ▲';
    font-size: 10px;
}
.sort-desc::after {
    content: ' ▼';
    font-size: 10px;
}

/* ========== Dashboard 工具类（替代 Tailwind CDN，仅看板页所需） ========== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.grid { display: grid; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-0\.5 { gap: 0.125rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.min-w-0 { min-width: 0; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.top-full { top: 100%; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.h-3 { height: 0.75rem; }
.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.w-3 { width: 0.75rem; }
.min-w-\[140px\] { min-width: 140px; }
.max-h-\[300px\] { max-height: 300px; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.mb-0\.5 { margin-bottom: 0.125rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.pl-4 { padding-left: 1rem; }
.pl-12 { padding-left: 3rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-\[8px\] { font-size: 8px; }
.text-\[9px\] { font-size: 9px; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-\[12px\] { font-size: 12px; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }
.font-semibold { font-weight: 600; }
.font-thin { font-weight: 100; }
.leading-relaxed { line-height: 1.625; }
.no-underline { text-decoration: none; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-yellow-500 { color: #eab308; }
.text-red-500 { color: var(--color-up); }
.text-\[\#d44\] { color: #d44; }
.text-\[\#00c853\] { color: #00c853; }
.text-\[\#3b82f6\] { color: #3b82f6; }
.text-\[\#ff3b30\] { color: #ff3b30; }
.text-\[\#8b5cf6\] { color: #8b5cf6; }
.text-\[\#f59e0b\] { color: #f59e0b; }
.text-\[\#8a8a95\] { color: #8a8a95; }
.text-\[\#5a5a6a\] { color: #5a5a6a; }
.text-white { color: #fff; }
.text-gray-100 { color: #f3f4f6; }
.text-gray-200 { color: #e5e7eb; }
.text-green-500 { color: var(--color-down); }
.bg-\[\#0a0c10\] { background-color: #0a0c10; }
.bg-\[\#0f1117\] { background-color: #0f1117; }
.bg-\[\#1f2937\]\/50 { background-color: rgba(31, 41, 55, 0.5); }
.bg-\[\#0f1117\]\/50 { background-color: rgba(15, 17, 23, 0.5); }
.bg-\[\#0f1117\]\/30 { background-color: rgba(15, 17, 23, 0.3); }
.bg-\[\#141821\]\/50 { background-color: rgba(20, 24, 33, 0.5); }
.bg-\[\#141821\]\/30 { background-color: rgba(20, 24, 33, 0.3); }
.bg-\[\#374151\]\/20 { background-color: rgba(55, 65, 81, 0.2); }
.bg-\[\#374151\]\/40 { background-color: rgba(55, 65, 81, 0.4); }
.bg-\[\#3b82f6\]\/10 { background-color: rgba(59, 130, 246, 0.1); }
.bg-\[\#3b82f6\]\/20 { background-color: rgba(59, 130, 246, 0.2); }
.bg-\[\#f59e0b\]\/10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-\[\#d44\]\/10 { background-color: rgba(221, 68, 68, 0.1); }
.bg-\[\#ff3b30\]\/10 { background-color: rgba(255, 59, 48, 0.1); }
.bg-\[\#1f2937\] { background-color: #1f2937; }
.bg-\[\#141821\] { background-color: #141821; }
.bg-\[\#374151\] { background-color: #374151; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border { border-width: 1px; border-style: solid; }
.border-\[\#1f2937\] { border-color: #1f2937; }
.border-\[\#374151\] { border-color: #374151; }
.border-gray-800 { border-color: #1f2937; }
.border-\[\#3b82f6\]\/20 { border-color: rgba(59, 130, 246, 0.2); }
.border-\[\#3b82f6\]\/30 { border-color: rgba(59, 130, 246, 0.3); }
.border-gray-500\/30 { border-color: rgba(107, 114, 128, 0.3); }
.rounded { border-radius: 0.25rem; }
.cursor-pointer { cursor: pointer; }
.overflow-y-auto { overflow-y: auto; }
.overflow-auto { overflow: auto; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -4px rgba(0, 0, 0, 0.2); }
.transition {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
.hover\:bg-\[\#1f2937\]:hover { background-color: #1f2937; }
.hover\:bg-\[\#374151\]:hover { background-color: #374151; }
.hover\:bg-\[\#374151\]\/40:hover { background-color: rgba(55, 65, 81, 0.4); }
.hover\:bg-\[\#3b82f6\]\/20:hover { background-color: rgba(59, 130, 246, 0.2); }
.hover\:text-\[\#3b82f6\]:hover { color: #3b82f6; }
.hover\:text-gray-200:hover { color: #e5e7eb; }
.hover\:text-white:hover { color: #fff; }
.hover\:underline:hover { text-decoration: underline; }