/* ============================================================
   pages/prediction.css — 风险预测引擎
   板块A 卡料概率预测 · 板块B What-If 场景推演器
   ============================================================ */

/* ---------------- 通用小节标题 ---------------- */
#page-prediction .sec-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  margin: 16px 0 8px;
}
#page-prediction .sec-label.sec-label-top { margin-top: 0; }
#page-prediction .sec-label::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px;
  background: var(--red); flex-shrink: 0;
}
#page-prediction .sec-label .t-en {
  font-size: 9.5px; color: var(--ink-4); letter-spacing: 1.4px; font-weight: 600;
}

/* ================================================================
   板块 A · 卡料概率预测
   ================================================================ */
#page-prediction .pred-grid {
  display: grid; grid-template-columns: 300px 1fr; gap: 22px;
}

/* ---- 左列：因子表单 ---- */
#page-prediction .pred-left {
  border-right: 1px solid var(--line-2); padding-right: 22px;
  display: flex; flex-direction: column;
}
#page-prediction .pred-form .field { margin-bottom: 13px; }
#page-prediction .pred-form .field-label { font-size: 12px; }
#page-prediction .pred-run { width: 100%; margin-top: 6px; letter-spacing: 1px; }
#page-prediction .pred-run-note {
  font-size: 11px; color: var(--ink-4); line-height: 1.6;
  margin-top: 10px; text-align: center;
}

/* ---- 右列：结果区 ---- */
#page-prediction .pred-right { min-width: 0; }
#page-prediction .pred-gauge { height: 230px; }

#page-prediction .pred-level-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 2px;
}
#page-prediction .pred-level-row .tag { font-size: 12px; padding: 4px 11px; border-radius: 7px; }
#page-prediction .pred-level-name { font-size: 13px; font-weight: 700; }
#page-prediction .pred-level-th {
  margin-left: auto; font-size: 10.5px; color: var(--ink-4); font-weight: 600; letter-spacing: .3px;
}
#page-prediction .pred-model-note {
  margin-top: 7px; line-height: 1.7; font-size: 11.5px; color: var(--ink-3);
}
#page-prediction .pred-model-note b { color: var(--ink-2); }

#page-prediction .pred-contrib { height: 220px; }

/* 行动建议卡片 */
#page-prediction .pred-advice { display: flex; flex-direction: column; gap: 8px; }
#page-prediction .adv-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; transition: border-color .15s, background .15s, transform .15s;
  animation: pageIn .3s ease both;
}
#page-prediction .adv-item:hover {
  border-color: #EFC9C9; background: var(--red-soft); transform: translateX(2px);
}
#page-prediction .adv-tag { flex-shrink: 0; margin-top: 1px; padding: 3px 9px; }
#page-prediction .adv-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }

/* ================================================================
   板块 B · What-If 场景推演器
   ================================================================ */
#page-prediction .wf-controls {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px;
}
#page-prediction .wf-sliders { border-left: 1px solid var(--line-2); padding-left: 22px; }

/* ---- 场景按钮组 ---- */
#page-prediction .scen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#page-prediction .scen-btn {
  text-align: left; font-family: inherit; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 11px 13px; transition: all .16s;
}
#page-prediction .scen-btn:hover { border-color: var(--ink-4); box-shadow: var(--shadow-sm); }
#page-prediction .scen-btn.active {
  border-color: var(--red); background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, .08);
}
#page-prediction .scen-name { font-size: 13px; font-weight: 700; color: var(--ink); }
#page-prediction .scen-btn.active .scen-name { color: var(--red); }
#page-prediction .scen-desc { font-size: 10.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.55; }

/* ---- 滑块区 ---- */
#page-prediction .wf-slider { margin-bottom: 16px; }
#page-prediction .wf-slider-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 9px;
}
#page-prediction .wf-slider-val {
  font-size: 13px; font-weight: 700; color: var(--red);
  background: var(--red-tint); padding: 2px 9px; border-radius: 7px; min-width: 52px; text-align: center;
}
#page-prediction .wf-slider-scale {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--ink-4); margin-top: 5px;
}
#page-prediction .wf-slider-note { font-size: 11px; color: var(--ink-4); line-height: 1.6; }

/* ---- 结果区 ---- */
#page-prediction .wf-results {
  display: grid; grid-template-columns: 3fr 2fr; gap: 14px;
}
#page-prediction .wf-panel {
  background: #FAFBFC; border: 1px solid var(--line-2); border-radius: 12px;
  padding: 14px 16px; min-width: 0;
}
#page-prediction .wf-panel-hd {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; font-size: 12.5px;
}
#page-prediction .wf-chart { height: 260px; }

/* 关键指标对比 */
#page-prediction .wf-metrics { display: flex; flex-direction: column; }
#page-prediction .wm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10.5px 2px; border-bottom: 1px solid var(--line-2);
}
#page-prediction .wm-row:last-child { border-bottom: none; }
#page-prediction .wm-name {
  flex: 1; font-size: 12px; font-weight: 600; color: var(--ink-2);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
#page-prediction .wm-unit { font-size: 10px; color: var(--ink-4); font-weight: 500; }
#page-prediction .wm-vals {
  display: flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap;
}
#page-prediction .wm-base { color: var(--ink-3); }
#page-prediction .wm-arrow-s { color: var(--ink-4); font-size: 11px; }
#page-prediction .wm-new { font-weight: 700; color: var(--ink); }
#page-prediction .wm-delta {
  min-width: 76px; text-align: right; font-size: 12px; font-weight: 700; white-space: nowrap;
}
#page-prediction .wm-delta.bad { color: var(--red); }
#page-prediction .wm-delta.good { color: var(--green); }
#page-prediction .wm-delta.flat { color: var(--ink-4); font-weight: 500; }

/* 告警卡片 */
#page-prediction .wf-alerts-panel { grid-column: 1 / -1; }
#page-prediction .wf-alerts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px;
}
#page-prediction .wf-alert {
  position: relative; overflow: hidden;
  display: flex; background: #fff; border: 1px solid var(--line-2);
  border-radius: 10px; padding: 12px 14px 12px 18px;
  animation: pageIn .3s ease both;
}
#page-prediction .wf-alert::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--ac, var(--ink-4));
}
#page-prediction .wf-alert.lv-P0 { --ac: #CC0000; }
#page-prediction .wf-alert.lv-P1 { --ac: #E05E0B; }
#page-prediction .wf-alert.lv-P2 { --ac: #C77700; }
#page-prediction .wf-alert.lv-P3 { --ac: #0B8A5C; }
#page-prediction .wa-title { display: flex; align-items: center; gap: 8px; }
#page-prediction .wa-name { font-size: 12.5px; font-weight: 700; color: var(--ink); }
#page-prediction .wa-text { font-size: 11.5px; color: var(--ink-3); line-height: 1.7; margin-top: 6px; }

/* ---- 顶栏 chip ---- */
#page-prediction .chip b { color: var(--red); }

/* ---------------- 响应式兜底 ---------------- */
@media (max-width: 1280px) {
  #page-prediction .pred-grid { grid-template-columns: 260px 1fr; gap: 16px; }
  #page-prediction .wf-results { grid-template-columns: 1fr; }
  #page-prediction .wf-controls { grid-template-columns: 1fr; }
  #page-prediction .wf-sliders { border-left: none; padding-left: 0; border-top: 1px solid var(--line-2); padding-top: 16px; }
}
@media (max-width: 960px) {
  #page-prediction .pred-grid { grid-template-columns: 1fr; }
  #page-prediction .pred-left { border-right: none; padding-right: 0; border-bottom: 1px solid var(--line-2); padding-bottom: 16px; }
}
