/* ---------- 火险摘要 ---------- */
.risk-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 24px;
  padding: 17px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-left: 4px solid var(--risk-color, #6f9f72);
  background: linear-gradient(135deg, rgba(255, 252, 248, 0.78), rgba(241, 245, 232, 0.62));
  backdrop-filter: blur(22px);
  box-shadow: 0 14px 40px rgba(55, 44, 30, 0.06);
}
.risk-strip-main { min-width: 0; flex: 1; }
.risk-eyebrow {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary, #8a7d70);
  font-weight: 700;
}
.risk-title-row { display: flex; align-items: baseline; gap: 10px; margin-top: 3px; }
.risk-title-row strong {
  font-family: var(--font-display, inherit);
  font-size: 30px;
  line-height: 1;
  color: var(--risk-color, #6f9f72);
  letter-spacing: -0.03em;
}
.risk-title-row > span:not(.source-badge) { font-size: 13px; color: var(--text-secondary); }
.risk-strip p { margin: 5px 0 0; font-size: 12px; color: var(--text-secondary); }
.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  color: #6b5a4c;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(120, 90, 60, 0.12);
  white-space: nowrap;
}
.risk-strip-metrics {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: none;
}
.risk-strip-metrics > div { text-align: center; }
.risk-strip-metrics span { display: block; font-size: 10.5px; color: var(--text-secondary); }
.risk-strip-metrics strong { display: block; font-size: 19px; line-height: 1.15; margin-top: 2px; color: var(--text); }
.risk-levels { display: flex; gap: 4px; align-items: center; }
.risk-level-chip {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 10px;
  color: #6b5a4c;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(120, 90, 60, 0.1);
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .risk-strip { flex-wrap: wrap; gap: 14px 18px; }
  .risk-strip-main { flex: 1 1 100%; }
  .risk-strip-metrics { flex: 1; justify-content: flex-start; }
}
@media (max-width: 767px) {
  .risk-strip { padding: 15px 16px; }
  .risk-title-row strong { font-size: 25px; }
  .risk-strip-metrics { gap: 14px; flex-wrap: wrap; }
}

/* ---------- 通用数据来源 / 等级 badge ---------- */
.sev-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; font-size: 11px;
  white-space: nowrap;
}
.sev-low { background: #eef2ea; color: #54704c; }
.sev-warning { background: #fff4cc; color: #806300; }
.sev-confirmed { background: #ffe5e3; color: #a52f22; }
.source-inline {
  display: inline-flex; align-items: center; padding: 2px 6px;
  border-radius: 5px; font-size: 10px; color: #746354;
  background: rgba(255, 255, 255, 0.48); border: 1px solid rgba(100, 70, 50, 0.1);
}
.source-inline.serial, .source-inline.camera, .source-inline.cloud { color: #3d6b42; }

.empty-state { padding: 18px 4px; color: var(--text-secondary); font-size: 12px; }

/* ---------- 节点详情弹窗 ---------- */
.node-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 16px; }
.node-sensor {
  padding: 10px 11px; border-radius: 12px; background: var(--surface-muted);
  border: 1px solid rgba(255,255,255,.5);
}
.node-sensor span { display: block; font-size: 10.5px; color: var(--text-secondary); }
.node-sensor strong { display: block; margin-top: 3px; font-size: 17px; font-variant-numeric: tabular-nums; }
.node-sensor strong small { font-size: 10px; color: var(--text-secondary); font-weight: 400; margin-left: 2px; }
.node-risk-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; }
.node-risk-chip { padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
#node-history-chart { min-height: 210px; }
.node-event-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; max-height: 130px; overflow: auto; }
.node-event-list li { font-size: 11.5px; color: var(--text-secondary); padding: 7px 9px; border-radius: 8px; background: rgba(255,255,255,.35); }
@media (max-width: 767px) { .node-detail-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 处置弹窗 ---------- */
.dispatch-timeline { list-style: none; padding: 0; margin: 12px 0 0; border-left: 2px solid rgba(154,52,18,.16); }
.dispatch-timeline li { position: relative; padding: 0 0 12px 16px; font-size: 12px; color: var(--text-secondary); }
.dispatch-timeline li::before { content: ""; position: absolute; left: -5px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: #9a3412; }
.dispatch-timeline strong { color: var(--text); font-weight: 600; }
.dispatch-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---------- 监控告警弹窗 ---------- */
.alarm-popup .modal {
  width: min(940px, 90vw);
  max-width: 940px;
  padding: 24px 26px;
}
.alarm-popup .modal-title { font-size: 1.55rem; }
.alarm-popup .modal-head .card-sub { font-size: 0.82rem; }
.alarm-popup img {
  width: 100%;
  max-height: min(540px, 56vh);
  object-fit: contain;
  border-radius: 14px;
  background: #0b0b0d;
}
.alarm-popup-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
  font-size: 0.95rem;
}
.alarm-popup-meta .sev-badge { font-size: 0.88rem; padding: 5px 11px; }
.alarm-popup-meta .source-inline { font-size: 0.9rem; padding: 4px 8px; }
.alarm-popup-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.alarm-popup-actions .btn { font-size: 1rem; padding: 11px 22px; }
@media (max-width: 640px) {
  .alarm-popup .modal { width: 94vw; padding: 18px; }
  .alarm-popup img { max-height: 42vh; }
  .alarm-popup .modal-title { font-size: 1.2rem; }
}


/* ---------- 告警等级筛选 ---------- */
.severity-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
  flex: none;
}
.severity-filter > span { white-space: nowrap; flex: none; }
.severity-filter .select {
  height: 38px;
  min-width: 118px;
  padding-top: 0;
  padding-bottom: 0;
}




/* ---------- 数据概览：按数据类型区分表达 ---------- */
.dash-reveal { animation: dash-reveal 0.65s linear both; }
@keyframes dash-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.dash-live {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr 1.15fr 1.1fr;
  gap: 14px;
  margin-top: 4px;
}
.dash-tile {
  animation: dash-reveal 0.5s linear both;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid rgba(126, 113, 98, 0.14);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(255,255,255,0.72), rgba(248,245,237,0.5));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.dash-tile:nth-child(1) { animation-delay: 0.03s; }
.dash-tile:nth-child(2) { animation-delay: 0.08s; }
.dash-tile:nth-child(3) { animation-delay: 0.13s; }
.dash-tile:nth-child(4) { animation-delay: 0.18s; }
.dash-events, .dash-trends, .dash-bottom { animation: dash-reveal 0.55s linear both; animation-delay: 0.22s; }
.tile-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; color: var(--text); font-size: 0.92rem; font-weight: 600;
}
.tile-hint { color: var(--text-secondary); font-size: 0.74rem; font-weight: 400; }
.tile-pair { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 14px; }
.tile-label { color: var(--text-secondary); font-size: 0.75rem; margin-bottom: 4px; }
.tile-value { font-family: var(--font-mono); font-size: 1.7rem; line-height: 1.05; font-weight: 600; color: #FF3B30; white-space: nowrap; }
.tile-value small { font-family: var(--font-sans); font-size: 0.7rem; color: var(--text-secondary); margin-left: 3px; font-weight: 400; }
.tile-value.is-blue { color: #007AFF; }
.tile-note { color: var(--text-secondary); font-size: 0.72rem; margin-top: 10px; }

.pm-ring {
  --pm-color: #FF9500;
  --pm-pct: 0%;
  width: 112px; height: 112px; margin: 10px auto 0; border-radius: 50%;
  background: conic-gradient(var(--pm-color) 0 var(--pm-pct), rgba(120,110,100,0.13) var(--pm-pct) 100%);
  display: grid; place-items: center;
  transition: background 0.55s linear;
}
.pm-ring-inner {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; align-content: center; gap: 1px;
  background: #fbfaf6; color: var(--text);
}
.pm-ring-inner strong { font-family: var(--font-mono); font-size: 1.3rem; line-height: 1; }
.pm-ring-inner span { font-size: 0.65rem; color: var(--text-secondary); }

.soil-row { margin-top: 13px; }
.soil-label { display: flex; justify-content: space-between; gap: 8px; font-size: 0.77rem; color: var(--text-secondary); margin-bottom: 5px; }
.soil-label strong { color: var(--text); font-family: var(--font-mono); font-size: 0.76rem; font-weight: 500; }
.soil-track { height: 7px; border-radius: 999px; background: rgba(112,85,62,0.12); overflow: hidden; }
.soil-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #FFB340, #FF9500); transition: width 0.55s linear; }
.soil-track.is-green span { background: linear-gradient(90deg, #7BE08D, #34C759); }

.compass {
  position: relative; width: 112px; height: 112px; margin: 7px auto 0; border-radius: 50%;
  border: 1px solid rgba(112,90,70,0.2); background: radial-gradient(circle at 50% 45%, #fffdf7, #f1ede3);
  box-shadow: inset 0 0 0 7px rgba(255,255,255,0.5);
}
.compass-n, .compass-e, .compass-s, .compass-w { position: absolute; color: #7c6b5b; font: 0.66rem var(--font-mono); }
.compass-n { top: 4px; left: 50%; transform: translateX(-50%); }
.compass-s { bottom: 4px; left: 50%; transform: translateX(-50%); }
.compass-w { left: 6px; top: 50%; transform: translateY(-50%); }
.compass-e { right: 6px; top: 50%; transform: translateY(-50%); }
.compass-needle {
  position: absolute; left: 50%; top: 50%; width: 2px; height: 36px;
  transform-origin: 50% 100%; transform: translate(-50%, -100%) rotate(180deg);
  background: linear-gradient(180deg, #FF3B30 0 55%, #007AFF 55% 100%);
  border-radius: 99px; transition: transform 0.55s linear;
}
.compass-needle::after { content: ""; position: absolute; top: -3px; left: 50%; width: 7px; height: 7px; transform: translateX(-50%); border-radius: 50%; background: #FF3B30; }
.compass-core { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%,-50%); background: #fffdf7; border: 2px solid #7c6b5b; }
.compass-degree { position: absolute; left: 50%; bottom: 15px; transform: translateX(-50%); font: 0.68rem var(--font-mono); color: var(--text); }

.dash-events {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 16px; padding: 11px 14px; border-radius: 14px;
  background: rgba(124,103,82,0.055); border: 1px solid rgba(124,103,82,0.1);
}
.event-status { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 0.78rem; }
.event-status strong { color: var(--text); font: 0.8rem var(--font-mono); }
.event-dot { width: 8px; height: 8px; border-radius: 50%; background: #b9b1a7; box-shadow: 0 0 0 3px rgba(185,177,167,0.14); transition: background 0.35s linear, box-shadow 0.35s linear; }
.event-dot.is-on { background: #FF3B30; box-shadow: 0 0 0 3px rgba(255,59,48,0.16); }
.event-dot.is-fire.is-on { background: #FF3B30; box-shadow: 0 0 0 3px rgba(255,59,48,0.16); }
.event-strip { display: grid; grid-template-columns: repeat(24, minmax(4px, 1fr)); gap: 3px; flex: 1; min-width: 220px; }
.event-strip span { display: block; height: 8px; border-radius: 2px; background: rgba(124,103,82,0.13); }
.event-strip span.is-smoke { background: #AEAEB2; }
.event-strip span.is-fire { background: #FF3B30; }
.event-legend { color: var(--text-secondary); font-size: 0.7rem; }

.dash-trends { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; margin-top: 24px; }
.dash-figure { margin: 0; min-width: 0; }
.dash-figure figcaption { color: var(--text); font-size: 0.86rem; font-weight: 600; margin-bottom: 2px; }
.dash-figure figcaption span { color: var(--text-secondary); font-size: 0.72rem; font-weight: 400; margin-left: 6px; }


@media (max-width: 1279px) {
  .dash-live { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-air { grid-column: span 2; }
}
@media (max-width: 767px) {
  .dash-live, .dash-trends, .dash-bottom { grid-template-columns: 1fr; }
  .tile-air { grid-column: auto; }
  .dash-events { gap: 10px; }
  .event-strip { min-width: 100%; order: 3; }
  .event-legend { order: 4; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-reveal, .pm-ring, .soil-track span, .compass-needle, .event-dot { animation: none !important; transition: none !important; }
}

@keyframes air-line-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.dash-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 18px; }
.dash-bottom-item { min-width: 0; padding: 13px 14px; border-radius: 14px; background: rgba(255,255,255,0.45); border: 1px solid rgba(124,103,82,0.1); }
.bottom-title { color: var(--text); font-size: 0.82rem; font-weight: 600; }
.bottom-title span { color: var(--text-secondary); font-size: 0.7rem; font-weight: 400; margin-left: 6px; }
.sparkline { width: 100%; height: 44px; margin-top: 9px; overflow: visible; }
.sparkline path { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spark-temp { stroke: #FF9500; }
.spark-hum { stroke: #34C759; }
.spark-legend { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: var(--text-secondary); font-size: 0.68rem; margin-top: 6px; }
.spark-legend .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.spark-legend .dot.temp { background: #FF9500; }
.spark-legend .dot.hum { background: #34C759; }
.wind-strip { display: grid; grid-template-columns: repeat(24, minmax(4px, 1fr)); gap: 3px; margin-top: 13px; }
.wind-strip span { display: grid; place-items: center; height: 22px; border-radius: 4px; background: rgba(0,122,255,0.07); }
.wind-strip i { display: block; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-bottom: 8px solid #007AFF; transform-origin: 50% 55%; }


/* 图表首次进入：用裁剪从左到右 / 从下到上显现，保证可见 */
.chart-in-left { animation: air-reveal 1.2s linear both; transform-origin: left center; }
.chart-in-up { animation: pm-reveal 1.1s linear both; transform-origin: center bottom; }
@keyframes air-reveal {
  from { clip-path: inset(0 100% 0 0); opacity: 0.35; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
@keyframes pm-reveal {
  from { clip-path: inset(100% 0 0 0); opacity: 0.35; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .chart-in-left, .chart-in-up { animation: none !important; }
}


/* 环境数据五张卡片：风向右侧增加风速 */
.kpi-row.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1280px) {
  .kpi-row.stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .kpi-row.stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
