* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  background: #09090c;
  color: #ede8df;
  display: flex;
  flex-direction: column;
}

/* ====== 默认竖屏：上地图 下面板 ====== */
.map-panel {
  position: relative;
  flex: 1 1 60%;
  min-height: 0;
  width: 100%;
}

/* 地图暗角遮罩，增加沉浸感 */
.map-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 55%,
    rgba(6, 4, 2, 0.4) 100%
  );
}

.side-panel {
  flex: 0 0 35%;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(175deg, rgba(16, 14, 12, 0.98) 0%, rgba(10, 9, 8, 0.99) 100%);
  border-top: 1px solid rgba(255, 200, 100, 0.08);
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 12px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: inset 0 1px 0 rgba(255, 200, 100, 0.04);
}

/* ====== 横屏：左地图 右面板 ====== */
@media (orientation: landscape) {
  html, body {
    flex-direction: row;
  }
  .map-panel {
    flex: 1 1 65%;
    height: 100%;
    min-width: 0;
  }
  .side-panel {
    flex: 0 0 35%;
    max-width: 380px;
    min-width: 180px;
    height: 100%;
    border-top: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    padding: 16px 14px calc(env(safe-area-inset-bottom) + 12px);
    padding-right: calc(env(safe-area-inset-right) + 14px);
    min-height: 0;
  }
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #09090c;
}

/* 顶部栏（地图内） */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 14px;
  pointer-events: none;
}

.top-left-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
}

/* LOGO 紧凑区块 */
.logo-block {
  display: inline-block;
  background: rgba(8, 6, 4, 0.7);
  border-radius: 6px;
  padding: 3px 12px 5px;
  border: 1px solid rgba(255, 200, 100, 0.08);
}

.logo-row1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
}

.logo-year {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 1px;
  color: rgba(200, 175, 130, 0.7);
}

.logo-horse {
  height: 48px;
  margin: -12px -6px -8px -6px;
  opacity: 0.9;
  filter: drop-shadow(0 0 3px rgba(255, 200, 100, 0.4));
}

.logo-row2 {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  color: rgba(240, 220, 180, 0.9);
  margin-top: -6px;
  text-shadow: 0 0 8px rgba(255, 200, 100, 0.12);
}

/* 当前 POI 名称标签 */
.poi-label {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  text-align: center;
}

/* ====== 右侧叙事面板内的 POI 卡片 ====== */
.poi-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: #eee;
}

.poi-card-header {
  flex-shrink: 0;
}

.poi-card-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

/* POI 导航栏（前后翻页） */
.poi-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.poi-nav-btn, .tip-link {
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  line-height: 1;
}

.tip-link {
  background: rgba(255, 205, 85, 0.1);
  border-color: rgba(255, 205, 85, 0.3);
  color: rgba(255, 205, 85, 0.9);
  font-size: 14px;
}

.poi-nav-btn:hover, .tip-link:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  transform: scale(1.1);
}

.tip-link:hover {
  background: rgba(255, 205, 85, 0.2);
  color: #ffcd55;
}

/* POI 名称与内联工具栏 */
.poi-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.poi-name-group {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.poi-name {
  flex-shrink: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 200, 100, 0.2);
}

.poi-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.poi-meta .dot {
  opacity: 0.3;
}

.poi-cluster {
  color: rgba(255,205,85,0.6);
}

.poi-meta .dot {
  margin: 0 6px;
  opacity: 0.5;
}

.poi-bubble {
  font-family: "PingFang SC", "Heiti SC", -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.3; /* 进一步缩小整体行距 */
  color: rgba(200, 176, 128, 0.92);
  text-align: justify;
  white-space: pre-wrap;
  word-break: break-word;
}

.en-bubble-line {
  display: inline-block;
  font-size: 12px; /* 调大一点点，比汉字略小 */
  line-height: 1.25;
  margin-top: 6px;
  color: rgba(200, 176, 128, 0.75);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.poi-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.5);
}

/* ====== 控制条 ====== */
.controls {
  position: absolute;
  z-index: 550;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 4px);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  flex-shrink: 0;
  background: none;
  color: #FFB800;
  border: none;
  font-size: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.3s, transform 0.1s;
}

.ctrl-btn:hover { opacity: 0.85; }
.ctrl-btn:active { opacity: 1; transform: scale(1.1); }

/* 播放键 · 正红内发光 */
#playBtn {
  opacity: 1;
  color: #ff1a1a;
  font-size: 22px;
  width: 40px;
  height: 40px;
  background: rgba(200, 0, 0, 0.15);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 30, 30, 0.55);
  box-shadow: inset 0 0 14px rgba(255, 0, 0, 0.45), 0 0 18px rgba(255, 0, 0, 0.35);
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.9);
}
#playBtn:hover {
  box-shadow: inset 0 0 18px rgba(255, 0, 0, 0.65), 0 0 28px rgba(255, 0, 0, 0.5);
}

#progress {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  outline: none;
  opacity: 0.4;
  transition: opacity 0.3s;
}
#progress:hover { opacity: 0.85; }

.speed-label {
  opacity: 0.85;
  font-size: 13px;
  font-weight: bold;
  color: rgba(255, 200, 100, 0.9);
}

.speed-btn, .bgm-btn {
  opacity: 0.8;
  font-size: 20px;
  font-weight: bold;
  color: rgba(255, 200, 100, 0.9);
  background: rgba(255, 200, 100, 0.12);
  border: 1px solid rgba(255, 200, 100, 0.25);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  text-shadow: 0 0 5px rgba(255, 200, 100, 0.5);
}
.speed-btn:hover, .bgm-btn:hover {
  opacity: 1;
  background: rgba(255, 200, 100, 0.25);
}

#progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  cursor: pointer;
}

#progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  border: none;
  cursor: pointer;
}

/* ====== TTS 内联按钮 ====== */
.tts-btn-inline {
  background: none;
  border: none;
  color: rgba(255, 205, 85, 0.6);
  font-size: 14px; /* 稍微调大一点点 */
  cursor: pointer;
  padding: 0;
  margin-right: 8px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.tts-btn-inline:hover {
  color: #ffcd55;
  transform: scale(1.1);
}

.tts-btn-inline.speaking {
  color: #ff5544;
  animation: ttsPulse 1.2s infinite;
}

.tts-lang {
  display: block;
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  margin-top: 8px;
  text-align: right;
}

/* ====== Leaflet 微调 ====== */
.leaflet-control-attribution {
  background: rgba(0,0,0,0.4) !important;
  color: rgba(255,255,255,0.5) !important;
  font-size: 9px !important;
}

.leaflet-control-attribution a {
  color: rgba(255,255,255,0.7) !important;
}

.leaflet-control-zoom {
  display: none;
}

/* ====== POI 地图标记 ====== */
.poi-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 220, 140, 0.9);
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 0 8px rgba(255, 220, 140, 0.6);
  cursor: pointer;
}

.poi-marker.active {
  background: #ffcd55;
  width: 18px;
  height: 18px;
  box-shadow: 0 0 16px rgba(255, 205, 85, 0.95);
}

.pilgrim-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff5544;
  border: 2px solid #fff;
  box-shadow: 0 0 18px rgba(255, 85, 68, 0.9);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(255,85,68,0.7); }
  50% { transform: scale(1.25); box-shadow: 0 0 22px rgba(255,85,68,1); }
}

/* ====== 离线 POI 标记 ====== */
.poi-marker.offroute {
  width: 10px;
  height: 10px;
  background: rgba(180, 160, 120, 0.7);
  border: 1.5px solid rgba(255,255,255,0.6);
  box-shadow: 0 0 5px rgba(180, 160, 120, 0.4);
}


/* ====== 赞助商横幅 ====== */
.sponsor-banner {
  flex-shrink: 0;
  border-top: 1px solid rgba(255,205,85,0.15);
  padding: 10px 0 8px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(255,205,85,0.06) 0%, rgba(255,140,50,0.04) 100%);
}

.sponsor-banner::before {
  content: "合作伙伴";
  display: block;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(255,205,85,0.45);
  text-align: center;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* 左右渐隐遮罩 */
.sponsor-banner::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  background: linear-gradient(90deg,
    rgba(14,14,18,0.95) 0%,
    transparent 12%,
    transparent 88%,
    rgba(14,14,18,0.95) 100%
  );
  pointer-events: none;
}

.sponsor-track {
  display: flex;
  align-items: center;
  gap: 32px;
  width: max-content;
  animation: scrollLogos 22s linear infinite;
  padding: 0 8px;
}

.sponsor-track img {
  height: 32px;
  opacity: 0.7;
  filter: brightness(1.3) contrast(0.95);
  transition: all 0.3s;
  object-fit: contain;
}
.sponsor-track img:hover {
  opacity: 1;
  filter: brightness(1.5);
  transform: scale(1.08);
}

@keyframes scrollLogos {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ====== 赞赏按钮 ====== */
.tip-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 180, 0, 0.08);
  border: 1px solid rgba(255, 180, 0, 0.2);
  color: rgba(255, 200, 100, 0.75);
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}
.tip-link:hover {
  background: rgba(255, 180, 0, 0.18);
  color: #ffcd55;
}

/* ====== 赞赏弹窗 ====== */
.tip-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
}
.tip-modal.open { display: flex; }

.tip-qr-wrapper {
  max-width: 85%;
  max-height: 85vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
}

.tip-qr-only {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

/* ====== 尾声祝福覆盖层 ====== */
.epilogue-overlay {
  position: absolute;
  inset: 0;
  z-index: 800;
  display: none;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}
.epilogue-overlay.visible {
  display: flex;
  animation: overlayFadeIn 2.5s ease;
}

.blessing-text {
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.9);
}
.blessing-year {
  font-size: 36px;
  font-weight: 200;
  letter-spacing: 10px;
  opacity: 0;
  animation: blessFade 2.5s ease 0.5s forwards;
}
.blessing-wish {
  font-size: 18px;
  letter-spacing: 5px;
  color: rgba(255,205,85,0.95);
  margin-top: 10px;
  opacity: 0;
  animation: blessFade 2.5s ease 1.8s forwards;
}
.blessing-credit {
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: 1.5px;
  color: rgba(255, 200, 100, 0.85); /* 柔和的金黄色，与主题呼应 */
  margin-top: 50px;
  opacity: 0;
  font-weight: 300;
  animation: blessFade 3s ease 3.5s forwards;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

@keyframes blessFade {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes overlayFadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
