/* ====================== 新增：楼层切换按钮样式 ====================== */
.floor-switcher {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.floor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(18, 35, 60, 0.8);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floor-btn:hover {
    background: rgba(31, 67, 111, 0.88);
    color: #dff4ff;
    border-color: rgba(80, 175, 255, 0.35);
}

.floor-btn.active {
    background: linear-gradient(90deg, #2086ff, #39c0ff);
    color: white;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(41, 145, 255, 0.24);
}

/* ====================== 修改：统一路径样式变量 ====================== */
:root {
    --rescue: #ff6b6b;
    --rescue-glow: rgba(255, 107, 107, 0.2);
    --evac: #2fd8a7;
    --evac-glow: rgba(47, 216, 167, 0.16);
}

/* 救援路线发光层：统一红色 */
.route-line.rescue-glow.route-index-0,
.route-line.rescue-glow.route-index-1 {
    stroke: var(--rescue-glow);
    stroke-width: 18;
}

/* 救援路线主线：统一红色 */
.route-line.rescue-main.route-index-0,
.route-line.rescue-main.route-index-1 {
    stroke: var(--rescue);
    stroke-width: 8;
}

/* 逃生路线发光层：统一绿色 */
.route-line.evac-glow.evac-index-0,
.route-line.evac-glow.evac-index-1 {
    stroke: var(--evac-glow);
    stroke-width: 14;
}

/* 逃生路线主线：统一绿色，去掉虚线（可选，保留也可以） */
.route-line.evac-main.evac-index-0,
.route-line.evac-main.evac-index-1 {
    stroke: var(--evac);
    stroke-width: 6;
    stroke-dasharray: none; /* 【修改】去掉虚线，更清晰 */
}

/* 救援箭头：统一救援红 */
.route-arrow.rescue.route-index-0,
.route-arrow.rescue.route-index-1 {
    background: var(--rescue);
    border: 1px solid rgba(255, 181, 181, 0.42);
}

/* 逃生箭头：统一青绿 */
.route-arrow.evac.evac-index-0,
.route-arrow.evac.evac-index-1 {
    background: var(--evac);
    border: 1px solid rgba(154, 255, 224, 0.4);
}

:root {
  --bg: #07111f;
  --bg-2: #0a1628;
  --panel: #0d1a2d;
  --panel-2: #12233c;
  --panel-3: #162a47;
  --line: rgba(101, 152, 223, 0.14);
  --line-strong: rgba(101, 152, 223, 0.26);
  --text: #ecf5ff;
  --muted: #90a8ca;
  --safe: #1cbf6f;
  --warning: #e0b332;
  --danger: #f08736;
  --extreme: #e34949;
  --blocked: #6d7b8b;
  --rescue: #ff5858;
  --evac: #43e276;
  --accent: #49a6ff;
  --accent-2: #28d7ff;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top, rgba(42, 94, 167, 0.26), transparent 36%),
    linear-gradient(180deg, #091425, var(--bg));
  color: var(--text);
  overflow-x: hidden;
}

.page-shell {
  max-width: 1460px;
  margin: 0 auto;
  padding: 8px 14px 14px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 4px 0 10px;
}

.brand-block h1 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: 0.6px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(18, 35, 60, 0.8);
  font-size: 12px;
  font-weight: 700;
}

.tag.cyan {
  color: #72e8ff;
}

.tag.amber {
  color: #ffbe57;
}

.tag.red {
  color: #ff7575;
}

button {
  background: linear-gradient(90deg, #2086ff, #39c0ff);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(41, 145, 255, 0.24);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.hero-card {
  min-height: 56px;
  padding: 12px 14px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15, 29, 51, 0.96), rgba(10, 20, 37, 0.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.hero-card strong {
  font-size: 28px;
  line-height: 1;
}

.hero-card-wide {
  grid-column: span 1;
}

.hero-card-wide strong {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: #dce9ff;
}

.dashboard {
  display: grid;
  grid-template-columns: 0.88fr 2.75fr 1.02fr;
  gap: 12px;
  min-height: calc(100vh - 140px);
}

.panel {
  background: linear-gradient(180deg, rgba(13, 26, 45, 0.96), rgba(8, 18, 33, 0.98));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.left-stack,
.right-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.left-stack {
  min-width: 0;
}

.section-card {
  padding: 12px;
}

.center-stage {
  padding: 12px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.panel-title.compact {
  margin-bottom: 8px;
}

.panel-title h2 {
  margin: 0;
  font-size: 14px;
}

.left-stack .panel-title {
  align-items: flex-start;
  gap: 8px;
}

.left-stack .panel-title h2 {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
}

.left-stack .panel-meta {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.right-stack .panel-title {
  align-items: flex-start;
  gap: 8px;
}

.right-stack .panel-title h2 {
  flex: 1;
  font-size: 13px;
  line-height: 1.2;
}

.right-stack .panel-meta {
  flex-shrink: 0;
  font-size: 11px;
}

.panel-meta,
.map-header-meta {
  color: var(--muted);
  font-size: 12px;
}

.map-header-meta {
  display: flex;
  gap: 12px;
}

.sensor-kpi-grid,
.person-status-board,
.detection-list,
.result-list {
  display: grid;
  gap: 8px;
}

.sensor-kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sensor-metric,
.person-card,
.route-card,
.video-preview,
.detection-item,
.result-item,
.map-footer-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.sensor-metric,
.person-card,
.route-card,
.detection-item,
.map-footer-card {
  padding: 12px;
}

.sensor-metric {
  min-height: 176px;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(86, 155, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(26, 49, 84, 0.96), rgba(16, 34, 60, 0.98));
  border-color: rgba(118, 170, 244, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 36px rgba(3, 10, 24, 0.26);
}

.sensor-metric::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%);
  pointer-events: none;
}

.right-stack .section-card {
  padding: 10px;
}

.right-stack .route-card,
.right-stack .detection-item,
.right-stack .result-compact-card {
  padding: 10px;
}

.sensor-metric-header,
.sensor-metric-footer,
.person-card-meta,
.result-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sensor-metric-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  column-gap: 8px;
  position: relative;
  z-index: 1;
}

.sensor-metric-header span,
.person-card-meta,
.result-item-row,
.meta {
  color: var(--muted);
  font-size: 12px;
}

.sensor-metric-header > span:first-child {
  color: #dce9ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.sensor-metric-value {
  display: block;
  margin: 12px 0 10px;
  color: #ffffff;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0.2px;
  font-weight: 800;
  word-break: normal;
  overflow-wrap: normal;
  text-align: left;
  text-shadow: 0 8px 24px rgba(25, 125, 255, 0.14);
  position: relative;
  z-index: 1;
}

.sensor-metric-value .unit {
  display: inline-block;
  margin-left: 3px;
  font-size: 0.82em;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  vertical-align: middle;
}

.sensor-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  padding: 0 8px;
  margin-left: 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.sensor-badge.high,
.status-pill.critical {
  color: #ffd9d9;
  background: linear-gradient(180deg, rgba(255, 96, 96, 0.42), rgba(227, 73, 73, 0.22));
  border-color: rgba(255, 134, 134, 0.48);
  box-shadow: 0 0 16px rgba(255, 96, 96, 0.18);
}

.sensor-badge.medium,
.status-pill.warning {
  color: #ffe6a8;
  background: linear-gradient(180deg, rgba(255, 196, 78, 0.34), rgba(224, 179, 50, 0.18));
  border-color: rgba(255, 211, 104, 0.4);
  box-shadow: 0 0 16px rgba(255, 196, 78, 0.14);
}

.sensor-badge.low,
.status-pill.normal {
  color: #d7ffe8;
  background: linear-gradient(180deg, rgba(42, 215, 129, 0.34), rgba(28, 191, 111, 0.16));
  border-color: rgba(122, 246, 175, 0.38);
  box-shadow: 0 0 16px rgba(42, 215, 129, 0.16);
}

.sensor-mini-trend {
  color: #dbeaff;
  white-space: nowrap;
}

.sensor-metric-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  color: #d4e3fb;
  font-size: 12px;
  position: relative;
  z-index: 1;
}

.sensor-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(133, 173, 234, 0.12);
}

.sensor-footer-label {
  color: #95add0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.sensor-footer-value {
  color: #f7fbff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sensor-metric-footer .sensor-mini-trend {
  color: #dff0ff;
}

.person-card strong,
.route-card strong,
.detection-item strong,
.map-footer-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.person-card {
  background: linear-gradient(180deg, rgba(18, 35, 60, 0.92), rgba(12, 23, 40, 0.92));
}

.person-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.video-preview {
  min-height: 156px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 165, 0, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(43, 62, 102, 0.4));
}

.video-stream-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 156px;
  object-fit: cover;
}

.video-stream-overlay {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 2;
}

.video-stream-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(9, 19, 33, 0.72);
  border: 1px solid rgba(138, 179, 245, 0.22);
  color: #eef6ff;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.video-stream-chip.status-online {
  color: #d7ffe8;
  border-color: rgba(122, 246, 175, 0.38);
}

.video-stream-chip.status-standby {
  color: #ffe6a8;
  border-color: rgba(255, 211, 104, 0.35);
}

.video-preview::before {
  content: none;
  position: absolute;
  top: 10px;
  right: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #0b1525;
  background: #ffbc47;
  font-size: 11px;
  font-weight: 800;
}

.video-preview::after {
  content: none;
  position: absolute;
  top: 32px;
  left: 42px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #0b1525;
  background: #ffbc47;
  font-size: 11px;
  font-weight: 800;
}

.video-preview .bbox,
.fake-box {
  position: absolute;
  border: 2px solid #ffbc47;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 188, 71, 0.18);
}

.video-preview .bbox.b1,
.fake-box.b1 {
  top: 20px;
  right: 28px;
  width: 66px;
  height: 70px;
}

.video-preview .bbox.b2,
.fake-box.b2 {
  top: 56px;
  left: 42px;
  width: 40px;
  height: 66px;
}

.video-preview .bbox.b3,
.fake-box.b3 {
  top: 86px;
  left: 92px;
  width: 72px;
  height: 34px;
}

.detection-item {
  min-height: 64px;
  background:
    linear-gradient(180deg, rgba(18, 35, 60, 0.96), rgba(11, 22, 38, 0.96)),
    linear-gradient(90deg, rgba(32, 134, 255, 0.16), rgba(255, 153, 0, 0.06));
}

.detection-visual {
  position: relative;
  height: 112px;
  border-radius: 12px;
  background:
    radial-gradient(circle at top right, rgba(0, 197, 255, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(86, 42, 58, 0.9), rgba(33, 46, 83, 0.82));
  border: 1px solid rgba(140, 176, 255, 0.12);
  overflow: hidden;
  margin-bottom: 8px;
}

.detection-item > div:not(.detection-visual),
.route-card > div {
  font-size: 12px;
  line-height: 1.35;
}

.detection-visual .box {
  position: absolute;
  border-radius: 8px;
  border: 2px solid #45d1ff;
}

.detection-visual .box.fire {
  top: 18px;
  right: 20px;
  width: 82px;
  height: 52px;
}

.detection-visual .box.victim {
  top: 44px;
  left: 42px;
  width: 38px;
  height: 68px;
}

.detection-visual .box.rescuer {
  top: 66px;
  left: 82px;
  width: 28px;
  height: 60px;
}

.detection-visual .box-label {
  position: absolute;
  top: -10px;
  left: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #45d1ff;
  color: #081120;
  font-size: 10px;
  font-weight: 800;
}

.risk-map {
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(24, 1fr);
  min-height: 640px;
  background: rgba(8, 18, 33, 0.6);
  padding: 6px;
  border-radius: 10px;
}

.cell {
  aspect-ratio: 1 / 1;
  min-height: 18px;
  border-radius: 6px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.cell.safe {
  background: var(--safe);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(28, 191, 111, 0.12);
}

.cell.warning {
  background: var(--warning);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(224, 179, 50, 0.14);
}

.cell.danger {
  background: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(240, 135, 54, 0.14);
}

.cell.extreme {
  background: var(--extreme);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(227, 73, 73, 0.16);
}

.cell.blocked {
  background: var(--blocked);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 0 1px rgba(109, 123, 139, 0.14);
}
.cell.exit {
  outline: 2px solid rgba(84, 255, 150, 0.52);
  box-shadow: 0 0 22px rgba(67, 226, 118, 0.18);
}

.cell.stair {
  outline: 2px solid rgba(95, 180, 255, 0.58);
  box-shadow: 0 0 22px rgba(86, 170, 255, 0.22);
}

.cell::before {
  transition: 0.2s ease;
}

.cell.exit-label::after {
  content: attr(data-label);
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #e9fff2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.cell.rescue-path::after,
.cell.evac-path::after,
.cell.rescuer::before,
.cell.trapped::before,
.cell.fire::before,
.cell.obstacle::before {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: 50%;
}

.cell.rescue-path::after,
.cell.evac-path::after {
  display: none;
}

.cell.rescuer::before,
.cell.trapped::before,
.cell.fire::before,
.cell.fire::after,
.cell.obstacle::before {
  display: block;
}

.cell.rescuer::before {
  inset: 22%;
  background: radial-gradient(circle, #62c4ff 0%, #2e9bff 72%, rgba(46, 155, 255, 0.24) 100%);
  box-shadow: 0 0 10px rgba(98, 196, 255, 0.42);
}

.cell.trapped::before {
  inset: 20%;
  background: radial-gradient(circle, #ffe27a 0%, #f3c743 70%, rgba(243, 199, 67, 0.18) 100%);
  box-shadow: 0 0 10px rgba(255, 214, 92, 0.4);
}

.cell.fire::before {
  inset: 18%;
  background: radial-gradient(circle, #ffd36b 0%, #ff8d36 48%, #e34949 78%, rgba(227, 73, 73, 0.12) 100%);
  box-shadow: 0 0 14px rgba(255, 124, 72, 0.44);
}

.cell.fire::after {
  content: "";
  position: absolute;
  inset: 32% 24% 18% 24%;
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  background: rgba(255, 241, 189, 0.88);
  transform: rotate(14deg);
}

.cell.obstacle::before {
  inset: 20%;
  border-radius: 4px;
  background: linear-gradient(135deg, #c2ccdb, #7d8da8);
  box-shadow: 0 0 8px rgba(194, 204, 219, 0.26);
}

.cell.puddle::before {
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 144, 226, 0.35) 0%, rgba(30, 100, 200, 0.60) 60%, rgba(20, 70, 160, 0.80) 100%);
  box-shadow: 0 0 10px rgba(30, 100, 200, 0.4);
}

.cell.drain::before {
  inset: 18%;
  border-radius: 3px;
  background: linear-gradient(135deg, #7a8fa0, #4a5e70);
  box-shadow: 0 0 6px rgba(74, 95, 112, 0.5);
}

.cell.labelled > span {
  display: none;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(10, 22, 39, 0.42);
  border: 1px solid rgba(101, 152, 223, 0.08);
}

.map-legend-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.path-legend {
  gap: 14px 18px;
}

.path-legend span {
  color: #bfd6f4;
}

.risk-scale {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.risk-bar {
  width: 140px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2bdc78, #f0c33d, #ff7043, #e34949);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.risk-scale-labels {
  display: flex;
  justify-content: space-between;
  width: 40px;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(18, 35, 60, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.map-chip.active {
  color: #dff4ff;
  border-color: rgba(80, 175, 255, 0.35);
  background: rgba(31, 67, 111, 0.88);
}

.map-chip strong {
  color: var(--text);
}

.map-stage {
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 23, 41, 0.96), rgba(8, 18, 33, 0.96));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(84, 127, 189, 0.08);
}

.map-canvas {
  position: relative;
}

.route-overlay,
.map-annotations {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.route-overlay {
  overflow: visible;
  z-index: 8;
}

.map-annotations {
  z-index: 12;
}

.route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* 救援路线发光层 */
.route-line.rescue-glow.route-index-0 {
  stroke: rgba(255, 92, 92, 0.22);
  stroke-width: 18;
}

.route-line.rescue-glow.route-index-1 {
  stroke: rgba(70, 180, 255, 0.20);
  stroke-width: 16;
}

/* 救援路线主线 */
.route-line.rescue-main.route-index-0 {
  stroke: rgba(255, 92, 92, 0.78);
  stroke-width: 8;
}

.route-line.rescue-main.route-index-1 {
  stroke: rgba(70, 180, 255, 0.78);
  stroke-width: 7;
}

/* 逃生路线发光层 */
.route-line.evac-glow {
  stroke: rgba(67, 226, 118, 0.16);
  stroke-width: 14;
}

/* 逃生路线主线：透明+虚线，避免盖住救援线 */
.route-line.evac-main {
  stroke: rgba(67, 226, 118, 0.72);
  stroke-width: 5;
  stroke-dasharray: 10 7;
}

/* 点位 */
.route-point {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.06);
}

.route-point.rescuer {
  background: #3fb5ff;
  box-shadow: 0 0 0 10px rgba(63, 181, 255, 0.18);
}

.route-point.victim {
  background: #f3d44f;
  box-shadow: 0 0 0 10px rgba(243, 212, 79, 0.18);
}

.route-point.fire {
  background: #ff972f;
  box-shadow: 0 0 0 10px rgba(255, 151, 47, 0.16);
}

.route-point.fire::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 149, 46, 0.45);
  animation: firePulse 1.6s ease-out infinite;
}

.route-point.smoke {
  background: #7cc8ff;
  box-shadow: 0 0 0 10px rgba(124, 200, 255, 0.16);
}

.route-point.obstacle {
  background: #b5bfd1;
  box-shadow: 0 0 0 10px rgba(181, 191, 209, 0.12);
}

.route-point.puddle {
  background: #4a90e2;
  box-shadow: 0 0 0 10px rgba(74, 144, 226, 0.16);
}

.route-point.drain {
  background: #7a8fa0;
  box-shadow: 0 0 0 10px rgba(122, 143, 160, 0.16);
}

.route-point.obstacle {
  background: #aeb7c8;
  box-shadow: 0 0 0 10px rgba(174, 183, 200, 0.14);
}

.route-halo {
  position: absolute;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 5px dashed rgba(255, 199, 79, 0.60);
  animation: pulse 1.8s linear infinite;
}

/* 标签 */
.annotation-label {
  position: absolute;
  transform: translate(0, -50%);
  color: #f2f7ff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.annotation-label.highlight {
  background: rgba(10, 19, 35, 0.92);
  border-color: rgba(255, 187, 87, 0.4);
  color: #fff4d6;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.annotation-label.fire {
  color: #fff0d2;
  border-color: rgba(255, 142, 54, 0.55);
  background: linear-gradient(135deg, rgba(70, 26, 12, 0.96), rgba(118, 37, 18, 0.92));
  box-shadow: 0 0 18px rgba(255, 120, 50, 0.26);
}

.annotation-label.small {
  font-size: 10px;
  color: #d5deef;
}

.annotation-label.small.smoke,
.annotation-label.small.obstacle {
  color: #d9e7f8;
}

.annotation-label.small.puddle,
.annotation-label.small.drain {
  color: #c8dff5;
  background: linear-gradient(135deg, rgba(10, 30, 70, 0.95), rgba(20, 50, 100, 0.92));
  border-color: rgba(74, 144, 226, 0.5);
}

.annotation-label.small.stair-marker {
  color: #d8efff;
  border-color: rgba(120, 194, 255, 0.42);
  background: linear-gradient(135deg, rgba(16, 42, 76, 0.94), rgba(18, 63, 108, 0.92));
  box-shadow: 0 8px 18px rgba(25, 72, 128, 0.24);
}

/* 箭头 */
.route-arrow {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #f8fcff;
  text-shadow: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
  opacity: 0.9;
}

.route-arrow.rescue.route-index-0 {
  background: rgba(226, 72, 72, 0.90);
  border: 1px solid rgba(255, 145, 145, 0.42);
}

.route-arrow.rescue.route-index-1 {
  background: rgba(70, 180, 255, 0.88);
  border: 1px solid rgba(160, 220, 255, 0.42);
}

.route-arrow.evac {
  background: rgba(41, 184, 92, 0.82);
  border: 1px solid rgba(139, 255, 178, 0.38);
}


.legend {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 10px rgba(0, 0, 0, 0.12);
}

.legend.safe {
  background: linear-gradient(135deg, #20b886, #35d39d);
}

.legend.warning {
  background: linear-gradient(135deg, #d8bb42, #f0c44f);
}

.legend.danger {
  background: linear-gradient(135deg, #ff9a3d, #ff8834);
}

.legend.extreme {
  background: linear-gradient(135deg, #f15a5a, #ea4b4b);
}

.legend.blocked {
  background: linear-gradient(135deg, #92a0b3, #7d8da2);
}

.legend.rescue {
  background: linear-gradient(135deg, #ff7272, #ff5f6a);
}

.legend.evac {
  background: linear-gradient(135deg, #36d69f, #2bc78f);
}

.map-footer-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.meta {
  margin-top: 4px;
}

.result-item {
  background: linear-gradient(180deg, rgba(16, 29, 49, 0.96), rgba(10, 19, 34, 0.96));
}

.result-compact-card {
  background: linear-gradient(180deg, rgba(16, 29, 49, 0.96), rgba(10, 19, 34, 0.96));
  border: 1px solid var(--line);
  border-radius: 12px;
}

.result-compact-head,
.result-compact-row {
  display: grid;
  grid-template-columns: 52px 1fr 40px;
  gap: 8px;
  align-items: center;
}

.result-compact-head {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.result-compact-head strong {
  grid-column: span 2;
  margin: 0;
  font-size: 13px;
  color: var(--text);
}

.result-compact-grid {
  display: grid;
  gap: 6px;
}

.result-compact-row {
  min-height: 28px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
}

.result-kind {
  color: var(--text);
  font-weight: 700;
}

.result-coord {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-confidence {
  text-align: right;
  color: #d9ecff;
  font-weight: 700;
}

.result-key {
  text-transform: lowercase;
  color: #f0f5ff;
  font-weight: 700;
}

.result-value {
  color: var(--muted);
}

.route-card + .route-card {
  margin-top: 8px;
}

.floating-actions {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 10px;
}

.fab {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff, #d7d2ff);
  color: #6b54ff;
  font-size: 16px;
  box-shadow: 0 12px 24px rgba(71, 80, 180, 0.28);
}

@keyframes pulse {
  0% { transform: scale(0.88); opacity: 1; }
  100% { transform: scale(1.12); opacity: 0.15; }
}

@media (max-width: 1400px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card-wide {
    grid-column: span 2;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .map-footer-cards {
    grid-template-columns: 1fr;
  }

  .risk-map {
    min-height: 420px;
  }

  .floating-actions {
    display: none;
  }
}

@media (max-width: 860px) {
  .page-shell {
    padding: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-block h1 {
    font-size: 28px;
  }

  .hero-stats,
  .sensor-kpi-grid {
    grid-template-columns: 1fr;
  }

  .hero-card-wide {
    grid-column: span 1;
  }
}


/* ====================== 新增：楼层切换按钮样式 ====================== */
.floor-switcher {
    display: flex;
    gap: 8px;
    margin: 0 8px;
}

.floor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(18, 35, 60, 0.8);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floor-btn:hover {
    background: rgba(31, 67, 111, 0.88);
    color: #dff4ff;
    border-color: rgba(80, 175, 255, 0.35);
}

.floor-btn.active {
    background: linear-gradient(90deg, #2086ff, #39c0ff);
    color: white;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(41, 145, 255, 0.24);
}

/* ====================== 统一：救援路线纯红，逃生路线纯绿 ====================== */
:root {
    --rescue: #e34949;
    --rescue-glow: rgba(227, 73, 73, 0.22);
    --evac: #1cbf6f;
    --evac-glow: rgba(28, 191, 111, 0.16);
}

/* 救援路线统一红色 */
.route-line.rescue-glow {
    stroke: var(--rescue-glow) !important;
    stroke-width: 18 !important;
}
.route-line.rescue-main {
    stroke: var(--rescue) !important;
    stroke-width: 8 !important;
}

/* 逃生路线统一绿色 */
.route-line.evac-glow {
    stroke: var(--evac-glow) !important;
    stroke-width: 14 !important;
}
.route-line.evac-main {
    stroke: var(--evac) !important;
    stroke-width: 6 !important;
    stroke-dasharray: none !important;
}

/* 箭头颜色统一 */
.route-arrow.rescue {
    background: var(--rescue) !important;
    border: 1px solid rgba(255, 145, 145, 0.42) !important;
}
.route-arrow.evac {
    background: var(--evac) !important;
    border: 1px solid rgba(139, 255, 178, 0.38) !important;
}