:root {
  --bg: #b8d1ae;
  --surface: rgba(245, 249, 239, 0.96);
  --surface-strong: #f6f9ef;
  --text: #244238;
  --muted: #5f8175;
  --border: rgba(51, 119, 97, 0.24);
  --accent: #4eb7a8;
  --accent-dark: #2f8c80;
  --red-route: #d65d4d;
  --pink: #e87b97;
  --shadow: 0 18px 50px rgba(28, 76, 58, 0.18);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
  max-width: 100vw;
  overflow-x: hidden;
}

.app-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  padding: 10px clamp(16px, 2.4vw, 34px);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(235, 244, 225, 0.92), rgba(215, 232, 203, 0.82));
  backdrop-filter: blur(14px);
}

/* 桌面端：header-row-top 和 header-row-search 均内联显示 */
.header-row-top {
  display: contents;
}

.header-row-search {
  display: contents;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 240px;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(61, 158, 143, 0.46);
  border-radius: 8px;
  background: rgba(91, 188, 171, 0.16);
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 760;
  line-height: 1.15;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 12px;
}

.route-tabs,
.zoom-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.route-tab,
.icon-button,
.panel-close {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(249, 252, 243, 0.78);
  color: var(--text);
  box-shadow: 0 6px 18px rgba(33, 86, 65, 0.08);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.route-tab {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}

.route-tab[aria-pressed="true"] {
  border-color: rgba(47, 140, 128, 0.62);
  background: rgba(78, 183, 168, 0.2);
  color: #1d6f65;
}

.icon-button,
.panel-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
}

.icon-button svg,
.panel-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.route-tab:hover,
.icon-button:hover,
.panel-close:hover {
  border-color: rgba(47, 140, 128, 0.55);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.route-tab:focus-visible,
.icon-button:focus-visible,
.panel-close:focus-visible {
  outline: 2px solid rgba(47, 140, 128, 0.72);
  outline-offset: 2px;
}

.app-shell.is-introing .brand {
  animation: header-intro-drop 720ms cubic-bezier(0.18, 0.82, 0.22, 1) 80ms both;
}

.app-shell.is-introing .toolbar {
  animation: header-intro-drop 760ms cubic-bezier(0.18, 0.82, 0.22, 1) 170ms both;
}

.map-workspace {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* ─── 左侧浮动控制面板 ────────────────────────────────────────── */
.map-left-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 220px;
  max-width: calc(100% - 24px);
  pointer-events: none;
}

.map-left-panel > * {
  pointer-events: auto;
}

.map-left-panel .search-box {
  flex: none;
  width: 100%;
}

.map-left-panel .route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.map-left-panel .zoom-tools {
  display: flex;
  gap: 5px;
}

/* 二级分类筛选行 */
.category-tabs-row {
  width: 100%;
  padding: 4px 0 2px;
  border-top: 1px solid rgba(47, 140, 128, 0.12);
  margin-top: 2px;
}
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.category-tab {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(249, 252, 243, 0.78);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(33, 86, 65, 0.06);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}
.category-tab[aria-pressed="true"] {
  border-color: rgba(47, 140, 128, 0.62);
  background: rgba(78, 183, 168, 0.2);
  color: #1d6f65;
}
.category-tab:hover {
  border-color: rgba(47, 140, 128, 0.55);
  background: var(--surface-strong);
  transform: translateY(-1px);
}
.category-tab:focus-visible {
  outline: 2px solid rgba(47, 140, 128, 0.72);
  outline-offset: 2px;
}

/* ─── 分类景点网格 ─────────────────────────────────────────────────────────────── */
.category-spot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 0 8px;
}
.category-spot-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: rgba(249, 252, 243, 0.92);
  border: 1px solid rgba(47, 140, 128, 0.14);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  text-align: left;
  padding: 0;
}
.category-spot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(33, 86, 65, 0.12);
}
.category-spot-card:focus-visible {
  outline: 2px solid rgba(47, 140, 128, 0.72);
  outline-offset: 2px;
}
.category-spot-thumb {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
  background: rgba(47, 140, 128, 0.08);
}
.category-spot-thumb--empty {
  background: rgba(47, 140, 128, 0.08);
}
.category-spot-name {
  display: block;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-card-thumb-wrap {
  position: relative;
  width: 100%;
}
.route-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.4;
  pointer-events: none;
}

.map-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(circle at 45% 42%, rgba(245, 247, 220, 0.2), transparent 32%), var(--bg);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-viewport.is-dragging {
  cursor: grabbing;
}

.map-stage {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.map-stage.is-focusing {
  transition: transform 560ms cubic-bezier(0.2, 0.72, 0.16, 1);
}

.map-stage.is-focusing .map-board {
  transition: width 560ms cubic-bezier(0.2, 0.72, 0.16, 1);
}

.map-stage.is-introing {
  transition: transform 1080ms cubic-bezier(0.18, 0.82, 0.18, 1);
}

.map-stage.is-introing .map-board {
  animation: map-intro-clarity 1080ms cubic-bezier(0.18, 0.82, 0.18, 1) both;
  transition: width 1080ms cubic-bezier(0.18, 0.82, 0.18, 1);
}

.map-board {
  position: relative;
  width: 1200px;
  aspect-ratio: 118576 / 76192;
  --marker-scale: 1;
  --marker-size: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  /* 性能优化：隔离布局计算范围，减少重排传播 */
  contain: layout style;
  /* 底图未加载时的骨架占位 */
  background: linear-gradient(135deg, #d8ead0 0%, #c5ddb8 30%, #b8d4a8 60%, #cce4be 100%);
}

/* 底图加载完成后移除骨架背景 */
.map-board.map-ready {
  background: none;
}

.map-board img,
.map-board picture {
  display: block;
  width: 100%;
  height: 100%;
}

.base-map {
  position: relative;
  z-index: 0;
  image-rendering: -webkit-optimize-contrast;
  object-fit: contain;
  pointer-events: none;
}

.tile-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.tile-layer.is-visible {
  opacity: 1;
}

.map-tile {
  position: absolute;
  image-rendering: -webkit-optimize-contrast;
  object-fit: fill;
  pointer-events: none;
}

.deep-tile-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.deep-tile-layer.is-visible {
  opacity: 1;
}

.deep-map-tile {
  position: absolute;
  image-rendering: -webkit-optimize-contrast;
  object-fit: fill;
  pointer-events: none;
}

.map-left-cleanup {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  width: 20.9%;
  background:
    linear-gradient(180deg, rgba(184, 209, 174, 0.98), rgba(184, 209, 174, 0.98)),
    var(--bg);
  pointer-events: none;
}

.map-board .sakura-branch-cover {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 70.16%;
  width: 29.84%;
  height: auto;
  pointer-events: none;
}

.map-board .sakura-branch-cutout {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 70.16%;
  width: 29.84%;
  height: auto;
  pointer-events: none;
  transform-origin: 84% 8%;
  animation: sakura-branch-breeze 4.8s ease-in-out infinite;
  will-change: transform;
}

.sakura-rain-layer {
  position: absolute;
  z-index: 2;
  top: 0;
  right: -3%;
  bottom: -8%;
  left: 66%;
  overflow: hidden;
  pointer-events: none;
  transform: translateZ(0);
}

.sakura-petal {
  position: absolute;
  top: var(--start-y);
  left: var(--left);
  width: var(--size);
  aspect-ratio: 1 / 1.45;
  border-radius: 70% 36% 68% 42%;
  background:
    radial-gradient(ellipse at 32% 20%, rgba(255, 255, 255, 0.92) 0 15%, transparent 17%),
    radial-gradient(ellipse at 72% 78%, rgba(237, 157, 174, 0.18) 0 24%, transparent 26%),
    linear-gradient(145deg, rgba(255, 239, 243, 0.95), rgba(230, 133, 154, 0.62));
  box-shadow: 0 1px 4px rgba(132, 68, 82, 0.1);
  filter: blur(var(--blur));
  opacity: 0;
  transform-origin: 50% 92%;
  animation: sakura-rain var(--duration) linear infinite;
  animation-delay: var(--delay);
  will-change: transform, opacity;
}

.sakura-petal::before {
  content: "";
  position: absolute;
  top: 16%;
  left: 47%;
  width: 10%;
  height: 66%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(198, 107, 126, 0.2), rgba(255, 255, 255, 0));
  opacity: 0.55;
  transform: rotate(7deg);
}

.sakura-petal::after {
  content: "";
  position: absolute;
  top: 12%;
  left: 18%;
  width: 28%;
  height: 18%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
}

.route-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  --route-color: rgba(226, 54, 43, 0.84);
  --route-sketch: rgba(255, 247, 242, 0.42);
  --route-glow: rgba(255, 237, 230, 0.7);
  opacity: 0;
  overflow: visible;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.route-layer[data-route="two-day"] {
  --route-color: rgba(0, 180, 160, 0.82);
  --route-sketch: rgba(255, 255, 255, 0.34);
  --route-glow: rgba(226, 250, 244, 0.64);
}

.route-layer.is-visible {
  opacity: 1;
}

.route-raster {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, filter;
}

.route-raster[data-route="two-day"] {
  filter: none;
}

.route-raster[data-route="one-day"] {
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.96))
    drop-shadow(0 0 3px rgba(214, 93, 77, 0.62))
    drop-shadow(0 2px 5px rgba(112, 51, 38, 0.28))
    saturate(1.18)
    contrast(1.04);
}

.route-raster.is-visible {
  display: block;
  animation: route-image-fade 520ms ease-out forwards;
}

.route-image {
  display: none;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 3px 7px var(--route-glow));
}

.route-layer[data-image-trace="true"] .route-image {
  display: none;
}

.route-layer[data-image-trace="true"] .route-path,
.route-layer[data-image-trace="true"] .route-draw-head {
  display: none;
}

.route-layer[data-image-trace="true"].is-visible .route-image {
  animation: route-image-fade 520ms ease-out forwards;
}

.route-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.route-path-shadow {
  opacity: 0.56;
  stroke: rgba(255, 255, 255, 0.68);
  stroke-width: 1.08px;
}

.route-path-sketch {
  opacity: 0.46;
  stroke: var(--route-sketch);
  stroke-width: 0.72px;
  transform: translate3d(0.22px, -0.16px, 0);
}

.route-path-main {
  filter: drop-shadow(0 3px 7px var(--route-glow));
  stroke: var(--route-color);
  stroke-width: 0.86px;
}

.route-draw-head {
  fill: rgba(255, 255, 255, 0.96);
  filter: drop-shadow(0 0 7px var(--route-glow));
  opacity: 0;
  pointer-events: none;
}

.route-layer.is-visible .route-path {
  animation: route-line-draw 4200ms cubic-bezier(0.2, 0.72, 0.16, 1) forwards;
}

.route-layer.is-visible .route-path-sketch {
  animation-duration: 4360ms;
}

.route-layer.is-visible .route-path-main {
  animation-duration: 4520ms;
}

.route-layer.is-visible .route-draw-head {
  animation: route-head-fade 4680ms ease-out forwards;
}

.markers-layer {
  position: absolute;
  z-index: 5;
  inset: 0;
  opacity: 0;
  transition: opacity 480ms ease 80ms;
  /* 性能优化：标记层提升到独立合成层 */
  will-change: contents;
  contain: layout;
}

/* 底图加载完成后显示点位 */
.map-board.map-ready .markers-layer {
  opacity: 1;
}

.map-marker {
  position: absolute;
  display: grid;
  width: var(--marker-size);
  height: var(--marker-size);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(232, 123, 151, 0.68);
  box-shadow: 0 0 0 0.5px rgba(207, 80, 103, 0.3), 0 5px 10px rgba(92, 36, 45, 0.1);
  color: #fff;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(var(--marker-scale));
  transform-origin: center;
  transition: background 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.map-marker::before {
  content: attr(data-label);
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 7px);
  left: 50%;
  max-width: 160px;
  padding: 5px 8px;
  border: 1px solid rgba(51, 119, 97, 0.18);
  border-radius: 6px;
  background: rgba(246, 249, 239, 0.94);
  box-shadow: 0 8px 20px rgba(28, 76, 58, 0.16);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translate(-50%, 4px) scale(0.96);
  transition: opacity 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.map-marker::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -5px;
  border: 1px solid rgba(232, 123, 151, 0.36);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.76);
}

.map-marker:not(.is-hidden):not(.is-active)::after {
  animation: marker-breath 2600ms ease-in-out infinite;
}

.map-marker:hover,
.map-marker:focus-visible,
.map-marker.is-pressed {
  background: rgba(239, 139, 164, 0.9);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.92), 0 0 0 4px rgba(232, 123, 151, 0.18), 0 8px 18px rgba(92, 36, 45, 0.16);
  transform: translate(-50%, -50%) scale(calc(var(--marker-scale) * 1.24));
}

.map-marker:hover::before,
.map-marker:focus-visible::before,
.map-marker.is-pressed::before {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.map-marker[data-type="landmark"] {
  width: var(--marker-size);
  height: var(--marker-size);
  border-radius: 999px;
  background: rgba(214, 93, 77, 0.78);
  box-shadow: 0 0 0 0.5px rgba(255, 239, 214, 0.72), 0 5px 12px rgba(93, 38, 31, 0.1);
  transform: translate(-50%, -50%) scale(var(--marker-scale));
}

.map-marker[data-type="landmark"]::after {
  border-color: rgba(214, 93, 77, 0.34);
}

.map-marker.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.map-marker.is-active {
  background: rgba(45, 145, 129, 0.82);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9), 0 0 0 3px rgba(78, 183, 168, 0.16), 0 7px 16px rgba(27, 90, 74, 0.14);
}

.map-marker.is-active::after {
  inset: -7px;
  border-color: rgba(78, 183, 168, 0.48);
  animation: marker-active-ripple 1550ms ease-out infinite;
}

.map-marker.is-active:hover,
.map-marker.is-active:focus-visible,
.map-marker.is-active.is-pressed {
  background: rgba(49, 159, 142, 0.94);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.92), 0 0 0 5px rgba(78, 183, 168, 0.2), 0 9px 20px rgba(27, 90, 74, 0.18);
}

.spot-panel {
  position: absolute;
  z-index: 4;
  top: auto;
  right: 18px;
  bottom: 18px;
  width: min(330px, calc(100vw - 36px));
  max-height: min(68dvh, calc(100% - 36px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
}

.spot-panel:focus {
  outline: none;
}

.spot-panel[data-panel-mode="route"] {
  position: absolute;
  top: var(--route-panel-top, 44%);
  right: auto;
  bottom: auto;
  left: var(--route-panel-left, 72%);
  width: min(282px, calc(100vw - 24px));
  height: var(--route-panel-height, min(42dvh, 360px));
  max-height: calc(100% - 24px);
  padding: 10px;
  border-radius: 8px;
  overflow: auto;
  box-shadow: 0 12px 32px rgba(27, 76, 58, 0.18);
}

.spot-panel[data-panel-mode="route"][data-has-detail="true"] {
  top: auto;
  right: 18px;
  bottom: 18px;
  left: auto;
  display: flex;
  width: min(680px, calc(100vw - 36px));
  height: min(68dvh, calc(100% - 36px));
  max-height: calc(100% - 36px);
  flex-direction: column;
  padding: 12px;
  overflow: hidden;
}

.spot-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.spot-panel.is-revealing {
  animation: panel-reveal 500ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
}

.spot-panel.is-closing {
  animation: panel-dismiss 240ms cubic-bezier(0.42, 0, 0.58, 1) both;
  pointer-events: none;
}

.panel-close {
  position: relative;
  z-index: 4;
  top: auto;
  right: auto;
  width: 32px;
  height: 32px;
  box-shadow: none;
  flex-shrink: 0;
}

.spot-panel h2 {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  will-change: opacity, transform;
  flex: 1;
}

.spot-panel[data-panel-mode="route"] h2 {
  margin: 0 34px 8px 0;
  font-size: 15px;
  line-height: 1.2;
}

.spot-panel[data-panel-mode="route"][data-has-detail="true"] h2 {
  flex: 0 0 auto;
}

.spot-detail-space {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
}

/* 桂面端：图文容器纵向排列 */
.spot-detail-media-row {
  display: contents;
}

.spot-panel[data-panel-mode="route"][data-has-detail="true"] .spot-detail-space {
  min-height: 0;
  flex: 1 1 auto;
}

.spot-media {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(78, 183, 168, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 243, 247, 0.68), rgba(240, 248, 237, 0.76)),
    rgba(255, 255, 255, 0.28);
  will-change: box-shadow, filter, opacity, transform;
}

.spot-media img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 400ms ease;
}

.spot-media img.is-loaded {
  opacity: 1;
}

/* 骨架闪烁动画 */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.spot-media.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(
    90deg,
    rgba(220, 235, 220, 0.6) 25%,
    rgba(240, 248, 237, 0.9) 50%,
    rgba(220, 235, 220, 0.6) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: inherit;
  pointer-events: none;
}

.spot-media.is-loaded::after {
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.spot-media-fallback {
  display: grid;
  min-height: 126px;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.spot-media::before,
.spot-media::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.spot-media::before {
  z-index: 2;
  inset: -38% -62%;
  background:
    radial-gradient(ellipse at 18% 44%, rgba(255, 255, 255, 0.78) 0 15%, transparent 38%),
    radial-gradient(ellipse at 47% 28%, rgba(231, 244, 225, 0.7) 0 14%, transparent 34%),
    radial-gradient(ellipse at 70% 58%, rgba(255, 235, 241, 0.58) 0 12%, transparent 32%),
    linear-gradient(100deg, transparent 0 18%, rgba(255, 255, 255, 0.72) 42%, transparent 72% 100%);
  filter: blur(10px);
  opacity: 0;
  transform: translate3d(-42%, 3%, 0) rotate(-7deg);
}

.spot-media::after {
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.62), transparent 58%);
  opacity: 0;
}

.spot-copy,
.spot-info-list {
  display: grid;
  gap: 7px;
}

.spot-copy p {
  margin: 0;
  color: #2f5145;
  font-size: 13px;
  line-height: 1.6;
  will-change: opacity, transform;
}

.spot-info-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spot-info-item {
  display: grid;
  gap: 4px;
  min-height: 42px;
  padding: 8px 9px;
  border: 1px solid rgba(51, 119, 97, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.36);
  will-change: opacity, transform;
}

.spot-info-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.spot-info-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.route-panel-summary {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(78, 183, 168, 0.18);
  border-radius: 999px;
  background: rgba(230, 248, 242, 0.58);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.route-panel-layout {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.route-panel-layout.has-detail {
  grid-template-columns: minmax(190px, 0.84fr) minmax(0, 1.2fr);
  height: 100%;
  gap: 12px;
}

.route-list-column {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.route-spot-list {
  display: grid;
  gap: 7px;
}

.route-panel-layout.has-detail .route-spot-list {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.route-spot-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px 6px 6px;
  border: 1px solid rgba(51, 119, 97, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 4px 12px rgba(28, 76, 58, 0.06);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  gap: 8px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.route-spot-button:hover,
.route-spot-button:focus-visible {
  border-color: rgba(78, 183, 168, 0.44);
  background: rgba(239, 250, 246, 0.76);
  box-shadow: 0 8px 18px rgba(28, 76, 58, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.route-spot-button.is-selected {
  border-color: rgba(47, 140, 128, 0.5);
  background: rgba(226, 248, 241, 0.86);
  box-shadow: 0 0 0 1px rgba(78, 183, 168, 0.12), 0 8px 18px rgba(28, 76, 58, 0.12);
}

.route-spot-button.is-selected .route-spot-order {
  border-color: rgba(47, 140, 128, 0.34);
  background: rgba(78, 183, 168, 0.24);
  color: #1d6f65;
}

.route-spot-order {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(78, 183, 168, 0.22);
  border-radius: 999px;
  background: rgba(78, 183, 168, 0.12);
  color: #297260;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.route-spot-name {
  min-width: 0;
  color: #21493d;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.route-spot-route {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(78, 183, 168, 0.12);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}

.route-detail-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  padding-left: 12px;
  border-left: 1px solid rgba(51, 119, 97, 0.16);
}

.route-detail-header {
  display: grid;
  align-items: start;
  min-width: 0;
  justify-items: start;
  gap: 7px;
}

.route-detail-title {
  min-width: 0;
  margin: 0;
  color: #21493d;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.route-detail-clear {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(51, 119, 97, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.route-detail-clear:hover,
.route-detail-clear:focus-visible {
  border-color: rgba(47, 140, 128, 0.48);
  background: rgba(239, 250, 246, 0.78);
  color: var(--accent-dark);
  outline: none;
  transform: translateY(-1px);
}

.route-detail-body {
  display: grid;
  min-height: 0;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.spot-panel.is-revealing h2 {
  animation: detail-title-in 360ms cubic-bezier(0.18, 0.82, 0.22, 1) 35ms both;
}

.spot-panel.is-revealing .spot-media {
  animation: detail-media-rise 640ms cubic-bezier(0.18, 0.82, 0.22, 1) 390ms both;
}

.spot-panel.is-revealing .spot-media::before {
  animation: media-mist-sweep 980ms cubic-bezier(0.18, 0.82, 0.22, 1) 480ms both;
}

.spot-panel.is-revealing .spot-media::after {
  animation: media-light-bloom 880ms ease-out 520ms both;
}

.spot-panel.is-revealing .spot-copy p {
  animation: detail-copy-fade 420ms ease-out both;
  animation-delay: 290ms;
}

.spot-panel.is-revealing .spot-info-item {
  animation: detail-info-rise 360ms ease-out both;
}

.spot-panel.is-revealing .route-panel-summary,
.spot-panel.is-revealing .route-spot-button {
  animation: detail-info-rise 360ms ease-out both;
}

.spot-panel.is-revealing .route-panel-summary {
  animation-delay: 80ms;
}

.spot-panel.is-revealing .route-spot-button {
  animation-delay: var(--route-item-delay);
}

.spot-panel[data-panel-mode="route"] .route-panel-summary {
  padding: 3px 7px;
  font-size: 11px;
}

.spot-panel[data-panel-mode="route"] .route-spot-list {
  gap: 5px;
}

.spot-panel[data-panel-mode="route"] .route-spot-button {
  grid-template-columns: 30px minmax(0, 1fr);
  min-height: 34px;
  padding: 5px 7px 5px 5px;
  gap: 6px;
}

.spot-panel[data-panel-mode="route"] .route-spot-order {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.spot-panel[data-panel-mode="route"] .route-spot-name {
  font-size: 12px;
}

.spot-panel[data-panel-mode="route"] .route-spot-route {
  display: none;
}

.spot-panel.is-revealing .spot-copy p:nth-child(1) {
  animation-delay: 150ms;
}

.spot-panel.is-revealing .spot-copy p:nth-child(2) {
  animation-delay: 220ms;
}

.spot-panel.is-revealing .spot-copy p:nth-child(3) {
  animation-delay: 290ms;
}

.spot-panel.is-revealing .spot-copy p:nth-child(n+4) {
  animation-delay: 360ms;
}

.spot-panel.is-revealing .spot-info-item:nth-child(1) {
  animation-delay: 640ms;
}

.spot-panel.is-revealing .spot-info-item:nth-child(2) {
  animation-delay: 700ms;
}

@media (max-width: 860px) {
  /* ─── 全局防溢出 ─────────────────────────────────────────── */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  body {
    overflow: hidden;
  }

  /* ─── CSS 变量：手机端布局尺寸 ─────────────────────────── */
  :root {
    --mobile-header-h: 46px;   /* header 高度：8+30+8 */
    --mobile-ctrl-h: 90px;     /* 控制栏高度：6+38+6+32+6+2 */
    --mobile-top-total: 136px; /* header + 控制栏合计 */
  }

  /* ─── Header 手机端：只保留品牌 ──────────────────────────── */
  .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 8px 12px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(235, 244, 225, 0.97), rgba(215, 232, 203, 0.92));
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .brand {
    min-width: 0;
    gap: 6px;
  }
  .brand p {
    display: none;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 15px;
    border-radius: 5px;
    flex-shrink: 0;
  }
  .brand h1 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ─── app-shell：为 fixed header 留出空间，移除 overflow 确保 fixed 定位正常 ─── */
  .app-shell {
    padding-top: var(--mobile-header-h);
    overflow: visible;
  }

  /* ─── 地图工作区：填满剩余高度，overflow visible 确保 fixed 面板不被裁切 ─── */
  .map-workspace {
    overflow: visible;
    position: relative;
    height: calc(100dvh - var(--mobile-header-h));
    min-height: 0;
  }

  /* ─── 地图视口：填满 map-workspace，但顶部留出控制栏空间 ─── */
  .map-viewport {
    position: absolute;
    top: var(--mobile-ctrl-h);
    left: 0;
    right: 0;
    bottom: 0;
  }

  /* ─── 左侧浮动控制面板（手机端）：fixed，紧贴 header 下方 ─── */
  .map-left-panel {
    position: fixed;
    top: var(--mobile-header-h);
    left: 0;
    right: 0;
    bottom: auto;
    width: 100vw;
    max-width: 100vw;
    flex-direction: column;
    gap: 0;
    padding: 6px 10px;
    background: rgba(235, 244, 225, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(61, 158, 143, 0.22);
    box-sizing: border-box;
    z-index: 40;
    pointer-events: auto;
  }
  .map-left-panel > * {
    pointer-events: auto;
  }

  /* ─── 搜索框：独占第一行，全宽 ──────────────────────────── */
  .map-left-panel .search-box {
    width: 100%;
    flex: none;
    margin-bottom: 0;
  }
  .search-box {
    flex: none;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .search-input-wrap {
    height: 38px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .search-input {
    font-size: 15px;
  }
  .search-dropdown {
    position: fixed;
    top: calc(var(--mobile-header-h) + var(--mobile-ctrl-h));
    left: 10px;
    right: 10px;
    z-index: 60;
  }
  .search-dropdown-item {
    padding: 10px 14px;
    font-size: 14px;
    min-height: 44px;
  }
  .search-dropdown-item-icon {
    width: 26px;
    height: 26px;
  }
  .search-dropdown-item-route {
    font-size: 11px;
  }

  /* ─── 第二行：panel-row = 路线筛选 + 缩放工具 ───────────── */
  .panel-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
  }
  .panel-row .route-tabs {
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .panel-row .route-tabs::-webkit-scrollbar {
    display: none;
  }
  .panel-row .zoom-tools {
    flex: 0 0 auto;
    gap: 4px;
  }
  .map-left-panel .route-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .map-left-panel .route-tabs::-webkit-scrollbar {
    display: none;
  }
  .map-left-panel .zoom-tools {
    display: flex;
    flex-shrink: 0;
    gap: 4px;
  }
  .route-tab {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .icon-button {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
  .icon-button svg {
    width: 14px;
    height: 14px;
  }

  /* ─── 二级分类筛选行（手机端） ────────────────────── */
  .category-tabs-row {
    width: 100%;
    padding: 5px 0 2px;
    border-top: 1px solid rgba(47, 140, 128, 0.15);
    margin-top: 4px;
  }
  .category-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .category-tabs::-webkit-scrollbar {
    display: none;
  }
  .category-tab {
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ─── 景点详情面板：底部对齐，顶部不超过控制栏 ─────── */
  .spot-panel {
    position: fixed !important;
    top: auto !important;
    left: 50% !important;
    right: auto !important;
    bottom: 0 !important;
    transform: translateX(-50%) !important;
    width: min(360px, 92vw) !important;
    max-width: 92vw !important;
    /* 最大高度 = 屏幕高度 - header - 控制栏 - 8px间距 */
    max-height: calc(100dvh - var(--mobile-top-total) - 8px);
    border-radius: 16px 16px 0 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px 16px 28px;
    box-sizing: border-box;
    z-index: 45 !important;
  }
  /* 手机端：底部对齐打开状态 */
  .spot-panel.is-open {
    transform: translateX(-50%) !important;
  }
  /* 手机端：底部弹出入场动画 */
  .spot-panel.is-revealing {
    animation: mobile-panel-reveal 300ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
  }
  /* 手机端：底部弹出退场动画 */
  .spot-panel.is-closing {
    animation: mobile-panel-dismiss 220ms cubic-bezier(0.42, 0, 0.58, 1) both;
  }
  .spot-panel h2 {
    font-size: 16px;
    margin-bottom: 8px;
    margin-right: 36px;
  }

  /* 图文区域：上下布局 */
  /* 手机端详情布局：图片 → 文字 → 地址，上下顺序排列 */
  .spot-detail-space {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: static;
  }
  .spot-detail-media-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .spot-media {
    width: 100%;
    height: auto;
    max-height: unset;
    aspect-ratio: 3 / 2;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    will-change: auto;
  }
  .spot-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .spot-copy {
    width: 100%;
    min-width: 0;
    position: relative;
  }
  .spot-copy p {
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 6px;
  }
  .spot-copy p:last-child {
    margin-bottom: 0;
  }
  .spot-info-list {
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
  }
  .spot-info-item {
    font-size: 12px;
  }
  /* ─── 路线面板（列表模式）─────────────────────────────────── */
  .spot-panel[data-panel-mode="route"] {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: auto;
    max-height: 60dvh;
    border-radius: 16px 16px 0 0;
    padding: 14px 12px 24px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 45 !important;
  }
  .spot-panel[data-panel-mode="route"].is-open {
    transform: none !important;
  }
  .spot-panel[data-panel-mode="route"].is-revealing {
    animation: panel-reveal 300ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
  }
  .spot-panel[data-panel-mode="route"].is-closing {
    animation: panel-dismiss 220ms cubic-bezier(0.42, 0, 0.58, 1) both;
  }
  .spot-panel[data-panel-mode="route"] h2 {
    font-size: 14px;
    margin-bottom: 6px;
  }
  .route-spot-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .route-spot-button {
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 36px;
    padding: 5px 7px 5px 5px;
    gap: 5px;
    font-size: 12px;
  }
  .route-spot-order {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  .route-spot-name {
    font-size: 12px;
  }

  /* ─── 路线面板（含详情模式）─────────────────────────────────── */
  .spot-panel[data-panel-mode="route"][data-has-detail="true"] {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: auto;
    max-height: 72dvh;
    border-radius: 16px 16px 0 0;
    padding: 12px 12px 24px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 45 !important;
  }
  .route-panel-layout.has-detail {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, auto) minmax(0, 1fr);
    gap: 8px;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
  }
  .route-panel-layout.has-detail .route-list-column {
    max-height: 130px;
    overflow: auto;
  }
  .route-detail-panel {
    padding-top: 10px;
    padding-left: 0;
    border-top: 1px solid rgba(51, 119, 97, 0.16);
    border-left: 0;
    min-height: 0;
    overflow: hidden;
  }
  .route-detail-body {
    overflow: auto;
  }
  .route-detail-title {
    font-size: 14px;
  }
   .route-spot-route {
    display: none;
  }
  /* ─── 分类面板（底部弹出）─────────────────────────────────────────────────────────────── */
  .spot-panel[data-panel-mode="category"] {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: auto;
    max-height: 65dvh;
    border-radius: 16px 16px 0 0;
    padding: 14px 12px 24px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 45 !important;
  }
  .spot-panel[data-panel-mode="category"].is-open {
    transform: none !important;
  }
  .spot-panel[data-panel-mode="category"].is-revealing {
    animation: panel-reveal 300ms cubic-bezier(0.16, 0.84, 0.24, 1) both;
  }
  .spot-panel[data-panel-mode="category"].is-closing {
    animation: panel-dismiss 220ms cubic-bezier(0.42, 0, 0.58, 1) both;
  }
  .spot-panel[data-panel-mode="category"] h2 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  .category-spot-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .category-spot-card {
    border-radius: 8px;
  }
  .category-spot-name {
    font-size: 12px;
    padding: 5px 7px;
  }
}
/* ─── 手机端居中弹窗动画 ──────────────────────────────────────────────────────────── */
@keyframes mobile-panel-reveal {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes mobile-panel-dismiss {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(40px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sakura-rain-layer {
    display: none;
  }

  .map-board .sakura-branch-cutout {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@keyframes header-intro-drop {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes map-intro-clarity {
  0% {
    filter: blur(5px) saturate(0.94) brightness(1.03);
    opacity: 0.78;
  }

  48% {
    filter: blur(1.2px) saturate(1.02) brightness(1.02);
    opacity: 0.96;
  }

  100% {
    filter: blur(0) saturate(1) brightness(1);
    opacity: 1;
  }
}

@keyframes route-line-draw {
  0% {
    stroke-dashoffset: 1;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes route-image-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 0.98;
  }
}

@keyframes route-head-fade {
  0%,
  8% {
    opacity: 0;
  }

  18%,
  86% {
    opacity: 0.92;
  }

  100% {
    opacity: 0;
  }
}

@keyframes marker-breath {
  0%,
  100% {
    opacity: 0.08;
    transform: scale(0.78);
  }

  48% {
    opacity: 0.42;
    transform: scale(1.35);
  }
}

@keyframes marker-active-ripple {
  0% {
    opacity: 0.5;
    transform: scale(0.72);
  }

  72% {
    opacity: 0;
    transform: scale(1.72);
  }

  100% {
    opacity: 0;
    transform: scale(1.72);
  }
}

@keyframes panel-reveal {
  0% {
    opacity: 0;
    transform: translate3d(18px, 10px, 0) scale(0.975);
  }

  62% {
    opacity: 1;
    transform: translate3d(-2px, 0, 0) scale(1.006);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes panel-dismiss {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate3d(12px, 16px, 0) scale(0.985);
  }
}

@keyframes media-mist-sweep {
  0% {
    opacity: 0;
    transform: translate3d(-42%, 3%, 0) rotate(-7deg);
  }

  18% {
    opacity: 0.86;
  }

  72% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translate3d(44%, -5%, 0) rotate(-7deg);
  }
}

@keyframes media-light-bloom {
  0% {
    opacity: 0;
  }

  38% {
    opacity: 0.68;
  }

  100% {
    opacity: 0;
  }
}

@keyframes detail-title-in {
  0% {
    opacity: 0;
    transform: translateY(9px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes detail-copy-fade {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes detail-media-rise {
  0% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    filter: blur(2px) saturate(0.96) brightness(0.99);
    opacity: 0;
    transform: translateY(14px) scale(0.982);
  }

  46% {
    box-shadow: 0 12px 26px rgba(78, 183, 168, 0.12), 0 0 26px rgba(255, 236, 241, 0.42);
    filter: blur(0.4px) saturate(1.03) brightness(1.02);
    opacity: 1;
  }

  100% {
    box-shadow: none;
    filter: blur(0) saturate(1) brightness(1);
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes detail-info-rise {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sakura-branch-breeze {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  38% {
    transform: translate3d(-1.15%, 0.58%, 0) rotate(3.2deg);
  }

  68% {
    transform: translate3d(0.52%, -0.34%, 0) rotate(-1.75deg);
  }
}

@keyframes sakura-rain {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(var(--start-rot)) scale(var(--scale));
  }

  8% {
    opacity: var(--opacity);
  }

  34% {
    transform: translate3d(var(--mid-x), 26vh, 0) rotate(var(--mid-rot)) scale(var(--scale));
  }

  62% {
    opacity: var(--opacity);
    transform: translate3d(var(--late-x), 54vh, 0) rotate(var(--late-rot)) scale(var(--scale));
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--end-x), 88vh, 0) rotate(var(--end-rot)) scale(var(--scale));
  }
}


/* ─── 搜索框 ─────────────────────────────────────────────── */

.search-box {
  position: relative;
  flex: 0 1 220px;
  min-width: 0;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(249, 252, 243, 0.88);
  box-shadow: 0 6px 18px rgba(33, 86, 65, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-input-wrap:focus-within {
  border-color: rgba(47, 140, 128, 0.62);
  box-shadow: 0 0 0 3px rgba(78, 183, 168, 0.18);
}

.search-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-right: 6px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  pointer-events: none;
}

.search-input {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  appearance: none;
}

.search-input::placeholder {
  color: var(--muted);
}

/* 隐藏浏览器自带的清除按钮 */
.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.search-clear:hover {
  background: rgba(78, 183, 168, 0.18);
  color: var(--accent-dark);
}

.search-clear svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(245, 249, 239, 0.98);
  box-shadow: 0 12px 32px rgba(28, 76, 58, 0.16);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease;
}

.search-dropdown-item:hover,
.search-dropdown-item[aria-selected="true"] {
  background: rgba(78, 183, 168, 0.14);
}

.search-dropdown-item-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(78, 183, 168, 0.18);
  display: grid;
  place-items: center;
}

.search-dropdown-item-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--accent-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-dropdown-item-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-dropdown-item-name mark {
  background: rgba(78, 183, 168, 0.28);
  color: var(--accent-dark);
  border-radius: 2px;
  font-weight: 650;
}

.search-dropdown-item-route {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
}

.search-dropdown-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* 高亮标记点 */
.map-marker.is-search-highlight {
  z-index: 8;
}

.map-marker.is-search-highlight::before {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.22) !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28), 0 0 16px rgba(245, 158, 11, 0.4) !important;
  animation: search-highlight-pulse 1.4s ease-in-out infinite !important;
}

@keyframes search-highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28), 0 0 16px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.14), 0 0 28px rgba(245, 158, 11, 0.55); }
}


/* ============ 右下方云朵装饰 ============ */
.map-board img.cloud-deco,
.cloud-deco {
  position: absolute;
  pointer-events: none;
  user-select: none;
  opacity: 0.96;
  z-index: 3;
}

/* 用高特异性覆盖 .map-board img 的 width:100%; height:100% */
.map-board img.cloud-1,
.map-board img.cloud-2,
.map-board img.cloud-3,
.map-board img.cloud-4,
.map-board img.cloud-5,
.map-board img.cloud-6,
.map-board img.cloud-7 {
  width: auto;
  height: auto;
  display: inline;
}

/* 云1：顶部中央（梁弄镇/大岚茶旅融合村上方） - 中等 */
.cloud-1 {
  left: 28%;
  top: 10%;
  width: 13%;
  height: auto;
  max-width: 13%;
  animation: cloud-drift-a 18s ease-in-out infinite alternate;
  animation-delay: -4s;
}

/* 云2：左侧中部（升仙桥/食光里左侧） - 较大 */
.cloud-2 {
  left: 2%;
  top: 28%;
  width: 16%;
  height: auto;
  max-width: 16%;
  animation: cloud-drift-b 20s ease-in-out infinite alternate;
  animation-delay: -9s;
}

/* 云3：右侧中部（雅庄村樱花王右侧） - 中等 */
.cloud-3 {
  left: 56%;
  top: 32%;
  width: 14%;
  height: auto;
  max-width: 14%;
  animation: cloud-drift-c 16s ease-in-out infinite alternate;
  animation-delay: -6s;
}

/* 云4：左下中部（七彩山丘/王阳明像左侧） - 大 */
.cloud-4 {
  left: 1%;
  top: 50%;
  width: 18%;
  height: auto;
  max-width: 18%;
  animation: cloud-drift-b 22s ease-in-out infinite alternate;
  animation-delay: -14s;
}

/* 云5：中下部（大乐之野下方） - 中等 */
.cloud-5 {
  left: 33%;
  top: 57%;
  width: 13%;
  height: auto;
  max-width: 13%;
  animation: cloud-drift-a 17s ease-in-out infinite alternate;
  animation-delay: -11s;
}

/* 云6：中下偏左（眠床岗/汉台附近） - 小 */
.cloud-6 {
  left: 20%;
  top: 67%;
  width: 10%;
  height: auto;
  max-width: 10%;
  animation: cloud-drift-c 14s ease-in-out infinite alternate;
  animation-delay: -3s;
}

/* 云7：底部大圈（四窗岩/四明山镇下方） - 最大 */
.cloud-7 {
  left: 25%;
  top: 78%;
  width: 20%;
  height: auto;
  max-width: 20%;
  animation: cloud-drift-d 25s ease-in-out infinite alternate;
  animation-delay: -18s;
}

/* 动画A：大弧度向右漂移，带轻微上下起伏 */
@keyframes cloud-drift-a {
  0%   { transform: translateX(0px)    translateY(0px)   scale(1.00); }
  20%  { transform: translateX(40px)   translateY(-18px) scale(1.01); }
  45%  { transform: translateX(90px)   translateY(-8px)  scale(1.00); }
  70%  { transform: translateX(120px)  translateY(-22px) scale(0.99); }
  100% { transform: translateX(160px)  translateY(-10px) scale(1.00); }
}

/* 动画B：向左大幅漂移，带弧形路径 */
@keyframes cloud-drift-b {
  0%   { transform: translateX(0px)    translateY(0px)   scale(1.00); }
  25%  { transform: translateX(-50px)  translateY(-14px) scale(1.01); }
  50%  { transform: translateX(-100px) translateY(-6px)  scale(1.00); }
  75%  { transform: translateX(-130px) translateY(-20px) scale(0.99); }
  100% { transform: translateX(-170px) translateY(-12px) scale(1.00); }
}

/* 动画C：斜向右上漂移，路径更飘逸 */
@keyframes cloud-drift-c {
  0%   { transform: translateX(0px)   translateY(0px)   rotate(0deg)   scale(1.00); }
  20%  { transform: translateX(30px)  translateY(-25px) rotate(0.5deg) scale(1.01); }
  45%  { transform: translateX(70px)  translateY(-14px) rotate(-0.3deg)scale(1.00); }
  65%  { transform: translateX(100px) translateY(-30px) rotate(0.8deg) scale(0.99); }
  100% { transform: translateX(140px) translateY(-18px) rotate(0deg)   scale(1.00); }
}

/* 动画D：慢速大幅右漂，最大位移，给最大云朵用 */
@keyframes cloud-drift-d {
  0%   { transform: translateX(0px)    translateY(0px)   scale(1.00); }
  15%  { transform: translateX(35px)   translateY(-12px) scale(1.01); }
  35%  { transform: translateX(80px)   translateY(-5px)  scale(1.00); }
  55%  { transform: translateX(130px)  translateY(-18px) scale(0.99); }
  75%  { transform: translateX(170px)  translateY(-8px)  scale(1.00); }
  100% { transform: translateX(200px)  translateY(-15px) scale(1.01); }
}

/* ============ 移动端适配：云朵缩小30% ============ */
@media (max-width: 768px) {
  .cloud-1 {
    width: 9.1%;
    max-width: 9.1%;
  }
  .cloud-2 {
    width: 11.2%;
    max-width: 11.2%;
  }
  .cloud-3 {
    width: 9.8%;
    max-width: 9.8%;
  }
  .cloud-4 {
    width: 12.6%;
    max-width: 12.6%;
  }
  .cloud-5 {
    width: 9.1%;
    max-width: 9.1%;
  }
  .cloud-6 {
    width: 7.0%;
    max-width: 7.0%;
  }
  .cloud-7 {
    width: 14.0%;
    max-width: 14.0%;
  }
}

/* ============ 面板表头固定 ============ */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 12px 14px 14px 14px;
}
