/**
 * HistoryRiver Explore V0.1
 * 地图视口、标记与浮动时间轴样式
 */

#map-viewport {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: #11161f;
}

/* MapLibre 控件样式定制 */
.maplibregl-ctrl-group {
  background: rgba(22, 28, 38, 0.92) !important;
  border: 1px solid var(--border-antique) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
  border-radius: var(--radius-sm) !important;
  backdrop-filter: blur(8px);
}

.maplibregl-ctrl-group button {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.maplibregl-ctrl-group button:last-child {
  border-bottom: none !important;
}

.maplibregl-ctrl-icon {
  filter: invert(0.85);
}

.maplibregl-ctrl-attrib {
  background-color: rgba(15, 20, 28, 0.75) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
  border-radius: 4px;
}

.maplibregl-ctrl-attrib a {
  color: #9cb3ce !important;
}

/* 城市标记容器 */
.city-marker-wrap {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  z-index: 10;
  user-select: none;
}

.city-marker-wrap:hover {
  transform: translateY(-4px) scale(1.08);
  z-index: 30;
}

.city-marker-wrap.is-selected {
  transform: translateY(-6px) scale(1.15);
  z-index: 40;
}

/* 标记图钉外观 */
.city-pin-outer {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.city-pin-core {
  width: 28px;
  height: 28px;
  background: radial-gradient(circle, #252e3d 0%, #151b24 100%);
  border: 2px solid #b59351;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
  transition: all var(--transition-fast);
}

.city-pin-glyph {
  font-size: 13px;
  line-height: 1;
}

/* 城市文本标签卡 */
.city-label-box {
  margin-top: 4px;
  padding: 2px 7px;
  background: rgba(15, 20, 28, 0.88);
  border: 1px solid rgba(181, 147, 81, 0.35);
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.city-name-zh {
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 600;
  color: #f7f3e8;
  letter-spacing: 0.3px;
}

/* 重点城池：尼尼微专属炫光特效 */
.city-pin-outer.is-featured-pin .city-pin-core {
  border: 2px solid #ffd700;
  background: radial-gradient(circle, #5c201a 0%, #201010 100%);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.7);
}

.city-pin-outer.is-featured-pin .pin-pulse-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  margin-left: -14px;
  border: 2px solid rgba(255, 215, 0, 0.85);
  border-radius: 50%;
  animation: radar-pulse 2.2s infinite ease-out;
  pointer-events: none;
}

@keyframes radar-pulse {
  0% { transform: scale(0.9); opacity: 1; }
  70% { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.8); opacity: 0; }
}

.city-badge-game {
  font-size: 9px;
  font-weight: 600;
  color: #12161f;
  background: #ffd700;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.2px;
}

/* 城市历史极盛高亮 */
.city-marker-wrap.city-peak .city-pin-core {
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
  border-color: #ffd666;
}

.city-marker-wrap.is-selected .city-label-box {
  border-color: #ffd700;
  background: rgba(30, 22, 14, 0.95);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.city-marker-wrap.is-selected .city-name-zh {
  color: #ffe899;
}

/* 古代地理区域注记标签 */
.region-label-tag {
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0.68;
  z-index: 5;
}

.region-label-tag .region-zh {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: #c9bda5;
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

.region-label-tag .region-en {
  font-size: 8.5px;
  color: #8c7f69;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.region-label-tag.region-type-sea .region-zh {
  color: #6398b7;
  letter-spacing: 3px;
  font-style: italic;
}

.region-label-tag.region-type-sea .region-en {
  color: #426982;
}

/* 底部浮动年代时间轴面板 */
.timeline-floating-dock {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(880px, calc(100% - 32px));
  background: rgba(18, 24, 34, 0.94);
  border: 1px solid var(--border-antique);
  border-top: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-lg);
  padding: 14px 20px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-smooth);
}

/* 时间轴顶部控制行 */
.timeline-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-year-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.year-title-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
}

.current-year-val {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: #ffd666;
  text-shadow: 0 0 10px rgba(255, 214, 102, 0.3);
  letter-spacing: 0.5px;
}

.timeline-ctrl-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-timeline-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-antique);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-timeline-ctrl:hover {
  background: #232c3d;
  color: #ffffff;
  border-color: #405068;
}

.btn-timeline-ctrl.playing {
  background: rgba(200, 59, 43, 0.2);
  border-color: var(--color-crimson);
  color: #ff9d94;
}

/* 滑块轨道区 */
.slider-rail-wrap {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-slider-input {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #253142;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.timeline-slider-input:hover {
  background: #2f3e53;
}

.timeline-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe285 0%, #b8860b 100%);
  border: 2px solid #ffffff;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 10px rgba(212, 175, 55, 0.5);
  transition: transform var(--transition-fast);
}

.timeline-slider-input::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}

/* 里程碑快捷药丸列表 */
.timeline-milestones-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.timeline-milestones-row::-webkit-scrollbar {
  display: none;
}

.milestone-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(30, 39, 54, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.milestone-chip:hover {
  background: #283446;
  color: var(--text-primary);
  border-color: rgba(212, 175, 55, 0.4);
}

.milestone-chip.active {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--color-gold);
  color: #ffd666;
  font-weight: 600;
}

/* 时代地缘动态简评 */
.era-summary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #a4b3c7;
  background: rgba(14, 18, 25, 0.65);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--color-gold);
}
