/**
 * ============================================================
 *  changzhenglu — 红色主题样式表
 *  适配: 桌面端 + 平板 + 手机（移动端优先）
 * ============================================================
 */

/* ===== CSS 变量 ===== */
:root {
  --red-dark:    #8B0000;
  --red:         #C41E3A;
  --red-light:   #E8474F;
  --gold:        #D4A843;
  --gold-light:  #FFD700;
  --bg:          #FFF5F5;
  --card-bg:     #FFFFFF;
  --text:        #333;
  --text-light:  #666;
  --shadow:      0 2px 12px rgba(139,0,0,0.12);
  --radius:      10px;
  --sidebar-w:   340px;
  --header-h:    56px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* === 胶囊/毛玻璃风格变量 === */
  --pill-radius:   999px;      /* 胶囊/药丸圆角 */
  --card-radius:   28px;       /* 卡片大圆角 */
  --blur-amount:   20px;       /* 毛玻璃模糊量 */
  --blur-dark:     rgba(20, 0, 0, 0.75);    /* 暗色毛玻璃底色 */
  --blur-light:    rgba(255, 255, 255, 0.85); /* 浅色毛玻璃底色 */
  --border-gold:   rgba(212, 168, 67, 0.45); /* 金色半透明边框 */
  --spring:        cubic-bezier(0.34, 1.56, 0.64, 1);  /* 弹性/弹簧动画曲线 */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);      /* 流畅缓出曲线 */
}

/* ===== 全局 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* 全局焦点样式：隐藏浏览器默认 outline，用金色焦点环替代 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
html, body {
  height: 100%; width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* ===== 顶部导航 ===== */
.header {
  flex-shrink: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-h);
  z-index: 1000;
  border-bottom: 2px solid var(--border-gold);
  box-shadow: 0 2px 12px rgba(139,0,0,0.25);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo {
  width: 34px; height: 34px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: bold; color: var(--red-dark);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(212,168,67,0.3);
}
.header-title {
  font-size: 18px; font-weight: bold; letter-spacing: 3px; white-space: nowrap;
  background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* 降级: 不支持 background-clip:text 的浏览器 */
@supports not (-webkit-background-clip: text) {
  .header-title {
    color: #FFD700;
    -webkit-text-fill-color: #FFD700;
  }
}
.header-subtitle {
  font-size: 11px; opacity: 0.8; letter-spacing: 2px; white-space: nowrap;
  color: rgba(255, 215, 0, 0.7);
}

/* 头部按钮组 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.header-badge {
  background: rgba(255,255,255,0.18);
  padding: 4px 12px;
  border-radius: var(--pill-radius);
  font-size: 11px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.header-btn {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.35s var(--spring);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}
.header-btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,215,0,0.4);
  transform: translateY(-1px);
}
.header-btn:active {
  transform: scale(0.93);
  background: rgba(255,255,255,0.4);
}

/* ===== 主内容区 ===== */
.main-container { flex: 1; display: flex; overflow: hidden; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--blur-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  z-index: 500;
  display: flex; flex-direction: column;
  overflow: hidden; flex-shrink: 0;
  border-right: 1px solid rgba(212,168,67,0.15);
}

/* 筛选按钮行 */
.sidebar-filter {
  display: flex; padding: 12px 10px; gap: 6px;
  border-bottom: 1px solid #f0e0e0;
  flex-shrink: 0;
}
.filter-btn {
  flex: 1; padding: 10px 6px;
  min-height: 44px;          /* 移动端最小触摸目标 */
  border: 1.5px solid #e8d8d8;
  background: #fff; color: var(--red);
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  letter-spacing: 1px;
  transition: all 0.35s var(--spring);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--red); color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196,30,58,0.3);
}
.filter-btn:active { transform: scale(0.94); }

/* 节点列表 */
.sidebar-list {
  flex: 1; overflow-y: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.sidebar-list::-webkit-scrollbar { width: 3px; }
.sidebar-list::-webkit-scrollbar-thumb {
  background: #e0c0c0; border-radius: 2px;
}

.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  margin: 4px 8px;
  min-height: 52px;
  cursor: pointer;
  border-radius: 16px;
  border-left: 3px solid transparent;
  transition: all 0.3s var(--ease-out-expo);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.list-item:active { background: #FFE0E0; transform: scale(0.98); }
.list-item.active  {
  background: #FFE8E8;
  border-left-color: var(--red);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(196,30,58,0.1);
}

.list-item-icon {
  width: 34px; height: 34px; min-width: 34px;
  background: var(--red);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
  transition: transform 0.3s var(--spring);
}
.list-item:hover .list-item-icon { transform: scale(1.08); }
.list-item-icon.chuzhou { background: #B8860B; }

.list-item-info { flex: 1; min-width: 0; }
.list-item-title {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item-desc {
  font-size: 11px; color: var(--text-light); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item-arrow { color: #ccc; font-size: 16px; }

/* ===== 地图 ===== */
.map-container { flex: 1; position: relative; overflow: hidden; }
#map { width: 100%; height: 100%; transition: transform 0.6s var(--ease-out-expo); }

#map.map-3d-mode {
  transform: perspective(1200px) rotateX(28deg) scale(1.08);
  transform-origin: 50% 70%;
  box-shadow: inset 0 -20px 60px rgba(0,0,0,0.15);
}

/* 缩放控件放大（移动端友好） */
.leaflet-control-zoom a {
  width: 40px !important; height: 40px !important;
  line-height: 40px !important; font-size: 20px !important;
}

/* ===== 地图图例 — 灵动岛风格 ===== */
.map-legend {
  position: absolute;
  bottom: 24px;
  right: 12px;
  z-index: 400;
  background: var(--blur-light);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
  border: 1px solid rgba(212,168,67,0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  pointer-events: none;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-line {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-label {
  color: #555;
  font-weight: 500;
  white-space: nowrap;
}

/* ===== 地图弹窗 ===== */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.leaflet-popup-content {
  margin: 10px 14px; font-family: inherit;
  min-width: 180px; max-width: 260px;
}
.map-popup-title {
  font-size: 14px; font-weight: bold;
  color: var(--red); margin-bottom: 4px;
}
.map-popup-meta {
  font-size: 11px; color: #999; margin-bottom: 6px;
}
.map-popup-desc {
  font-size: 12px; color: var(--text-light);
  margin-bottom: 10px; line-height: 1.4;
}
.map-popup-btn {
  display: inline-block;
  padding: 10px 18px; min-height: 44px;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--pill-radius);
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.3s var(--spring);
}
.map-popup-btn:hover {
  background: var(--red-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196,30,58,0.3);
}
.map-popup-btn:active { background: var(--red-dark); }

/* ===== 移动端浮动按钮 ===== */
.mobile-toggle {
  display: none;
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%; transform: translateX(-50%);
  z-index: 900;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: 1.5px solid var(--border-gold);
  border-radius: var(--pill-radius);
  padding: 12px 28px; min-height: 48px;
  font-size: 14px; font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(196,30,58,0.45);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.35s var(--spring);
}
.mobile-toggle:active { transform: translateX(-50%) scale(0.93); }

/* 面板遮罩 */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 490;
}

/* ===== Modal 弹窗 — 灵动岛风格 ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  align-items: flex-end;      /* 移动端底部弹出 */
  justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal {
  background: #fff;
  border-radius: 28px 28px 0 0;
  width: 100%; max-width: 680px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.25);
  border: 1px solid rgba(212,168,67,0.2);
  transform: translateY(100%);
  transition: transform 0.45s var(--spring);
  padding-bottom: var(--safe-bottom);
}
.modal-overlay.show .modal { transform: translateY(0); }

.modal-header {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 28px 28px 0 0;
}
.modal-header-group { flex: 1; min-width: 0; }
.modal-title {
  font-size: 17px; font-weight: bold; letter-spacing: 1px;
}
.modal-meta {
  font-size: 11px; opacity: 0.8; margin-top: 2px;
}
.modal-close {
  background: rgba(255,255,255,0.2);
  border: none; color: #fff;
  width: 36px; height: 36px; min-width: 36px;
  border-radius: var(--pill-radius);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-left: 12px;
  touch-action: manipulation;
  transition: all 0.3s var(--spring);
}
.modal-close:active { background: rgba(255,255,255,0.4); transform: scale(0.9); }

.modal-body {
  flex: 1; overflow-y: auto;
  padding: 16px 18px;
  -webkit-overflow-scrolling: touch;
}
.modal-image {
  width: 100%; border-radius: 8px;
  margin-bottom: 12px; display: none;
}
.modal-desc {
  font-size: 14px; line-height: 1.85;
  color: var(--text); margin-bottom: 16px;
  text-indent: 2em;
}

/* 视频容器 */
.modal-video-wrap {
  position: relative;
  padding-bottom: 56.25%;   /* 16:9 */
  height: 0; overflow: hidden;
  border-radius: 8px;
  background: #000;
  margin-bottom: 4px;
}
.modal-video-wrap iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* 视频平台信息标签 */
.video-platform-info {
  display: none;
  padding: 4px 14px;
  margin-bottom: 10px;
  background: #FFF3E0;
  color: #E65100;
  border-radius: var(--pill-radius);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}

/* 视频外链按钮（嵌入不可用时） */
.video-fallback-link {
  display: none;
  padding: 12px 20px;
  margin-top: 8px;
  background: linear-gradient(135deg, #FF6F00, #FF8F00);
  color: #fff;
  text-decoration: none;
  border-radius: var(--pill-radius);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 1px;
  transition: all 0.35s var(--spring);
}
.video-fallback-link:hover {
  background: linear-gradient(135deg, #E65100, #FF6F00);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(230, 81, 0, 0.4);
}

/* 无视频占位 */
.video-placeholder {
  display: none;
  padding: 24px; text-align: center;
  color: var(--text-light); font-size: 13px;
  background: #f9f9f9; border-radius: 8px;
  margin-bottom: 8px;
}
.video-placeholder .no-video-icon {
  font-size: 36px; display: block; margin-bottom: 8px;
}
.video-placeholder .no-video-text {
  display: block; margin-top: 6px; font-size: 13px; color: #999;
}

/* ============================================================
   节点详情：视频 / 图片 双容器（多条 + 横向滑动）
   —— 仅在详情弹窗 (modal) 内生效，不影响其他模块
   ============================================================ */
.media-section { margin-bottom: 4px; }

/* --- 「视频」「图片」切换按钮 --- */
.media-tabs {
  display: flex; gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(139, 0, 0, 0.12);
}
.media-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 18px;
  border: 1.5px solid rgba(139, 0, 0, 0.18);
  background: #fff;
  color: var(--text-light);
  border-radius: var(--pill-radius);
  font-family: inherit;
  font-size: 13px; font-weight: 600; letter-spacing: 1px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.3s var(--spring);
}
.media-tab:hover { border-color: var(--red); color: var(--red); }
.media-tab:active { transform: scale(0.94); }
.media-tab.active {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(196, 30, 58, 0.35);
}
.media-tab-count {
  min-width: 18px; padding: 0 5px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--pill-radius);
  font-size: 11px; line-height: 17px; text-align: center;
}
.media-tab.active .media-tab-count { background: rgba(255, 255, 255, 0.28); }

/* --- 两个独立容器：默认只显示激活的那个 --- */
.media-panel { display: none; }
.media-panel.active {
  display: block;
  animation: mediaPanelIn 0.32s var(--ease-out-expo);
}
@keyframes mediaPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- 横向滑动容器 --- */
.media-strip-wrap { position: relative; }
.media-strip {
  display: flex; gap: 12px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}
.media-strip::-webkit-scrollbar { height: 5px; }
.media-strip::-webkit-scrollbar-track { background: transparent; }
.media-strip::-webkit-scrollbar-thumb {
  background: rgba(196, 30, 58, 0.3);
  border-radius: var(--pill-radius);
}

/* --- 单条媒体卡片 --- */
.media-card {
  flex: 0 0 auto;
  width: 78%; max-width: 330px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid rgba(139, 0, 0, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.media-card-frame {
  position: relative;
  width: 100%; padding-bottom: 56.25%;   /* 16:9 统一高度 */
  background: #1a1a1a; overflow: hidden;
}
.media-card-frame > iframe,
.media-card-frame > video,
.media-card-frame > img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  border: none; display: block;
}
.media-card-frame > img { object-fit: cover; cursor: zoom-in; }

/* 视频封面 / 播放按钮 */
.media-poster {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #2b0b0b, #6b0f14);
  color: #fff;
  border: none; cursor: pointer; font-family: inherit;
  transition: filter 0.25s ease;
}
.media-poster:hover { filter: brightness(1.18); }
.media-poster-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  font-size: 17px; padding-left: 3px;
  transition: all 0.3s var(--spring);
}
.media-poster:hover .media-poster-icon {
  background: var(--red); border-color: #fff; transform: scale(1.08);
}
.media-poster-text {
  font-size: 12px; letter-spacing: 1px; opacity: 0.85;
}

/* 卡片左上角平台 / 序号角标 */
.media-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  padding: 3px 10px;
  background: var(--blur-dark);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border-radius: var(--pill-radius);
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  pointer-events: none;
  max-width: calc(100% - 16px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 卡片底部说明条 */
.media-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 10px;
}
.media-card-title {
  font-size: 12px; color: var(--text-light);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.media-card-open {
  flex-shrink: 0;
  color: var(--red); text-decoration: none;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.media-card-open:hover { text-decoration: underline; }

/* --- 左右切换箭头（桌面端辅助） --- */
.media-nav {
  position: absolute; top: 50%; z-index: 3;
  width: 34px; height: 34px;
  transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  background: var(--blur-dark);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff; border: none; border-radius: 50%;
  font-size: 16px; line-height: 1; cursor: pointer;
  transition: all 0.25s var(--spring);
}
.media-nav.prev { left: -4px; }
.media-nav.next { right: -4px; }
.media-nav:hover { background: var(--red); }
.media-nav[hidden] { display: none; }

/* --- 空状态 / 底部提示 --- */
.media-empty {
  padding: 26px 24px; text-align: center;
  color: var(--text-light); font-size: 13px;
  background: #f9f9f9; border-radius: 8px;
}
.media-empty .no-video-icon { font-size: 34px; display: block; margin-bottom: 8px; }
.media-empty .no-video-text { display: block; margin-top: 4px; font-size: 13px; color: #999; }
.media-hint {
  margin-top: 2px; text-align: center;
  font-size: 11px; color: #b09a9a; letter-spacing: 1px;
}
.media-hint[hidden] { display: none; }

/* ===== Toast 提示 — 灵动岛风格 ===== */
.toast {
  position: fixed;
  top: calc(90px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--blur-dark);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--pill-radius);
  border: 1px solid var(--border-gold);
  font-size: 13px;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.4s var(--spring);
  letter-spacing: 1px;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 加载动画 ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%; width: 100%;
  background: var(--bg);
  position: absolute; top: 0; left: 0; z-index: 9999;
  transition: opacity 0.3s ease;
}
.loading-spinner {
  width: 40px; height: 40px;
  position: relative;
  border: 4px solid #f0d0d0;
  border-top: 4px solid var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-spinner::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold-light);
  animation: spin 1.2s linear infinite reverse;
  opacity: 0.6;
}
.loading-text {
  font-size: 13px;
  color: #999;
  letter-spacing: 1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 响应式：桌面端 Modal 居中 ===== */
@media (min-width: 769px) {
  .modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--card-radius);
    width: 90vw; max-height: 85vh;
    transform: translateY(30px) scale(0.95);
    padding-bottom: 0;
    border: 1px solid var(--border-gold);
  }
  .modal-overlay.show .modal { transform: translateY(0) scale(1); }
  .modal-header { border-radius: var(--card-radius) var(--card-radius) 0 0; }
}

/* ===== 献花按钮 ===== */
.flower-btn {
  position: absolute;
  bottom: 80px;
  right: 16px;
  z-index: 600;
  width: 64px;
  height: 64px;
  border-radius: var(--pill-radius);
  background: linear-gradient(135deg, rgba(196,30,58,0.9), rgba(232,71,79,0.85));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: 2px solid var(--border-gold);
  box-shadow: 0 4px 20px rgba(196, 30, 58, 0.45);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.35s var(--spring);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.flower-btn:hover {
  box-shadow: 0 6px 28px rgba(196, 30, 58, 0.6);
  transform: translateY(-2px);
}
.flower-btn:active { transform: scale(0.88); }
.flower-icon { font-size: 24px; line-height: 1; }
.flower-count-label { font-size: 11px; font-weight: bold; letter-spacing: 1px; }

/* ===== 地图控制面板 ===== */
.map-controls {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 650;
  display: flex; flex-direction: column; gap: 6px;
}
.map-ctrl-btn {
  width: 44px; height: 44px;
  border-radius: var(--pill-radius);
  border: 1.5px solid rgba(212,168,67,0.4);
  background: var(--blur-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 1px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.35s var(--spring);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.map-ctrl-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(196,30,58,0.3);
  border-color: var(--red);
}
.map-ctrl-btn:active { transform: scale(0.9); }
.map-ctrl-btn.active {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 4px 18px rgba(196,30,58,0.45);
}
.map-ctrl-btn.map-ctrl-layer { font-size: 16px; }

/* ===== 献花弹窗 ===== */
.flower-toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 4000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease, transform 0.45s var(--spring);
}
.flower-toast.show {
  opacity: 1; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.flower-toast-content {
  background: linear-gradient(135deg, rgba(139,0,0,0.92), rgba(196,30,58,0.88));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  border-radius: var(--card-radius);
  padding: 32px 36px;
  text-align: center;
  box-shadow: 0 8px 48px rgba(139, 0, 0, 0.5);
  border: 2px solid rgba(255, 215, 0, 0.5);
  max-width: 90vw; width: 360px;
  position: relative;
}
.flower-toast-close {
  position: absolute;
  top: 10px; right: 14px;
  background: rgba(255, 255, 255, 0.2);
  border: none; color: #fff;
  width: 30px; height: 30px;
  border-radius: var(--pill-radius);
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s var(--spring);
}
.flower-toast-close:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}
.flower-toast-icon {
  font-size: 48px; margin-bottom: 12px;
  animation: flowerPulse 1.5s ease-in-out infinite;
}
@keyframes flowerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.flower-toast-msg {
  font-size: 17px; font-weight: bold;
  letter-spacing: 2px; line-height: 1.6;
  white-space: pre-line;
}
.flower-toast-count {
  margin-top: 12px; font-size: 14px;
  color: rgba(255, 215, 0, 0.9); letter-spacing: 1px;
}

/* ================================================================
   响应式：移动端 (≤768px)
   ================================================================ */
@media (max-width: 768px) {
  /* 顶部导航 */
  .header {
    height: 48px;
    padding: 0 12px;
    gap: 8px;
  }
  .header-left { gap: 6px; max-width: 55%; }
  .header-title {
    font-size: 13px; letter-spacing: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 100%;
  }
  .header-subtitle { font-size: 9px; letter-spacing: 1px; }
  .header-badge { display: none; }
  .header-logo { width: 26px; height: 26px; font-size: 13px; flex-shrink: 0; }
  .header-actions { gap: 4px; flex-shrink: 0; }
  .header-btn {
    padding: 5px 10px; font-size: 11px; letter-spacing: 0;
    min-height: 34px;
  }

  /* 侧边栏 → 底部抽屉 */
  .sidebar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100% !important;
    height: 55vh;
    max-height: calc(55vh + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    border-radius: 24px 24px 0 0;
    background: var(--blur-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateY(100%);
    transition: transform 0.4s var(--spring);
    box-shadow: 0 -6px 24px rgba(0,0,0,0.18);
    border-top: 1px solid var(--border-gold);
    z-index: 510;
  }
  .sidebar.open { transform: translateY(0); }
  .sidebar::before {
    content: "";
    display: block;
    width: 36px; height: 4px;
    background: #d0c0c0; border-radius: 2px;
    margin: 10px auto 6px; flex-shrink: 0;
  }
  .sidebar-filter { padding: 8px 8px; gap: 4px; }
  .filter-btn {
    padding: 10px 4px; font-size: 12px;
    min-height: 40px;
  }
  .list-item {
    padding: 10px 10px; margin: 2px 6px;
    min-height: 46px; border-radius: 12px;
  }
  .list-item-title { font-size: 13px; }
  .list-item-desc { font-size: 10px; }
  .list-item-icon { width: 30px; height: 30px; min-width: 30px; font-size: 12px; border-radius: 10px; }

  .mobile-toggle { display: block; }
  .sidebar-backdrop.show { display: block; }

  /* 弹窗 */
  .modal { max-height: 82vh; }
  .modal-title { font-size: 15px; }
  .modal-desc { font-size: 13px; line-height: 1.7; }
  .map-popup-btn { padding: 10px 18px; font-size: 14px; }

  /* 地图控件 */
  .map-legend {
    bottom: 70px; right: 8px;
    padding: 6px 10px; font-size: 10px;
    gap: 4px; border-radius: 8px;
  }
  .legend-line { width: 16px; height: 2px; }
  .legend-dot { width: 8px; height: 8px; }

  .map-controls { top: 10px; right: 8px; gap: 4px; }
  .map-ctrl-btn { width: 36px; height: 36px; font-size: 11px; }
  .map-ctrl-btn.map-ctrl-layer { width: 36px; font-size: 13px; }

  /* 献花 — 放在图例上方，避免重合 */
  .flower-btn {
    bottom: 128px; right: 8px;
    width: 50px; height: 50px;
  }
  .flower-icon { font-size: 18px; }
  .flower-count-label { font-size: 10px; }

  /* 3D 地图 */
  #map.map-3d-mode {
    transform: perspective(1000px) rotateX(18deg) scale(1.04);
  }

  /* 献花弹窗 */
  .flower-toast-content { padding: 24px 20px; width: 280px; }
  .flower-toast-icon { font-size: 36px; }
  .flower-toast-msg { font-size: 14px; }
  .flower-toast-count { font-size: 12px; }
}

/* ================================================================
   响应式：小屏手机 (≤400px)
   ================================================================ */
@media (max-width: 400px) {
  .header {
    height: 42px; padding: 0 8px; gap: 4px;
  }
  .header-left { max-width: 50%; }
  .header-title { font-size: 11px; letter-spacing: 0; }
  .header-subtitle { display: none; }
  .header-logo { width: 22px; height: 22px; font-size: 11px; }
  .header-btn { padding: 4px 8px; font-size: 10px; min-height: 30px; }

  .filter-btn { font-size: 10px; padding: 8px 2px; min-height: 36px; }
  .list-item { padding: 8px 8px; min-height: 40px; }
  .list-item-title { font-size: 12px; }
  .list-item-icon { width: 26px; height: 26px; min-width: 26px; }

  .map-legend {
    bottom: 68px; right: 4px;
    padding: 4px 8px; font-size: 9px; border-radius: 6px;
  }
  .legend-line { width: 14px; height: 2px; }
  .legend-dot { width: 7px; height: 7px; }

  .map-controls { top: 8px; right: 6px; gap: 3px; }
  .map-ctrl-btn { width: 32px; height: 32px; font-size: 10px; }
  .map-ctrl-btn.map-ctrl-layer { width: 32px; font-size: 11px; }

  .flower-btn {
    bottom: 118px; right: 6px;
    width: 44px; height: 44px;
  }
  .flower-icon { font-size: 16px; }
  .flower-count-label { font-size: 9px; }

  /* 缩小 3D 透视 */
  #map.map-3d-mode {
    transform: perspective(800px) rotateX(14deg) scale(1.02);
  }

  .flower-toast-content { padding: 20px 16px; width: 260px; }
  .flower-toast-icon { font-size: 32px; }
}

/* ================================================================
   响应式：横屏手机
   ================================================================ */
@media (max-width: 900px) and (orientation: landscape) {
  .header { height: 40px; }
  .header-title { font-size: 13px; }
  .header-subtitle { font-size: 9px; }
  .sidebar { height: 75vh; }
  .modal { max-height: 75vh; }
  .mobile-toggle { bottom: 8px; }
  .flower-btn { bottom: 112px; }
  .map-legend { bottom: 60px; }
  .map-controls { top: 6px; right: 6px; }
}
