/* ============================================
   LG-NewUI 地图功能样式
   ============================================ */

/* ---------- 距离指示器 ---------- */
.distance-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 1.2rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-top: 1rem;
  user-select: none;
  font-family: 'Noto Serif SC', serif;
}

.distance-indicator:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.distance-indicator .dist-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.distance-indicator .dist-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  color: #ff6b8a;
}

.distance-indicator .dist-value {
  background: linear-gradient(135deg, #ff6b8a, #ff8e53);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.distance-indicator .dist-unit {
  font-weight: 500;
  color: #888;
}

/* 头像区域距离指示器 */
.bg-img .middle {
  position: relative;
}

.bg-img .middle .distance-indicator {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.bg-img .middle .distance-indicator:hover {
  transform: translateX(-50%) translateY(-2px);
}

/* ---------- 地图弹窗遮罩 ---------- */
.lg-map-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lg-map-overlay.lg-map-overlay-show {
  opacity: 1;
  visibility: visible;
}

/* ---------- 地图弹窗容器 ---------- */
.lg-map-modal {
  position: absolute;
  top: 3%;
  left: 3%;
  right: 3%;
  bottom: 3%;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lg-map-overlay.lg-map-overlay-show .lg-map-modal {
  transform: scale(1);
}

/* ---------- 地图容器 ---------- */
.lg-map {
  width: 100%;
  height: 100%;
  background: #0f1923;
}

/* ---------- 地图头部信息条 ---------- */
.lg-map-header {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(30, 38, 50, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lg-map-header .lmh-avatar {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.lg-map-header .lmh-name {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Noto Serif SC', serif;
}

.lg-map-header .lmh-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.65rem;
}

.lg-map-header .lmh-distance {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #ff6b8a;
  font-weight: 700;
  font-size: 0.9rem;
}

.lg-map-header .lmh-distance .d-icon {
  width: 0.9rem;
  height: 0.9rem;
}

.lg-map-header .lmh-divider {
  width: 1px;
  height: 1.2rem;
  background: rgba(255, 255, 255, 0.15);
}

/* ---------- 关闭按钮 ---------- */
.lg-map-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(20, 28, 36, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.lg-map-close:hover {
  background: rgba(255, 107, 138, 0.9);
  transform: rotate(90deg);
}

.lg-map-close svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* ---------- 底部信息栏 ---------- */
.lg-map-footer {
  position: absolute;
  bottom: 8rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 100;
  pointer-events: none;
}

.lg-map-footer .lmf-left {
  background: rgba(20, 28, 36, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.8rem 1.2rem;
  border-radius: 1rem;
  color: #fff;
  pointer-events: auto;
  max-width: 60%;
}

.lg-map-footer .lmf-title {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
}

.lg-map-footer .lmf-desc {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.2rem;
}

/* ---------- 地图图例/版权 ---------- */
.lg-map-footer .lmf-right {
  background: rgba(20, 28, 36, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.65rem;
  pointer-events: auto;
}

/* 隐藏高德地图 logo 和版权信息 */
.lg-map-modal .amap-logo {
  display: none !important;
}

.lg-map-modal .amap-copyright {
  display: none !important;
}

.lg-map-modal .amap-copyright a {
  display: none !important;
}

/* ---------- 自定义标记 ---------- */
.lg-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lg-marker {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 120;
}

.lg-marker:hover {
  transform: scale(1.1);
}

.lg-marker .lg-marker-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
  background: #ddd;
}

.lg-marker-boy .lg-marker-avatar {
  border-color: #64b5f6;
  box-shadow: 0 0 20px rgba(100, 181, 246, 0.5);
}

.lg-marker-girl .lg-marker-avatar {
  border-color: #ff6b8a;
  box-shadow: 0 0 20px rgba(255, 107, 138, 0.5);
}

.lg-marker .lg-marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 138, 0.6);
  animation: lg-pulse 2s ease-out infinite;
  pointer-events: none;
}

.lg-marker .lg-marker-pulse.blue {
  border-color: rgba(100, 181, 246, 0.6);
}

@keyframes lg-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

.lg-marker .lg-marker-label {
  margin-top: 0.4rem;
  background: rgba(20, 28, 36, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  padding: 0.2rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lg-marker-girl .lg-marker-pulse {
  border-color: rgba(255, 107, 138, 0.6);
}

.lg-marker-boy .lg-marker-pulse {
  border-color: rgba(100, 181, 246, 0.6);
}

/* ---------- 标记信息窗口 ---------- */
.lg-info-window {
  background: rgba(20, 28, 36, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  min-width: 180px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
}

.lg-info-window .liw-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.lg-info-window .liw-avatar {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.lg-info-window .liw-info {
  flex: 1;
  min-width: 0;
}

.lg-info-window .liw-name {
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
  margin-bottom: 0.2rem;
}

.lg-info-window .liw-addr {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lg-info-window .liw-weather-loading {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 0.5rem 0;
}

.lg-info-window .liw-weather {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lg-info-window .liw-temp {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ff6b8a;
  line-height: 1;
}

.lg-info-window .liw-wind {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.lg-info-window .liw-weather-unavailable {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 0.5rem 0;
  font-style: italic;
}

/* 高德 InfoWindow 样式覆盖 */
.amap-info-content {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.amap-info-close {
  display: none !important;
}

/* ---------- 距离信息窗 ---------- */
.lg-distance-window {
  background: rgba(20, 28, 36, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 0.8rem;
  padding: 1rem 1.2rem;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lg-distance-window .ldw-title {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lg-distance-window .ldw-title .dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b8a, #ff8e53);
}

.lg-distance-window .ldw-dist {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b8a, #ff8e53);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lg-distance-window .ldw-unit {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.lg-distance-window .ldw-desc {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* ---------- 连线动画 ---------- */
.lg-map-polyline {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: lg-draw-line 2s ease-out forwards;
}

@keyframes lg-draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- 天气卡片 ---------- */
.lg-weather {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  min-width: 140px;
  z-index: 10;
  font-family: 'Noto Serif SC', serif;
  opacity: 0;
  animation: lg-weather-fade-in 0.5s ease-out forwards;
}

.lg-weather-boy {
  border-left: 3px solid #64b5f6;
}

.lg-weather-girl {
  border-left: 3px solid #ff6b8a;
}

@keyframes lg-weather-fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.lg-weather .lw-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
}

.lg-weather .lw-icon svg {
  width: 100%;
  height: 100%;
}

.lg-weather .lw-icon .lw-loading {
  animation: lg-weather-spin 1.5s linear infinite;
  color: #aaa;
}

@keyframes lg-weather-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.lg-weather .lw-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.2;
}

.lg-weather .lw-temp {
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
}

.lg-weather .lw-temp-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: #333;
  background: linear-gradient(135deg, #ff6b8a, #ff8e53);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lg-weather .lw-unit {
  font-size: 0.9rem;
  color: #888;
  font-weight: 500;
}

.lg-weather .lw-detail {
  display: flex;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: #666;
  font-weight: 500;
}

.lg-weather .lw-feels,
.lg-weather .lw-hum,
.lg-weather .lw-vis {
  white-space: nowrap;
}

.lg-weather .lw-text {
  font-size: 0.75rem;
  color: #555;
  font-weight: 500;
  white-space: nowrap;
}

.lg-weather-boy .lw-temp-val {
  background: linear-gradient(135deg, #64b5f6, #42a5f5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lg-weather-girl .lw-temp-val {
  background: linear-gradient(135deg, #ff6b8a, #ff8e53);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .bg-img .middle {
    padding: 3rem 2rem 2rem;
  }

  .bg-img .middle img {
    width: 6rem;
    height: 6rem;
  }

  .bg-img .middle .love-icon img {
    width: 4rem;
    height: 4rem;
  }

  .lg-map-header {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    gap: 0.5rem;
  }

  .lg-map-header .lmh-avatar {
    width: 1.5rem;
    height: 1.5rem;
  }

  .lg-map-header .lmh-name {
    font-size: 0.7rem;
  }

  .lg-map-header .lmh-distance {
    font-size: 0.75rem;
  }

  .lg-map-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
  }

  .lg-marker .lg-marker-avatar {
    width: 2.2rem;
    height: 2.2rem;
  }

  .distance-indicator {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .lg-weather {
    min-width: 110px;
    padding: 0.3rem 0.5rem;
    gap: 0.3rem;
  }

  .lg-weather .lw-icon {
    width: 1.6rem;
    height: 1.6rem;
  }

  .lg-weather .lw-temp-val {
    font-size: 1.1rem;
  }

  .lg-weather .lw-detail {
    font-size: 0.6rem;
    gap: 0.25rem;
  }

  .lg-weather .lw-text {
    font-size: 0.65rem;
  }
}

/* ---------- 停留点样式 ---------- */
.lg-stop-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  transition: all 0.3s ease;
}

/* 未点亮 - 灰色 */
.lg-stop-dot-off {
  background: #999;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

/* 点亮 - 粉色发光 */
.lg-stop-dot-on {
  background: #ff6b8a;
  box-shadow: 0 0 8px rgba(255, 107, 138, 0.8), 0 0 16px rgba(255, 107, 138, 0.4);
  animation: lg-stop-dot-glow 1.5s ease-in-out infinite;
}

@keyframes lg-stop-dot-glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 107, 138, 0.8), 0 0 16px rgba(255, 107, 138, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 12px rgba(255, 107, 138, 1), 0 0 24px rgba(255, 107, 138, 0.6);
    transform: scale(1.1);
  }
}
