/* research_forecast_v9.css —— 「行情预判 · 四维决策参考」（规则版本 V9）页面样式。
 * 只补充 research_forecast.html 内联样式里没有的部分；颜色、圆角、字号沿用全站约定：
 *   红涨 #dc2626 / 蓝跌 #1d4ed8 / 强调 #2563eb / 边框 #e5e7eb / 卡片圆角 10px / 正文 13px。
 * 所有类名以 rf- 开头，避免与其它页面样式冲突。
 */

/* ---------------- 页面工具条：版本切换（四维决策参考 / 多因素共振版）+ 数据日期 ---------------- */
.rf-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 14px; }
.rf-tabs { display: inline-flex; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: #fff; }
.rf-tabs a { padding: 5px 14px; font-size: 13px; color: #6b7280; font-weight: 500; text-decoration: none; white-space: nowrap; }
.rf-tabs a + a { border-left: 1px solid #e5e7eb; }
.rf-tabs a:hover { background: #f3f4f6; color: #111827; text-decoration: none; }
.rf-tabs a.on { background: #eff6ff; color: #2563eb; font-weight: 600; }
.rf-bar .rf-asof { margin-left: auto; font-size: 12px; color: #6b7280; font-variant-numeric: tabular-nums; }
.rf-bar .rf-asof b { color: #111827; }

/* ---------------- 通用小部件 ---------------- */
.rf-g { display: grid; gap: 10px; }
.rf-g > * { min-width: 0; }
.rf-g > .card { margin-top: 0; }                 /* 页面内联样式里 .card + .card 有上边距，网格里不需要 */
.rf-g.c2 { grid-template-columns: 1fr 1fr; }
.rf-g.c3 { grid-template-columns: repeat(3, 1fr); }
.rf-g.c4 { grid-template-columns: repeat(4, 1fr); }
.rf-g.c5 { grid-template-columns: repeat(5, 1fr); }
.rf-g.c21 { grid-template-columns: 3fr 2fr; }
@media (max-width: 980px) { .rf-g.c4, .rf-g.c5 { grid-template-columns: 1fr 1fr; } .rf-g.c21 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .rf-g.c2, .rf-g.c3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .rf-g.c4.wide { grid-template-columns: 1fr; } }
.rf-mt { margin-top: 10px; }
/* 等高的左右两列：列内卡片纵向排布，带 rf-grow 的卡片 / 图表吃掉剩余高度，保证两列底边对齐 */
.rf-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rf-col > .card { margin-top: 0; }
.rf-colcard { display: flex; flex-direction: column; }
.rf-grow { flex: 1 1 auto; }
.chart.rf-grow { height: 0; }                     /* 高度由 min-height 与弹性伸展决定，不受画布自身高度影响 */
.rf-k { font-size: 11.5px; color: #6b7280; font-weight: 600; }
.rf-v { font-size: 20px; font-weight: 800; color: #0f172a; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rf-d { font-size: 12px; color: #475569; margin-top: 4px; line-height: 1.6; }
.rf-d b, .rf-line b { color: #0f172a; }
.rf-line { font-size: 12.5px; color: #475569; line-height: 1.7; }
.rf-tile { border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; background: #fff; }
.rf-tile.red { border-color: #fecaca; background: #fff7f7; }
.rf-tile.blue { border-color: #bfdbfe; background: #f7faff; }
.rf-tile.gray { background: #f8fafc; }
.rf-tile.acc { border-color: #bfdbfe; background: #eff6ff; }
.rf-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 2px 8px; background: #fff; font-size: 12px; white-space: nowrap; }
.rf-chip b { font-variant-numeric: tabular-nums; }
.rf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rf-badge { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 8px; font-size: 10.5px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.rf-badge.sell { color: #1d4ed8; background: #eff6ff; }
.rf-badge.buy { color: #dc2626; background: #fef2f2; }
.rf-badge.hold { color: #4b5563; background: #f3f4f6; }
.rf-badge.spare { color: #9ca3af; background: #f8fafc; border: 1px dashed #e5e7eb; }
.rf-badge.warn { color: #b45309; background: #fffbeb; }
.rf-badge.ok { color: #047857; background: #ecfdf5; }
.rf-note { font-size: 12px; color: #64748b; line-height: 1.7; }
.rf-alert { border: 1px solid #fde68a; background: #fffbeb; color: #92400e; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 12px; }
.rf-spark { display: block; }
.chart.h260 { height: 260px; } .chart.h340 { height: 340px; }

/* 资金配置条：上一行股票 / 现金，下一行期指空头 */
.rf-stack { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: #eef2f7; font-size: 11px; font-weight: 700; color: #fff; }
.rf-stack > span { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; min-width: 0; }
.rf-stack .s { background: #dc2626; } .rf-stack .c { background: #cbd5e1; color: #475569; } .rf-stack .h { background: #2563eb; }
.rf-stack.fut { height: 14px; margin-top: 4px; background: transparent; font-weight: 600; }
.rf-stack.fut .h { border-radius: 4px; }
.rf-stack.fut .ft { justify-content: flex-start; padding-left: 6px; color: #2563eb; }
.rf-stack.fut .ft.none { padding-left: 0; color: #9ca3af; font-weight: 400; }

/* ---------------- 差异化资金体量方案 ---------------- */
.rf-scard { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; background: #fff; cursor: pointer; transition: border-color .1s; position: relative; }
.rf-scard:hover { border-color: #93c5fd; }
.rf-scard.on { border-color: #2563eb; box-shadow: inset 0 0 0 1px #2563eb; background: #fbfdff; }
.rf-scard .h { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: #111827; }
.rf-scard .h .sk { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: #e5e7eb; color: #374151; font-size: 12px; font-weight: 800; }
.rf-scard.on .h .sk { background: #2563eb; color: #fff; }
.rf-scard .h .tg { margin-left: auto; font-size: 10.5px; font-weight: 600; color: #6b7280; background: #f3f4f6; border-radius: 8px; padding: 0 7px; line-height: 18px; }
.rf-scard .h .qm { font-weight: 400; }
.rf-scard .sub { display: flex; align-items: center; min-height: 24px; margin: 5px 0 8px; font-size: 11.5px; color: #6b7280; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rf-scard .sub b { color: #0f172a; margin: 0 3px; }
.rf-scard .m4 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 10px; }
.rf-scard .m4 .rf-v { font-size: 16px; }
.rf-scard .nav { margin-top: 8px; }
.rf-scard:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.rf-floor { display: inline-flex; align-items: center; gap: 4px; }
.rf-floor > span { margin-right: 2px; }
.rf-floor button { border: 1px solid #e5e7eb; background: #fff; color: #4b5563; border-radius: 5px; padding: 1px 7px; font-size: 11px; line-height: 18px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.rf-floor button:hover { border-color: #93c5fd; }
.rf-floor button.on { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.rf-status { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: #475569; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fafbfc; margin-top: 10px; }
.rf-status b { color: #0f172a; font-variant-numeric: tabular-nums; }

/* ---------------- 仓位 ---------------- */
.rf-heat { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(34px, 1fr); gap: 2px; }
.rf-heat .hc { border-radius: 4px; padding: 6px 0; text-align: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rf-heat .hd { font-size: 10px; color: #9ca3af; text-align: center; padding: 0 0 2px; font-variant-numeric: tabular-nums; }
.rf-heat-row { display: grid; grid-template-columns: 86px 1fr; gap: 8px; align-items: center; margin-bottom: 3px; font-size: 12px; color: #6b7280; }
.rf-log { list-style: none; margin: 0; padding: 0; }
.rf-log li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f1f5f9; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rf-log li:last-child { border-bottom: 0; }
.rf-log .ld { color: #6b7280; width: 78px; }
.rf-log .la { margin-left: auto; font-weight: 700; }

/* ---------------- 行业与题材 ---------------- */
/* 左：一级行业强弱 + 持仓个股；右：二级行业 / 题材 / 强势行业。两列等高：右列最后一张卡片（强势二级行业）吃掉剩余高度，表格在卡片内滚动。 */
.rf-ind { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.rf-ind-r { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rf-ind-r > .card { margin-top: 0; }
.rf-fill-card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.rf-fill { flex: 1 1 0; height: 0; min-height: 220px; overflow: auto; }
.rf-fill table.t thead th { position: sticky; top: 0; z-index: 1; }
.rf-fill table.t td { padding-top: 4px; padding-bottom: 4px; }
.rf-fill .rf-spark, .rf-ir .rf-spark { display: inline-block; vertical-align: middle; }
.rf-ir { display: grid; grid-template-columns: 72px 64px minmax(70px, 1fr) 50px minmax(0, 2.6fr) 40px; grid-template-areas: "in sp tr iv sl sc"; gap: 0 8px; align-items: center; min-height: 31px; padding: 2px 0; border-bottom: 1px solid #f8fafc; font-size: 12px; }
.rf-ir:last-child { border-bottom: 0; }
.rf-ir .in { grid-area: in; text-align: right; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-ir.has .in { font-weight: 700; }
.rf-ir .sp { grid-area: sp; text-align: center; line-height: 0; }
.rf-ir .sp .mut { line-height: 20px; }
.rf-ir .tr { grid-area: tr; height: 12px; position: relative; background: #f8fafc; border-radius: 3px; }
.rf-ir .tr::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; border-left: 1px solid #cbd5e1; }
.rf-ir .fl { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.rf-ir .fl.up { left: 50%; background: #f87171; } .rf-ir .fl.dn { right: 50%; background: #60a5fa; }
.rf-ir .iv { grid-area: iv; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.rf-ir .sl { grid-area: sl; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.rf-ir .sc { grid-area: sc; text-align: right; font-variant-numeric: tabular-nums; color: #6b7280; font-weight: 600; white-space: nowrap; }
.rf-ir .sc.full { color: #dc2626; } .rf-ir .sc.z { color: #d1d5db; font-weight: 400; }
.rf-ir.hd { min-height: 0; padding: 0 0 5px; border-bottom: 1px solid #e5e7eb; font-size: 11.5px; font-weight: 600; color: #6b7280; }
.rf-ir.hd .in { color: #6b7280; font-weight: 600; }
.rf-ir.hd .sp { line-height: inherit; }
.rf-ir.hd .tr { height: auto; background: none; text-align: center; }
.rf-ir.hd .tr::before { display: none; }
.rf-ir.hd .sl { display: block; }
.rf-slot { height: 24px; border-radius: 6px; border: 1px dashed #d1d5db; background: #fafbfc; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: #9ca3af; overflow: hidden; white-space: nowrap; padding: 0 4px; min-width: 0; }
.rf-slot.f { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; font-weight: 600; }
.rf-slot.f a { color: inherit; overflow: hidden; text-overflow: ellipsis; }
.rf-slot.f.buy { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.rf-ibar { display: grid; grid-template-columns: 86px 1fr 52px; gap: 8px; align-items: center; padding: 3px 0; font-size: 12.5px; }
.rf-ibar .in { text-align: right; color: #111827; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-ibar .tr { height: 14px; background: #f1f5f9; border-radius: 3px; position: relative; }
.rf-ibar .fl { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #93c5fd, #2563eb); }
.rf-ibar .fl.full { background: linear-gradient(90deg, #fca5a5, #dc2626); }
.rf-ibar .iv { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rf-ibar .iv small { font-weight: 400; color: #9ca3af; }
@media (max-width: 980px) {
  .rf-ind { grid-template-columns: 1fr; }
  .rf-fill { flex: none; height: auto; max-height: 420px; }
}

/* ---------------- 个股 ---------------- */
.rf-dbar { position: relative; height: 12px; min-width: 90px; background: #f8fafc; border-radius: 3px; }
.rf-dbar::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; border-left: 1px solid #cbd5e1; }
.rf-dbar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.rf-dbar i.up { left: 50%; background: #f87171; } .rf-dbar i.dn { right: 50%; background: #60a5fa; }
/* 模型排名轨道：刻度 0 ~ 40%，前 6%（买入区，浅红）/ 6% ~ 30%（持有区，灰）/ 30% 以外（卖出区，浅蓝） */
.rf-rk { position: relative; height: 12px; min-width: 110px; border-radius: 3px; background: linear-gradient(90deg, #fecaca 0, #fecaca 15%, #eef2f7 15%, #eef2f7 75%, #bfdbfe 75%, #bfdbfe 100%); }
.rf-rk i { position: absolute; top: -3px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: #0f172a; }
.rf-rk.near i { background: #d97706; }
.rf-rk.out i { background: #1d4ed8; }
table.t th.sortable { cursor: pointer; user-select: none; }
table.t th.sortable:hover { color: #2563eb; }
table.t th.sortable.asc::after { content: " ↑"; color: #2563eb; } table.t th.sortable.desc::after { content: " ↓"; color: #2563eb; }
table.t td.c, table.t th.c { text-align: center; }
.rf-rk u { position: absolute; top: 4px; height: 4px; background: rgba(15, 23, 42, .26); border-radius: 2px; text-decoration: none; }

/* ---------------- 止盈止损 ---------------- */
.rf-rule { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 760px) { .rf-rule { grid-template-columns: 1fr; } }

@media (max-width: 760px) {
  .rf-bar .rf-asof { margin-left: 0; flex-basis: 100%; }
  .tv-page-forecast .section-title { flex-wrap: wrap; }
  /* 行业行：第一行 名称 / 走势 / 强弱条 / 取值 / 只数，第二行为持仓个股 */
  .rf-ir { grid-template-columns: 60px 48px minmax(0, 1fr) 46px 34px; grid-template-areas: "in sp tr iv sc" "sl sl sl sl sl"; gap: 4px 6px; font-size: 11.5px; }
  .rf-ir .sl.none, .rf-ir.hd .sl { display: none; }
  .rf-ir.has { padding-bottom: 6px; }
}
