/* 智量资本 - 标的详情弹窗（带Tab） */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 880px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

.modal-header {
    padding: 24px 28px 0 28px;
    border-bottom: 1px solid var(--border);
}

.modal-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.modal-ticker {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-name {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.modal-close {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.modal-close:hover { background: #f1f5f9; color: var(--text-primary); }

/* Tab导航 */
.detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar { display: none; }

.detail-tab {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

.detail-tab:hover { color: var(--text-primary); background: #f8fafc; }

.detail-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    font-weight: 600;
}

.modal-body { padding: 24px 28px; }

/* ---- Tab内容 ----
   Tab "概览" */

/* 信息网格 */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.info-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
}

.info-item .label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.info-item .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-item .sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* 看涨/看跌 */
.bull-bear-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.bull-box { background: #f0fdf4; border-radius: 10px; padding: 14px; }
.bear-box { background: #fef2f2; border-radius: 10px; padding: 14px; }

.bull-bear-label { font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.bull-bear-label.bull { color: #16a34a; }
.bull-bear-label.bear { color: #dc2626; }

.bull-bear-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* 操作按钮 */
.detail-actions {
    display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
}

.detail-actions .action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--border); background: white; cursor: pointer;
    transition: all 0.15s; color: var(--text-secondary);
}
.detail-actions .action-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: var(--text-primary); }
.detail-actions .action-btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.detail-actions .action-btn.primary:hover { background: var(--primary-dark); }

/* 段标题 */
.section-title {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 6px;
}
.section-title .count { color: var(--text-muted); font-weight: 400; font-size: 13px; }

/* 研报列表 */
.report-list { margin-bottom: 20px; }
.report-item {
    display: flex; justify-content: space-between;
    padding: 10px 14px; border-radius: 8px;
    transition: all 0.1s; cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
.report-item:last-child { border-bottom: none; }
.report-item:hover { background: #f8fafc; }
.report-item .report-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.report-item .report-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0;}
.report-item .report-type { font-size: 11px; color: var(--text-muted); }
.report-item .report-date { font-size: 11px; color: var(--text-muted); }

/* 阶段流转 */
.stage-list { margin-bottom: 20px; }
.stage-item {
    display: flex; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.stage-item:last-child { border-bottom: none; }
.stage-dot-big {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary); margin-top: 5px; flex-shrink: 0;
}
.stage-item .stage-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.stage-item .stage-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stage-item .stage-notes { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* 空状态/详情框 */
.empty-state { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.detail-box { background: #f8fafc; border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.detail-box .label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.detail-box .text { font-size: 13px; color: var(--text-primary); line-height: 1.5; }

/* ====================
   Tab "基本面"
   ==================== */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.profile-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
}

.profile-item .label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.profile-item .value { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.profile-item .sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.business-desc-box {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.business-desc-box .label {
    font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px;
}

.business-desc-box .text {
    font-size: 13px; color: var(--text-primary); line-height: 1.6;
}

/* ====================
   Tab "投行评级"
   ==================== */
.consensus-bar {
    display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}

.consensus-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 18px;
    text-align: center;
    min-width: 100px;
    flex: 1;
}

.consensus-item .value {
    font-size: 22px; font-weight: 700; color: var(--primary);
}

.consensus-item .label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }

.rating-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.rating-card:last-child { border-bottom: none; }

.rating-bank { flex: 1; }
.rating-bank .bank-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.rating-bank .analyst-name { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.rating-badge {
    font-size: 11px; font-weight: 600;
    padding: 4px 10px; border-radius: 20px;
}

.rating-badge.buy { background: #dcfce7; color: #16a34a; }
.rating-badge.hold { background: #fef9c3; color: #a16207; }
.rating-badge.sell { background: #fef2f2; color: #dc2626; }
.rating-badge.overweight { background: #dcfce7; color: #16a34a; }
.rating-badge.neutral { background: #f1f5f9; color: #64748b; }

.rating-target {
    text-align: right;
}

.rating-target .price {
    font-size: 14px; font-weight: 700; color: var(--text-primary);
}

.rating-target .upside {
    font-size: 11px;
}

/* ====================
   Tab "财务数据"
   ==================== */
.fin-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

.fin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fin-table th {
    background: #f8fafc;
    padding: 10px 14px;
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.fin-table th:first-child { text-align: left; }

.fin-table td {
    padding: 10px 14px;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.fin-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
}

.fin-table tr:last-child td { border-bottom: none; }

.fin-table .highlight {
    background: #f0f9ff;
}

/* ====================
   Tab "研报流转"
   ==================== */

@media (max-width: 768px) {
    .info-grid, .bull-bear-grid, .profile-grid { grid-template-columns: 1fr; }
    .consensus-bar { flex-direction: column; }
    .rating-card { flex-direction: column; align-items: flex-start; }
    .modal-content { max-width: 100%; border-radius: 0; }
    .modal-overlay { padding: 0; }
    .modal-body, .modal-header { padding: 20px 16px; }
}

/* K线图相关 */
.chart-period-btn {
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all 0.15s;
    user-select: none;
}
.chart-period-btn:hover { background: #e2e8f0; }
.chart-period-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 财报链接 */
.filings-group { margin-bottom: 20px; }
.filings-source-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    padding-left: 4px;
}
.filings-list { display: flex; flex-direction: column; gap: 6px; }
.filing-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s;
    border: 1px solid #f1f5f9;
}
.filing-item:hover {
    background: #f0f4f8;
    border-color: #e2e8f0;
}
.filing-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.filing-info { flex: 1; min-width: 0; }
.filing-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}
.filing-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.filing-arrow {
    font-size: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}
