/* 康博投资量化交易系统 —— 浅色交易终端风格（匹配 IDE light theme） */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e2e5ea;
  --text: #1a1f2e;
  --text-dim: #6b7280;
  --header: #1f2937;
  --accent: #2563eb;
  /* 涨跌色（统一红涨绿跌 —— 中国惯例） */
  --up-intl: #dc2626;   /* 涨=红 */
  --down-intl: #16a34a; /* 跌=绿 */
  --up-cn: #dc2626;     /* 涨=红 */
  --down-cn: #16a34a;   /* 跌=绿 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

/* 顶栏 */
.topbar {
  background: var(--header);
  color: #fff;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-size: 16px; font-weight: 600; }
.status { display: flex; gap: 8px; align-items: center; }
.badge {
  background: rgba(255,255,255,.12);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
}
.badge.env { cursor: pointer; background: rgba(255,255,255,.2); }
.badge.env.real { background: #b91c1c; }
.badge.ok { background: #16a34a; }
.badge.err { background: #b91c1c; }
.badge.session-regular { background: #dc2626; }
.badge.session-pre { background: #2563eb; }
.badge.session-post { background: #7c3aed; }
.badge.session-overnight { background: #1e3a8a; }
.badge.session-closed { background: #6b7280; }

/* 标签 */
.tabs { display: flex; background: var(--panel); border-bottom: 1px solid var(--border); padding: 0 18px; }
.tab {
  background: none; border: none; padding: 12px 20px; cursor: pointer;
  font-size: 14px; color: var(--text-dim); border-bottom: 2px solid transparent;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

main { padding: 14px 18px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 工具栏 */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar input, .card input, .card select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; background: #fff; }
button {
  padding: 6px 14px; border: 1px solid var(--border); background: #fff; cursor: pointer;
  border-radius: 4px; font-size: 13px; color: var(--text);
}
button:hover { background: #f0f2f5; }
.btn-buy { background: var(--up-intl); color: #fff; border: none; width: 100%; padding: 9px; font-weight: 600; }
.btn-buy:hover { opacity: .9; background: var(--up-intl); }
.hint { color: var(--text-dim); font-size: 12px; }

/* 行情表 */
.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; overflow: auto; }
.quote-table { width: 100%; border-collapse: collapse; }
.quote-table th, .quote-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.quote-table th { background: #f9fafb; text-align: left; font-weight: 600; color: var(--text-dim); position: sticky; top: 0; }
.quote-table th.r, .quote-table td.r { text-align: right; }
.quote-table tbody tr:hover { background: #f9fafb; }
.empty { text-align: center; color: var(--text-dim); padding: 24px; }
.up-intl { color: var(--up-intl); font-weight: 600; }
.down-intl { color: var(--down-intl); font-weight: 600; }
.up-cn { color: var(--up-cn); font-weight: 600; }
.down-cn { color: var(--down-cn); font-weight: 600; }
.flash { animation: flash 0.6s; }
@keyframes flash { 0% { background: #fffde7; } 100% { background: transparent; } }

/* 交易 */
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 14px; }
.card h3 { font-size: 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.card input, .card select { width: 100%; margin-bottom: 8px; }
.row { display: flex; gap: 8px; }
.row select, .row button { flex: 1; }
.acct-info { font-size: 12px; color: var(--text-dim); line-height: 1.8; }
.warn { font-size: 12px; color: #b45309; margin-top: 6px; }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th, .mini-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px; }
.mini-table th { color: var(--text-dim); text-align: left; }
.mini-table th.r, .mini-table td.r { text-align: right; }
.table-wrap.sm { max-height: 320px; overflow: auto; }

/* 行情时段切换 */
.session-selector { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.session-selector .session-label { font-size: 12px; color: var(--text-dim); margin-right: 4px; }
.session-selector button { padding: 4px 10px; font-size: 12px; border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; }
.session-selector button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 个股详情模态框时段选择器 */
.detail-session-bar { display: flex; align-items: center; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: #f9fafb; }
.detail-session-bar .session-label { font-size: 12px; color: var(--text-dim); margin-right: 4px; }
.detail-session-bar button { padding: 3px 10px; font-size: 12px; border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; }
.detail-session-bar button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.detail-current-session { margin-left: auto; font-size: 11px; color: var(--text-dim); }

/* 图表提示框 */
.chart-wrap { position: relative; }
.chart-tooltip {
  position: absolute; display: none; pointer-events: none;
  background: rgba(30,34,45,0.97); border: 1px solid #363a45;
  border-radius: 6px; padding: 10px 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  font-size: 12px; line-height: 1.6; min-width: 170px; z-index: 10;
}
.chart-tooltip .tt-time { font-weight: 600; margin-bottom: 6px; color: #d1d4dc; border-bottom: 1px solid #2a2e39; padding-bottom: 4px; font-size: 11px; }
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; }
.chart-tooltip .tt-label { color: #787b86; }
.chart-tooltip .tt-val { font-family: 'Courier New', monospace; font-weight: 600; color: #d1d4dc; }

/* 期权链 */
.detail-options, .detail-etf { padding: 12px; }
.options-expirations { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.options-expirations button { padding: 5px 12px; font-size: 12px; border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; }
.options-expirations button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.options-summary { display: flex; gap: 16px; font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.options-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.options-table th, .options-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.options-table th:first-child, .options-table td:first-child { text-align: left; }
.options-table th { background: #f9fafb; color: var(--text-dim); font-weight: 600; }
.options-table .opt-call { color: var(--up-intl); }
.options-table .opt-put { color: var(--down-intl); }
.options-table .opt-strike { font-weight: 600; }

/* 持仓名称可点击 */
.pos-name-clickable { color: var(--accent); cursor: pointer; text-decoration: underline; }
.pos-name-clickable:hover { color: #1e4fd8; }

/* 自选股列表滚动 */
.watchlist-wrap {
  max-height: 70vh;
  overflow-y: auto;
}

/* 批量删除 checkbox */
.watch-chk { cursor: pointer; }
#selectAllChk { cursor: pointer; }
#batchDeleteBtn:hover { background: #e74c3c; color: #fff; }

/* "已加入" 标签 */
.btn-added-watch {
  display: inline-block; padding: 2px 8px; font-size: 11px;
  background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9;
  border-radius: 3px; font-weight: 600;
}

/* ==================== 个股详情（富途风格）==================== */
.detail-modal { width: 1200px; max-width: 98vw; max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.detail-modal .modal-body { flex: 1; overflow: hidden; padding: 0; }

/* 详情头部 */
.detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: #fff;
  flex-shrink: 0;
}
.detail-header-left { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.detail-name { font-size: 18px; font-weight: 600; color: var(--text); }
.detail-code { font-size: 13px; color: var(--text-dim); font-family: 'Courier New', monospace; }
.detail-header-center { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 0 20px; }
.detail-price-row { display: flex; align-items: baseline; gap: 12px; }
.detail-price { font-size: 32px; font-weight: 700; font-family: 'Courier New', monospace; letter-spacing: -0.5px; }
.detail-change { font-size: 18px; font-weight: 600; }
.detail-change-pct { font-size: 18px; font-weight: 600; }
.detail-update-time { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.detail-close-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; line-height: 1; }
.detail-close-btn:hover { color: #333; }

/* 详情标签 */
.detail-tabs {
  display: flex; border-bottom: 1px solid var(--border); background: #fafbfc; flex-shrink: 0;
}
.detail-tab {
  padding: 10px 22px; border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--text-dim); border-bottom: 2px solid transparent;
}
.detail-tab:hover { color: var(--text); background: #f0f1f3; }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; background: #fff; }

/* 详情主体：左右分栏 */
.detail-body { display: flex; height: 100%; overflow: hidden; }
.detail-main { flex: 1.35; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow: hidden; }
.detail-sidebar { flex: 0.65; min-width: 320px; max-width: 420px; background: #fafbfc; overflow-y: auto; }

/* 内容面板 */
.detail-tab-content { flex: 1; overflow-y: auto; padding: 12px; }
.dtab-panel { display: none; }
.dtab-panel.active { display: block; }

/* K线工具栏 */
.detail-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding: 0 4px;
}
.detail-ktype-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.detail-ktype-btns button {
  padding: 3px 10px; border: 1px solid var(--border); background: #fff; border-radius: 4px;
  cursor: pointer; font-size: 12px; color: var(--text-dim);
}
.detail-ktype-btns button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.detail-kline-info { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* 缩放信息 */
.chart-zoom-info { font-size: 11px; color: #999; white-space: nowrap; }
.chart-zoom-info button {
  padding: 1px 8px; border: 1px solid #ddd; background: #f5f5f5; border-radius: 3px;
  cursor: pointer; font-size: 11px; color: #666; margin-left: 6px;
}
.chart-zoom-info button:hover { background: #e8e8e8; }

/* 图表+内嵌盘口布局 */
.chart-main-row { display: flex; gap: 0; }
.chart-main-row .chart-wrap { flex: 1; min-width: 0; }
.chart-ob-inline {
  width: 180px; flex-shrink: 0; border-left: 1px solid #e8e8e8; padding: 0 8px;
  background: #fafafa; overflow-y: auto; max-height: 500px;
}
.chart-ob-title { font-size: 12px; font-weight: 600; color: #888; padding: 6px 0 4px; border-bottom: 1px solid #eee; margin-bottom: 4px; text-align: center; }
.chart-ob-content { font-size: 11px; }
.chart-ob-content .ob-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 4px; font-family: 'Courier New', monospace; font-size: 11px;
  border-bottom: 1px solid #f0f0f0;
}
.chart-ob-content .ob-row.ask .ob-price { color: #27ae60; }
.chart-ob-content .ob-row.bid .ob-price { color: #e74c3c; }
.chart-ob-content .ob-label { color: #999; font-size: 10px; min-width: 28px; }
.chart-ob-content .ob-price { font-weight: 600; flex: 1; text-align: right; }
.chart-ob-content .ob-vol { color: #aaa; font-size: 10px; min-width: 45px; text-align: right; }
.chart-ob-content .ob-sep { border-top: 1px dashed #ccc; margin: 4px 0; }
.chart-ob-content .ob-spread {
  text-align: center; padding: 3px 0; font-size: 10px; color: #888;
}
.chart-ob-content .ob-latest {
  text-align: center; padding: 2px 0; font-size: 12px; font-weight: 700;
  font-family: 'Courier New', monospace;
}

/* 图表滚动条 */
.chart-scrollbar {
  height: 14px; background: #f5f5f5; border-top: 1px solid #e0e0e0;
  position: relative; cursor: pointer; user-select: none;
}
.chart-scroll-thumb {
  position: absolute; top: 2px; bottom: 2px; background: #c0c0c0;
  border-radius: 7px; min-width: 20px; cursor: grab;
}
.chart-scroll-thumb:active { cursor: grabbing; background: #999; }
.chart-scroll-thumb:hover { background: #a8a8a8; }

/* 5日分时图例 */
.chart-5d-legend {
  position: absolute; top: 8px; left: 16px;
  display: flex; gap: 10px; font-size: 10px; color: #666; z-index: 10;
}
.chart-5d-legend .legend-item { display: flex; align-items: center; gap: 3px; }
.chart-5d-legend .legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* 盘口样式 */
.detail-orderbook { padding: 12px; }
.detail-orderbook h4 { font-size: 14px; margin: 0 0 12px; color: #555; }
.detail-ob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-ob-col h5 { font-size: 12px; color: #888; margin: 0 0 8px; font-weight: 600; }
.detail-ob-row {
  display: flex; justify-content: space-between; padding: 5px 8px; border-bottom: 1px solid #f0f0f0;
  font-size: 13px; font-family: 'Courier New', monospace;
}
.detail-ob-row .ob-price { font-weight: 600; }
.detail-ob-row .ob-vol { color: #666; }
.detail-ob-ask .ob-price { color: #27ae60; } /* 卖盘价：绿 */
.detail-ob-bid .ob-price { color: #e74c3c; } /* 买盘价：红 */

/* 侧边栏信息 */
.sidebar-section { border-bottom: 1px solid var(--border); padding: 14px 16px; }
.sidebar-section:last-child { border-bottom: none; }
.sidebar-title { font-size: 12px; font-weight: 600; color: #888; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.info-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.info-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.info-row .info-label { color: #888; }
.info-row .info-value { font-weight: 600; font-family: 'Courier New', monospace; }
.info-value.up-intl, .info-value.up-cn { font-weight: 700; }
.info-value.down-intl, .info-value.down-cn { font-weight: 700; }
.info-full { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 8px; }
.info-full:last-child { margin-bottom: 0; }
.info-full .info-label { color: #888; }
.info-full .info-value { font-weight: 600; font-family: 'Courier New', monospace; }

/* 交易按钮 */
.detail-trade-row { display: flex; gap: 8px; margin-top: 12px; }
.detail-trade-row button { flex: 1; padding: 10px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; color: #fff; font-size: 14px; }
.detail-trade-row .btn-buy { background: var(--up-intl); }
.detail-trade-row .btn-sell { background: var(--down-intl); }
.detail-trade-row .btn-buy:hover, .detail-trade-row .btn-sell:hover { opacity: 0.9; }

/* 逐笔成交/新闻/基本面占位 */
.detail-placeholder { padding: 40px; text-align: center; color: var(--text-dim); font-size: 13px; }

@media (max-width: 1100px) {
  .detail-body { flex-direction: column; }
  .detail-sidebar { max-width: none; border-right: none; border-top: 1px solid var(--border); max-height: 45vh; }
  .detail-main { border-right: none; border-bottom: 1px solid var(--border); }
}
.btn-cancel { padding: 3px 8px; font-size: 11px; color: #b91c1c; }

/* 资讯 */
.news-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.news-list { max-height: 70vh; overflow: auto; }
.news-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.news-item a { color: var(--text); text-decoration: none; font-weight: 500; }
.news-item a:hover { color: var(--accent); }
.news-item .meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.news-item .src { background: #eef2ff; color: var(--accent); padding: 1px 6px; border-radius: 3px; margin-right: 6px; }

/* 情绪指数面板 */
.sentiment-panel { margin-bottom: 16px; }
.sentiment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sentiment-header h3 { margin: 0; font-size: 15px; }
.sentiment-header button { padding: 3px 12px; font-size: 12px; }
.sentiment-grid { display: grid; grid-template-columns: 1fr 1.3fr 1fr 1fr; gap: 14px; }
.sentiment-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; text-align: center; transition: border-color .2s;
}
.sentiment-card.danger { border-color: #e53e3e; box-shadow: 0 0 0 1px #e53e3e33; }
.sentiment-card.warning { border-color: #dd6b20; box-shadow: 0 0 0 1px #dd6b2033; }
.sentiment-card.safe { border-color: #38a169; }
.sentiment-card-title { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.sentiment-card-value { font-size: 32px; font-weight: 700; line-height: 1.2; }
.sentiment-card-status { font-size: 13px; font-weight: 600; margin-top: 4px; padding: 2px 10px; border-radius: 4px; display: inline-block; }
.sentiment-card-status.danger { background: #fed7d7; color: #c53030; }
.sentiment-card-status.warning { background: #feebc8; color: #c05621; }
.sentiment-card-status.safe { background: #c6f6d5; color: #276749; }
.sentiment-card-status.neutral { background: #e2e8f0; color: #4a5568; }
.sentiment-card-status.fear { background: #dbeafe; color: #2c5282; }
.sentiment-card-status.greed { background: #fef3c7; color: #92400e; }
.sentiment-card-desc { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.sentiment-card-thresholds { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; font-size: 10px; margin-top: 8px; }
.sentiment-card-thresholds .thr-low { color: #e53e3e; }
.sentiment-card-thresholds .thr-high { color: #dd6b20; }
.sentiment-card-thresholds .thr-safe { color: #38a169; }

/* CNN 仪表盘 */
.sentiment-gauge { margin-top: 10px; }
.gauge-bar { position: relative; height: 10px; border-radius: 5px; overflow: visible; display: flex; }
.gauge-zone { height: 100%; }
.gauge-zone.fear { background: #c53030; }
.gauge-zone.fear-mid { background: #ed8936; }
.gauge-zone.neutral { background: #ecc94b; }
.gauge-zone.greed-mid { background: #48bb78; }
.gauge-zone.greed { background: #2f855a; }
.gauge-pointer { position: absolute; top: -4px; width: 3px; height: 18px; background: #1a202c; border-radius: 2px; transform: translateX(-50%); transition: left .5s ease; z-index: 2; }
.gauge-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-dim); margin-top: 4px; }

/* 仓位预警弹窗 */
.alert-overlay { z-index: 2000; }
.alert-modal-box { max-width: 460px; }
.alert-modal-box .modal-header { display: none; }
.alert-modal-header { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.alert-icon { font-size: 24px; }
.alert-title { font-size: 18px; font-weight: 700; flex: 1; }
.alert-modal-header .modal-close { font-size: 22px; }
.alert-modal-body { padding: 20px; }
.alert-message { font-size: 15px; line-height: 1.5; margin-bottom: 16px; }
.alert-position-row { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 16px; background: var(--bg); border-radius: 8px; margin-bottom: 14px; }
.alert-position-item { text-align: center; }
.alert-position-label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.alert-position-value { font-size: 24px; font-weight: 700; }
.alert-position-value.target { color: #e53e3e; }
.alert-position-arrow { font-size: 20px; color: var(--text-dim); }
.alert-action { font-size: 14px; font-weight: 600; padding: 10px 14px; background: #fff3cd; color: #856404; border-radius: 6px; text-align: center; }
.alert-index-info { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 10px; }
.alert-modal-footer { display: flex; gap: 10px; padding: 0 20px 20px; }
.btn-alert-dismiss { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); cursor: pointer; font-size: 13px; }
.btn-alert-confirm { flex: 1; padding: 10px; border: none; border-radius: 6px; background: #e53e3e; color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-alert-confirm:hover { background: #c53030; }

/* toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--header); color: #fff;
  padding: 10px 16px; border-radius: 6px; opacity: 0; transition: opacity .3s; z-index: 99; max-width: 360px;
}
.toast.show { opacity: 1; }
.toast.err { background: #b91c1c; }

/* 个股KPI检查 */
.single-stock-check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px; background: #f0f4ff; border-radius: 6px; border: 1px solid #d0e0ff; }
.single-stock-check .check-label { font-size: 13px; font-weight: 600; color: #2962ff; white-space: nowrap; }
.single-stock-check button { padding: 5px 16px; border: none; border-radius: 4px; cursor: pointer; color: #fff; font-weight: 600; font-size: 13px; background: #2962ff; }
.single-stock-check button:hover { background: #1e4fd8; }
.single-stock-check button:disabled { background: #aaa; cursor: not-allowed; }
.single-check-result { margin-bottom: 16px; padding: 14px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; }
.single-check-result .scr-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.single-check-result .scr-code { font-size: 16px; font-weight: 700; color: #2962ff; cursor: pointer; }
.single-check-result .scr-name { font-size: 14px; color: #555; }
.single-check-result .scr-badge { padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.scr-badge.full { background: #fde8e8; color: #991b1b; }
.scr-badge.qualified { background: #fff3cd; color: #856404; }
.scr-badge.fail { background: #dcfce7; color: #166534; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.kpi-card { padding: 12px; border-radius: 8px; border: 1px solid #e0e0e0; text-align: center; }
.kpi-card.pass { background: #f0fff4; border-color: #c3e6cb; }
.kpi-card.fail { background: #fff5f5; border-color: #f5c6cb; }
.kpi-card.nodata { background: #f8f9fa; border-color: #e0e0e0; }
.kpi-card .kpi-title { font-size: 12px; color: #888; margin-bottom: 4px; }
.kpi-card .kpi-value { font-size: 18px; font-weight: 700; }
.kpi-card.pass .kpi-value { color: #27ae60; }
.kpi-card.fail .kpi-value { color: #e74c3c; }
.kpi-card.nodata .kpi-value { color: #aaa; }
.kpi-card .kpi-status { font-size: 11px; margin-top: 4px; }
.kpi-card.pass .kpi-status { color: #27ae60; }
.kpi-card.fail .kpi-status { color: #e74c3c; }
.kpi-card.nodata .kpi-status { color: #aaa; }

@media (max-width: 960px) {
  .trade-grid, .news-grid { grid-template-columns: 1fr; }
  .sentiment-grid { grid-template-columns: 1fr; }
}

/* ==================== PEG 个股情绪指数 ==================== */
.peg-criteria { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px; background: #f8f9fa; border-radius: 6px; }
.peg-low { color: #dc2626; }
.peg-high { color: #16a34a; }
.peg-fair { color: #888; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: #2962ff; }
.sortable span { font-size: 11px; }
.peg-assessment-low { color: #dc2626; font-weight: 600; }
.peg-assessment-high { color: #16a34a; font-weight: 600; }
.peg-assessment-fair { color: #888; }

/* PEG 预警详情 */
.peg-alert-detail { margin-top: 8px; }

/* ==================== 短线买卖信号（六维度评分）==================== */
.stm-score { font-size: 16px; font-weight: 700; font-family: 'Courier New', monospace; padding: 2px 8px; border-radius: 4px; }
.stm-buy { color: #991b1b; background: #fde8e8; }
.stm-sell { color: #166534; background: #dcfce7; }
.stm-neutral { color: #856404; background: #fff3cd; }
.stm-action { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 4px; display: inline-block; }
.dim-bar { display: flex; flex-wrap: wrap; gap: 4px; }
.dim-tag { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 500; white-space: nowrap; }
.dim-pos { background: #fde8e8; color: #991b1b; }
.dim-neg { background: #dcfce7; color: #166534; }
.dim-neu { background: #f0f0f0; color: #888; }

/* ==================== 单只股票短线六维度查询结果 ==================== */
.stm-single-result {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; margin-bottom: 14px;
}
.stm-single-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.stm-single-title { display: flex; align-items: center; gap: 10px; }
.stm-single-title .stm-code { font-size: 18px; font-weight: 700; color: var(--text); }
.stm-single-title .stm-name { font-size: 14px; color: var(--text-secondary, #666); }
.stm-single-title .stm-price { font-size: 16px; font-weight: 600; color: var(--accent, #1967d2); }
.stm-single-score { display: flex; align-items: center; gap: 10px; }
.stm-score-label { font-size: 12px; color: var(--text-secondary, #888); }
.stm-score-value { font-size: 24px; font-weight: 800; padding: 2px 12px; border-radius: 6px; }
.stm-boost { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #e8f0fe; color: #1967d2; }
.stm-action-badge { font-size: 14px; font-weight: 700; padding: 4px 14px; border-radius: 6px; }

/* 评判标准条 */
.stm-criteria-bar {
  display: flex; gap: 16px; margin-bottom: 14px; padding: 10px 12px;
  background: var(--bg-secondary, #f8f9fa); border-radius: 8px; flex-wrap: wrap;
}
.stm-criteria-box { flex: 1; min-width: 300px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stm-criteria-title { font-size: 12px; font-weight: 600; color: var(--text); margin-right: 4px; }
.stm-criteria-signal { flex: 1; min-width: 200px; }
.stm-criteria-signal .stm-signal-list li { border-bottom: none; padding: 2px 0; }

.stm-dim-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px;
}
.stm-dim-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px; transition: box-shadow .2s;
}
.stm-dim-card.dim-pos { border-left: 4px solid #dc2626; }
.stm-dim-card.dim-neg { border-left: 4px solid #16a34a; }
.stm-dim-card.dim-neu { border-left: 4px solid #ffc107; }
.stm-dim-header { display: flex; justify-content: space-between; align-items: center; }
.stm-dim-name { font-size: 13px; font-weight: 600; color: var(--text); }
.stm-dim-weight { font-size: 10px; color: var(--text-secondary, #999); }
.stm-dim-score { font-size: 22px; font-weight: 800; text-align: center; }
.dim-pos .stm-dim-score { color: #991b1b; }
.dim-neg .stm-dim-score { color: #166534; }
.dim-neu .stm-dim-score { color: #856404; }
.stm-dim-reason { font-size: 12px; color: var(--text); text-align: center; font-weight: 500; }
.stm-dim-raw { font-size: 10px; color: var(--text-secondary, #aaa); text-align: center; }

.stm-detail-section {
  display: flex; gap: 20px; flex-wrap: wrap;
}
.stm-detail-left { flex: 1; min-width: 280px; }
.stm-detail-right { flex: 1; min-width: 200px; }
.stm-detail-section h4 { font-size: 13px; font-weight: 600; margin: 0 0 8px 0; color: var(--text); }
.stm-signal-list { list-style: none; padding: 0; margin: 0; }
.stm-signal-list li {
  padding: 5px 0; font-size: 12px; color: var(--text);
  border-bottom: 1px dashed var(--border);
}
.stm-signal-list li:last-child { border-bottom: none; }

/* ==================== 个股技术指标 ==================== */
.tech-indicator-box { min-height: 200px; }
.tech-signal-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; background: #f8f9fa; border-radius: 6px; margin-bottom: 14px;
}
.tech-signal-tag {
  display: inline-block; padding: 3px 10px; font-size: 12px; font-weight: 600;
  border-radius: 4px;
}
.tech-signal-buy { background: #fde8e8; color: #991b1b; }
.tech-signal-sell { background: #dcfce7; color: #166534; }
.tech-signal-neutral { background: #e2e8f0; color: #4a5568; }

.tech-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.tech-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; transition: border-color .2s;
}
.tech-card-title { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.tech-card-value { font-size: 22px; font-weight: 700; font-family: 'Courier New', monospace; line-height: 1.3; }
.tech-card-value.tech-buy { color: #dc2626; }
.tech-card-value.tech-sell { color: #16a34a; }
.tech-card-desc { font-size: 11px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }
.tech-card-conclusion {
  font-size: 12px; font-weight: 600; margin-top: 8px; padding: 5px 8px;
  border-radius: 4px; line-height: 1.4;
}
.tech-card-conclusion.tech-buy { background: #fde8e8; color: #991b1b; }
.tech-card-conclusion.tech-sell { background: #dcfce7; color: #166534; }
.tech-card-conclusion:not(.tech-buy):not(.tech-sell) { background: #fff3cd; color: #856404; }

@media (max-width: 900px) {
  .tech-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .tech-grid { grid-template-columns: 1fr; }
}

/* ============================ 多用户认证 ============================ */
.auth-overlay {
  display: flex; position: fixed; inset: 0; background: linear-gradient(135deg, #1a2332 0%, #2c3e50 100%);
  z-index: 9999; justify-content: center; align-items: center;
}
.auth-box {
  background: #fff; border-radius: 12px; padding: 36px 32px; width: 360px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); text-align: center;
}
.auth-box h2 { margin: 0 0 8px; font-size: 22px; color: #1a2332; }
.auth-subtitle { color: #888; font-size: 14px; margin: 0 0 24px; }
.auth-input {
  width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 14px; margin-bottom: 12px; box-sizing: border-box; transition: border-color .2s;
}
.auth-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(41,98,255,0.1); }
.auth-buttons { display: flex; gap: 10px; margin-top: 8px; }
.auth-btn-primary {
  flex: 1; padding: 10px; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.auth-btn-primary:hover { background: #1e4fd0; }
.auth-btn-secondary {
  flex: 1; padding: 10px; background: #f0f2f5; color: #333; border: 1px solid #ddd;
  border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s;
}
.auth-btn-secondary:hover { background: #e4e7eb; }
.auth-hint { color: #bbb; font-size: 11px; margin: 16px 0 0; }
.auth-forgot { display: block; text-align: center; margin-top: 8px; color: var(--accent, #2962ff); font-size: 12px; text-decoration: none; cursor: pointer; }
.auth-forgot:hover { text-decoration: underline; }

/* 用户徽章 */
.user-badge {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  background: #f0f2f5; padding: 4px 10px; border-radius: 6px;
}
.user-badge .user-name { font-weight: 600; color: #333; }
.user-badge .admin-tag {
  background: #2962ff; color: #fff; font-size: 10px; padding: 1px 6px;
  border-radius: 3px; font-weight: 600;
}
.btn-logout {
  background: none; border: 1px solid #ddd; color: #666; font-size: 11px;
  padding: 2px 8px; border-radius: 4px; cursor: pointer;
}
.btn-logout:hover { background: #e74c3c; color: #fff; border-color: #e74c3c; }

/* 持仓市场筛选标签 */
.market-filter-bar {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.market-tag {
  display: inline-block; padding: 3px 12px; font-size: 12px;
  border-radius: 4px; cursor: pointer; user-select: none;
  background: #f0f2f5; color: var(--text-dim); border: 1px solid transparent;
  transition: all .15s;
}
.market-tag:hover { background: #e2e8f0; color: var(--text); }
.market-tag.active {
  background: var(--accent); color: #fff; font-weight: 600;
}

/* ==================== 个股深度研报（紧凑版） ==================== */
.report-panel { margin-top: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.report-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.report-header h3 { margin: 0; font-size: 14px; }
.report-header button { padding: 4px 12px; }

/* 研报主体 */
.report-doc { font-size: 12.5px; line-height: 1.6; color: var(--text); }
.report-doc h1 { font-size: 18px; font-weight: 800; margin-bottom: 3px; color: var(--text); letter-spacing: -0.3px; }
.report-doc .report-subtitle { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }
.report-doc .report-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.report-doc .report-tag {
  font-size: 10.5px; padding: 2px 9px; border-radius: 11px;
  background: #eff6ff; color: #2563eb; font-weight: 500; border: 1px solid #dbeafe;
}

/* 核心结论：渐变蓝背景 + 左侧蓝色粗边 */
.report-doc .report-conclusion {
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fe 100%);
  border-left: 3px solid #2563eb; padding: 11px 14px;
  border-radius: 0 7px 7px 0; margin-bottom: 14px; font-size: 12.5px; line-height: 1.7;
  color: #1f2937;
}
.report-doc .report-conclusion .conclusion-label {
  color: #2563eb; font-weight: 700; margin-right: 4px;
}
.report-doc .report-conclusion .hl-risk { color: #dc2626; font-weight: 600; }
.report-doc .report-conclusion .hl-positive { color: #16a34a; font-weight: 600; }
.report-doc .report-conclusion .hl-warn { color: #d97706; font-weight: 600; }
.report-doc .report-conclusion .conclusion-label { margin-bottom: 6px; font-size: 12.5px; }
.report-doc .report-conclusion .conclusion-lines { list-style: none; margin: 0; padding: 0; }
.report-doc .report-conclusion .conclusion-lines li {
  position: relative; padding-left: 16px; margin-bottom: 6px; line-height: 1.5;
  font-size: 12.5px; color: #374151;
}
.report-doc .report-conclusion .conclusion-lines li::before {
  content: ""; position: absolute; left: 1px; top: 7px;
  width: 6px; height: 6px; border-radius: 50%; background: #2563eb;
}
.report-doc .report-conclusion .conclusion-text { font-size: 12.5px; line-height: 1.6; color: #374151; }

/* 指标卡片网格：6 列单行（最新价/总市值/PE/PB/目标价均值/年初至今）*/
.report-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-bottom: 10px; }
.report-metric-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 9px;
  padding: 11px 12px; transition: all .2s; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.report-metric-card:hover { border-color: #2563eb; box-shadow: 0 2px 6px rgba(37,99,235,0.08); }
.report-metric-label { font-size: 10.5px; color: var(--text-dim); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.2px; }
.report-metric-value { font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -0.4px; }
.report-metric-sub { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; }
.report-metric-value.up { color: #16a34a; }
.report-metric-value.down { color: #dc2626; }
.report-metric-value.neutral { color: #d97706; }

/* 报告章节卡片 */
.report-section {
  margin-bottom: 12px; padding: 13px 15px; background: #fafbff;
  border: 1px solid #e5e8f0; border-radius: 9px; box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.report-section h2 {
  font-size: 13.5px; font-weight: 700; margin: 0 0 10px 0; color: var(--text);
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.report-section h2 .num {
  display: inline-flex; align-items: center; justify-content: center;
  background: #2563eb; color: #fff; font-size: 11px; min-width: 19px; height: 19px;
  border-radius: 5px; padding: 0 6px; font-weight: 700;
}
.report-section h2 .badge {
  display: inline-block; background: #fff5e6; color: #d97706;
  font-size: 10.5px; padding: 2px 9px; border-radius: 9px; font-weight: 600;
  border: 1px solid #ffe0a3;
}

/* 两栏布局（图+文） */
.report-two-col { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.report-two-col .chart-area { display: flex; justify-content: center; align-items: center; }
.report-two-col .chart-area canvas { max-width: 175px; max-height: 175px; }

/* 项目符号列表（成长驱动 / 风险） */
.report-section ul.bullet-list { list-style: none; padding: 0; margin: 0; }
.report-section ul.bullet-list li {
  position: relative; padding-left: 17px; margin-bottom: 7px; line-height: 1.6;
  color: #374151; font-size: 12.5px;
}
.report-section ul.bullet-list li::before {
  content: ""; position: absolute; left: 1px; top: 7px;
  width: 6px; height: 6px; border-radius: 50%; background: #2563eb;
}
.report-section ul.bullet-list.risk-list li::before { background: #dc2626; }
.report-section ul.bullet-list li b { color: #111827; }
.report-section ul.bullet-list li .tag {
  display: inline-block; background: #eff6ff; color: #2563eb;
  font-size: 10.5px; padding: 1px 6px; border-radius: 3px; margin-right: 4px;
  font-weight: 600;
}

/* 标签式内联元素 */
.report-inline-tags { display: flex; flex-direction: column; gap: 5px; }
.report-inline-tag {
  display: inline-block; padding: 3px 9px; border-radius: 5px;
  background: #fff; border: 1px solid #e2e8f0; font-size: 11.5px; color: #1f2937;
}
.report-inline-tag b { color: #2563eb; margin-right: 4px; }

/* 研报表格 */
.report-table-wrap { overflow-x: auto; margin-bottom: 4px; border-radius: 7px; border: 1px solid #e8edf2; }
.report-table { width: 100%; border-collapse: collapse; font-size: 11.5px; background: #fff; }
.report-table thead th {
  background: #f8fafc; padding: 8px 11px; text-align: right; font-weight: 600;
  color: #475569; border-bottom: 2px solid #e2e8f0; white-space: nowrap;
}
.report-table thead th:first-child { text-align: left; }
.report-table tbody td { padding: 7px 11px; text-align: right; border-bottom: 1px solid #f1f5f9; color: #1f2937; }
.report-table tbody td:first-child { text-align: left; font-weight: 500; color: #475569; }
.report-table tbody tr:nth-child(even) td { background: #fcfcfd; }
.report-table tbody tr:hover td { background: #f0f5ff; }
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table td.up-intl { color: #16a34a; font-weight: 600; }
.report-table td.down-intl { color: #dc2626; font-weight: 600; }

/* 分析师评级条 */
.rating-bar { display: flex; height: 22px; border-radius: 5px; overflow: hidden; margin: 8px 0 6px; }
.rating-seg { display: flex; align-items: center; justify-content: center; font-size: 10.5px; color: #fff; font-weight: 700; }
.rating-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 10.5px; color: var(--text-dim); margin-bottom: 8px; }
.rating-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }

/* 同业对比柱状图 */
.report-bar-chart { background: #fff; border-radius: 7px; padding: 12px; border: 1px solid #e8edf2; }
.report-bar-chart .peer-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 11.5px; }
.report-bar-chart .peer-name { width: 56px; text-align: right; color: #475569; font-weight: 500; }
.report-bar-chart .peer-bar { flex: 1; background: #f1f5f9; height: 20px; border-radius: 4px; overflow: hidden; }
.report-bar-chart .peer-bar-fill {
  height: 100%; background: linear-gradient(90deg, #94a3b8 0%, #64748b 100%);
  display: flex; align-items: center; padding-left: 7px; color: #fff; font-size: 10.5px; font-weight: 600;
  transition: width .6s ease; border-radius: 4px;
}
.report-bar-chart .peer-bar-fill.highlight { background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%); }
.report-bar-chart .peer-bar-axis { display: flex; justify-content: space-between; font-size: 10px; color: #94a3b8; padding-left: 64px; margin-top: 3px; }

/* 简介区 */
.report-desc { color: var(--text-dim); font-size: 11.5px; line-height: 1.65; margin-top: 6px; padding: 9px 13px; background: #f8fafc; border-radius: 6px; border: 1px solid #f1f5f9; }

/* 研报加载状态 */
.report-loading { padding: 40px; text-align: center; color: var(--text-dim); font-size: 13px; }
.report-loading .spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: #2563eb; border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 两列并排容器（紧凑布局，避免小板块平铺全宽） */
.report-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.report-cols-2 > .report-section { margin-bottom: 0; }
.report-cols-2 > .report-section:only-child { grid-column: 1 / -1; }
.report-cols-2 > .report-conclusion { margin-bottom: 0; align-self: stretch; }

/* 左列竖叠（同业估值对比 + 财务健康度）| 右列（估值分析） */
.report-cols-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; align-items: start; }
.report-col-left { display: flex; flex-direction: column; gap: 12px; }
.report-col-left > .report-section { margin-bottom: 0; }
.report-cols-stack > .report-section { margin-bottom: 0; }

@media (max-width: 1100px) {
  .report-metrics { grid-template-columns: repeat(3, 1fr); }
  .report-two-col { grid-template-columns: 1fr; }
  .report-cols-2 { grid-template-columns: 1fr; }
  .report-cols-2 > .report-section { margin-bottom: 12px; }
  .report-cols-stack { grid-template-columns: 1fr; }
  .report-col-left > .report-section { margin-bottom: 12px; }
}

@media (max-width: 720px) {
  .report-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* 增长持续期卡片（时间因子） */
.gd-card { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.gd-explain { flex: 1 1 100%; font-size: 12px; line-height: 1.5; color: #6b7280; background: #f1f5f9; border-left: 3px solid #3b82f6; padding: 7px 10px; border-radius: 4px; margin-bottom: 4px; }
.gd-main { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; padding: 6px 14px; border-radius: 8px; background: #f8f9fb; min-width: 120px; }
.gd-years { font-size: 34px; font-weight: 700; line-height: 1; }
.gd-years .gd-unit { font-size: 14px; font-weight: 500; margin-left: 3px; color: #666; }
.gd-years.safe { color: #27ae60; }
.gd-years.moderate { color: #e69500; }
.gd-years.stretched { color: #e74c3c; }
.gd-label { font-size: 11px; color: #888; margin-top: 6px; }
.gd-side { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.gd-row { display: flex; justify-content: space-between; font-size: 12px; color: #555; }
.gd-row b { color: #222; }
.gd-bar { height: 8px; border-radius: 5px; background: #eee; overflow: hidden; margin-top: 2px; }
.gd-bar i { display: block; height: 100%; border-radius: 5px; }
.gd-bar.safe i { background: #27ae60; }
.gd-bar.moderate i { background: #e69500; }
.gd-bar.stretched i { background: #e74c3c; }
.gd-status-txt { font-size: 11px; margin-top: 2px; }
.gd-status-txt.safe { color: #27ae60; }
.gd-status-txt.moderate { color: #b97700; }
.gd-status-txt.stretched { color: #e74c3c; }

/* 选股表：增长持续期 / 配置权重 列 */
.screener-table td.gd-cell.safe { color: #27ae60; font-weight: 700; }
.screener-table td.gd-cell.moderate { color: #b97700; font-weight: 700; }
.screener-table td.gd-cell.stretched { color: #e74c3c; font-weight: 700; }
.screener-table td.weight-cell { font-weight: 600; color: #2962ff; }
.screener-table td.long { color: #27ae60; }
.screener-table td.mid { color: #2c7be5; }
.screener-table td.short { color: #b97700; }
.screener-table td.tactical { color: #888; }

/* ==================== 基本面深度分析（紧凑版） ==================== */

/* 基本面评分卡片 */
.report-score-card {
  display: grid; grid-template-columns: 120px 1fr 1fr; gap: 16px;
  align-items: center; padding: 4px 0;
}
.score-total { text-align: center; }
.score-total-value { font-size: 38px; font-weight: 900; line-height: 1.1; letter-spacing: -1.5px; }
.score-total-label { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.score-total-grade {
  display: inline-block; color: #fff; font-size: 11px; font-weight: 600;
  padding: 2px 12px; border-radius: 11px; margin-top: 6px;
}
.score-radar-wrap { display: flex; justify-content: center; align-items: center; }
.score-radar-wrap canvas { max-width: 175px; max-height: 175px; }
.score-details { display: flex; flex-direction: column; gap: 6px; }
.score-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 11px; background: #fff; border: 1px solid #e2e8f0; border-radius: 7px;
  transition: all .2s; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.score-item:hover { border-color: #2563eb; box-shadow: 0 2px 6px rgba(37,99,235,0.08); }
.score-item-label { font-size: 11.5px; color: var(--text-dim); }
.score-item-value { font-size: 15px; font-weight: 800; }

/* 财务健康度网格 */
.report-health-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.health-item {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 7px;
  padding: 9px 11px; transition: all .2s; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.health-item:hover { border-color: #2563eb; box-shadow: 0 2px 6px rgba(37,99,235,0.08); }
.health-item.good { border-left: 3px solid #16a34a; background: #f0fdf4; }
.health-item.bad { border-left: 3px solid #dc2626; background: #fef2f2; }
.health-label { font-size: 10.5px; color: var(--text-dim); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.2px; }
.health-value { font-size: 14px; font-weight: 700; color: #1f2937; }
.health-item.good .health-value { color: #15803d; }
.health-item.bad .health-value { color: #b91c1c; }

/* PE 分位条 */
.pe-percentile-bar { margin-top: 12px; padding: 11px 13px; background: #fff; border: 1px solid #e8edf2; border-radius: 8px; }
.pe-pct-label { font-size: 12.5px; color: #475569; margin-bottom: 8px; }
.pe-pct-tag { font-size: 10.5px; padding: 2px 9px; border-radius: 9px; font-weight: 600; margin-left: 6px; }
.pe-pct-track {
  height: 11px; background: linear-gradient(90deg, #16a34a 0%, #2563eb 35%, #d97706 70%, #dc2626 100%);
  border-radius: 6px; position: relative; box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
}
.pe-pct-fill { height: 100%; border-radius: 6px; opacity: 0.85; transition: width .8s ease; }
.pe-pct-marker {
  position: absolute; top: -3px; width: 4px; height: 17px; background: #1f2937;
  border-radius: 2px; transform: translateX(-50%); box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 2;
}
.pe-pct-axis { display: flex; justify-content: space-between; font-size: 10px; color: #94a3b8; margin-top: 6px; }

/* 合理估值区间卡片 */
.val-range-card {
  margin-top: 12px; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 9px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.val-range-title { font-size: 12.5px; font-weight: 700; color: #475569; margin-bottom: 11px; }
.val-range-method { margin-bottom: 12px; }
.val-range-method:last-of-type { margin-bottom: 0; }
.vrm-head { font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; }
.vrm-note { font-size: 10.5px; font-weight: 500; color: var(--text-dim); }
.vrm-head::before { content: ""; display: inline-block; width: 3px; height: 13px; background: #3b82f6; border-radius: 2px; margin-right: 1px; }
.val-range-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.val-range-item { text-align: center; padding: 11px 8px; border-radius: 9px; border: 1px solid #e2e8f0; transition: all .2s; }
.val-range-item:hover { transform: translateY(-2px); box-shadow: 0 3px 8px rgba(0,0,0,0.06); }
.val-range-item.conservative { background: #f0fdf4; border-color: #bbf7d0; }
.val-range-item.base { background: #eff6ff; border-color: #bfdbfe; }
.val-range-item.optimistic { background: #fffbeb; border-color: #fde68a; }
.vr-label { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2px; }
.vr-price { font-size: 18px; font-weight: 800; color: #1f2937; letter-spacing: -0.4px; }
.vr-pe { font-size: 10.5px; color: var(--text-dim); margin-top: 3px; }
.val-range-footer { font-size: 11.5px; color: var(--text-dim); margin-top: 11px; padding-top: 10px; border-top: 1px solid #f1f5f9; }

@media (max-width: 1100px) {
  .report-score-card { grid-template-columns: 1fr; gap: 12px; }
  .report-health-grid { grid-template-columns: repeat(2, 1fr); }
  .val-range-grid { grid-template-columns: 1fr; }
}

/* ============================ 量化买入/卖出信号面板 ============================ */
.quant-single-result { margin-top: 12px; }
.quant-single-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.quant-single-header .stm-code { font-size: 15px; font-weight: 700; }
.quant-single-header .stm-name { font-size: 13px; color: var(--text-dim); }
.quant-single-header .stm-price { font-size: 15px; font-weight: 600; }
.quant-sig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1100px) { .quant-sig-grid { grid-template-columns: 1fr; } }
.quant-sig-block { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fafafa; }
.quant-sig-block.quant-sig-on { border-color: #dc2626; background: #fff7f7; box-shadow: 0 0 0 2px rgba(220,38,38,0.08); }
.quant-sig-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.quant-trig { font-size: 11px; font-weight: 700; color: #fff; background: #dc2626; padding: 2px 8px; border-radius: 10px; }
.quant-notrig { font-size: 11px; color: #999; padding: 2px 8px; border: 1px solid #ddd; border-radius: 10px; }
.quant-check-list { display: flex; flex-direction: column; gap: 4px; }
.quant-check { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 6px; border-radius: 4px; }
.quant-check-mark { font-weight: 700; width: 14px; text-align: center; }
.quant-check.dim-pos .quant-check-mark { color: #991b1b; }
.quant-check.dim-neg .quant-check-mark { color: #166534; }
.quant-check-label { flex: 1; color: #444; }
.quant-check-val { color: var(--text-dim); font-size: 11px; white-space: nowrap; }
.quant-ind-box { margin-top: 12px; }
.quant-ind-box h4 { font-size: 13px; margin: 0 0 6px; color: var(--text); }

/* 量化信号弹窗内的操作标签（覆盖通用 .alert-action 大块样式） */
.alert-item .alert-action { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 4px; margin-left: 4px; display: inline-block; }
.alert-action.stm-buy { color: #991b1b; background: #fde8e8; }
.alert-action.stm-sell { color: #166534; background: #dcfce7; }
