/* 地图标注：计划 / 作品 / 图鉴 bubble + dot（从 index.html 抽出并统一） */

.woodsper-map-ann,
.woodsper-plan-bubble,
.woodsper-plan-dot,
.woodsper-work-bubble,
.woodsper-work-dot,
.woodsper-atlas-bubble,
.woodsper-atlas-dot {
  background: transparent !important;
  border: none !important;
}

.woodsper-atlas-bubble,
.woodsper-work-bubble,
.woodsper-plan-bubble {
  overflow: visible !important;
}

/* —— 气泡外壳：顶/侧留白给聚合角标，避免负偏移被 Leaflet 定宽高裁切 —— */
.map-ann-bubble-wrap {
  position: relative;
  display: inline-block;
  /* 顶/侧给角标；底给气泡三角（ARROW_TIP ≈ 8.5px） */
  padding: 6px 6px 10px;
  overflow: visible;
}

.woodsper-map-ann.leaflet-marker-icon,
.woodsper-plan-bubble.leaflet-marker-icon,
.woodsper-work-bubble.leaflet-marker-icon,
.woodsper-atlas-bubble.leaflet-marker-icon {
  overflow: visible !important;
}

.map-ann-bubble {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  background: rgba(255, 255, 255, 0.97);
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
  max-width: 260px;
  cursor: pointer;
}

.map-ann-bubble::before,
.map-ann-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-style: solid;
}

.map-ann-bubble::before {
  border-width: 8.5px 7px 0 7px;
  border-color: rgba(15, 23, 42, 0.18) transparent transparent transparent;
  bottom: -8.5px;
}

.map-ann-bubble::after {
  border-width: 7.5px 6px 0 6px;
  border-color: rgba(255, 255, 255, 0.97) transparent transparent transparent;
  bottom: -7px;
  z-index: 1;
}

.map-ann-bubble-title {
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  min-width: 0;
  z-index: 2;
}

/* 聚合角标：落在 wrap 的 padding 区内，叠在封面/气泡右上角（勿用负偏移） */
.map-ann-count {
  position: absolute;
  top: 0;
  right: 0;
  box-sizing: border-box;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--map-ann-count-tint, #3b82f6);
  color: #fff;
  border: 1px solid #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.map-ann-count-text {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* —— 计划 mid —— */
.map-ann-plan-bubble {
  border-color: rgba(255, 166, 0, 0.45);
}

.map-ann-plan-bubble::before {
  border-top-color: rgba(255, 166, 0, 0.45);
}

.map-ann-plan-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffa600;
  color: #fff;
  z-index: 2;
}

.map-ann-glyph {
  display: block;
}

/* —— mid 封面卡（作品 / 有图图鉴共用） —— */
/* 不用 overflow:hidden：底部气泡三角在卡外，需可见；圆角由图片/底栏各自裁 */
.map-ann-cover-card {
  position: relative;
  overflow: visible;
  background: #0f172a;
  border: 1.5px solid #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.2);
  cursor: pointer;
}

.map-ann-cover-card::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 4.5px 0 4.5px;
  border-color: #fff transparent transparent transparent;
  z-index: 2;
  pointer-events: none;
}

.map-ann-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.map-ann-media-glyph-wrap {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.82);
  filter: drop-shadow(0 0.5px 1px rgba(0, 0, 0, 0.4));
  pointer-events: none;
  line-height: 0;
}

.map-ann-cover-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 14px 6px 5px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.72));
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

.map-ann-work-text-bubble {
  border-color: rgba(59, 130, 246, 0.4);
}

.map-ann-work-text-bubble::before {
  border-top-color: rgba(59, 130, 246, 0.4);
}

/* —— 图鉴 mid 无封面气泡 —— */
.map-ann-atlas-bubble {
  border-color: var(--map-ann-accent, rgba(56, 142, 174, 0.4));
}

.map-ann-atlas-bubble::before {
  border-top-color: var(--map-ann-accent, rgba(56, 142, 174, 0.4));
}

.map-ann-atlas-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  z-index: 2;
}

.map-ann-atlas-cover {
  flex-shrink: 0;
  object-fit: cover;
  background: #eef2f7;
  z-index: 2;
}

/* —— 色点（计划/作品/图鉴同档尺寸，靠色/图标/封面区分） —— */
.map-ann-dot-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.map-ann-dot {
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
}

.map-ann-plan-dot {
  background: #ffa600;
}

.map-ann-work-dot {
  background: #3b82f6;
}

.map-ann-work-dot.is-icon {
  background: rgba(59, 130, 246, 0.9);
}

.map-ann-dot-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-ann-dot-count,
.map-ann-dot-cover-count {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-align: center;
}

.map-ann-dot-cover-count {
  background: rgba(0, 0, 0, 0.35);
}

.map-ann-dot-emoji {
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-ann-side-title {
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  text-shadow:
    0 0 3px #fff,
    0 0 3px #fff,
    1px 0 0 #fff,
    -1px 0 0 #fff,
    0 1px 0 #fff,
    0 -1px 0 #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
