/* ETF 指数分析 v2.0 样式 - 动态加仓 + 板块轮动 */

.etf-overview-container,
.etf-detail-container,
.etf-preference-container,
.etf-plan-container,
.etf-signals-container {
    padding-top: 80px;
    padding-bottom: 40px;
}

/* ========== 通用卡片 ========== */
.stat-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
    transition: transform .15s ease, box-shadow .15s ease;
    display: block;
    color: inherit;
    text-decoration: none;
}
.stat-card:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.06); color: inherit; text-decoration: none; }
.stat-card .stat-label { color: #888; font-size: 11px; margin-bottom: 2px; }
.stat-card .stat-value { font-size: 18px; font-weight: 700; color: #333; line-height: 1.2; }

.stat-build  { border-left: 4px solid #dc3545; }
.stat-add    { border-left: 4px solid #fd7e14; }
.stat-hold   { border-left: 4px solid #6c757d; }
.stat-reduce { border-left: 4px solid #20c997; }
.stat-exit   { border-left: 4px solid #198754; }
.stat-capital { border-left: 4px solid #0d6efd; }
.stat-used    { border-left: 4px solid #dc3545; }
.stat-remain  { border-left: 4px solid #198754; }

/* ========== 资金概览卡 ========== */
.capital-overview-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 12px 16px;
}
.capital-overview-card .cap-item {
    text-align: center;
    padding: 6px 10px;
}
.capital-overview-card .cap-value {
    font-size: 18px;
    font-weight: 700;
}
.capital-overview-card .cap-label {
    font-size: 11px;
    color: #888;
}

/* ========== 信号 badge ========== */
.signal-BUILD  { background-color: #dc3545; color: #fff; }
.signal-ADD    { background-color: #fd7e14; color: #fff; }
.signal-HOLD   { background-color: #6c757d; color: #fff; }
.signal-REDUCE { background-color: #20c997; color: #fff; }
.signal-EXIT   { background-color: #198754; color: #fff; }

/* ========== 恐惧贪婪条 ========== */
.fg-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    height: 100%;
}
.fg-bar-wrapper {
    position: relative;
    width: 55%;
    min-width: 220px;
    padding-top: 18px;
}
.fg-bar {
    height: 10px;
    border-radius: 6px;
    background: linear-gradient(to right,
        #198754 0%, #20c997 25%, #ffc107 50%, #fd7e14 75%, #dc3545 100%);
}
.fg-pointer {
    position: absolute;
    top: 12px;
    left: 50%;
    width: 2px;
    height: 22px;
    background: #222;
    transform: translateX(-1px);
}
.fg-labels {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* ========== 微笑曲线条 ========== */
.smile-zone-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
}
.smile-zone-bar {
    display: flex;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin: 8px 0;
}
.smile-zone-bar .z-S1 { background: #6f42c1; flex: 2; }
.smile-zone-bar .z-S2 { background: #dc3545; flex: 2; }
.smile-zone-bar .z-S3 { background: #fd7e14; flex: 2; }
.smile-zone-bar .z-S4 { background: #0d6efd; flex: 2; }
.smile-zone-bar .z-S5 { background: #198754; flex: 2; }
.smile-zone-bar .z-STOP { background: #000; flex: 1; }

.smile-zone-pointer {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    background: #222;
    z-index: 2;
    border-radius: 2px;
}
.smile-zone-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    margin-top: 4px;
}
.smile-action-badge {
    font-size: 1rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
}
.smile-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-top: 8px;
}

/* ========== 板块强度排名 ========== */
.sector-rank-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}
.sector-rank-item:last-child { border-bottom: none; }
.sector-rank-num {
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    margin-right: 8px;
    flex-shrink: 0;
}
.sector-rank-num.r1 { background: #dc3545; }
.sector-rank-num.r2 { background: #fd7e14; }
.sector-rank-num.r3 { background: #ffc107; }
.sector-rank-num.r4, .sector-rank-num.r5 { background: #adb5bd; }
.sector-rank-info { flex: 1; min-width: 0; }
.sector-rank-name { font-size: 13px; font-weight: 600; }
.sector-rank-group { font-size: 10px; color: #aaa; }
.sector-rank-bar-bg {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-top: 3px;
    overflow: hidden;
}
.sector-rank-bar {
    height: 100%;
    border-radius: 2px;
    transition: width .3s;
}
.sector-rank-score {
    font-size: 13px;
    font-weight: 700;
    margin-left: 8px;
    min-width: 36px;
    text-align: right;
}
.sector-overheat {
    font-size: 10px;
    color: #dc3545;
    margin-left: 4px;
}

/* ========== 快捷跳转卡 ========== */
.quick-jump-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    height: 100%;
}
.etf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.etf-chips .chip {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    background: #f1f3f5;
    color: #495057;
    border-radius: 20px;
    text-decoration: none;
    transition: background .15s;
}
.etf-chips .chip:hover { background: #dee2e6; }

/* ========== 详情页 header ========== */
.etf-header {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 18px;
}

/* ========== 信号表格 ========== */
.signal-table-card .table { font-size: 14px; }
.signal-table-card thead th { font-weight: 600; color: #555; }

/* ========== 收藏 chip ========== */
.etf-chips .chip-favorite {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px 3px 10px;
    border-radius: 20px;
    font-size: 12px;
}
.etf-chips .chip-favorite a { color: #856404; text-decoration: none; }
.etf-chips .chip-favorite a:hover { text-decoration: underline; }
.etf-chips .chip-close {
    background: transparent;
    border: none;
    color: #b58900;
    font-size: 14px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}
.etf-chips .chip-close:hover { color: #dc3545; }

/* ========== 偏好预设卡片 ========== */
.preset-cards .preset-card {
    cursor: pointer !important;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0 !important;
    transition: border-color .2s, box-shadow .2s, background .2s;
    background: #fff;
    height: 100%;
    user-select: none;
}
.preset-cards .preset-card:hover { border-color: #0d6efd; box-shadow: 0 4px 12px rgba(13,110,253,.15); }
.preset-cards .preset-card:hover .preset-fill-badge { background: #0d6efd; color: #fff; }
.preset-cards .preset-card.active { border-color: #0d6efd; background: #eff6ff; }
.preset-cards .preset-card.active .preset-fill-badge { background: #0d6efd; color: #fff; }
.preset-card .preset-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.preset-card .preset-desc { font-size: 12px; color: #6c757d; line-height: 1.5; }
.preset-fill-badge {
    cursor: pointer;
    display: inline-block;
    padding: 2px 10px;
    font-size: 11px;
    border-radius: 12px;
    background: #e9ecef;
    color: #495057;
    transition: all .2s;
    border: 1px solid #dee2e6;
}

/* ========== 微笑曲线偏好开关 ========== */
.smile-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.smile-toggle-wrapper .form-check-input {
    width: 48px;
    height: 24px;
}

/* ========== 信号中心 ========== */
.etf-signal-summary .badge { margin-right: 6px; }
.signal-table td { vertical-align: middle; }
.signal-table .fund-fav-btn {
    background: transparent;
    border: none;
    color: #ffc107;
    cursor: pointer;
    padding: 2px 6px;
}
.signal-table .fund-fav-btn:hover { color: #fd7e14; }
.amount-positive { color: #dc3545; font-weight: 600; }
.amount-negative { color: #198754; font-weight: 600; }
.amount-neutral { color: #6c757d; }

/* ========== 确认操盘模态框 ========== */
.confirm-modal .modal-amount-input {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}
.confirm-modal .modal-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.confirm-modal .modal-info-row:last-child { border-bottom: none; }

/* 快捷本金按钮 */
.capital-quick-btn {
    font-size: 12px;
    padding: 2px 10px;
    margin-right: 4px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .fg-bar-wrapper { width: 100%; min-width: 0; margin-top: 12px; }
    .stat-card .stat-value { font-size: 15px; }
    .stat-card { padding: 6px 8px; }
    .stat-card .stat-label { font-size: 10px; margin-bottom: 1px; }
    .capital-overview-card .cap-value { font-size: 14px; }
    .smile-zone-labels { font-size: 8px; }
}

/* ========== 图表全屏 ========== */
.chart-card { position: relative; }
.chart-card .btn-fullscreen {
    opacity: 0.5;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 14px;
    transition: opacity .2s;
}
.chart-card:hover .btn-fullscreen { opacity: 1; }
.chart-fullscreen {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    background: #fff;
    padding: 48px 16px 16px;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden;
}
.chart-fullscreen .card-body,
.chart-fullscreen > div[id^="chart-"] {
    width: 100% !important;
    height: calc(100vh - 64px) !important;
}
.chart-fullscreen-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.3);
    z-index: 9998;
}
.btn-fullscreen-exit {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 10000;
    font-size: 20px;
}
