/* ============================================================
   SteelEye — 钢铁车间 × 仪表盘风格
   原创：炭黑底 + 钢蓝 + 警示橙 + 警告红
   字号偏大、对比度高、SVG 等比缩放、字体清晰
   ============================================================ */

:root {
  --bg:        #e6ebf0;
  --bg-2:      #d5dde6;
  --panel:     #f7f9fb;
  --panel-2:   #eef2f6;
  --line:      rgba(30,46,66,.10);
  --line-2:    rgba(30,46,66,.18);
  --text:      #1d2733;
  --text-2:    #445366;
  --text-3:    #66778a;
  --text-4:    #8b9aab;

  --steel:     #24537d;
  --steel-2:   #3d6f9d;
  --steel-dim: rgba(36,83,125,.10);
  --cyan:      #24537d;
  --amber:     #b86e00;
  --amber-dim: rgba(184,110,0,.12);
  --red:       #b42318;
  --red-dim:   rgba(180,35,24,.10);
  --green:     #067647;
  --green-dim: rgba(6,118,71,.10);
  --violet:    #5b6472;

  --radius:    8px;
  --radius-sm: 4px;
  --shadow:    0 4px 18px rgba(0,0,0,.45);
  --mono:      ui-monospace, "JetBrains Mono", "SF Mono", Consolas, "Cascadia Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* 数字字体等宽 */
.num, .kpi-val, .clock, .verdict-conf, .table td, .chart text,
.data-table td, .prob-bar-val, .oee-kpi-val, .spc-cap-val { font-variant-numeric: tabular-nums; }

/* ==================== 顶栏 ==================== */
.topbar {
  height: 60px;
  background: #0d2b45;
  color: #f4f7fa;
  border-bottom: 1px solid #081e32;
  display: flex; align-items: center;
  padding: 0 22px; gap: 28px;
  position: relative;
}
.topbar::before {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 2px;
  width: 100%;
  background: #8ea0b3;
  opacity: .8;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 38px; height: 38px; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.brand-sub  { font-size: 11.5px; color: #c5d2df; letter-spacing: 1.5px; }

.plant-status {
  display: flex; align-items: center; gap: 14px;
  margin-left: 32px; padding: 7px 16px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.8s ease-in-out infinite;
}
.status-label { font-size: 12.5px; color: #c5d2df; letter-spacing: 1px; }
.lamp { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 12.5px; color: #e7eef5; }
.lamp i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px currentColor;
  color: var(--green);
}
.lamp[data-line="L2"] i { background: var(--amber); color: var(--amber); }
.lamp[data-line="L3"] i { background: var(--red); color: var(--red); }

.top-meta { margin-left: auto; text-align: right; font-family: var(--mono); }
.clock { font-size: 17px; font-weight: 600; color: #f4f7fa; }
.date  { font-size: 12px; color: #c5d2df; display: block; }

/* ==================== 布局 ==================== */
.layout { display: flex; height: calc(100vh - 60px); }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: #f7f9fb; border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 16px 12px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius);
  color: var(--text-2); cursor: pointer;
  font-size: 14.5px; user-select: none;
  transition: all .18s ease;
  border-left: 2px solid transparent;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.035); color: var(--text); }
.nav-item.active {
  background: #e7eef5;
  color: var(--text);
  border-left-color: var(--steel);
}
.nav-item.active::after {
  content: ""; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; background: var(--steel); border-radius: 50%;
}
.nav-ico {
  font-size: 14px; width: 18px; text-align: center;
  color: var(--steel); opacity: .8;
}
.nav-item.active .nav-ico { color: var(--steel); opacity: 1; }
.sidebar-footer { padding: 14px 14px; border-top: 1px solid var(--line); }
.ver { font-family: var(--mono); font-size: 11.5px; color: var(--text-4); }
.powered { font-size: 10.5px; color: var(--text-4); margin-top: 3px; }

/* ==================== 主区 ==================== */
.main {
  flex: 1; overflow-y: auto; padding: 24px 28px;
  position: relative;
}
.main::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(140,170,210,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,170,210,.018) 1px, transparent 1px);
  background-size: 40px 40px;
}

.page { display: block; animation: fade .35s ease; }
/* 通用隐藏工具类：页面里大量元素用 class="... hidden" 做初始隐藏，
   之前只定义了 .page.hidden 和 .modal.hidden，导致 .dz-preview / .detect-out /
   .card 等带 hidden 的元素实际一直显示（表现为空的破图占位和多余面板）。 */
.hidden { display: none !important; }

.page.hidden { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: .5px; }
.src-tag, .src-mini {
  font-size: 11.5px; color: var(--text-3);
  font-family: var(--mono); letter-spacing: .5px;
}
.src-tag {
  padding: 4px 10px; background: var(--steel-dim);
  border: 1px solid rgba(58,123,213,.3); border-radius: 12px;
}
.src-tag::before { content: "⬡ "; color: var(--steel); }

/* ==================== KPI ==================== */
.kpi-row {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  padding: 16px 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--steel);
}
.kpi.k-warn::before { background: var(--amber); }
.kpi.k-bad::before  { background: var(--red); }
.kpi.k-good::before { background: var(--green); }
.kpi-label { font-size: 12px; color: var(--text-3); letter-spacing: 1px; }
.kpi-val {
  font-size: 26px; font-weight: 700; margin-top: 6px;
  color: var(--text); letter-spacing: .5px;
}
.kpi-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; font-family: var(--mono); }
.kpi-sub.up   { color: var(--green); }
.kpi-sub.down { color: var(--red); }

/* ==================== 卡片 ==================== */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  position: relative; transition: border-color .2s;
}
.card:hover { border-color: var(--line-2); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-head h3 { font-size: 15.5px; font-weight: 600; letter-spacing: .3px; }

.grid-2-1 {
  display: grid; grid-template-columns: 2fr 1fr; gap: 16px;
  margin-bottom: 16px;
}

/* ==================== 图表 ==================== */
.chart { width: 100%; height: 240px; position: relative; }
.chart-tall { height: 320px; }
.chart svg { display: block; overflow: visible; }
.chart text {
  fill: #66778a; font-size: 11.5px;
  font-family: var(--mono);
}
.chart .grid-line { stroke: rgba(30,46,66,.08); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); }
.empty { padding: 32px; text-align: center; color: var(--text-4); font-size: 13px; }

.legend {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px;
  margin-top: 14px; font-size: 12px;
}
.legend-item { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.legend-swatch { width: 14px; height: 4px; border-radius: 2px; }

/* ==================== 告警 ==================== */
.alerts-card { display: flex; flex-direction: column; }
.alerts { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 320px; }
.alert-item {
  padding: 11px 14px;
  background: var(--red-dim); border: 1px solid rgba(255,82,82,.18);
  border-left: 3px solid var(--red); border-radius: var(--radius-sm);
  display: flex; justify-content: space-between; align-items: center;
  animation: slideIn .35s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.alert-time { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.alert-line { font-weight: 600; color: var(--text); }
.alert-ratio { color: var(--red); font-family: var(--mono); font-weight: 700; }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 8px var(--red);
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ==================== 检测 ==================== */
.detect-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.dropzone {
  display: flex; align-items: center; justify-content: center;
  min-height: 360px; cursor: pointer;
  border: 2px dashed rgba(58,123,213,.3) !important;
  transition: all .25s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--steel) !important;
  background: rgba(58,123,213,.04);
}
.dz-empty { text-align: center; }
.dz-empty svg { margin-bottom: 14px; }
.dz-text { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }
.dz-hint  { font-size: 12px; color: var(--text-4); font-family: var(--mono); }
.dz-preview { text-align: center; }
.dz-preview img {
  max-width: 100%; max-height: 320px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
}
.btn-repick {
  margin-top: 12px; padding: 7px 18px;
  background: transparent; border: 1px solid var(--line-2);
  color: var(--text-2); border-radius: var(--radius-sm); cursor: pointer;
}
.btn-repick:hover { border-color: var(--steel); color: var(--text); }

.detect-empty { padding: 60px; text-align: center; color: var(--text-4); }
.verdict { padding: 20px; text-align: center; position: relative; }
.verdict-name { font-size: 26px; font-weight: 700; margin-bottom: 4px; color: var(--amber); }
.verdict-conf {
  font-size: 14px; color: var(--text-3); font-family: var(--mono);
}
.conf-ring {
  position: absolute; right: 20px; top: 20px; width: 76px; height: 76px;
}
.prob-list { margin-top: 14px; }
.prob-row { padding: 9px 0; }
.prob-head { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 13px; }
.prob-name { color: var(--text-2); }
.prob-bar-val { font-family: var(--mono); color: var(--text); }
.prob-bar { height: 6px; background: rgba(255,255,255,.04); border-radius: 3px; overflow: hidden; }
.prob-bar-fill {
  height: 100%; background: #8ea0b3;
  border-radius: 3px;
  transition: width .8s cubic-bezier(.4,.0,.2,1);
}
.prob-row.top .prob-bar-fill {
  background: #b86e00;
}
.dict-link {
  margin-top: 14px; padding: 12px 14px;
  background: rgba(255,255,255,.02); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2);
}
.btn {
  padding: 8px 18px; background: #0d2b45; color: white;
  border: none; border-radius: var(--radius-sm);
  font-size: 13.5px; cursor: pointer; transition: opacity .2s;
  font-family: inherit;
}
.btn:hover { opacity: .85; }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--steel); color: var(--text); }
.btn-small { padding: 4px 10px; font-size: 12px; }
.detect-chain {
  margin-top: 14px; padding: 12px 14px;
  background: rgba(255,255,255,.02); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2);
}
.detect-chain b { color: var(--text); font-family: var(--mono); }
.lamp.warn i { background: var(--amber); color: var(--amber); }
.lamp.bad i { background: var(--red); color: var(--red); }
.lamp.good i { background: var(--green); color: var(--green); }

/* ==================== 归因 ==================== */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.select, .input, .textarea {
  padding: 7px 12px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--text); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; outline: none;
}
.select:focus, .input:focus, .textarea:focus { border-color: var(--steel); }
.select-wide { min-width: 220px; }
.textarea { resize: vertical; min-height: 36px; width: 100%; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.chk input { cursor: pointer; }

.attr-layout { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 16px; }
.attr-verdict .card-head { margin-bottom: 14px; }
.verdict-cause {
  font-size: 22px; font-weight: 700; padding: 14px;
  border-radius: var(--radius); text-align: center; margin-bottom: 12px;
}
.verdict-cause.equipment { background: var(--red-dim); color: var(--red); }
.verdict-cause.material  { background: var(--green-dim); color: var(--green); }
.verdict-cause.unknown   { background: rgba(255,255,255,.04); color: var(--text-3); }
.attr-stat {
  display: flex; justify-content: space-between;
  padding: 8px 0; font-size: 13px; border-bottom: 1px dashed var(--line);
}
.attr-stat:last-child { border: none; }
.attr-stat-key { color: var(--text-3); }
.attr-stat-val { font-family: var(--mono); color: var(--text); }

.evi { margin-top: 12px; }
.evi-item {
  padding: 8px 12px; margin-top: 6px;
  background: rgba(255,255,255,.02); border-left: 2px solid var(--steel);
  font-size: 12.5px; line-height: 1.7; color: var(--text-2);
}
.similar-item {
  padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: 8px;
  font-size: 12.5px;
}
.similar-item:hover { border-color: var(--steel); }
.similar-head {
  display: flex; justify-content: space-between; margin-bottom: 4px;
  font-family: var(--mono); color: var(--text-3);
}
.similar-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; background: var(--amber-dim); color: var(--amber);
}

/* ==================== 设备 ==================== */
.eq-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; margin-bottom: 16px; }
.health-big {
  font-size: 56px; font-weight: 800; text-align: center;
  letter-spacing: 2px;
}
.health-big.good { color: var(--green); }
.health-big.warn { color: var(--amber); }
.health-big.bad  { color: var(--red); }
.health-label { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 6px; }
.health-band {
  margin-top: 14px; padding: 8px 14px;
  background: rgba(255,255,255,.02); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-2);
}
.health-stat {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 13px;
}
.health-stat-key { color: var(--text-3); }
.health-stat-val { font-family: var(--mono); }

/* ==================== OEE ==================== */
.oee-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.oee-kpi {
  padding: 18px 22px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  text-align: center;
}
.oee-kpi-label { font-size: 12.5px; color: var(--text-3); letter-spacing: 1.5px; }
.oee-kpi-val { font-size: 36px; font-weight: 800; margin-top: 8px; color: #0d2b45; }
.oee-kpi-sub { font-size: 11px; color: var(--text-4); margin-top: 4px; font-family: var(--mono); }
.oee-kpi.k-avail .oee-kpi-val { color: var(--steel-2); }
.oee-kpi.k-perf  .oee-kpi-val { color: var(--amber); }
.oee-kpi.k-qual  .oee-kpi-val { color: var(--green); }

.oee-bars { display: flex; flex-direction: column; gap: 16px; padding: 8px 0; }
.oee-bar-row { display: flex; align-items: center; gap: 14px; }
.oee-bar-label { width: 50px; font-weight: 600; color: var(--text); }
.oee-bar-track {
  flex: 1; display: flex; gap: 3px; height: 28px;
  border-radius: 4px; overflow: hidden;
  background: rgba(255,255,255,.02);
}
.oee-bar-seg { display: flex; align-items: center; justify-content: center; color: white; font-size: 11.5px; font-family: var(--mono); transition: width .8s; }
.oee-bar-seg.avail { background: #24537d; }
.oee-bar-seg.perf  { background: #8ea0b3; }
.oee-bar-seg.qual  { background: #067647; }
.oee-bar-val { width: 70px; font-family: var(--mono); font-weight: 600; text-align: right; }

/* ==================== SPC ==================== */
.spc-cap-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.spc-cap {
  padding: 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  text-align: center;
}
.spc-cap-label { font-size: 11.5px; color: var(--text-3); letter-spacing: .5px; }
.spc-cap-val { font-size: 22px; font-weight: 700; margin-top: 6px; }
.spc-cap.good .spc-cap-val { color: var(--green); }
.spc-cap.warn .spc-cap-val { color: var(--amber); }
.spc-cap.bad  .spc-cap-val { color: var(--red); }
.warn-pill {
  padding: 3px 10px; border-radius: 12px;
  background: var(--amber-dim); color: var(--amber);
  font-size: 11.5px; font-family: var(--mono);
}
.violation-marker { fill: var(--red); stroke: white; stroke-width: 1.5; }

/* ==================== 表格 ==================== */
.table-wrap { overflow-x: auto; max-height: 540px; overflow-y: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  padding: 10px 12px; text-align: left;
  background: var(--panel-2); color: var(--text-3);
  font-weight: 600; font-size: 12px; letter-spacing: .5px;
  border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; z-index: 1;
}
.data-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
.data-table tr:hover td { background: rgba(255,255,255,.02); color: var(--text); }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-family: var(--mono);
}
.tag-green  { background: var(--green-dim); color: var(--green); }
.tag-amber  { background: var(--amber-dim); color: var(--amber); }
.tag-red    { background: var(--red-dim);   color: var(--red); }
.tag-blue   { background: var(--steel-dim); color: var(--steel-2); }
.tag-gray   { background: rgba(255,255,255,.04); color: var(--text-3); }
.row-btn {
  padding: 3px 9px; font-size: 11.5px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); color: var(--text-2);
  border-radius: var(--radius-sm); margin-right: 4px;
}
.row-btn:hover { border-color: var(--steel); color: var(--text); }
.row-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* ==================== 字典 ==================== */
.dict-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.dict-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  transition: all .2s;
}
.dict-card:hover { border-color: var(--steel); transform: translateY(-2px); }
.dict-card h3 { font-size: 16px; margin-bottom: 4px; }
.dict-card .dc-key {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-4);
}
.dict-section { margin-top: 12px; }
.dict-section-label {
  font-size: 11.5px; color: var(--text-3); letter-spacing: 1px;
  margin-bottom: 4px;
}
.dict-section-content { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.dict-sev {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 11.5px; margin-top: 6px;
}
.sev-low  { background: var(--green-dim); color: var(--green); }
.sev-mid  { background: var(--amber-dim); color: var(--amber); }
.sev-high { background: var(--red-dim);   color: var(--red); }

/* ==================== 数据来源 ==================== */
.src-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px;
}
.src-card h3 { font-size: 16px; margin-bottom: 6px; }
.src-meta { display: grid; grid-template-columns: 100px 1fr; gap: 4px 14px; font-size: 13px; margin-top: 10px; }
.src-meta-k { color: var(--text-3); }
.src-meta-v { color: var(--text-2); word-break: break-all; }
.src-card.synthetic { border-left: 3px solid var(--amber); }
.src-card.public    { border-left: 3px solid var(--green); }

/* ==================== 模态 ==================== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(3px);
}
.modal.hidden { display: none; }
.modal-card {
  width: 460px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.modal-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-3); }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* ==================== Toast ==================== */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 11px 22px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font-size: 13.5px; opacity: 0; pointer-events: none;
  transition: all .3s; z-index: 200;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(30,46,66,.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(30,46,66,.3); }
.shot { position: relative; display: inline-block; max-width: 100%; }
.shot img { display: block; max-width: 100%; max-height: 360px; }
.region {
  position: absolute; box-sizing: border-box;
  border: 2px dashed #ff6b6b; background: rgba(255,107,107,.10);
}
.region-tag {
  position: absolute; top: 0; left: 2px;
  font-size: 11px; line-height: 1.3; color: #ff6b6b; font-weight: 700;
}

/* 归因置信度分档 */
.confidence-high   { color: #2e7d32; }
.confidence-medium { color: #ef6c00; }
.confidence-low    { color: #c62828; }
.action-note { margin-top: 6px; padding: 6px 10px; border-radius: 4px; font-size: 12.5px; }
.action-note.high    { background: rgba(46,125,50,.10);  border-left: 4px solid #2e7d32; }
.action-note.warning { background: rgba(239,108,0,.10); border-left: 4px solid #ef6c00; }
.detect-chain .alert { margin-top: 6px; padding: 6px 10px; border-radius: 4px; font-size: 12.5px; }
.detect-chain .alert.success { background: rgba(46,125,50,.10);  border-left: 4px solid #2e7d32; }
.detect-chain .alert.warning { background: rgba(255,193,7,.16); border-left: 4px solid #f9a825; }
.highlight-note { margin-top: 6px; font-size: 12px; color: var(--text-3); }

@media (max-width: 1400px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .dict-grid { grid-template-columns: repeat(2, 1fr); }
  .spc-cap-row { grid-template-columns: repeat(3, 1fr); }
}
