/* A股策略实验室 - 样式 */
:root {
    --bg: #0d1117;
    --card-bg: #161b22;
    --border: #30363d;
    --text: #c9d1d9;
    --text-dim: #8b949e;
    --up: #ef4444;
    --down: #22c55e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --btn-primary: #238636;
    --btn-primary-hover: #2ea043;
    --btn-danger: #da3633;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* 顶部导航 */
.top-bar {
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: #010409;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 24px;
    flex-shrink: 0;
}
.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 8px rgba(88,166,255,0.3);
}
.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}
.logo-tag {
    font-size: 10px;
    color: var(--text-dim);
    background: rgba(88,166,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    border: 1px solid rgba(88,166,255,0.2);
}

.nav-tabs { display: flex; gap: 4px; flex: 1; }

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dim);
    font-size: 14px;
}
.nav-tab:hover { background: var(--card-bg); color: var(--text); }
.nav-tab.active { background: var(--accent); color: #fff; }
.tab-icon { font-size: 16px; }

.top-right { display: flex; align-items: center; gap: 16px; }

.engine-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    background: #21262d;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
}
.engine-status.on { background: #0d3320; color: #3fb950; border: 1px solid #238636; }

.clock { color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; }

/* 页面容器 */
.page { padding: 16px 24px; min-height: calc(100vh - 56px); }

.section-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.section-row.flex-1 { flex: 1; min-height: 0; }

/* 卡片 */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    min-width: 0;
}
.card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.card-header h3 { margin-bottom: 0; }

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* 大盘指数 */
.index-card {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
}
.idx-name { font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.idx-price { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.idx-change { font-size: 13px; font-variant-numeric: tabular-nums; }

/* 涨跌颜色 */
.up, .rise { color: var(--up); }
.down, .fall { color: var(--down); }

/* 自选股搜索 */
.search-box {
    display: flex;
    gap: 6px;
}
.search-box input {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--text);
    font-size: 13px;
    width: 180px;
    outline: none;
}
.search-box input:focus { border-color: var(--accent); }
.search-box button {
    background: var(--btn-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 14px;
    cursor: pointer;
    font-size: 13px;
}

.search-results {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
    max-height: 150px;
    overflow-y: auto;
}
.search-item {
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.search-item:hover { background: #1c2128; }
.add-btn { color: var(--accent); font-size: 12px; }

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--text-dim);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #21262d;
    white-space: nowrap;
}
.data-table .clickable-row { cursor: pointer; }
.data-table .clickable-row:hover { background: #1c2128; }

.del-btn { color: var(--btn-danger); cursor: pointer; font-size: 12px; }
.del-btn:hover { text-decoration: underline; }

.empty { text-align: center; color: var(--text-dim); padding: 20px !important; }

/* K线图 */
.kline-card { display: flex; flex-direction: column; }
.chart-container { flex: 1; min-height: 350px; }

.kline-period { display: flex; gap: 4px; }
.kline-period button {
    background: #21262d;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 3px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.kline-period button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* 账户 */
.account-card { min-width: 320px; }
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.acc-item label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 2px; }
.acc-item .val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

.stats-grid { grid-template-columns: repeat(4, 1fr); }

/* 下单面板 */
.order-card { min-width: 340px; }
.order-form { display: flex; flex-direction: column; gap: 10px; }

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-row label {
    width: 80px;
    text-align: right;
    color: var(--text-dim);
    font-size: 13px;
    flex-shrink: 0;
}
.form-row input, .form-row select {
    flex: 1;
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--accent); }
.form-row select { cursor: pointer; }
.form-row.estimated .val { font-size: 15px; font-weight: 600; }

.order-btns { display: flex; gap: 12px; margin-top: 6px; }
.btn-buy, .btn-sell {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-buy { background: var(--up); color: #fff; }
.btn-sell { background: var(--down); color: #fff; }
.btn-buy:hover, .btn-sell:hover { opacity: 0.85; }

.btn-primary {
    background: var(--btn-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}
.btn-primary:hover { background: var(--btn-primary-hover); }

.btn-cancel {
    background: #21262d;
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 12px;
    cursor: pointer;
}

.btn-sm {
    background: #21262d;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 4px;
}
.btn-sm.btn-resume { color: #3fb950; border-color: #238636; }
.btn-sm.btn-del { color: var(--btn-danger); border-color: #da3633; }

.status-active { color: #3fb950; }
.status_paused, .status-paused { color: #d29922; }
.status_completed, .status-completed { color: var(--text-dim); }

/* 策略创建 */
.strategy-create-card { min-width: 380px; }

/* 历史行情查询 */
.history-query {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.history-query input, .history-query select {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.history-query input { width: 150px; }
.history-query button {
    background: var(--btn-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 13px;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeIn 0.3s;
}
.toast.success { background: #0d3320; color: #3fb950; border: 1px solid #238636; }
.toast.error { background: #3d1214; color: #f85149; border: 1px solid #da3633; }
.toast.info { background: #0c2d6b; color: #58a6ff; border: 1px solid #1f6feb; }

@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* 策略实验室 */
.lab-config-card { min-width: 280px; }
.lab-form { display: flex; flex-direction: column; gap: 10px; }
.lab-form .hint { color: var(--text-dim); font-size: 12px; margin-left: 6px; }
.lab-strategy-card { flex: 1; }
.strategy-slots { display: flex; flex-direction: column; gap: 12px; }
.strategy-slot {
    background: #0d1117;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 12px;
    transition: border-left-color 0.2s;
}
.slot-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.slot-label {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.slot-name { flex: 1; }
.slot-params {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.param-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.param-row label {
    color: var(--text-dim);
    font-size: 12px;
    white-space: nowrap;
}
.param-row input, .param-row select {
    width: 90px;
    background: #161b22;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.param-row input:focus, .param-row select:focus { border-color: var(--accent); }

.btn-add-strategy {
    background: #21262d;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    padding: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-add-strategy:hover { border-color: var(--accent); color: var(--accent); }

.btn-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-run-backtest {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #238636 0%, #1f6feb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
}
.btn-run-backtest:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-run-backtest:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-export {
    padding: 14px 20px;
    background: #21262d;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-export:hover { background: #30363d; border-color: var(--accent); }

/* 预设选择 */
.preset-row .preset-select {
    flex: 1;
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}
.preset-row .preset-select:focus { border-color: var(--accent); }

/* 最优高亮 */
.badge-hint {
    font-size: 12px;
    font-weight: 400;
    color: #e3b341;
    margin-left: 8px;
}
.best-cell {
    position: relative;
    background: rgba(227, 179, 65, 0.08);
}
.best-star {
    color: #e3b341;
    font-weight: 700;
    font-size: 14px;
    margin-left: 2px;
}

/* 折叠区域 */
.strategy-mgmt-card { margin-top: 16px; }
.collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.collapse-header h3 { margin-bottom: 0; }
.collapse-toggle {
    color: var(--text-dim);
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 4px;
    background: #21262d;
}
.collapse-body {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 回测结果 */
.backtest-results { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }

.metrics-compare-table-wrap { overflow-x: auto; }
.metrics-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.metrics-compare-table th, .metrics-compare-table td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}
.metrics-compare-table th:first-child, .metrics-compare-table td:first-child { text-align: left; }
.metrics-compare-table thead th {
    background: #0d1117;
    font-weight: 600;
    position: sticky;
    top: 0;
}
.metric-name { color: var(--text-dim); font-weight: 500; white-space: nowrap; }

.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

.trade-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}
.trade-tabs button {
    background: #21262d;
    border: 1px solid var(--border);
    border-radius: 6px 6px 0 0;
    color: var(--text-dim);
    padding: 6px 16px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.trade-tabs button.active {
    background: var(--card-bg);
    border-bottom-color: var(--card-bg);
    color: var(--accent);
}

/* 占位符 */
.lab-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}
.placeholder-content { text-align: center; color: var(--text-dim); }
.placeholder-icon { font-size: 48px; color: var(--accent); margin-bottom: 16px; }
.placeholder-content h3 { color: var(--text); font-size: 18px; margin-bottom: 8px; }
.placeholder-content p { font-size: 14px; margin-bottom: 20px; }
.placeholder-features { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.feature {
    background: #21262d;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
    color: var(--accent);
}

/* 响应式 */
@media (max-width: 1200px) {
    .section-row { flex-wrap: wrap; }
    .flex-1, .flex-2, .flex-3 { flex: 1 1 100% !important; min-width: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .metrics-compare-table { font-size: 12px; }
    .metrics-compare-table th, .metrics-compare-table td { padding: 6px 8px; }
}

/* ===== 智能选股 ===== */
.screener-config-card { min-width: 280px; max-width: 320px; }
.screener-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.screener-form .form-row { margin: 0; }
.screener-form select, .screener-form input[type="number"] { width: 100%; }
.btn-run-screener { margin-top: 4px; width: 100%; padding: 10px; font-size: 15px; }

.screener-strategy-desc { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.screener-strategy-desc p { color: var(--text-dim); font-size: 13px; margin-bottom: 8px; line-height: 1.6; }
.weight-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.weight-tag { display: inline-block; background: #21262d; border: 1px solid var(--border); border-radius: 12px;
              padding: 2px 10px; font-size: 12px; color: var(--accent); white-space: nowrap; }

.screener-radar-card { min-height: 400px; }
.screener-detail-info { margin-bottom: 8px; font-size: 18px; font-weight: 700; }

.factor-detail-list { max-height: 200px; overflow-y: auto; margin-top: 12px; }
.factor-detail-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px;
                      border-bottom: 1px solid #21262d; }
.fd-label { width: 70px; color: var(--text); font-weight: 500; }
.fd-category { width: 40px; color: var(--text-dim); font-size: 11px; }
.fd-value { flex: 1; color: var(--text-dim); }
.fd-score { width: 40px; text-align: right; font-weight: 600; }
.score-high { color: #3fb950; }
.score-mid { color: #d29922; }
.score-low { color: #f97583; }

.screener-table { font-size: 13px; }
.screener-table th { white-space: nowrap; }
.rank-cell { font-weight: 700; text-align: center; }
.rank-top { color: #d29922; font-size: 15px; }
.score-cell { display: flex; align-items: center; gap: 6px; }
.score-bar { flex: 1; height: 8px; background: #21262d; border-radius: 4px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.screener-table .selected { background: rgba(88,166,255,0.08); }

.btn-add-watch { font-size: 12px; padding: 2px 8px; background: var(--btn-primary); color: #fff;
                 border: none; border-radius: 4px; cursor: pointer; }
.btn-add-watch:hover { background: var(--btn-primary-hover); }

.card-header-right { display: flex; align-items: center; gap: 12px; }
.screener-meta { color: var(--text-dim); font-size: 12px; }

.screener-loading-card { text-align: center; padding: 60px 20px; }
.loading-spinner { display: inline-block; width: 40px; height: 40px; border: 3px solid var(--border);
                   border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.screener-loading-card p { color: var(--text-dim); }

.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ===== 通知系统 ===== */
.notif-bell { position: relative; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
              transition: background 0.2s; user-select: none; }
.notif-bell:hover { background: var(--card-bg); }
.notif-badge { position: absolute; top: -2px; right: -2px; background: #f97583; color: #fff;
               font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px;
               display: flex; align-items: center; justify-content: center; font-weight: 700; }

.notif-panel { position: absolute; top: 52px; right: 20px; width: 360px; max-height: 480px;
               background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
               box-shadow: 0 8px 32px rgba(0,0,0,0.5); z-index: 200; overflow: hidden; }
.notif-panel-header { display: flex; justify-content: space-between; align-items: center;
                      padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-panel-header h3 { font-size: 14px; margin: 0; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #21262d;
              cursor: pointer; transition: background 0.15s; }
.notif-item:hover { background: #21262d; }
.notif-item.unread { background: rgba(88,166,255,0.06); }
.notif-type-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap;
                    background: #21262d; color: var(--accent); font-weight: 500; align-self: flex-start; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-body { font-size: 12px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-suggestion { font-size: 12px; color: #d2a8ff; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: italic; }
.notif-time { font-size: 11px; color: #484f58; margin-top: 2px; }
.notif-empty { text-align: center; padding: 40px; color: var(--text-dim); font-size: 13px; }

/* 今日动态 */
.today-dash { margin-bottom: 16px; }
.today-dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.today-dash-header h3 { font-size: 15px; margin: 0; }
.today-date { font-size: 12px; color: var(--text-dim); }
.today-stats { display: flex; gap: 24px; margin-bottom: 12px; }
.today-stat { display: flex; flex-direction: column; align-items: center; }
.ts-num { font-size: 24px; font-weight: 700; color: var(--accent); }
.ts-num.alert-stat { color: #d29922; }
.ts-num.trade-stat { color: #3fb950; }
.ts-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.today-events { display: flex; flex-direction: column; gap: 6px; }
.today-event-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.te-type { font-size: 11px; padding: 1px 8px; border-radius: 8px; background: #21262d; color: var(--accent); }
.te-title { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-time { color: var(--text-dim); font-size: 12px; font-variant-numeric: tabular-nums; }

.perf-cell { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; text-align: center; }

/* ===== 统计显著性检验 ===== */
.stat-test-card h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat-summary { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 16px; background: #161b22; border-radius: 8px; margin-bottom: 16px; }
.stat-summary-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.stat-summary-row.stat-recommendation { width: 100%; margin-top: 4px; }
.stat-label { color: var(--text-dim); }
.stat-value { color: var(--text); font-weight: 500; }
.stat-value.stat-best { color: #3fb950; font-weight: 700; }
.stat-pair-block { margin-bottom: 16px; border: 1px solid #30363d; border-radius: 8px; overflow: hidden; }
.stat-pair-title { padding: 8px 16px; background: #21262d; color: var(--accent); font-size: 14px; margin: 0; }
.stat-test-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.stat-test-table th { padding: 8px 10px; background: #161b22; color: var(--text-dim); text-align: left; font-weight: 500; border-bottom: 1px solid #30363d; white-space: nowrap; }
.stat-test-table td { padding: 6px 10px; border-bottom: 1px solid #21262d; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-test-table tr.stat-significant td { background: rgba(63,185,80,0.06); }
.stat-test-table tr.stat-insignificant td { background: transparent; }
.sig-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.sig-yes { background: rgba(63,185,80,0.15); color: #3fb950; }
.sig-no { background: rgba(139,148,158,0.15); color: #8b949e; }
.p-significant { color: #3fb950; font-weight: 700; }
.effect-大效应 { color: #f85149; font-weight: 600; }
.effect-中等效应 { color: #d29922; font-weight: 600; }
.effect-小效应 { color: #58a6ff; }
.effect-忽略不计 { color: #8b949e; }
.stat-verdict { max-width: 260px; font-size: 11px; color: var(--text-dim); line-height: 1.4; }

/* ===== 个股简介 ===== */
.stock-profile-card { margin-top: 16px; }
.profile-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.profile-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-title h3 { margin: 0; }
.profile-code { font-size: 14px; color: var(--text-dim); font-family: monospace; }
.profile-industry { font-size: 11px; padding: 2px 10px; border-radius: 10px; background: rgba(88,166,255,0.15); color: #58a6ff; }
.profile-market { font-size: 11px; padding: 2px 10px; border-radius: 10px; background: rgba(63,185,80,0.15); color: #3fb950; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 24px; margin-bottom: 16px; }
.profile-item { display: flex; gap: 8px; font-size: 13px; line-height: 1.5; }
.profile-item label { color: var(--text-dim); white-space: nowrap; min-width: 70px; flex-shrink: 0; }
.profile-item span { color: var(--text); word-break: break-all; }
.profile-item a { color: var(--accent); text-decoration: none; }
.profile-item a:hover { text-decoration: underline; }
.profile-indices { font-size: 12px; color: var(--text-dim); }
.profile-section { margin-bottom: 12px; }
.profile-section h4 { font-size: 13px; color: var(--accent); margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid #21262d; }
.profile-section p { font-size: 13px; color: var(--text); line-height: 1.7; margin: 0; }

/* ===== T+1 冻结标记 ===== */
.t1-warn { color: #d29922; font-weight: 600; }
.t1-frozen { color: #d29922; font-size: 12px; }

/* ===== 数据完整度 ===== */
.data-completeness-badge {
    font-size: 12px; padding: 2px 10px; border-radius: 10px; font-weight: 600; white-space: nowrap;
}
.data-completeness-badge.dc-good { background: rgba(63,185,80,0.15); color: #3fb950; }
.data-completeness-badge.dc-warn { background: rgba(210,153,34,0.15); color: #d29922; }
.data-completeness-badge.dc-bad { background: rgba(249,117,131,0.15); color: #f97583; }

.dc-tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
.dc-tag.dc-good { background: rgba(63,185,80,0.15); color: #3fb950; }
.dc-tag.dc-warn { background: rgba(210,153,34,0.15); color: #d29922; }
.dc-tag.dc-bad { background: rgba(249,117,131,0.15); color: #f97583; }

.dc-inline { font-size: 12px; margin-left: 12px; padding: 2px 10px; border-radius: 10px; font-weight: 500; }
.dc-inline.dc-good { background: rgba(63,185,80,0.15); color: #3fb950; }
.dc-inline.dc-warn { background: rgba(210,153,34,0.15); color: #d29922; }
.dc-inline.dc-bad { background: rgba(249,117,131,0.15); color: #f97583; }

.fd-missing { color: #484f58; font-style: italic; }
.fd-approx { font-size: 10px; background: rgba(210,153,34,0.2); color: #d29922; padding: 1px 5px; border-radius: 6px; margin-left: 4px; font-style: normal; vertical-align: middle; }

/* ===== 策略信号状态 ===== */
.signal-cell { font-size: 12px; }
.signal-idle { color: var(--text-dim); }
.signal-long_entered { color: #3fb950; font-weight: 600; }
.perf-cell { font-size: 12px; color: var(--text-dim); }

/* ===== 底部联系方式 ===== */
.app-footer {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    border-top: 1px solid var(--border);
    gap: 24px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 280px;
}
.footer-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px rgba(88,166,255,0.25);
    transition: transform 0.3s;
}
.footer-logo:hover { transform: scale(1.1); }

.footer-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.footer-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}
.footer-desc {
    font-size: 12px;
    color: var(--text-dim);
    max-width: 320px;
    line-height: 1.5;
}

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

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    transition: all 0.3s;
}
.contact-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(88,166,255,0.1);
}

.contact-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.contact-icon { font-size: 16px; }
.contact-title { color: var(--accent); }

.contact-body {
    display: flex;
    align-items: center;
    gap: 12px;
}
.xiaohongshu-qr {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    transition: transform 0.3s;
}
.xiaohongshu-qr:hover { transform: scale(1.8); z-index: 10; }

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.contact-id {
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.contact-hint {
    font-size: 11px;
    color: var(--text-dim);
}

/* ===== 估值分析 ===== */
.valuation-search-card { min-width: 300px; }

.valuation-price-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}
.vp-current, .vp-fair {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.vp-label { font-size: 13px; color: var(--text-dim); }
.vp-value { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vp-current .vp-value { color: var(--text); }
.vp-fair .vp-value { color: var(--accent); }
.vp-arrow { font-size: 24px; color: var(--text-dim); }

.valuation-upside {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}
.valuation-upside.up { color: #3fb950; }
.valuation-upside.down { color: #f97583; }

.valuation-recommendation {
    text-align: center;
    margin-bottom: 12px;
}
.recommendation-badge {
    display: inline-block;
    padding: 6px 24px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
}
.badge-undervalued { background: rgba(63,185,80,0.15); color: #3fb950; border: 1px solid #238636; }
.badge-overvalued { background: rgba(249,117,131,0.15); color: #f97583; border: 1px solid #da3633; }
.badge-fair { background: rgba(210,153,34,0.15); color: #d29922; border: 1px solid #9e6a03; }

.valuation-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 13px;
    color: var(--text-dim);
}

.view-mode-tabs {
    display: flex;
    gap: 4px;
}
.view-mode-tabs button {
    background: #21262d;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.view-mode-tabs button:hover { background: #30363d; color: var(--text); }
.view-mode-tabs button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.valuation-summary-card { min-width: 320px; }

.valuation-financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.vf-item { display: flex; flex-direction: column; gap: 2px; }
.vf-item label { font-size: 11px; color: var(--text-dim); }
.vf-item span { font-size: 14px; color: var(--text); font-weight: 500; }

.valuation-loading-card { text-align: center; padding: 40px 20px; }

.method-ok { color: #3fb950; font-weight: 700; }
.method-na { font-size: 11px; color: #484f58; font-style: italic; }
.text-dim { color: var(--text-dim); }

.tag-industry {
    font-size: 11px; padding: 1px 8px; border-radius: 8px;
    background: rgba(88,166,255,0.12); color: #58a6ff; white-space: nowrap;
}
.val-highlight { font-variant-numeric: tabular-nums; }

/* 响应式：小屏幕时footer垂直排列 */
@media (max-width: 768px) {
    .app-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-brand {
        min-width: auto;
        width: 100%;
    }
    .footer-contact {
        width: 100%;
    }
    .contact-card {
        min-width: auto;
        width: 100%;
    }
    .logo-img { width: 28px; height: 28px; }
    .logo-text { font-size: 14px; }
    .logo-tag { display: none; }
}
