/* ==========================================================================
   怒放的生命 · 2007-2026 全球旅行足迹大屏 - 样式表
   Design Aesthetic: Cosmic Dark, Vibrant Life, Glassmorphism, Glowing Particles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Montserrat:wght@300;400;600;800&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --bg-dark: #05050b;
  --bg-panel: rgba(12, 14, 28, 0.76);
  --bg-glass: rgba(20, 24, 45, 0.55);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(255, 100, 50, 0.4);
  
  --color-flight-inter: #ff3366;  /* 洲际飞行：怒放炽红/霓虹粉 */
  --color-flight-regional: #ff9900; /* 区域飞行：炽热金黄 */
  --color-overland: #00f2fe;        /* 陆路自驾/高铁：电光蓝/极光 */
  --color-island: #00ff88;          /* 海岛/游轮：翡翠绿/碧蓝 */
  --color-hub: #ff0055;             /* 大本营/广州：核心脉冲 */
  
  --text-main: #ffffff;
  --text-sub: rgba(255, 255, 255, 0.75);
  --text-muted: rgba(255, 255, 255, 0.45);
  
  --font-title: 'Cinzel', 'Noto Sans SC', serif;
  --font-body: 'Montserrat', 'Noto Sans SC', sans-serif;
  
  --shadow-glow: 0 0 25px rgba(255, 51, 102, 0.4);
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* 背景星空/离子漂浮 Canvas */
#bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* 地图容器 */
#map-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: transparent;
}

/* Leaflet 地图底图样式 - 保持精致暗黑地理轮廓 */
.leaflet-container {
  background: #080a14 !important;
}

/* 卫星真实地貌暗黑高对比度滤镜 */
.satellite-dark-tiles {
  filter: brightness(0.68) contrast(1.28) saturate(0.75);
}

.satellite-label-tiles {
  filter: brightness(1.15) contrast(1.1) drop-shadow(0 0 2px rgba(0,0,0,0.9));
}

.dark-tiles {
  filter: brightness(0.9) contrast(1.15) saturate(0.6);
}

/* 备用：标准 OSM 瓦片转换为夜间暗黑风格滤镜 */
.dark-tiles-osm {
  filter: brightness(0.65) invert(1) contrast(1.4) hue-rotate(200deg) saturate(0.4);
}

/* 粒子图层 Canvas */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 500; /* 放置于地图点线之上 */
  pointer-events: none;
}

/* 头部大标题 & 视觉艺术面板 */
.header-panel {
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 1000;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  max-width: 540px;
  animation: fadeInDown 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #fff 0%, #ff7799 50%, #ffaa44 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(255, 51, 102, 0.5);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title .sparkle {
  color: #ff3366;
  animation: pulseGlow 2s infinite alternate;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-sub);
  letter-spacing: 1px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-subtitle .badge {
  background: linear-gradient(90deg, #ff3366, #ff9900);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* 核心指标统计卡片 */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-title);
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #ffd0aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#stat-visitors {
  background: linear-gradient(180deg, #ffffff 0%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.4));
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #00ff88;
  border-radius: 50%;
  margin-right: 4px;
  box-shadow: 0 0 8px #00ff88;
  animation: liveBlink 1.5s infinite alternate;
}

@keyframes liveBlink {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.3); }
}

/* 右侧控制与图例面板 */
.legend-panel {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 1000;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInRight 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.legend-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.legend-row:hover {
  color: #fff;
  transform: translateX(-2px);
}

.legend-color-line {
  width: 22px;
  height: 4px;
  border-radius: 2px;
  box-shadow: 0 0 10px currentColor;
}

.visitor-badge-row {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-sub);
}

.live-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: #00ff88;
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.live-pulse {
  width: 5px;
  height: 5px;
  background: #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 6px #00ff88;
  animation: livePulse 1.2s infinite ease-out;
}

@keyframes livePulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.visitor-mini-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sub);
  font-size: 11px;
}

.visitor-mini-info strong {
  color: #00f2fe;
  font-family: var(--font-title);
  font-size: 13px;
}

/* 控制按钮组 */
.map-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  background: rgba(255, 51, 102, 0.3);
  border-color: #ff3366;
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.5);
  transform: translateY(-2px);
}

.btn-icon.active-audio {
  background: rgba(255, 51, 102, 0.4);
  border-color: #ff3366;
  color: #ffaa00;
  box-shadow: 0 0 18px rgba(255, 51, 102, 0.8);
}

.btn-icon.active-audio i {
  animation: spinSlow 4s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 左下角：年度里程统计直方图面板 */
.stats-chart-panel-left {
  position: absolute;
  bottom: 180px;
  left: 28px;
  z-index: 1000;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 14px 18px;
  width: 410px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 右下角：大洲分布比率图面板 */
.stats-chart-panel-right {
  position: absolute;
  bottom: 180px;
  right: 28px;
  z-index: 1000;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 14px 18px;
  width: 330px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-title i {
  color: #ff3366;
}

.chart-container-box {
  width: 100%;
  height: 135px;
  position: relative;
}

/* 底部：全功能可滑动/自动播放时间轴 */
.timeline-bar-container {
  position: absolute;
  bottom: 18px;
  left: 28px;
  right: 28px;
  z-index: 1000;
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 10px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-play-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff3366 0%, #ff9900 100%);
  border: none;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.6);
  transition: var(--transition-smooth);
}

.btn-play:hover {
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(255, 51, 102, 0.9);
}

.speed-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2px;
}

.speed-opt {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.speed-opt.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 700;
}

.timeline-current-year {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

.year-badge-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.current-year-display {
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(90deg, #ffffff, #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

/* 当年事件全景按钮 */
.btn-year-details {
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.4);
  color: #ffaa00;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.btn-year-details:hover {
  background: rgba(255, 51, 102, 0.35);
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.6);
  transform: translateY(-1px);
}

/* 事件 Chips 容器：支持完整平滑滚动/横向排列，无截断！ */
.event-chips-container {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none; /* Firefox */
}

.event-chips-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.event-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: #ffffff;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.event-chip:hover {
  background: rgba(255, 51, 102, 0.25);
  border-color: #ff3366;
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.5);
  transform: scale(1.03);
}

.event-chip .chip-type-icon {
  font-size: 10px;
}

.event-chip .chip-city {
  font-weight: 700;
  color: #ffaa00;
}

.event-chip .chip-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
}

/* 浮动年份时光全景弹窗 Modal */
.year-details-modal {
  position: absolute;
  bottom: 110px;
  left: 28px;
  width: 460px;
  max-height: 380px;
  z-index: 2000;
  background: rgba(12, 15, 30, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.year-details-modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: #ff3366;
}

.modal-body {
  padding: 14px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-event-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-event-item:hover {
  background: rgba(255, 51, 102, 0.2);
  border-color: #ff3366;
  transform: translateX(4px);
}

.modal-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-item-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-item-desc {
  font-size: 11px;
  color: var(--text-sub);
}

.modal-item-dist {
  font-size: 11px;
  font-weight: 700;
  color: #ff9900;
}

/* 滑块轨道与年份节点刻度 */
.slider-wrapper {
  position: relative;
  width: 100%;
  padding: 6px 0;
}

.timeline-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ff3366 var(--progress, 100%), rgba(255, 255, 255, 0.15) 0%);
  outline: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #ff3366;
  box-shadow: 0 0 15px #ff3366;
  cursor: grab;
  transition: transform 0.15s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.year-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  position: relative;
}

.year-tick {
  font-size: 11px;
  font-family: var(--font-title);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.year-tick:hover, .year-tick.active {
  color: #ffaa00;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 170, 0, 0.8);
}

.year-tick.has-event::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: #ff3366;
  border-radius: 50%;
  margin: 2px auto 0;
  box-shadow: 0 0 6px #ff3366;
}

/* 自定义 Leaflet 地图 Marker 样式 */
.custom-city-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-inner {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff3366;
  box-shadow: 0 0 15px #ff3366;
}

.marker-inner::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 51, 102, 0.6);
  animation: pulseRipple 2s infinite ease-out;
}

.marker-hub .marker-inner {
  width: 18px;
  height: 18px;
  background: #ff0055;
  box-shadow: 0 0 25px #ff0055;
}

.marker-hub .marker-inner::before {
  top: -10px;
  left: -10px;
  width: 36px;
  height: 36px;
  border-color: rgba(255, 0, 85, 0.9);
}

/* 地图弹出框 (Tooltip / Popup) */
.leaflet-popup-content-wrapper {
  background: rgba(10, 12, 25, 0.9) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px !important;
  color: #fff !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.8) !important;
}

.leaflet-popup-tip {
  background: rgba(10, 12, 25, 0.9) !important;
}

.popup-card {
  padding: 4px 6px;
}

.popup-year {
  font-size: 10px;
  font-weight: 800;
  color: #ff9900;
  letter-spacing: 1px;
}

.popup-city {
  font-size: 16px;
  font-weight: 700;
  margin: 2px 0 4px 0;
  color: #ffffff;
}

.popup-desc {
  font-size: 11px;
  color: var(--text-sub);
}

/* 动画 KEYFRAMES */
@keyframes pulseGlow {
  0% { opacity: 0.6; filter: drop-shadow(0 0 5px #ff3366); }
  100% { opacity: 1; filter: drop-shadow(0 0 20px #ff9900); }
}

@keyframes pulseRipple {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   移动端与响应式适配 (Responsive & Mobile Adaptation)
   ========================================================================== */

/* 1. 中等屏幕与平板 (Max-Width: 1024px) */
@media (max-width: 1024px) {
  .header-panel {
    top: 16px;
    left: 16px;
    max-width: 380px;
    padding: 16px 20px;
  }
  .legend-panel {
    top: 16px;
    right: 16px;
    padding: 12px 16px;
  }
  .stats-chart-panel-left {
    width: 340px;
    bottom: 165px;
    left: 16px;
  }
  .stats-chart-panel-right {
    width: 280px;
    bottom: 165px;
    right: 16px;
  }
  .timeline-bar-container {
    left: 16px;
    right: 16px;
    bottom: 14px;
  }
}

/* 2. 手机与移动设备 (Max-Width: 768px) */
@media (max-width: 768px) {
  /* 头部面板改为顶部全宽微型卡片 */
  .header-panel {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    padding: 12px 16px;
    border-radius: 14px;
  }
  .header-title {
    font-size: 18px;
  }
  .header-subtitle {
    font-size: 11px;
  }
  .stats-summary-grid {
    margin-top: 8px;
    padding-top: 8px;
    gap: 8px;
  }
  .stat-value {
    font-size: 16px;
  }
  .stat-label {
    font-size: 9px;
  }

  /* 图例面板置于合适定位 */
  .legend-panel {
    top: auto;
    bottom: 235px;
    right: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(10, 12, 25, 0.88);
  }
  .legend-row {
    font-size: 10px;
    gap: 6px;
  }

  /* 图表面板在手机端紧凑响应 */
  .stats-chart-panel-left {
    position: absolute;
    left: 10px;
    bottom: 155px;
    width: 48%;
    padding: 10px 12px;
    border-radius: 14px;
  }
  .stats-chart-panel-right {
    position: absolute;
    right: 10px;
    bottom: 155px;
    width: 48%;
    padding: 10px 12px;
    border-radius: 14px;
  }
  .chart-container-box {
    height: 100px;
  }
  .chart-title {
    font-size: 11px;
  }

  /* 底部时间轴移动端优化 */
  .timeline-bar-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 10px 14px;
    border-radius: 16px;
  }
  .btn-play {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  .current-year-display {
    font-size: 22px;
  }
  .btn-year-details {
    padding: 2px 8px;
    font-size: 10px;
  }

  /* 浮动 Modal 在手机端变为 BottomSheet 弹窗 */
  .year-details-modal {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 75px;
    max-height: 60vh;
    border-radius: 16px;
  }
}

/* 3. 超小屏手机 (Max-Width: 480px) */
@media (max-width: 480px) {
  .stats-chart-panel-left, .stats-chart-panel-right {
    display: none; /* 小屏手机专注全屏地图与离子流 */
  }
  .legend-panel {
    display: none;
  }
  .header-panel {
    padding: 10px 14px;
  }
  .timeline-bar-container {
    padding: 8px 12px;
  }
  .timeline-controls-row {
    gap: 6px;
  }
}

/* ==========================================================================
   4. 移动端与设备横屏适配 (Mobile & Tablet Landscape Adaptation)
   ========================================================================== */
@media (orientation: landscape) and (max-height: 540px) {
  .header-panel {
    top: 6px;
    left: 6px;
    right: auto;
    max-width: 440px;
    padding: 6px 12px;
    border-radius: 10px;
  }

  .header-title {
    font-size: 15px;
    margin-bottom: 2px;
  }

  .header-subtitle {
    font-size: 10px;
  }

  .stats-summary-grid {
    margin-top: 4px;
    padding-top: 4px;
    gap: 6px;
  }

  .stat-value {
    font-size: 14px;
  }

  .stat-label {
    font-size: 8px;
  }

  .legend-panel {
    top: 6px;
    bottom: auto;
    right: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    max-width: 220px;
  }

  .legend-title {
    font-size: 9px;
    margin-bottom: 0;
  }

  .legend-items {
    gap: 4px;
  }

  .legend-row {
    font-size: 9px;
  }

  .visitor-badge-row {
    margin-top: 2px;
    padding-top: 4px;
    font-size: 9px;
  }

  .map-actions {
    display: none; /* 横屏时隐藏地图工具按钮以保留极高视野 */
  }

  /* 左右图表在矮横屏时隐藏，保证全屏地图视觉效果 */
  .stats-chart-panel-left, 
  .stats-chart-panel-right {
    display: none;
  }

  /* 底部时间轴横屏紧凑响应 */
  .timeline-bar-container {
    left: 6px;
    right: 6px;
    bottom: 6px;
    padding: 6px 12px;
    border-radius: 12px;
  }

  .timeline-controls-row {
    gap: 8px;
  }

  .btn-play {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .current-year-display {
    font-size: 18px;
  }

  .year-badge-box {
    gap: 6px;
  }

  .btn-year-details {
    font-size: 9px;
    padding: 2px 6px;
  }

  .slider-wrapper {
    margin-top: 4px;
  }

  .timeline-slider {
    height: 4px;
  }

  .year-tick-label {
    font-size: 8px;
  }

  .year-details-modal {
    top: 10px;
    bottom: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: none;
  }
}
