/**
 * 2D 漏点 / 排水 / 流水路径 CSS 特效
 * 用于航拍图、热成像叠加、侧栏卡片，与 WebGL 模块视觉语言一致。
 */

:root {
  --leak-high: #ef4444;
  --leak-mid: #f59e0b;
  --leak-low: #3b82f6;
  --water-deep: #0d47a1;
  --water-light: #4fc3f7;
  --water-foam: #b3e5fc;
  --seep-out: #26c6da;
}

/* —— 漏点闪烁圆点 —— */
.fx-leak-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 0 0 0 currentColor;
}
.fx-leak-dot::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.55;
  animation: fx-ripple 1.6s ease-out infinite;
}
.fx-leak-dot.high {
  background: var(--leak-high);
  color: var(--leak-high);
  animation: fx-pulse-high 1.2s ease-in-out infinite;
}
.fx-leak-dot.mid {
  background: var(--leak-mid);
  color: var(--leak-mid);
  animation: fx-pulse-mid 1.4s ease-in-out infinite;
}
.fx-leak-dot.low {
  background: var(--leak-low);
  color: var(--leak-low);
  animation: fx-pulse-low 1.6s ease-in-out infinite;
}

@keyframes fx-pulse-high {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  50% { transform: scale(1.25); box-shadow: 0 0 12px 4px rgba(239, 68, 68, 0.25); }
}
@keyframes fx-pulse-mid {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}
@keyframes fx-pulse-low {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 0.7; }
}
@keyframes fx-ripple {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* —— 排水口脉冲 —— */
.fx-drain {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--water-foam), var(--water-deep));
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.55);
  animation: fx-drain-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
.fx-drain::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(79, 195, 247, 0.5);
  animation: fx-ripple 2s ease-out infinite;
}
@keyframes fx-drain-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.18); filter: brightness(1.25); }
}

/* —— 积水区域高亮 —— */
.fx-water-zone {
  position: absolute;
  border-radius: 40% 55% 45% 50% / 50% 40% 55% 45%;
  background: radial-gradient(
    ellipse at 40% 40%,
    rgba(79, 195, 247, 0.45),
    rgba(13, 71, 161, 0.18) 70%,
    transparent 100%
  );
  border: 1px solid rgba(129, 212, 250, 0.35);
  pointer-events: none;
  animation: fx-wet-breathe 3.2s ease-in-out infinite;
  mix-blend-mode: screen;
}
@keyframes fx-wet-breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.04); }
}

/* —— 流水路径虚线动画 —— */
.fx-water-path {
  stroke: var(--water-light);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 8 10;
  animation: fx-flow-dash 1.2s linear infinite;
  filter: drop-shadow(0 0 4px rgba(79, 195, 247, 0.6));
}
.fx-water-path.seepage {
  stroke: #ff9100;
}
.fx-water-path.seep-out {
  stroke: var(--seep-out);
}
@keyframes fx-flow-dash {
  to { stroke-dashoffset: -36; }
}

/* —— 阶段标签胶囊 —— */
.fx-stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(10, 22, 40, 0.72);
  color: #e8f4ff;
  border: 1px solid rgba(79, 195, 247, 0.35);
  backdrop-filter: blur(8px);
}
.fx-stage-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--water-light);
  box-shadow: 0 0 8px var(--water-light);
  animation: fx-pulse-low 1s ease-in-out infinite;
}
.fx-stage-pill[data-stage='infiltrate'] .dot { background: var(--leak-high); box-shadow: 0 0 8px var(--leak-high); }
.fx-stage-pill[data-stage='surfaceFlow'] .dot,
.fx-stage-pill[data-stage='layerMigrate'] .dot { background: var(--leak-mid); box-shadow: 0 0 8px var(--leak-mid); }
.fx-stage-pill[data-stage='seepOut'] .dot { background: var(--seep-out); box-shadow: 0 0 8px var(--seep-out); }

/* —— 垂直滴落条（侧栏示意） —— */
.fx-drip-column {
  position: relative;
  width: 4px;
  height: 48px;
  border-radius: 2px;
  background: linear-gradient(to bottom, transparent, var(--water-light));
  overflow: hidden;
}
.fx-drip-column::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 10px;
  border-radius: 2px;
  background: var(--water-foam);
  animation: fx-drip-fall 1.4s ease-in infinite;
  box-shadow: 0 0 6px var(--water-light);
}
@keyframes fx-drip-fall {
  0% { top: -12px; opacity: 0; }
  20% { opacity: 1; }
  100% { top: 100%; opacity: 0.2; }
}
