/* ========================================
   map.css —— 地图容器与地图内叠加UI样式
   ======================================== */

.map-wrap {
  position: relative;
  width: 100%;
  height: 560px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glow);
  box-shadow: var(--panel-shadow);
}

.map-wrap.map-wrap-tall { height: 720px; }
.map-wrap.map-wrap-compact { height: 360px; }

/* 地图容器通用样式：覆盖所有页面用到的 Cesium 容器 id（index.html 用
   #cesiumContainer，emergency.html 用 #cesiumContainerEmergency），否则容器
   会因为没有显式 height 继承 height:auto，内容为空时塌陷成 0 高度，导致
   Cesium canvas 渲染出来但宽高是 0（entity 正常添加，但完全不可见）。 */
#cesiumContainer, #cesiumContainerEmergency, #cesiumContainerImpact, .cesium-canvas-slot {
  width: 100%;
  height: 100%;
}

/* 覆盖 Cesium 默认的版权信息样式，避免破坏科技风视觉 */
.cesium-viewer-bottom {
  display: none !important;
}
.cesium-widget-credits {
  display: none !important;
}

/* 地图左上角图例浮层 */
.map-legend {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: rgba(13, 24, 44, 0.85);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  backdrop-filter: blur(6px);
}
[data-theme="light"] .map-legend {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(16, 36, 72, 0.15);
}
.map-legend .legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  color: var(--text-secondary);
}
.map-legend .legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

/* 地图右上角工具条 */
.map-toolbar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  gap: 8px;
}

/* 地图加载中占位 */
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  background: var(--bg-panel-solid);
}
.map-loading .spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(64,220,255,0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 滑坡影响范围推演：图层清单（代替简单图例，可点击查看依据） ---------- */
.impact-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 4px;
  border: 1px solid transparent;
  transition: all 0.2s;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.impact-legend-item:hover {
  background: rgba(255,255,255,0.05);
}
[data-theme="light"] .impact-legend-item:hover {
  background: #f3f6fa;
}
.impact-legend-item.impact-legend-item-active {
  border-color: var(--border-glow-strong);
  background: rgba(64,220,255,0.08);
  color: var(--text-primary);
}
.impact-legend-label {
  flex: 1;
  font-weight: 600;
}
.impact-legend-radius {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

/* 情景参数条 */
.scenario-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-softer);
  border-radius: var(--radius-md);
}
[data-theme="light"] .scenario-bar {
  background: #f7f9fc;
}
.scenario-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.impact-combo { position: relative; max-width: 520px; margin-bottom: 14px; }
.impact-combo input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
}
.impact-combo input:focus { border-color: var(--border-glow-strong); }
.impact-combo-menu {
  display: none;
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  box-shadow: var(--panel-shadow);
}
.impact-combo-menu.open { display: block; }
.impact-combo-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}
.impact-combo-item:hover { background: rgba(64,220,255,0.1); }
.impact-combo-item small { display: block; color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }

.scenario-field select {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12.5px;
}
.scenario-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.scenario-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-cyan);
}

/* 模型成熟度进度条 */
.maturity-bar-track {
  height: 10px;
  background: var(--bar-track);
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0;
}
.maturity-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--warning-orange), var(--accent-cyan));
  border-radius: 6px;
  transition: width 0.4s;
}

/* 预警等级归一化对照表样式 */
.mapping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.mapping-table th, .mapping-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.mapping-table th {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
}
.mapping-table td {
  color: var(--text-secondary);
}
