:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e6e8eb;
  --text: #1f2329;
  --muted: #8a9099;
  --primary: #2f6bff;
  --up: #e34d4d;      /* 涨：红（A股惯例） */
  --down: #1aa260;    /* 跌：绿（A股惯例） */
  --up-bg: #fdecec;
  --down-bg: #e9f7f0;
  --shadow: 0 1px 4px rgba(0, 0, 0, .06);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 20px; }
.title { font-size: 16px; font-weight: 700; }
.tag {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* v4.1 交易状态指示器 */
.trading-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.trading-active { color: #1aa260 !important; }

.btn {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { opacity: .9; color: #fff; }

/* ---------- 免责声明 ---------- */
.disclaimer {
  background: #fff7e6; color: #8a6d3b; border-bottom: 1px solid #ffe7ba;
  padding: 8px 18px; font-size: 12.5px; line-height: 1.6;
}

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  /* 左栏 280~320 自适应：常规 14" 笔记本左 280，15"+ 给 320；右栏占满剩余 */
  grid-template-columns: clamp(260px, 22vw, 320px) 1fr;
  gap: 16px;
  padding: 14px 24px;
  align-items: start;
  max-width: 1680px;          /* 避免 2K/4K 屏被拉到过宽 */
  margin: 0 auto;             /* 居中 */
}
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;  /* 窄屏单列 */
    padding: 12px 14px;
  }
}

.left-col, .right-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.right-col {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 130px);   /* 让详情区尽量填满视口高度 */
}
.left-col {
  display: flex;
  flex-direction: column;
}

/* ---------- 搜索框 ---------- */
.search-box { position: relative; margin-bottom: 14px; }
.search-box input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; outline: none;
}
.search-box input:focus { border-color: var(--primary); }
.search-box .btn { margin-top: 8px; width: 100%; }

.cost-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 8px 10px;
  background: #fafbfc; border: 1px solid var(--border); border-radius: 8px;
}
.cost-row label { font-size: 12.5px; white-space: nowrap; }
.cost-row input {
  flex: 1; min-width: 0; padding: 5px 8px !important;
  font-size: 13px !important; border-radius: 6px !important;
}
.cost-hint { font-size: 11.5px; white-space: nowrap; }

.search-dropdown {
  position: absolute; top: 42px; left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 280px; overflow-y: auto;
}
.search-dropdown .item {
  padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px;
}
.search-dropdown .item:hover { background: #f2f6ff; }
.search-dropdown .item .nm { font-weight: 600; }
.search-dropdown .item .cd { color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }

/* ---------- 区块标题 ---------- */
.section-title {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 700; color: var(--text);
  margin: 14px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.muted { color: var(--muted); }

/* ---------- 行情表 ---------- */
.table-wrap { max-height: clamp(320px, calc(100vh - 520px), 480px); overflow-y: auto; }
.quote-table { width: 100%; border-collapse: collapse; }
.quote-table th, .quote-table td {
  padding: 9px 6px; text-align: left; border-bottom: 1px solid #f0f1f3; font-size: 13px;
}
.quote-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.quote-table .num { text-align: right; }
.quote-table tbody tr { cursor: pointer; }
.quote-table tbody tr:hover { background: #f7f9ff; }
.quote-table tr.selected { background: #eef3ff; }
.quote-table .nm { font-weight: 600; }
.quote-table .cd { color: var(--muted); font-size: 12px; }
.quote-table .empty { text-align: center; color: var(--muted); padding: 24px 0; }
.up { color: var(--up); }
.down { color: var(--down); }
.del-btn {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: 6px;
}
.del-btn:hover { color: var(--up); background: var(--up-bg); }
.cost-btn {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  cursor: pointer; font-size: 11px; padding: 1px 6px; border-radius: 5px; margin-right: 2px;
}
.cost-btn:hover { color: var(--primary); border-color: var(--primary); }
.price-main { font-weight: 600; }
.quote-table .sub {
  font-size: 11px; line-height: 1.3; margin-top: 2px; font-weight: 500;
}

/* ---------- 组合总览 ---------- */
.portfolio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.pf-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: center;
}
.pf-card .v { font-size: 20px; font-weight: 700; }
.pf-card .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pf-buy .v { color: var(--up); }
.pf-hold .v { color: #d98a00; }
.pf-sell .v { color: var(--down); }
.pf-empty { grid-column: 1 / -1; padding: 12px 0; text-align: center; }
.pf-list { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); line-height: 1.8; }

/* ---------- 详情区 ---------- */
.detail-empty { display: flex; min-height: 420px; align-items: center; justify-content: center; }
.detail-empty .big { color: var(--muted); font-size: 15px; }

.detail {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;             /* 关键：flex 子项允许内部滚动/收缩 */
}

.stock-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 6px 2px 12px;
  flex-shrink: 0;
}
.d-name { font-size: 20px; font-weight: 700; }
.d-code { margin-left: 8px; font-size: 13px; }
.d-price-box { text-align: right; }
.d-price { font-size: 26px; font-weight: 700; }
.d-change { font-size: 14px; margin-left: 8px; }

/* v4.1 图表控件栏：tabs + 刷新按钮同行 */
.chart-controls {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; flex-shrink: 0; gap: 8px;
}
.chart-tabs { display: flex; gap: 6px; }
.chart-tab {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 5px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.chart-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* v4.1 图表右侧控件 */
.chart-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.refresh-status {
  font-size: 11px; white-space: nowrap;
}
.refresh-interval-select {
  padding: 4px 6px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; font-size: 12px;
  color: var(--text); cursor: pointer;
}
.chart-refresh-btn {
  font-size: 12px !important; padding: 5px 12px !important; white-space: nowrap;
}

/* 图表容器：宽度撑满右栏，高度跟随视口自适应（保持合理宽高比） */
.chart {
  width: 100%;
  flex: 1 1 auto;            /* 在 right-col flex 列里吃掉剩余空间 */
  min-height: 520px;         /* 兜底：太矮的窗口也保证基本可视区 */
  height: clamp(520px, calc(100vh - 360px), 720px);
  background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 0;
}

/* ---------- 分析面板 ---------- */
.analysis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1280px) { .analysis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px)  { .analysis { grid-template-columns: 1fr; } }
.analysis .loading { grid-column: 1 / -1; }
.a-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
}
.a-card h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ind-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; border-bottom: 1px dashed #f0f1f3; }

/* 持仓盈亏卡 */
.pnl-card { border-left: 3px solid var(--up); }
.pnl-card.down { border-left-color: var(--down); }
.pnl-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.pnl-row .k { color: var(--muted); }
.pnl-row.big { font-size: 16px; font-weight: 700; padding: 6px 0; margin-top: 2px; border-top: 1px dashed #f0f1f3; }
.pnl-empty { background: #fafbfc; }
.pnl-empty h4 { color: var(--muted); }
.ind-row:last-child { border-bottom: none; }
.ind-row .k { color: var(--muted); }

.prob-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.prob {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: center;
}
.prob .p { font-size: 22px; font-weight: 700; }
.prob .lb { font-size: 12px; color: var(--muted); margin-top: 2px; }
.prob .ad { font-size: 12px; margin-top: 4px; font-weight: 600; }

.advice-banner {
  grid-column: 1 / -1; border-radius: 10px; padding: 14px; text-align: center;
  font-size: 16px; font-weight: 700;
}
.advice-strongbuy { background: #fdecec; color: #c0392b; }
.advice-buy { background: #fff0ee; color: #e3695b; }
.advice-hold { background: #fff7e6; color: #b8860b; }
.advice-reduce { background: #eafaf3; color: #1aa260; }
.advice-sell { background: #e6f7ee; color: #138a4d; }

.risk-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-weight: 700; font-size: 12px;
}
.risk-low { background: #e6f7ee; color: #138a4d; }
.risk-midlow { background: #eafaf3; color: #1aa260; }
.risk-mid { background: #fff7e6; color: #b8860b; }
.risk-midhigh { background: #fff1e6; color: #d9730d; }
.risk-high { background: #fdecec; color: #c0392b; }

.drivers { font-size: 13px; line-height: 1.9; }
.drivers .pos { color: var(--up); }
.drivers .neg { color: var(--down); }

/* ---------- 多周期上涨概率：建议价位 ---------- */
.prob-prices {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed #f0f1f3;
  text-align: left;
  font-size: 12px; line-height: 1.6;
}
.pp-row { display: flex; justify-content: space-between; }
.pp-row .k { color: var(--muted); }
.pp-row .v { font-weight: 600; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; }
.pp-row .v.buy  { color: #c0392b; }
.pp-row .v.stop { color: #1aa260; }
.pp-row .v.tgt  { color: #2f6bff; }

/* ---------- AI 智能分析面板 ---------- */
.ai-panel { display: flex; flex-direction: column; gap: 12px; }
.ai-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  background: var(--panel);
}
.ai-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.ai-title { font-size: 14px; font-weight: 700; }
.ai-sub-title {
  display: flex; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 8px;
}
.ai-refresh { padding: 3px 10px; font-size: 12px; }

/* ── v3.3 AI 模式标识 ── */
.ai-mode-strip {
  display: flex; align-items: center; justify-content: flex-end;
  margin-bottom: 8px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.ai-mode-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}
.ai-mode-llm {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #6d28d9; border: 1px solid #c4b5fd;
}
.ai-mode-rule {
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
}

/* AI 操作建议横幅 */
.ai-banner {
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ai-action { font-size: 22px; font-weight: 800; }
.ai-sub    { font-size: 12px; opacity: .85; }
/* AI 中线视角（v2.2：评分 + 摘要，不再给操作建议） */
.ai-aux-banner {
  border-radius: 10px; padding: 12px 14px;
  background: linear-gradient(135deg, #f0f6ff, #f9faff);
  border: 1px solid #d8e4fc;
  margin-bottom: 12px;
}
.ai-aux-title  { font-size: 13px; font-weight: 700; color: #2b4f8d; margin-bottom: 4px; }
.ai-aux-meta   { font-size: 11.5px; margin-bottom: 8px; }
.ai-aux-scores { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 12.5px; }
.ai-aux-score  { display: inline-flex; align-items: baseline; gap: 4px; }
.ai-aux-score b { font-weight: 700; color: #1f3a73; }
.ai-aux-tag {
  padding: 1px 8px; border-radius: 6px;
  background: #eef3ff; color: #2b4f8d; font-weight: 600;
}
.ai-strongbuy { background: linear-gradient(90deg, #fdecec, #fbd5d5); color: #a52a1f; }
.ai-buy       { background: linear-gradient(90deg, #fff0ee, #ffe2dd); color: #c0392b; }
.ai-hold      { background: linear-gradient(90deg, #fff7e6, #ffeac9); color: #8a6d3b; }
.ai-reduce    { background: linear-gradient(90deg, #e9f7f0, #d3f0e1); color: #138a4d; }
.ai-sell      { background: linear-gradient(90deg, #e6f7ee, #c8ebd8); color: #138a4d; }

/* AI 综合摘要 */
.ai-summary {
  font-size: 13px; line-height: 1.7;
  padding: 10px 12px; background: #fafbfc; border-radius: 8px;
  border-left: 3px solid var(--primary);
  margin-bottom: 12px;
}

/* AI 跳转提示（精简后引导到下方量化评估面板） */
.ai-shortcut {
  font-size: 12.5px; line-height: 1.6;
  padding: 8px 12px; background: #eef3ff;
  border: 1px dashed var(--primary); border-radius: 8px;
  color: #4a5b8c;
  margin-bottom: 8px;
}

/* 价位建议三联卡 */
.ai-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 720px) { .ai-levels { grid-template-columns: 1fr; } }
.lv-item {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; background: #fafbfc;
  border-top: 3px solid var(--muted);
}
.lv-item.buy    { border-top-color: #c0392b; }
.lv-item.stop   { border-top-color: #1aa260; }
.lv-item.target { border-top-color: #2f6bff; }
.lv-k { font-size: 12px; color: var(--muted); }
.lv-v {
  font-size: 22px; font-weight: 800;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  margin: 4px 0;
}
.lv-h { font-size: 11.5px; color: var(--muted); }

/* 当前价区间位置 */
.ai-pos { margin-top: 12px; }
.pos-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pos-bar {
  position: relative; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #e9f7f0 0%, #fff7e6 50%, #fdecec 100%);
  margin: 6px 0 4px;
}
.pos-mark {
  position: absolute; top: -4px; width: 14px; height: 16px;
  background: var(--primary); border-radius: 3px;
  transform: translateX(-7px);
  box-shadow: 0 0 0 2px #fff;
}
.pos-axis {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
}

/* 关键驱动信号 */
.ai-sigs { display: flex; flex-direction: column; gap: 6px; }
.sig {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: #fafbfc; border: 1px solid var(--border);
}
.sig-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
  background: var(--muted);
}

/* AI 评语（每条新闻） */
.news-ai-review {
  font-size: 12px; color: #1f2329; line-height: 1.5;
  margin: 4px 0 4px 22px;
  padding: 4px 8px;
  background: #f4f6fa; border-radius: 4px;
  border-left: 2px solid var(--primary);
}

/* 风险收益比 badge */
.rr-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.rr-good { background: #e6f7ee; color: #138a4d; }
.rr-ok   { background: #fff7e6; color: #8a6d3b; }
.rr-bad  { background: #fdecec; color: #c0392b; }
.sig.pos .sig-dot { background: var(--up); }
.sig.neg .sig-dot { background: var(--down); }
.sig-name { font-size: 13px; font-weight: 600; }
.sig-w {
  display: inline-block; padding: 1px 6px; border-radius: 10px;
  font-size: 11px; background: #eef3ff; color: var(--primary);
  font-weight: 700; margin-left: 4px;
}
.sig-detail { font-size: 12px; margin-top: 2px; }

/* 新闻列表 */
.ai-news { display: flex; flex-direction: column; gap: 6px; }
.news-item {
  display: block; text-decoration: none; color: var(--text);
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: #fafbfc; transition: .15s;
}
.news-item:hover { background: #eef3ff; border-color: var(--primary); }
.news-line1 { display: flex; align-items: center; gap: 8px; }
.news-line2 {
  display: flex; justify-content: space-between;
  font-size: 11.5px; margin-top: 4px;
}
.news-title {
  font-size: 13px; font-weight: 600; line-height: 1.4;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.news-item.pos { border-left: 3px solid var(--up); }
.news-item.neg { border-left: 3px solid var(--down); }
.news-item.neu { border-left: 3px solid var(--muted); }
.news-tag {
  display: inline-block; padding: 1px 7px; border-radius: 10px;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.news-tag.pos { background: #fdecec; color: #c0392b; }
.news-tag.neg { background: #e9f7f0; color: #138a4d; }
.news-tag.neu { background: #f0f1f3; color: var(--muted); }

/* AI 免责声明 */
.ai-disclaimer {
  font-size: 12px; color: var(--muted); line-height: 1.7;
  padding: 8px 12px; background: #fff7e6; border: 1px solid #ffe7ba;
  border-radius: 8px;
}

footer.footer {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 16px; border-top: 1px solid var(--border); background: var(--panel);
}

/* ═══════════════════════════════════════════════════════════
   量化评估框架（Framework Panel）样式
   ═══════════════════════════════════════════════════════════ */

.fw-container {
  display: flex; flex-direction: column; gap: 12px;
}
.fw-panel {
  display: flex; flex-direction: column; gap: 12px;
}
.fw-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.fw-title { font-size: 15px; font-weight: 700; }

/* v4.1 AI 重新分析按钮 */
.fw-reanalyze-btn {
  font-size: 12px !important; padding: 4px 10px !important;
  border-radius: 6px !important; white-space: nowrap; flex-shrink: 0;
  background: #fff; border: 1px solid var(--primary); color: var(--primary);
}
.fw-reanalyze-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 2 列网格 */
.fw-grid-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 768px) { .fw-grid-2col { grid-template-columns: 1fr; } }

/* 3 列网格 */
.fw-grid-3col {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 960px) { .fw-grid-3col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .fw-grid-3col { grid-template-columns: 1fr; } }

/* 通用卡片 */
.fw-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; background: var(--panel);
}
.fw-card-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px dashed #f0f1f3;
}

/* ── v3.3 LLM 复审标识 / v3.4 4 态徽章（未启用/失败/通过/调整） ── */
.fw-llm-tag {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 6px; padding: 1px 8px;
  font-size: 10.5px; font-weight: 600; border-radius: 10px;
  vertical-align: middle; cursor: help;
}
.fw-llm-pass {
  background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
}
.fw-llm-decision, .fw-llm-price {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #6d28d9; border: 1px solid #c4b5fd;
}
.fw-llm-skip {
  background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db;
}
.fw-llm-err {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
}
.fw-llm-detail {
  margin-top: 6px; padding: 5px 9px;
  font-size: 11.5px; line-height: 1.5;
  border-radius: 6px;
}
.fw-llm-detail.fw-llm-pass {
  background: #f0fdf4; color: #166534; border-left: 3px solid #22c55e;
}
.fw-llm-detail.fw-llm-changed {
  background: #faf5ff; color: #5b21b6; border-left: 3px solid #8b5cf6;
}
.fw-llm-detail.fw-llm-err {
  background: #fef2f2; color: #991b1b; border-left: 3px solid #ef4444;
}
.fw-llm-mark {
  font-size: 11px; cursor: help; margin-left: 2px;
}

/* ── 市场环境评分 ── */
.fw-total-score {
  display: flex; align-items: baseline; gap: 4px;
  padding: 8px 0;
}
.fw-total-num {
  font-size: 36px; font-weight: 800; color: var(--primary);
}
.fw-total-label { font-size: 14px; color: var(--muted); }
.fw-cap-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: #fafbfc; border-radius: 8px;
  font-size: 14px; font-weight: 600;
}
.fw-cap-val { font-size: 20px; font-weight: 800; }
.fw-eval-text {
  font-size: 13px; color: var(--text); line-height: 1.6;
  padding: 8px 0; border-bottom: 1px dashed #f0f1f3; margin-bottom: 8px;
}
.fw-score-detail { display: flex; flex-direction: column; gap: 4px; }
.fw-score-row {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
}
.fw-score-key { font-weight: 600; min-width: 90px; }
.fw-score-val { font-weight: 700; min-width: 30px; }
.fw-score-reason { flex: 1; font-size: 11.5px; }

.fw-pos { color: var(--up); }
.fw-neg { color: var(--down); }
.fw-neu { color: #d98a00; }

/* ── 决策卡片 ── */
.fw-decision-card { border-left: 4px solid var(--primary); }
.fw-decision-card.strongbuy { border-left-color: #c0392b; background: linear-gradient(135deg, #fff, #fdecec); }
.fw-decision-card.buy { border-left-color: #e3695b; background: linear-gradient(135deg, #fff, #fff0ee); }
.fw-decision-card.hold { border-left-color: #d98a00; background: linear-gradient(135deg, #fff, #fff7e6); }
.fw-decision-card.reduce { border-left-color: #1aa260; background: linear-gradient(135deg, #fff, #eafaf3); }
.fw-decision-card.sell { border-left-color: #138a4d; background: linear-gradient(135deg, #fff, #e6f7ee); }
.fw-decision-text {
  font-size: 26px; font-weight: 800; margin: 8px 0;
}
.fw-decision-sub {
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.fw-signals { display: flex; gap: 6px; flex-wrap: wrap; }

/* Badge */
.fw-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.fw-badge-good { background: #e6f7ee; color: #138a4d; }
.fw-badge-warn { background: #fff1e6; color: #d9730d; }
.fw-badge-neu { background: #f0f1f3; color: var(--muted); }

.fw-limit-warn {
  margin-top: 10px; padding: 8px 12px;
  background: #fdecec; border: 1px solid #f5c6cb; border-radius: 8px;
  color: #c0392b; font-size: 13px; font-weight: 600;
}

/* ── 三价模型 ── */
.fw-tp-levels { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.fw-tp-item {
  padding: 8px 10px; border-radius: 8px; background: #fafbfc;
  border-left: 3px solid var(--muted);
}
.fw-tp-item.buy { border-left-color: #c0392b; }
.fw-tp-item.stop { border-left-color: #1aa260; }
.fw-tp-item.target { border-left-color: #2f6bff; }
.fw-tp-label { font-size: 11.5px; color: var(--muted); }
.fw-tp-val {
  font-size: 20px; font-weight: 800;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  margin: 2px 0;
}
.fw-tp-sub { font-size: 11px; }

.fw-rr-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #fafbfc; border-radius: 8px;
  font-size: 13px; margin-bottom: 8px;
}
.fw-rr-val { font-size: 18px; font-weight: 800; }

.fw-pos-bar-wrap { margin-top: 4px; }
.fw-pos-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); margin-bottom: 4px;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
}

/* ── 仓位建议 ── */
.fw-pos-detail { display: flex; flex-direction: column; gap: 6px; }
.fw-pos-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px dashed #f0f1f3;
  font-size: 13px;
}
.fw-pos-row:last-child { border-bottom: none; }
.fw-pos-v { font-weight: 700; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; }
.fw-pos-note {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed #f0f1f3;
  font-size: 11.5px; line-height: 1.6;
}

/* ── 技术指标 ── */
.fw-tech-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.fw-tech-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 8px; background: #fafbfc; border-radius: 6px;
  font-size: 12px;
}
.fw-tech-k { color: var(--muted); font-weight: 600; }
.fw-tech-v {
  font-weight: 700;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
}

/* ── 新闻催化 ── */
.fw-macro-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fw-news-list { display: flex; flex-direction: column; gap: 6px; }
.fw-news-item {
  padding: 8px 10px; border-radius: 8px; background: #fafbfc;
  border: 1px solid var(--border);
}
.fw-news-item.pos { border-left: 3px solid var(--up); }
.fw-news-item.neg { border-left: 3px solid var(--down); }
.fw-news-header {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.fw-cat-tag {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; font-weight: 600; flex-shrink: 0;
}
.fw-cat-high { background: #fdecec; color: #c0392b; }
.fw-cat-mid { background: #fff7e6; color: #b8860b; }
.fw-cat-low { background: #f0f1f3; color: var(--muted); }
.fw-cat-level { background: #eef3ff; color: var(--primary); }
.fw-news-title {
  font-size: 12.5px; font-weight: 600; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fw-news-meta {
  display: flex; gap: 12px; font-size: 11px; margin-top: 4px;
}
.fw-cat-warn {
  margin-top: 8px; padding: 8px 12px;
  background: #fff7e6; border: 1px solid #ffe7ba; border-radius: 6px;
  color: #8a6d3b; font-size: 12px; font-weight: 600;
}

/* ── 风险提示 ── */
.fw-risks { display: flex; flex-direction: column; gap: 6px; }
.fw-risk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px; font-size: 12.5px;
}
.fw-risk-lvl {
  padding: 1px 7px; border-radius: 8px;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.fw-risk-critical .fw-risk-lvl { background: #c0392b; color: #fff; }
.fw-risk-critical { background: #fdecec; border: 1px solid #f5c6cb; }
.fw-risk-high .fw-risk-lvl { background: #e34d4d; color: #fff; }
.fw-risk-high { background: #fff0ee; }
.fw-risk-mid .fw-risk-lvl { background: #d98a00; color: #fff; }
.fw-risk-mid { background: #fff7e6; }
.fw-risk-low .fw-risk-lvl { background: #1aa260; color: #fff; }
.fw-risk-low { background: #e9f7f0; }

.fw-risk-rules {
  padding: 8px 10px; background: #fafbfc; border-radius: 6px;
  border: 1px dashed var(--border);
}

/* ── v2.1 新增组件 ── */

/* 风控滑块 */
.risk-row {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.risk-row input[type="range"] {
  flex: 1; height: 4px; -webkit-appearance: none; appearance: none;
  background: #ddd; border-radius: 2px; outline: none; cursor: pointer;
}
.risk-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); cursor: pointer;
}
.risk-row label { white-space: nowrap; font-size: 12px; }

/* NLP 催化强度条 */
.ai-nlp-bar { margin: 12px 0 8px; }
.ai-nlp-label { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.ai-nlp-track {
  height: 8px; background: #e9ecef; border-radius: 4px; overflow: hidden;
  margin: 4px 0;
}
.ai-nlp-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.ai-nlp-fill.nlp-strong { background: #1aa260; }
.ai-nlp-fill.nlp-good { background: #52c41a; }
.ai-nlp-fill.nlp-neu { background: #d98a00; }
.ai-nlp-fill.nlp-weak { background: #e34d4d; }
.ai-nlp-marks {
  display: flex; justify-content: space-between; font-size: 10px; color: var(--muted);
}
.ai-nlp-detail { font-size: 11px; margin-top: 2px; }

/* 黑天鹅警报 */
.ai-blackswan-warn {
  padding: 10px 14px; background: #fdecec; border: 2px solid #e34d4d;
  border-radius: 8px; color: #c0392b; font-weight: 700; font-size: 13px;
  margin-bottom: 10px; animation: pulse-warn 1.5s infinite;
}
@keyframes pulse-warn {
  0%, 100% { opacity: 1; } 50% { opacity: 0.75; }
}

/* 紧急退出警报 */
.fw-emergency-alert {
  padding: 12px 16px; background: #fff0ee;
  border: 2px solid #e34d4d; border-radius: 10px;
  margin-bottom: 12px; animation: pulse-warn 1.5s infinite;
}
.fw-emerg-title { font-size: 14px; font-weight: 700; color: #c0392b; margin-bottom: 6px; }
.fw-emerg-item {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  font-size: 12px; border-bottom: 1px solid #f5c6cb;
}
.fw-emerg-item:last-child { border-bottom: none; }
.fw-emerg-type { font-weight: 700; white-space: nowrap; }
.fw-emerg-action { font-weight: 700; margin-left: auto; white-space: nowrap; }
.fw-emerg-critical { color: #c0392b; }
.fw-emerg-high { color: #e34d4d; }
.fw-emerg-mid { color: #d98a00; }

/* 五因子/四维因子 V2（优化：无灰色粗条 + 阈值刻度） */
.fw-factor-detail { margin-top: 6px; }
.fw-factor-row {
  display: flex; align-items: center; gap: 6px; padding: 3px 0;
  font-size: 12px;
}
.fw-factor-name { width: 85px; flex-shrink: 0; font-weight: 600; }
.fw-factor-bar-wrap {
  flex: 1; height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden;
}
.fw-factor-bar { height: 100%; border-radius: 3px; transition: width .5s; }
.fw-factor-bar.fw-pos { background: #1aa260; }
.fw-factor-bar.fw-neu { background: #d98a00; }
.fw-factor-bar.fw-neg { background: #e34d4d; }
.fw-factor-score { width: 40px; text-align: right; font-weight: 600; }
.fw-factor-wt { width: 35px; text-align: right; }
.fw-factor-reason { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 四维因子 V2（柔色单层 + 阈值标记） ── */
.fw-factor-row-v2 {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  font-size: 12px; background: #fafbfc; border-radius: 8px; margin-bottom: 4px;
}
.fw-factor-icon { width: 20px; text-align: center; flex-shrink: 0; font-size: 14px; }
.fw-factor-name-v2 {
  width: 75px; flex-shrink: 0; font-weight: 600; font-size: 12.5px;
}
.fw-factor-wtv2 { font-size: 10px; font-weight: 400; }
.fw-factor-track-v2 {
  flex: 1; height: 8px; background: #eef0f4; border-radius: 4px;
  position: relative; overflow: visible;
}
.fw-factor-fill-v2 {
  height: 100%; border-radius: 4px; transition: width .5s; display: block;
}
.fw-factor-fill-v2.fw-pos { background: linear-gradient(90deg, #1aa260, #4ecb71); }
.fw-factor-fill-v2.fw-neu { background: linear-gradient(90deg, #d98a00, #f0a500); }
.fw-factor-fill-v2.fw-neg { background: linear-gradient(90deg, #e34d4d, #f07070); }
.fw-factor-mark-v2 {
  position: absolute; top: -2px; bottom: -2px; width: 1px;
  background: rgba(0,0,0,.15); z-index: 1;
}
.fw-factor-score-v2 {
  width: 42px; text-align: right; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.fw-factor-score-v2.fw-pos { color: #1aa260; }
.fw-factor-score-v2.fw-neu { color: #d98a00; }
.fw-factor-score-v2.fw-neg { color: #e34d4d; }

/* 综合分评级徽章 */
.fw-comp-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; margin-left: 6px;
}
.fw-star-good { background: #d4edda; color: #155724; }
.fw-star-warn { background: #fef3cd; color: #856404; }

/* MScore */
.fw-mscore-row {
  display: flex; align-items: center; gap: 10px; margin: 8px 0 4px;
}
.fw-mscore-label { font-size: 14px; font-weight: 700; }
.fw-mscore-val {
  font-size: 20px; font-weight: 800; padding: 2px 10px;
  border-radius: 6px; background: #f5f6f8;
}
.fw-mscore-val.fw-pos { color: #1aa260; }
.fw-mscore-val.fw-neu { color: #d98a00; }
.fw-mscore-val.fw-warn { color: #e34d4d; }
.fw-mscore-val.fw-neg { color: #c0392b; }
.fw-mscore-cap { font-size: 13px; margin-left: 8px; }
.fw-nlp-macro { font-size: 11px; margin-top: 4px; }

/* 自适应支撑带 */
.fw-band-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px; background: #f0f5ff; border-radius: 6px;
  font-size: 12px; margin-bottom: 4px;
}
.fw-band-meta { font-size: 11px; margin-bottom: 6px; }

/* 分级止盈 */
.fw-tp-levels.column { flex-direction: column; }

/* 风险徽章危险级别 */
.fw-badge-danger {
  background: #fdecec; color: #c0392b; border: 1px solid #e34d4d;
}

/* ── 仓位建议 V2（小白化横幅） ── */
.fw-pos-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.fw-pos-banner.fw-pos { background: #d4edda; border: 1px solid #a3d9b1; }
.fw-pos-banner.fw-neu { background: #fef3cd; border: 1px solid #ffe082; }
.fw-pos-banner.fw-warn { background: #ffe8d6; border: 1px solid #ffc299; }
.fw-pos-banner.fw-neg { background: #f0f0f0; border: 1px solid #ddd; }
.fw-pos-banner-emoji { font-size: 22px; }
.fw-pos-banner-level { font-size: 20px; font-weight: 800; color: #333; }
.fw-pos-banner-pct { font-size: 18px; font-weight: 700; color: #555; }
.fw-pos-banner-tip { font-size: 12px; color: #888; margin-left: auto; }
.fw-pos-row-highlight {
  background: #f5f9ff; border-radius: 6px; padding: 4px 6px; margin: 2px -6px;
  font-weight: 600;
}

/* ── AI 新闻列表 V2（5条 + AI评语） ── */
.ai-news-section { margin: 14px 0 10px; }
.ai-news-section-title {
  font-size: 13px; font-weight: 700; margin-bottom: 8px;
  padding-bottom: 4px; border-bottom: 1px solid #eaecef;
}
.ai-news-list { display: flex; flex-direction: column; gap: 6px; }
.ai-news-item {
  padding: 8px 10px; border: 1px solid #eaecef; border-radius: 8px;
  background: #fafbfc; transition: border-color .15s;
}
.ai-news-item:hover { border-color: #c0c5cc; }
.ai-news-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ai-news-title {
  font-size: 13px; color: #333; text-decoration: none; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-news-title:hover { color: #1a73e8; text-decoration: underline; }
.ai-news-sent {
  font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap;
  flex-shrink: 0; font-weight: 600;
}
.ai-news-sent.nlp-strong { background: #d4edda; color: #155724; }
.ai-news-sent.nlp-good   { background: #e6f4ea; color: #1aa260; }
.ai-news-sent.nlp-neu    { background: #f0f0f0; color: #666; }
.ai-news-sent.nlp-weak   { background: #fdecec; color: #c0392b; }
.ai-news-review { font-size: 12px; margin-top: 4px; line-height: 1.6; }

/* ── 四维因子田字格 2x2 布局 ── */
.fw-factor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.fw-factor-cell {
  padding: 10px 12px;
  background: #fafbfc;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .15s, box-shadow .15s;
}
.fw-factor-cell:hover {
  border-color: #c0c5cc;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.fw-factor-cell-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px;
}
.fw-factor-cell-name { font-weight: 600; }
.fw-factor-cell-wt { font-size: 11px; }
.fw-factor-cell-mid {
  display: flex; align-items: center; gap: 8px;
}
.fw-factor-cell-reason { font-size: 11px; line-height: 1.4; }

/* ── 仓位等级 5 档颜色 ── */
.fw-pos-banner.fw-emerg-critical {
  background: #fdecec; border: 1px solid #c0392b;
  animation: pulse-warn 1.5s infinite;
}
.fw-pos-banner.fw-emerg-critical .fw-pos-banner-level { color: #c0392b; }
.fw-pos-banner.fw-emerg-critical .fw-pos-banner-pct { color: #c0392b; }
.fw-pos-banner.fw-emerg-critical .fw-pos-banner-tip { color: #c0392b; }
.fw-pos-banner.fw-warn-tip { color: #d98a00; }

/* AI 合并区段样式 */
.fw-ai-section {
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

/* ── 基本面明细 v3.2 ── */
.fw-card-fundamental {
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}
.fnd-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 8px; margin-bottom: 12px;
  border-bottom: 1px dashed #e8eaef;
}
.fnd-head-left { display: flex; align-items: baseline; gap: 10px; }
.fnd-head-title { font-size: 14px; font-weight: 700; color: var(--text); }
.fnd-head-meta { font-size: 11px; }
.fnd-head-right { display: flex; align-items: center; gap: 10px; }
.fnd-head-score {
  font-size: 28px; font-weight: 800;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
}
.fnd-head-score.fw-pos { color: #1aa260; }
.fnd-head-score.fw-neu { color: #d98a00; }
.fnd-head-score.fw-neg { color: #e34d4d; }

.fnd-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; line-height: 1.5;
}
.fnd-badge-good { background: #e6f7ee; color: #138a4d; }
.fnd-badge-warn { background: #fff4e0; color: #c66500; }
.fnd-badge-danger { background: #fdecec; color: #c0392b; }

.fnd-reason {
  padding: 8px 12px; margin-bottom: 12px;
  background: #f8fafd; border-left: 3px solid var(--primary, #2f6bff);
  border-radius: 6px; font-size: 12.5px; color: var(--text); line-height: 1.5;
}

.fnd-groups {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
@media (max-width: 700px) {
  .fnd-groups { grid-template-columns: 1fr; }
}

.fnd-group {
  background: #ffffff;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.fnd-group-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.fnd-group-name { font-weight: 700; color: var(--text); }
.fnd-group-wt { font-size: 11px; }
.fnd-group-score {
  margin-left: auto;
  font-weight: 800; font-size: 14px;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
}
.fnd-group-score.fw-pos { color: #1aa260; }
.fnd-group-score.fw-neu { color: #d98a00; }
.fnd-group-score.fw-neg { color: #e34d4d; }

.fnd-group-track {
  position: relative; height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden;
}

/* ── 子指标行（v3.2 核心） ── */
.fnd-subs { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.fnd-sub-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #fafbfc;
  border-radius: 6px;
  font-size: 12px;
  border-left: 2px solid transparent;
  transition: background 0.15s;
}
.fnd-sub-row:hover { background: #f4f6fa; }
.fnd-sub-row.fnd-sub-raw { grid-template-columns: 1fr auto; }
.fnd-sub-row.fnd-sub-missing { border-left-color: #d98a00; background: #fffaf0; }

.fnd-sub-name {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.fnd-sub-label {
  font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fnd-sub-desc {
  font-size: 10.5px; color: #8a8f9a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.fnd-sub-val {
  font-weight: 700; font-size: 13px;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  color: var(--text);
  white-space: nowrap;
  padding: 0 4px;
}
.fnd-sub-val.fnd-sub-missing { color: #c66500; font-weight: 600; }

.fnd-sub-valraw {
  font-weight: 700; font-size: 13px;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  color: var(--text);
  white-space: nowrap;
  padding: 0 4px;
}

.fnd-sub-score-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 36px;
}
.fnd-sub-score {
  font-weight: 800; font-size: 12px;
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  padding: 1px 6px; border-radius: 4px;
}
.fnd-sub-score.fw-pos { color: #138a4d; background: #e6f7ee; }
.fnd-sub-score.fw-neu { color: #c66500; background: #fff4e0; }
.fnd-sub-score.fw-neg { color: #c0392b; background: #fdecec; }
.fnd-sub-conf { font-size: 9.5px; line-height: 1; }

.fnd-group-reason {
  font-size: 11px; color: #6a7080;
  padding: 4px 8px 0;
  border-top: 1px dashed #eef0f4;
  margin-top: 2px;
  line-height: 1.5;
}

/* ── 分段加载：量化分析空闲状态 ── */
.fw-idle-container {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 36px 20px; text-align: center;
  gap: 12px;
  background: linear-gradient(135deg, #f8faff 0%, #f0f5ff 100%);
  border: 2px dashed #c8d6f0; border-radius: 12px;
  min-height: 200px;
}
.fw-idle-icon { font-size: 48px; }
.fw-idle-title {
  font-size: 18px; font-weight: 700; color: #1f2329;
}
.fw-idle-desc {
  font-size: 13px; color: #6b7280; max-width: 420px; line-height: 1.6;
}
.fw-idle-btn {
  font-size: 15px !important; font-weight: 700 !important;
  padding: 10px 28px !important; border-radius: 10px !important;
  margin-top: 8px;
  transition: all 0.2s;
}
.fw-idle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 107, 255, 0.35);
}
.fw-idle-hint {
  font-size: 12px; margin-top: 4px;
}

/* ── v3.5 尾盘版三价模型徽章 ── */
.fw-closing-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  vertical-align: middle;
}
.fw-closing-badge-wait {
  background: #e6e8eb;
  color: #8a9099;
}

/* 尾盘版元数据 */
.fw-closing-meta {
  font-size: 10px;
  line-height: 1.4;
  margin-top: 4px;
}

/* 占位卡片样式 */
.fw-card-placeholder {
  border: 1px dashed var(--border);
  background: var(--bg);
}
.fw-card-placeholder .fw-card-title {
  border-bottom: 1px dashed var(--border);
}

/* v3.5.1 早间刷新徽章 */
.fw-closing-badge-morning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* ── v3.6 AI 中线摘要独立卡片样式 ── */
.fw-ai-summary-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #fafbff 0%, #f0f4ff 100%);
  border: 1px solid #d6def0;
}

.fw-ai-summary-scores {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 6px 0;
}

.fw-ai-summary-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  min-width: 60px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
}

.fw-ai-summary-score-item b {
  font-size: 14px;
  margin-top: 2px;
  font-weight: 600;
}

.fw-ai-mode-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #f0f0ff;
  font-size: 0.75em;
  margin-left: 8px;
  font-weight: 500;
}

.fw-llm-mscore-badge {
  display: inline-block;
  padding: 1px 8px;
  margin-left: 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

/* v3.6 新闻区域独立卡片 */
.fw-news-section-card {
  background: var(--panel);
}

/* v3.6 LLM 三价校准区域 */
.fw-llm-calibration {
  margin-top: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
  border-radius: 8px;
  border: 1px solid #e0e4f0;
}

.fw-llm-cal-head {
  font-size: 12px;
  font-weight: 600;
  color: #8b5cf6;
  margin-bottom: 6px;
}

.fw-llm-cal-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #f0f0ff;
  display: inline-block;
}

.fw-cal-direction {
  font-size: 11px;
  padding: 2px 0;
  margin-bottom: 6px;
}

.fw-cal-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.fw-cal-price-item {
  font-size: 11px;
  padding: 2px 8px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #e0e4f0;
}

.fw-cal-advice {
  font-size: 11px;
  margin-bottom: 4px;
}

.fw-cal-risks {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
}

.fw-cal-risk-item {
  font-size: 11px;
  color: #d98a00;
  padding: 1px 0;
}

.fw-llm-cal-skipped {
  border-style: dashed;
  opacity: 0.85;
  background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
}

.fw-llm-cal-na {
  border-style: dashed;
  opacity: 0.6;
  background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
}

/* ═══════════════════════════════════════════════════════════════
   v4.0 五价定价模型卡片
   ═══════════════════════════════════════════════════════════════ */

.fw-five-price-card {
  border-left: 3px solid #8b5cf6;
}

.fw-five-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.fw-five-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.fw-five-item.buy-now { border-left: 3px solid #3b82f6; }
.fw-five-item.buy-pre { border-left: 3px solid #f59e0b; }
.fw-five-item.buy-week { border-left: 3px solid #10b981; }
.fw-five-item.stop { border-left: 3px solid #ef4444; }
.fw-five-item.t1 { border-left: 3px solid #8b5cf6; }
.fw-five-item.t2 { border-left: 3px solid #ec4899; }
.fw-five-item.sell { border-left: 3px solid #f97316; }

.fw-five-item.fw-five-skipped {
  opacity: 0.6;
  border-left: 3px dashed #ccc;
}

.fw-five-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.fw-five-val {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fw-five-sub {
  font-size: 10px;
  color: var(--muted);
}

.fw-five-grid-item {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  margin-left: 2px;
}

.fw-five-footer {
  opacity: 0.7;
  font-size: 11px;
}

/* 芯片（Chip）组件 */
.fw-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fw-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f0f1f3;
  border: 1px solid var(--border);
  color: var(--text);
}

.fw-chip-warn {
  color: #d98a00;
  background: #fef3e1;
  border-color: #fbbf24;
}

/* ── 决策横幅中的仓位百分比行 ── */
.fw-decision-pos {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fef9e7;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
  color: var(--text);
}

/* ── v4.5 日历事件卡片 ── */
.fw-calendar-events-card {
  border-left: 3px solid #06b6d4;
}
.fw-cal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0;
}
@media (max-width: 600px) { .fw-cal-grid { grid-template-columns: 1fr; } }

.fw-cal-item {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.fw-cal-item.dividend {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-left: 3px solid #22c55e;
}
.fw-cal-item.dividend .fw-cal-icon { background: #22c55e; color: #fff; padding: 2px 4px; border-radius: 4px; font-size: 11px; }
.fw-cal-item.dividend .fw-cal-date { color: #15803d; font-weight: 700; white-space: nowrap; }
.fw-cal-item.earnings {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-left: 3px solid #3b82f6;
}
.fw-cal-item.earnings .fw-cal-icon { background: #3b82f6; color: #fff; padding: 2px 4px; border-radius: 4px; font-size: 11px; }
.fw-cal-item.earnings .fw-cal-date { color: #1d4ed8; font-weight: 700; white-space: nowrap; }
.fw-cal-desc { flex: 1; }
.fw-cal-days { font-size: 10px; margin-left: 4px; }
.fw-cal-days.cal-high { color: #dc2626; font-weight: 700; }
.fw-cal-days.cal-mid { color: #d97706; }

.fw-cal-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}
.fw-cal-badge-dividend { background: #dcfce7; color: #15803d; }
.fw-cal-badge-earnings { background: #dbeafe; color: #1d4ed8; }
.fw-cal-badge-calibrated { background: #ede9fe; color: #6d28d9; }

/* v4.5 五价 LLM 校准标记 */
.fw-cal-mark {
  font-size: 10px;
  color: #7c3aed;
  font-weight: 700;
  margin-left: 3px;
}

/* v5.1: 五价 LLM 校准值展示 — 醒目风格 */
.fw-five-item.fw-five-llm-adjusted {
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
  border: 1.5px solid #c4b5fd;
  box-shadow: 0 2px 8px rgba(139, 92, 246, .08);
}
.fw-five-val-llm {
  color: #7c3aed;
  font-weight: 800;
  font-size: 22px;
  margin-right: 6px;
  text-shadow: 0 1px 2px rgba(124, 58, 237, .08);
}
.fw-five-val-orig {
  color: #9ca3af;
  font-size: 13px;
  font-weight: 400;
  text-decoration: line-through;
  margin-left: 2px;
  opacity: 0.65;
}
.fw-five-llm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 3px 9px;
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(139, 92, 246, .25);
}
.fw-five-llm-badge .fw-llm-icon {
  font-size: 12px;
}
.fw-five-llm-badge .fw-five-llm-factor {
  background: rgba(255, 255, 255, .25);
  padding: 0 5px; border-radius: 6px;
  font-size: 10px; margin-left: 2px;
}
.fw-cal-mark:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.fw-llm-fpcal {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: #fff;
}

/* ═══════════════════════ 预警模块 v5.1 ═══════════════════════ */

/* Toast 通知容器 */
.alert-toast-container {
  position: fixed; top: 60px; right: 16px;
  z-index: 10000; display: flex; flex-direction: column;
  gap: 8px; max-width: 360px;
}

/* Toast 单项 */
.alert-toast {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  animation: alertSlideIn 0.3s ease-out;
  cursor: pointer; position: relative;
}
.alert-toast.price   { background: #fff3e0; border-left: 4px solid #f97316; color: #9a3412; }
.alert-toast.change  { background: #fce4ec; border-left: 4px solid #e91e63; color: #880e4f; }
.alert-toast.tech    { background: #e8f5e9; border-left: 4px solid #4caf50; color: #1b5e20; }
.alert-toast.volume  { background: #e3f2fd; border-left: 4px solid #2196f3; color: #0d47a1; }
.alert-toast.five    { background: #ede9fe; border-left: 4px solid #8b5cf6; color: #4a148c; }
.alert-toast.composite { background: #fce4ec; border-left: 4px solid #9c27b0; color: #4a148c; }

.alert-toast-close {
  position: absolute; top: 4px; right: 8px;
  font-size: 14px; color: inherit; opacity: 0.5; cursor: pointer;
  background: none; border: none;
}
.alert-toast-title { font-weight: 700; margin-bottom: 2px; }
.alert-toast-value { font-size: 12px; opacity: 0.85; }

@keyframes alertSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes alertSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

/* 闹钟按钮 */
.alert-bell-btn {
  position: relative; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 16px;
  cursor: pointer; color: var(--muted); transition: .15s;
}
.alert-bell-btn:hover { border-color: var(--primary); color: var(--primary); }
.alert-bell-btn.has-alert { color: #f97316; border-color: #f97316; animation: bellShake 0.5s; }

.alert-bell-badge {
  position: absolute; top: -4px; right: -4px;
  background: #ef4444; color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; border-radius: 8px; font-weight: 700;
}
.alert-bell-badge.hidden { display: none; }

@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
}

/* 预警管理面板（侧边抽屉） */
.alert-panel {
  position: fixed; top: 0; right: 0; width: 380px; height: 100vh;
  background: var(--panel); box-shadow: -4px 0 20px rgba(0,0,0,.15);
  z-index: 9000; display: flex; flex-direction: column;
  transition: transform 0.3s ease;
}
.alert-panel.hidden { transform: translateX(100%); }
.alert-panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.alert-panel-header h3 { margin: 0; font-size: 15px; }
.alert-panel-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.alert-panel-footer { padding: 12px 20px; border-top: 1px solid var(--border); }

/* 预警规则列表项 */
.alert-rule-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px; gap: 8px;
}
.alert-rule-item.disabled { opacity: 0.5; }
.alert-rule-info { flex: 1; }
.alert-rule-name { font-size: 13px; font-weight: 600; }
.alert-rule-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 开关 toggle */
.alert-toggle {
  position: relative; width: 40px; height: 22px; flex-shrink: 0;
  background: #d1d5db; border-radius: 11px; cursor: pointer;
  transition: background .2s; border: none;
}
.alert-toggle.active { background: #3b82f6; }
.alert-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; background: #fff;
  border-radius: 50%; transition: transform .2s;
}
.alert-toggle.active::after { transform: translateX(18px); }

/* 弹窗 */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.4); z-index: 10001;
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-content {
  background: var(--panel); border-radius: 12px; width: 480px;
  max-height: 70vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 15px; }
.modal-close { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.modal-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.modal-body select { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.modal-body input[type="number"] { background: var(--bg); color: var(--text); }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* 预警历史列表项 */
.alert-hist-item {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.alert-hist-item:last-child { border-bottom: none; }
.alert-hist-time { color: var(--muted); font-size: 11px; }
.alert-hist-msg { margin: 4px 0; }
.alert-hist-value { font-weight: 600; }
