/* ==========================================================================
   MESL 44 雷达扫描与扇形扫描核心视觉样式 (Framework 44 - Radar Scanner HUD)
   ========================================================================== */

.radar-hud-wrapper {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-container {
  position: relative;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 25, 44, 0.85) 0%, rgba(6, 11, 20, 0.95) 75%, #050b14 100%);
  border: 2px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 0 35px rgba(0, 242, 254, 0.18), inset 0 0 30px rgba(0, 242, 254, 0.12);
  overflow: hidden;
}

/* 装饰性外部雷达刻度外环 */
.radar-outer-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed rgba(56, 189, 248, 0.25);
  pointer-events: none;
  animation: radarRotateOuter 60s linear infinite;
}

.radar-outer-ring::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #00f2fe;
  border-radius: 50%;
  box-shadow: 0 0 10px #00f2fe;
}

/* 坐标十字线与角度线 */
.radar-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.radar-grid::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.3) 15%, rgba(0, 242, 254, 0.5) 50%, rgba(0, 242, 254, 0.3) 85%, transparent);
  transform: translateY(-50%);
}

.radar-grid::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(0, 242, 254, 0.3) 15%, rgba(0, 242, 254, 0.5) 50%, rgba(0, 242, 254, 0.3) 85%, transparent);
  transform: translateX(-50%);
}

.radar-diagonal-1,
.radar-diagonal-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 1px;
  background: rgba(30, 41, 59, 0.6);
  pointer-events: none;
}
.radar-diagonal-1 { transform: translate(-50%, -50%) rotate(45deg); }
.radar-diagonal-2 { transform: translate(-50%, -50%) rotate(-45deg); }

/* 同心圆网格 */
.radar-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(0, 242, 254, 0.16);
  pointer-events: none;
}

.radar-circle-1 { width: 28%; height: 28%; border-color: rgba(0, 242, 254, 0.28); }
.radar-circle-2 { width: 54%; height: 54%; border-color: rgba(0, 242, 254, 0.2); }
.radar-circle-3 { width: 78%; height: 78%; border-color: rgba(0, 242, 254, 0.15); }
.radar-circle-4 { width: 94%; height: 94%; border: 1px solid rgba(0, 242, 254, 0.12); }

/* 核心扇形扫描光束 (Sector Sweep) */
.radar-sweep-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(0, 242, 254, 0.45) 0deg,
    rgba(0, 242, 254, 0.2) 25deg,
    rgba(56, 189, 248, 0.08) 50deg,
    transparent 80deg,
    transparent 360deg
  );
  animation: radarSweep 3.5s linear infinite;
  pointer-events: none;
  transform-origin: center center;
  z-index: 2;
}

/* 扇形扫描领先高亮线 */
.radar-sweep-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, #00f2fe, #ffffff);
  transform-origin: 0% 50%;
  box-shadow: 0 0 12px #00f2fe;
  pointer-events: none;
  z-index: 3;
}

/* 中心基站圆点与脉冲 */
.radar-center-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 16px #00f2fe;
  z-index: 4;
}

.radar-center-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #00f2fe;
  animation: radarCenterPulse 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  pointer-events: none;
}

/* 全球 POP 雷达探测节点 */
.radar-node-blip {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.25s ease;
}

.radar-node-blip:hover {
  transform: translate(-50%, -50%) scale(1.15);
}

.radar-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  position: relative;
  margin: 0 auto;
}

.radar-node-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #00f2fe;
  animation: blipPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.radar-node-tag {
  margin-top: 5px;
  background: rgba(6, 13, 26, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #e0f2fe;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.radar-node-tag .ping-val {
  color: #10b981;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

/* 各大节点具体坐标分布 */
.node-hk { top: 38%; left: 74%; }
.node-sg { top: 68%; left: 68%; }
.node-jp { top: 26%; left: 82%; }
.node-us { top: 32%; left: 24%; }
.node-uk { top: 22%; left: 45%; }
.node-de { top: 30%; left: 52%; }

/* 雷达侧边 HUD 监视器数据面板 */
.radar-hud-readout {
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  background: rgba(10, 18, 35, 0.9);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 6;
}

.hud-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

.hud-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: #00f2fe;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

.hud-stat-value.healthy {
  color: #10b981;
}

/* 动画定义 */
@keyframes radarSweep {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes radarRotateOuter {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes radarCenterPulse {
  0% {
    width: 14px;
    height: 14px;
    opacity: 1;
  }
  100% {
    width: 44px;
    height: 44px;
    opacity: 0;
  }
}

@keyframes blipPing {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  80%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* 响应式微调 */
@media (max-width: 640px) {
  .radar-hud-wrapper {
    max-width: 340px;
  }
  .radar-hud-readout {
    position: relative;
    bottom: auto;
    margin-top: 15px;
    padding: 10px 12px;
  }
  .radar-node-tag {
    font-size: 9px;
    padding: 1px 4px;
  }
  .hud-stat-label {
    font-size: 9px;
  }
  .hud-stat-value {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .radar-sweep-beam,
  .radar-outer-ring,
  .radar-center-pulse,
  .radar-node-dot::after {
    animation: none !important;
  }
  .radar-sweep-beam {
    opacity: 0.25;
    transform: rotate(45deg);
  }
}
