/* 地图弹窗 - 核心样式 */
:root {
  --map-pink: #ff5c8d;
  --map-bg-blur: rgba(30, 30, 45, 0.75);
  --map-border-color: rgba(255, 255, 255, 0.15);
}

body.modal-open {
  overflow: hidden;
}

.map-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.map-modal.show {
  display: block;
  opacity: 1;
}

.map-container {
  width: 100%;
  height: 100%;
}

/* ====== 顶部信息条 (Pill) ====== */
.map-top-bar {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--map-bg-blur);
  border: 1px solid var(--map-border-color);
  border-radius: 999px; /* Pill shape */
  padding: 8px 12px;
  z-index: 1010;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  user-select: none;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.pill-info {
  display: flex;
  flex-direction: column;
  color: #fff;
}

.pill-info.right-align {
  align-items: flex-end;
}

.pill-name {
  font-size: 16px;
  font-weight: 600;
  font-family: 'LXGW WenKai', sans-serif;
}

.pill-sub-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.pill-sub-info i {
  font-size: 14px;
}

.pill-distance {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.pill-distance i {
  font-size: 20px;
}

.pill-distance .val {
  font-size: 18px;
  font-weight: bold;
  font-family: 'DIN-Bold', 'Courier New', monospace;
}

.pill-distance .unit {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* ====== 右上角控制按钮 ====== */
.map-controls-top-right {
  position: fixed;
  top: 30px;
  right: 30px;
  display: flex;
  gap: 12px;
  z-index: 1010;
}

.map-control-btn {
  width: 44px;
  height: 44px;
  background: var(--map-bg-blur);
  border: 1px solid var(--map-border-color);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.map-control-btn:hover {
  background: rgba(45, 45, 65, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

/* ====== 右侧边栏 ====== */
.map-sidebar {
  position: fixed;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1010;
  background: var(--map-bg-blur);
  border: 1px solid var(--map-border-color);
  border-radius: 999px; /* Pill shape */
  padding: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar-btn {
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.sidebar-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-btn.active {
  background: var(--map-pink);
  color: #fff;
  box-shadow: 0 0 15px var(--map-pink);
}

/* ====== 地图标记 (与之前类似, 可按需保留或修改) ====== */
.map-marker {
  position: relative;
  width: 50px;
  height: 50px;
}

.marker-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid var(--map-pink);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(255, 92, 141, 0.4);
}

.marker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ====== 响应式适配 ====== */
@media (max-width: 768px) {
  .map-top-bar {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 24px;
  }

  .map-sidebar {
    top: auto;
    bottom: 30px;
    right: 50%;
    transform: translateX(50%);
    flex-direction: row;
    padding: 8px;
  }

  .map-controls-top-right {
    top: 20px;
    right: 20px;
  }
}


/* 1. 头像雷达波纹效果 */
.marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 2px solid var(--map-pink);
    border-radius: 50%;
    animation: ripple 2s linear infinite;
    pointer-events: none;
}

@keyframes ripple {
    0% { width: 50px; height: 50px; opacity: 1; }
    100% { width: 120px; height: 120px; opacity: 0; }
}

/* 2. 头像容器：Hover 放大效果 */
.map-marker {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
.map-marker:hover {
    transform: scale(1.2);
    z-index: 999;
}

/* 3. 爱心生长动画 */
.heart-pop {
    animation: heartPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes heartPopIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 爱心节点的呼吸灯效果 */
.heart-node {
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(255, 92, 141, 0.9));
}

/* 轨道底线淡入 */
.path-fade-in {
    stroke-dasharray: 10, 10;
    animation: dashMove 20s linear infinite;
}

@keyframes dashMove {
    to { stroke-dashoffset: -500; }
}