/* SVG 地图热区：烫金描边 + 固定定位信息卡 */

.map-svg-overlay-anchor {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 3;
  pointer-events: auto;
  overflow: visible;
}

.map-hotspot-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: auto;
}

.map-hotspot-g {
  pointer-events: auto;
}

.map-hotspot-path {
  /* 接近全透明仍可命中填充区；纯 transparent 在部分 WebKit 下不易触发 hover */
  fill: rgba(0, 0, 0, 0.02);
  stroke: transparent;
  stroke-width: 3;
  cursor: pointer;
  /* fill 在部分环境下命中区过窄，改用 all 保证悬停高亮可靠 */
  pointer-events: all;
  transition: stroke 0.15s ease, filter 0.15s ease;
}

.map-hotspot-g:hover .map-hotspot-path,
.map-hotspot-path:hover,
.map-hotspot-path.is-linked-hover,
.map-hotspot-path:focus-visible {
  fill: rgba(0, 0, 0, 0.02);
  stroke: #ffe566;
  stroke-width: 3;
  filter: drop-shadow(0 0 1px #fff0a0) drop-shadow(0 0 4px #ffd700)
    drop-shadow(0 0 10px #ffb800) drop-shadow(0 0 20px #ff9500)
    drop-shadow(0 0 40px rgba(255, 140, 0, 0.7)) drop-shadow(0 0 60px rgba(255, 120, 0, 0.4));
}

.map-hotspot-path:focus-visible {
  outline: none;
}

/* 太和殿鸟瞰热区：不单独覆盖，与首页地图 #chinaMapHotspotSvg 使用同一套 .map-hotspot-path / :hover 烫金描边 + 光晕 */

.map-hotspot-info-card {
  position: fixed;
  z-index: 9999;
  max-width: min(360px, calc(100vw - 24px));
  padding: 14px 16px 16px;
  border-radius: 14px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: linear-gradient(165deg, rgba(36, 14, 14, 0.94), rgba(18, 8, 8, 0.92));
  border: 1px solid rgba(255, 220, 140, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 200, 100, 0.12),
    0 18px 48px rgba(0, 0, 0, 0.55);
  color: #f5efe0;
  font-family: "Noto Sans SC", system-ui, sans-serif;
  transform-origin: center center;
}

/* 默认深棕卡不再使用：仅详情页传入 --detailHero 时才显示悬浮说明 */
.map-hotspot-info-card:not(.map-hotspot-info-card--detailHero) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.map-hotspot-info-card.map-hotspot-info-card--detailHero.is-visible {
  display: block !important;
  visibility: visible;
  opacity: 1;
  animation: mapHotspotPopIn 0.27s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* 太和殿 / 御花园：顶栏横条大卡（宽度由 JS placement=top 与内联配合） */
.map-hotspot-info-card--detailHero.map-hotspot-info-card--taihe,
.map-hotspot-info-card--detailHero.map-hotspot-info-card--yuhua {
  max-width: min(640px, calc(100vw - 40px));
  width: min(640px, calc(100vw - 40px));
  min-height: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
}

.map-hotspot-info-card--taihe .map-hotspot-info-card__inner,
.map-hotspot-info-card--yuhua .map-hotspot-info-card__inner {
  display: block;
  min-height: 0;
}

.map-hotspot-info-card--taihe .map-hotspot-info-card__brand,
.map-hotspot-info-card--yuhua .map-hotspot-info-card__brand {
  display: none !important;
}

.map-hotspot-info-card--taihe .map-hotspot-info-card__main,
.map-hotspot-info-card--yuhua .map-hotspot-info-card__main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 1rem;
  row-gap: 0.35rem;
  padding: 9px 15px 12px;
  box-sizing: border-box;
}

.map-hotspot-info-card--taihe .map-hotspot-info-card__tag,
.map-hotspot-info-card--yuhua .map-hotspot-info-card__tag {
  margin-bottom: 0;
}

.map-hotspot-info-card--taihe .map-hotspot-info-card__title,
.map-hotspot-info-card--yuhua .map-hotspot-info-card__title {
  margin: 0;
}

.map-hotspot-info-card--taihe .map-hotspot-info-card__en,
.map-hotspot-info-card--yuhua .map-hotspot-info-card__en {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.map-hotspot-info-card--taihe .map-hotspot-info-card__desc,
.map-hotspot-info-card--yuhua .map-hotspot-info-card__desc {
  flex: 1 1 100%;
  margin: 0;
}

.map-hotspot-info-card--detailHero:not(.map-hotspot-info-card--taihe):not(.map-hotspot-info-card--yuhua)
  .map-hotspot-info-card__inner {
  display: contents;
}

.map-hotspot-info-card--detailHero:not(.map-hotspot-info-card--taihe):not(.map-hotspot-info-card--yuhua)
  .map-hotspot-info-card__brand {
  display: none;
}

.map-hotspot-info-card__tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255, 236, 190, 0.95);
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(255, 210, 120, 0.35);
}

.map-hotspot-info-card__title {
  font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  color: #ffecc8;
  margin: 0 0 4px;
  line-height: 1.25;
}

.map-hotspot-info-card__en {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(245, 230, 200, 0.72);
  margin: 0 0 10px;
}

.map-hotspot-info-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(245, 235, 215, 0.88);
}

@keyframes mapHotspotPopIn {
  0% {
    opacity: 0;
    transform: scale(0.68);
  }
  62% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-hotspot-path {
    transition: none;
  }
  .map-hotspot-info-card.map-hotspot-info-card--detailHero.is-visible {
    animation: none;
    opacity: 1;
    transform: scale(1);
  }
}
