/* ═══════════════════════════════════════════════════════
   [E] 财务图表
       .financial-* / .chart-* / .custom-multi-select
   ═══════════════════════════════════════════════════════ */

/* ==================== 财务分析模式 ==================== */
.financial-container {
    display: none;
    flex: 1;
    padding: 20px;
    background: var(--bg-primary, #f9fafb);
    overflow-y: auto;
}

.financial-container.active {
    display: flex;
    flex-direction: column;
}

.financial-panel {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.financial-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 16px 20px;
    background: var(--bg-secondary, #fff);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.control-group select,
.control-group input {
    padding: 8px 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #111827);
    font-size: 0.95rem;
    min-width: 160px;
    cursor: pointer;
}

.year-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.year-range input {
    width: 90px;
    min-width: 0;
}

.control-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.financial-chart-container {
    background: var(--bg-secondary, #fff);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.financial-table-wrapper {
    background: var(--bg-secondary, #fff);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 12px 20px;
}

.financial-table-wrapper summary {
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    color: var(--text-primary, #111827);
}

.table-container {
    max-height: 400px;
    overflow: auto;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
}

#financial-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#financial-data-table th {
    background: var(--bg-tertiary, #f3f4f6);
    padding: 12px 8px;
    text-align: right;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    position: sticky;
    top: 0;
    z-index: 10;
}

#financial-data-table th:first-child {
    text-align: left;
}

#financial-data-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid var(--border-color-light, #f0f0f0);
}

#financial-data-table td:first-child {
    text-align: left;
    font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .financial-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 15px; /* 新增：减小内边距，给内容留更多空间 */
    }
    .control-actions {
        margin-left: 0;
        justify-content: flex-end;
    }
    .control-group select,
    .control-group input {
        min-width: 100%;
    }

    /* ✅ 新增：修复年份范围布局 */
    .financial-controls .control-group .year-range {
        display: flex;
        align-items: center;
        width: 100%;
        gap: 6px;
    }

    .financial-controls .control-group .year-range input {
        /* 关键：覆盖全局的 min-width: 100% */
        min-width: 0 !important;
        width: 100%; /* 变回自适应，由 flex 分配 */
        flex: 1;     /* 平分剩余空间 */
        font-size: 14px; /* 移动端稍微调小字体 */
        padding: 6px 8px; /* 减小内边距 */
    }

    .financial-controls .control-group .year-range span {
        flex-shrink: 0; /* 连字符不允许被压缩 */
        color: var(--text-secondary-color, #888);
    }
}

/* 指标下拉菜单固定宽度防换行 */
#metric-left-select,
#metric-right-select {
    width: 250px;            /* 固定宽度，足够容纳最长选项 */
    min-width: auto;         /* 覆盖父级 min-width，避免冲突 */
    white-space: nowrap;     /* 强制单行 */
    box-sizing: border-box;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #metric-left-select,
    #metric-right-select {
        width: 100%;
        min-width: 0;
    }
}

/* ========== 自定义多选下拉组件 ========== */
.custom-multi-select {
    position: relative;
    width: 100%;
    max-width: 280px;
    -webkit-user-select: none;
    user-select: none;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: var(--input-bg, #fff);
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary, #333);
    cursor: pointer;
    transition: border-color 0.2s;
}

.multi-select-trigger:hover {
    border-color: var(--primary-color, #4f46e5);
}

.multi-select-trigger .selected-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 桌面端下拉面板：从按钮下方弹出 */
.custom-multi-select .multi-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 280px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--input-bg, #fff);
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.custom-multi-select .multi-select-dropdown.show {
    display: block;
}

.dropdown-group {
    padding: 8px 12px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light, #eee);
    text-align: left;
}

/* 选项行：只用 span，不用原生 checkbox */
.dropdown-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 16px;
    min-height: 44px;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}

.dropdown-option:hover {
    background: var(--hover-bg, #f5f5f5);
}

/* 🎯 自定义勾选框：未选中状态 */
.dropdown-option::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid #b0b0b0;
    border-radius: 4px;
    background-color: #fff;
    box-sizing: border-box;
}

/* 🎯 选中状态：蓝底 + 白色勾 */
.dropdown-option.selected::before {
    background-color: #4a90d9;
    border-color: #4a90d9;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/></svg>");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* 文字 */
.dropdown-option .option-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
    color: var(--text-color, #333);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 深色模式适配 */
body.dark-mode .dropdown-option::before {
    background-color: #2d2d2d;
    border-color: #666;
}
body.dark-mode .dropdown-option.selected::before {
    background-color: #6366f1;
    border-color: #6366f1;
}
body.dark-mode .dropdown-option .option-label {
    color: #f0f0f0;
}

/* ========== 移动端：下拉面板从底部弹起 ========== */
@media (max-width: 768px) {
    /* 1. 确保父级容器不裁切下拉框 */
    .financial-controls,
    .control-group,
    .custom-multi-select {
        overflow: visible !important;
    }

    .custom-multi-select {
        max-width: 100%;
    }

    .multi-select-trigger {
        padding: 12px;
        font-size: 16px;
    }

    .custom-multi-select .multi-select-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        
        /* ✅ 核心：锁死宽度，避免 100vw 带来的偏移 */
        width: 100% !important; 
        min-width: 0 !important;
        max-width: 100% !important;
        
        max-height: 60vh !important;
        overflow-y: auto !important;
        border-radius: 12px 12px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
        z-index: 9999 !important;
        padding: 8px 0 !important;
        box-sizing: border-box !important;
    }
    
    /* 配合 JS 的 has-search，去掉多余的上下内边距 */
    .custom-multi-select .multi-select-dropdown.has-search {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* 2. 搜索框容器：统一左侧内边距为 16px */
    .dropdown-search-wrapper {
        padding: 12px 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: transparent !important; /* 防止双背景重叠 */
        border-bottom: none !important; /* 移动端不需要底部分割线 */
    }
    
    /* 3. 搜索输入框外观：让框体完整、圆润 */
    .dropdown-search-input {
        font-size: 16px !important; /* 防止 iOS 自动放大 */
        padding: 10px 12px !important;
        background: #f3f4f6 !important;
        border-radius: 8px !important;
        border: 1px solid #e5e7eb !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 4. 关键对齐：选项行左侧内边距设为 16px，与上方搜索框容器绝对对齐 */
    .dropdown-option {
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 16px !important; /* 这里的 16px 必须和 wrapper 一致 */
        padding-right: 16px !important;
    }
}

/* ==================== 财务分析模块新增样式 ==================== */

/* 图表类型下拉框（左轴/右轴图表类型选择） */
.chart-type-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    background: var(--input-bg, #fff);
    font-size: 14px;
    min-width: 120px;
    cursor: pointer;
}

/* 年份范围 + 频率控件组：作为一个整体，内部元素不拆开 */
.control-group-row-wrap {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;       /* 内部两个小组不拆开，整体换行由父级 flex-wrap 控制 */
    align-items: flex-end;
    gap: 16px;
}

.year-range-group,
.frequency-group {
    display: flex;
    flex-direction: column;
    white-space: nowrap;     /* 防止内部文字换行 */
}

/* 移动端适配：窄屏下整体竖向排列 */
@media (max-width: 768px) {
    .control-group-row-wrap {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ═══════════════════════════════════════════════════════
   [F] 电话会卡片
       .transcript-* / .financial-subtab*
   ═══════════════════════════════════════════════════════ */

/* ================================================================
   财务板块 - 子标签 + 电话会展示
   ================================================================ */

/* ---------- 子标签栏 ---------- */
.financial-subtabs {
    display: flex;
    gap: 4px;
    margin: 12px 0 16px 0;
    padding: 4px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    width: fit-content;
}

.financial-subtab {
    padding: 8px 18px;
    border: none;
    background: transparent;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.financial-subtab:hover {
    background: rgba(255, 255, 255, 0.6);
    color: #333;
}

.financial-subtab.active {
    background: #fff;
    color: #2b6cf6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* 深色主题适配（如果启用） */
body.dark-mode .financial-subtabs {
    background: rgba(255, 255, 255, 0.06);
}
body.dark-mode .financial-subtab {
    color: #aaa;
}
body.dark-mode .financial-subtab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
}
body.dark-mode .financial-subtab.active {
    background: rgba(43, 108, 246, 0.18);
    color: #6da2ff;
    box-shadow: none;
}

/* ---------- 视图容器 ---------- */
.financial-view {
    display: none;
}
.financial-view.active {
    display: block;
    animation: fadeInView 0.18s ease;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 财务共享控制区（主股票 + 对比股票 + 年份范围） ---------- */
.financial-controls-shared {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
    padding-bottom: 14px;
    margin-bottom: 4px;
}
body.dark-mode .financial-controls-shared {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   电话会视图（完整版）
   ============================================================ */

/* ---------- 工具栏 ---------- */
.transcript-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0 16px 0;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}
body.dark-mode .transcript-toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* 工具栏内的 select（季度 / 情绪） */
.transcript-toolbar > select {
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s;
    min-width: 110px;
    height: 34px;
    box-sizing: border-box;
}
.transcript-toolbar > select:focus {
    outline: none;
    border-color: #2b6cf6;
}
body.dark-mode .transcript-toolbar > select {
    background: #1c1f26;
    color: #ddd;
    border-color: rgba(255, 255, 255, 0.12);
}

/* 搜索框容器 */
.transcript-search-wrapper {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
    max-width: 320px;
    height: 34px;
}
.transcript-search-wrapper > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 12px;
    pointer-events: none;
}
.transcript-search {
    width: 100%;
    height: 100%;
    padding: 0 12px 0 32px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #333;
    transition: border-color 0.15s;
    box-sizing: border-box;
    line-height: 1;
}
.transcript-search:focus {
    outline: none;
    border-color: #2b6cf6;
}
body.dark-mode .transcript-search {
    background: #1c1f26;
    color: #ddd;
    border-color: rgba(255, 255, 255, 0.12);
}

/* 计数提示：推到最右 */
.transcript-count-hint {
    flex: 0 0 auto;
    font-size: 12px;
    color: #888;
    margin-left: auto;
    padding-left: 16px;
    white-space: nowrap;
}

/* ---------- 卡片列表 ---------- */
.transcript-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 每个公司的分组 */
.transcript-symbol-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transcript-symbol-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.transcript-symbol-header:hover .transcript-symbol-name {
    color: #2b6cf6;
}

.transcript-symbol-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    transition: color 0.15s;
}
body.dark-mode .transcript-symbol-name {
    color: #eee;
}

.transcript-symbol-meta {
    font-size: 12px;
    color: #888;
}

.transcript-collapse-icon {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
}
.transcript-symbol-group.collapsed .transcript-collapse-icon {
    transform: rotate(-90deg);
}
.transcript-symbol-group.collapsed .transcript-symbol-cards {
    display: none;
}

.transcript-symbol-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- 单张卡片 ---------- */
.transcript-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: #fff;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.18s;
}
.transcript-card:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}
body.dark-mode .transcript-card {
    background: #1c1f26;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}
body.dark-mode .transcript-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

/* 卡片头部 */
.transcript-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 14px;
}
body.dark-mode .transcript-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.transcript-quarter-badge {
    padding: 3px 10px;
    background: #2b6cf6;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.transcript-sentiment-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.transcript-sentiment-badge.positive {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}
.transcript-sentiment-badge.neutral {
    background: rgba(234, 179, 8, 0.12);
    color: #ca8a04;
}
.transcript-sentiment-badge.negative {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
body.dark-mode .transcript-sentiment-badge.positive { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
body.dark-mode .transcript-sentiment-badge.neutral  { background: rgba(234, 179, 8, 0.2); color: #facc15; }
body.dark-mode .transcript-sentiment-badge.negative { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.transcript-meta-chip {
    font-size: 12px;
    color: #888;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---------- 卡片内 section ---------- */
.transcript-section {
    margin: 16px 0;
}
.transcript-section:first-of-type {
    margin-top: 0;
}

.transcript-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
body.dark-mode .transcript-section-title {
    color: #999;
}

.transcript-section-title .count {
    background: rgba(0, 0, 0, 0.06);
    color: #666;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
body.dark-mode .transcript-section-title .count {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
}

/* ---------- 关键要点 ---------- */
.transcript-keypoints {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transcript-keypoint {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid #ccc;
    transition: background 0.15s;
}
.transcript-keypoint:hover {
    background: rgba(0, 0, 0, 0.04);
}
body.dark-mode .transcript-keypoint {
    background: rgba(255, 255, 255, 0.03);
}
body.dark-mode .transcript-keypoint:hover {
    background: rgba(255, 255, 255, 0.05);
}

.transcript-keypoint.positive { border-left-color: #22c55e; }
.transcript-keypoint.neutral  { border-left-color: #eab308; }
.transcript-keypoint.negative { border-left-color: #ef4444; }

.transcript-kp-content {
    flex: 1;
    min-width: 0;
}

.transcript-kp-category {
    display: inline-block;
    padding: 1px 7px;
    background: rgba(43, 108, 246, 0.1);
    color: #2b6cf6;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}
body.dark-mode .transcript-kp-category {
    background: rgba(43, 108, 246, 0.2);
    color: #6da2ff;
}

.transcript-kp-summary {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}
body.dark-mode .transcript-kp-summary {
    color: #ddd;
}

.transcript-kp-reason {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
    font-style: italic;
}
body.dark-mode .transcript-kp-reason {
    color: #888;
}

/* ---------- 管理层指引 ---------- */
.transcript-guidance-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.transcript-guidance-item {
    padding: 9px 12px;
    background: rgba(43, 108, 246, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(43, 108, 246, 0.1);
    min-width: 0;
}
body.dark-mode .transcript-guidance-item {
    background: rgba(43, 108, 246, 0.08);
    border-color: rgba(43, 108, 246, 0.15);
}

.transcript-guidance-key {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
    font-family: 'SF Mono', Menlo, monospace;
    /* 🆕 新增 */
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
}
body.dark-mode .transcript-guidance-key {
    color: #999;
}

.transcript-guidance-value {
    font-size: 14px;
    font-weight: 600;
    color: #2b6cf6;
    margin-bottom: 2px;
}
body.dark-mode .transcript-guidance-value {
    color: #6da2ff;
}

.transcript-guidance-period {
    font-size: 11px;
    color: #999;
    display: inline-block;
    margin-left: 6px;
    font-weight: 400;
}

.transcript-guidance-note {
    font-size: 11px;
    color: #888;
    line-height: 1.4;
    margin-top: 4px;
    /* 🆕 允许完整换行显示，不再截断 */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow: visible;
    max-height: none;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
}

/* ---------- 问答主题 ---------- */
.transcript-qa-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.transcript-qa-tag {
    padding: 4px 10px;
    background: rgba(139, 92, 246, 0.08);
    color: #7c3aed;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid rgba(139, 92, 246, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
body.dark-mode .transcript-qa-tag {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.25);
}

.transcript-qa-analyst {
    font-size: 11px;
    color: #888;
    margin-left: 4px;
}

/* ---------- 负面信号 ---------- */
.transcript-negative-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.04);
    border-radius: 8px;
    border-left: 3px solid #ef4444;
}
body.dark-mode .transcript-negative-list {
    background: rgba(239, 68, 68, 0.08);
}

.transcript-negative-item {
    display: flex;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #444;
}
body.dark-mode .transcript-negative-item {
    color: #ccc;
}

.transcript-negative-item::before {
    content: "•";
    color: #ef4444;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---------- 展开/收起按钮 ---------- */
.transcript-expand-btn {
    margin-top: 6px;
    padding: 4px 10px;
    background: transparent;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.transcript-expand-btn:hover {
    background: rgba(43, 108, 246, 0.06);
    border-color: #2b6cf6;
    color: #2b6cf6;
}
body.dark-mode .transcript-expand-btn {
    border-color: rgba(255, 255, 255, 0.15);
    color: #aaa;
}
body.dark-mode .transcript-expand-btn:hover {
    background: rgba(43, 108, 246, 0.15);
    border-color: #2b6cf6;
    color: #6da2ff;
}

/* ---------- 空状态 ---------- */
.transcript-empty {
    padding: 60px 20px;
    text-align: center;
    color: #888;
}
.transcript-empty i {
    font-size: 42px;
    color: #ccc;
    margin-bottom: 12px;
    display: block;
}
body.dark-mode .transcript-empty i {
    color: #555;
}
.transcript-empty-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}
body.dark-mode .transcript-empty-title {
    color: #aaa;
}
.transcript-empty-hint {
    font-size: 12px;
    color: #999;
}

/* ---------- 加载状态 ---------- */
.transcript-loading {
    padding: 60px 20px;
    text-align: center;
    color: #888;
}
.transcript-loading .spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(43, 108, 246, 0.2);
    border-top-color: #2b6cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   导出功能
   ============================================================ */

/* ---------- 工具栏「导出全部」按钮 ---------- */
.transcript-export-btn {
    flex: 0 0 auto;
    margin-left: 4px;
    padding: 0 14px;
    height: 34px;
    border: 1px solid rgba(43, 108, 246, 0.3);
    background: rgba(43, 108, 246, 0.06);
    color: #2b6cf6;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    white-space: nowrap;
}
.transcript-export-btn:hover {
    background: rgba(43, 108, 246, 0.12);
    border-color: #2b6cf6;
}
.transcript-export-btn:active {
    transform: scale(0.97);
}
body.dark-mode .transcript-export-btn {
    border-color: rgba(109, 162, 255, 0.3);
    background: rgba(43, 108, 246, 0.15);
    color: #6da2ff;
}
body.dark-mode .transcript-export-btn:hover {
    background: rgba(43, 108, 246, 0.25);
}

/* ---------- 单卡片导出按钮 ---------- */
.transcript-card-export-btn {
    margin-left: auto;
    padding: 5px 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #999;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
    opacity: 0;
}
.transcript-card:hover .transcript-card-export-btn {
    opacity: 1;
}
.transcript-card-export-btn:hover {
    background: rgba(43, 108, 246, 0.1);
    color: #2b6cf6;
    border-color: rgba(43, 108, 246, 0.2);
}
body.dark-mode .transcript-card-export-btn {
    color: #888;
}
body.dark-mode .transcript-card-export-btn:hover {
    background: rgba(43, 108, 246, 0.2);
    color: #6da2ff;
}

/* ---------- 导出 loading 遮罩 ---------- */
.transcript-export-loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 99999;
    color: #fff;
    font-size: 14px;
}
.transcript-export-loading .spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
    .transcript-toolbar {
        flex-wrap: wrap;
    }
    .transcript-search-wrapper {
        flex: 1 1 100%;
        max-width: none;
    }
    .transcript-count-hint {
        margin-left: 0;
        padding-left: 0;
    }
    .transcript-export-btn {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .transcript-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .transcript-search-wrapper {
        max-width: none;
        width: 100%;
    }
    .transcript-count-hint {
        margin-left: 0;
        padding-left: 0;
        text-align: right;
    }
    .transcript-guidance-list {
        grid-template-columns: 1fr;
    }
    .transcript-card {
        padding: 14px;
    }
}

/* ==========================================================
   📊 财务图表全屏相关样式
   ========================================================== */

/* ---------- 移动端图表顶部工具组（导出 + 全屏） ---------- */
.chart-top-tools {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    display: flex;
    gap: 8px;
    align-items: center;
    pointer-events: auto;
}

.chart-top-tools .action-button {
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* 电脑端隐藏整个工具组 */
@media (min-width: 769px) {
    .chart-top-tools {
        display: none !important;
    }
    .mobile-only-btn {
        display: none !important;
    }
}

/* 🚀 图表全屏状态：旋转 90° 变成横向布局 */
.financial-chart-container.fullscreen {
    position: fixed !important;
    top: 50%;
    left: 50%;
    width: 100vh;   /* 宽高互换 */
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
    z-index: 99999;
    background: var(--surface-color, #fff);
    padding: 10px;
    box-sizing: border-box;
    border-radius: 0;
    overflow: hidden;
}

/* 现代浏览器用动态视口单位，避免地址栏遮挡 */
@supports (width: 100dvh) {
    .financial-chart-container.fullscreen {
        width: 100dvh;
        height: 100dvw;
    }
}

/* 图表填满旋转后的容器 */
.financial-chart-container.fullscreen #financial-chart {
    width: 100% !important;
    height: 100% !important;
}

/* 🆕 全屏时：工具组脱离容器旋转，固定到屏幕物理左上角
   （该位置在旋转后视觉上落在图表左侧中部，不遮挡居中标题与中央数据区） */
.chart-top-tools.fullscreen-active {
    position: fixed !important;
    top: 12px;
    left: 12px;
    right: auto;
    bottom: auto;
    z-index: 100000;   /* 必须大于容器的 99999 */
}

/* 全屏时按钮加底色，避免贴在图表上辨识不清 */
.chart-top-tools.fullscreen-active #chart-export-overlay-btn {
    background: var(--surface-color, #fff);
    color: #2b6cf6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.chart-top-tools.fullscreen-active #chart-fullscreen-btn {
    background: var(--danger-color, #ea4335);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ==================== 估值分析模式 ==================== */
.valuation-metric-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 16px 0;
}
.valuation-metric-cards .metric-card {
    background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
    padding: 16px; text-align: center;
}
.valuation-metric-cards .metric-label { font-size: 13px; color: #888; margin-bottom: 8px; }
.valuation-metric-cards .metric-value { font-size: 24px; font-weight: 600; color: #333; margin-bottom: 4px; }
.valuation-metric-cards .metric-hint { font-size: 11px; color: #aaa; }
.valuation-footnote {
    font-size: 12px; color: #999; margin-top: 12px; padding: 8px 12px;
    background: #fafafa; border-radius: 4px; line-height: 1.6;
}
.valuation-footnote code { background: #f0f0f0; padding: 1px 4px; border-radius: 2px; font-size: 11px; }
.valuation-toggle-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; font-size: 13px; cursor: pointer; }
@media (max-width: 768px) {
    .valuation-metric-cards { grid-template-columns: 1fr; }
    .valuation-metric-cards .metric-value { font-size: 20px; }
}

/* ============================================================
   🆕 估值区响应式与工具组样式
   ============================================================ */
.valuation-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    width: 100%;
    margin-bottom: 16px;
}
.valuation-fin-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .valuation-controls, .valuation-fin-group {
        flex-direction: column;
        align-items: stretch !important;
    }
    .valuation-controls .control-group {
        width: 100%;
        max-width: 100%;
    }
}

/* 全屏时，工具组脱离旋转容器，固定到物理左上角（同财务模式） */
.chart-top-tools.fullscreen-active {
    position: fixed !important;
    top: 12px;
    left: 12px;
    right: auto;
    bottom: auto;
    z-index: 100000;
}
.chart-top-tools.fullscreen-active #val-top-export,
.chart-top-tools.fullscreen-active #val-top-fullscreen {
    background: var(--surface-color, #fff);
    color: #2b6cf6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.chart-top-tools.fullscreen-active #val-top-fullscreen {
    background: var(--danger-color, #ea4335);
    color: #fff;
}
/* 修复估值图在全屏时的尺寸自适应 */
.financial-chart-container.fullscreen #valuation-band-chart {
    width: 100% !important;
    height: 100% !important;
}

/* ==========================================
   🆕 股东与筹码 (Ownership) 专属样式
   ========================================== */
.financial-view-ownership .badge {
    font-weight: 600;
}

/* 做空数据条 */
#ownership-short-bar {
    display: flex;
    gap: 40px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-left: 4px solid #faad14;
    margin-bottom: 20px;
}

/* 内部人时间轴 */
#insider-timeline ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#insider-timeline li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 16px;
}
#insider-timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}
#insider-timeline li.buy::before { background: #52c41a; }
#insider-timeline li.sell::before { background: #ff4d4f; }

/* 机构持仓表格 */
#ownership-list table {
    width: 100%;
    border-collapse: collapse;
}
#ownership-list th {
    text-align: left;
    padding: 8px 0;
    color: #888;
    font-weight: 500;
    border-bottom: 1px solid #eee;
}
#ownership-list td {
    padding: 8px 0;
    border-bottom: 1px dashed #f5f5f5;
    font-size: 13px;
    color: #333;
}
#ownership-list tr:hover { background: #fafafa; }

/* ============================================================
   🆕 多选下拉：搜索框（纯吸顶，不破坏原版任何布局）
   ============================================================ */

/* 1. 消除带搜索时产生的默认上下 padding，让搜索框完美贴边 */
.custom-multi-select .multi-select-dropdown.has-search {
    padding-top: 0;
    padding-bottom: 0;
}

/* 2. 搜索框吸附在顶部 */
.dropdown-search-wrapper {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--input-bg, #fff);
    border-bottom: 1px solid var(--border-light, #eee);
    box-sizing: border-box;
    width: 100%;
}

.dropdown-search-wrapper i {
    color: #aaa;
    font-size: 13px;
    flex-shrink: 0;
}

.dropdown-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    padding: 4px 0;
    color: var(--text-primary, #333);
}

.dropdown-search-input::placeholder {
    color: #bbb;
}

/* 3. 列表正常 block 流，不做任何干扰 */
.dropdown-list {
    display: block;
}

/* 4. 空状态 */
.dropdown-empty {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* 5. 移动端彻底修复：下拉菜单左侧被裁切、宽度溢出问题 */
@media (max-width: 768px) {
    .dropdown-search-wrapper {
        padding: 12px 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .dropdown-search-input {
        font-size: 16px !important; /* 防止 iOS 自动放大 */
        padding: 8px 12px !important;
        background: #f3f4f6 !important;
        border-radius: 8px !important;
    }

    /* ✅ 新增修复：确保选项行有充足的左边距，不被切掉复选框和图标 */
    .dropdown-option {
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}