/* ============================================================
   南日岛 · Nanri Island —— 星空飞入地图首页
   深空蓝 × 鎏金 × 玻璃拟态
   ============================================================ */

:root {
  --space-950: #05080f;
  --space-900: #0a0d13;
  --space-800: #0e1626;
  --space-700: #143a5c;
  --navy-700: #1b4a74;
  --navy-500: #2a5f8f;
  --gold-600: #a9852f;
  --gold-500: #c9a86a;
  --gold-300: #e6d3ab;
  --white: #fff;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font-sans); color: var(--white); background: var(--space-950); overflow: hidden; }

button { font-family: inherit; cursor: pointer; }

/* ============================================================
   3D 星空舞台
   ============================================================ */
.stage3d {
  position: fixed; inset: 0; z-index: 10;
  background:
    radial-gradient(1200px 700px at 75% 20%, rgba(42,95,143,.18), transparent 60%),
    radial-gradient(800px 500px at 15% 85%, rgba(201,168,106,.10), transparent 55%),
    var(--space-950);
  transition: opacity .8s ease;
}
.stage3d.is-leaving { opacity: 0; pointer-events: none; }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* HUD */
.stage3d__hud {
  position: absolute; left: 7vw; bottom: 11vh; z-index: 3; max-width: 560px;
  pointer-events: none;
}
.stage3d__eyebrow {
  font-size: 12px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--gold-300); margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.stage3d__eyebrow::before { content: ""; width: 40px; height: 1px; background: linear-gradient(90deg, var(--gold-500), transparent); }
.stage3d__title {
  font-family: var(--font-serif); font-weight: 600; line-height: 1.2;
  font-size: clamp(38px, 6vw, 68px); color: #fff; margin-bottom: 18px;
  text-shadow: 0 6px 40px rgba(0,0,0,.6);
}
.stage3d__sub { font-size: 15px; color: rgba(255,255,255,.78); margin-bottom: 30px; line-height: 1.8; }
.stage3d__actions { pointer-events: auto; }
.stage3d__hint { margin-top: 22px; font-size: 12.5px; letter-spacing: .08em; color: rgba(255,255,255,.4); }
.stage3d__live { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; letter-spacing: .06em; color: rgba(255,255,255,.55); }
.stage3d__live span { display: inline-flex; align-items: center; gap: 6px; }
.stage3d__live #liveSat, .stage3d__live #liveLst { color: var(--gold-300); font-variant-numeric: tabular-nums; }

.btn { display: inline-block; font-size: 15px; font-weight: 600; letter-spacing: .05em; padding: 14px 34px; border-radius: 999px; transition: all .25s; border: 0; }
.btn--gold { background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--space-900); box-shadow: 0 10px 30px rgba(201,168,106,.35); }
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(201,168,106,.5); }
.btn--ghost { background: transparent; border: 1.5px solid rgba(255,255,255,.45); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }

/* ============================================================
   过渡遮罩
   ============================================================ */
.transition {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--space-950);
  opacity: 0; visibility: hidden;
  transition: opacity .45s ease;
}
.transition.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.transition__beam {
  width: 2px; height: 120px;
  background: linear-gradient(180deg, transparent, var(--gold-500), transparent);
  animation: beamPulse 1s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(201,168,106,.7);
}
@keyframes beamPulse { 0%,100% { transform: scaleY(.6); opacity:.6; } 50% { transform: scaleY(1); opacity:1; } }
.transition__label { font-family: var(--font-serif); font-size: 22px; letter-spacing: .18em; color: var(--gold-300); }

/* ============================================================
   实景地图层
   ============================================================ */
.map-layer {
  position: fixed; inset: 0; z-index: 20;
  transition: opacity .8s ease;
}
.map-layer.is-hidden { opacity: 0; pointer-events: none; }
.map { position: absolute; inset: 0; background: var(--space-900); }
.map-layer.is-hidden .map { pointer-events: none; }

/* Leaflet 覆层微调 */
.leaflet-container { font-family: var(--font-sans) !important; }
.leaflet-popup-content-wrapper { border-radius: 12px; background: rgba(10,13,19,.92); color: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.5); border: 1px solid rgba(201,168,106,.35); }
.leaflet-popup-content { margin: 14px 18px; line-height: 1.7; font-size: 13.5px; }
.leaflet-popup-content strong { color: var(--gold-300); display: block; font-size: 15px; margin-bottom: 4px; }
.leaflet-popup-tip { background: rgba(10,13,19,.92); border: 1px solid rgba(201,168,106,.35); }
.leaflet-popup-close-button { color: #fff !important; }

/* 自定义地标 marker：圆点 + 常驻名字标签 */
.wt-match::after { display: none; }
.wt-marker {
  display: flex; align-items: center; gap: 0; cursor: pointer;
  transform: translate(0, 0); white-space: nowrap;
}
.wt-marker__dot {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 30%, #fff 0%, var(--c, #c9a86a) 45%, var(--c, #c9a86a) 100%);
  border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(5,8,15,.45), 0 4px 10px rgba(0,0,0,.5);
  z-index: 2;
}
.wt-marker__name {
  margin-left: -4px; margin-top: 18px;
  font-size: 11.5px; font-weight: 600; color: #fff;
  background: rgba(5,8,15,.78); border: 1px solid rgba(255,255,255,.25);
  padding: 2px 9px; border-radius: 999px; line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0,0,0,.35); letter-spacing: .02em;
  transition: background .2s;
}
.wt-marker:hover .wt-marker__name { background: var(--c, #c9a86a); border-color: transparent; }

/* 图例提示 */
.leaflet-control-layers { background: rgba(10,13,19,.85) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.15) !important; border-radius: 10px !important; }
.leaflet-control-layers-expanded { padding: 8px 12px !important; font-size: 12.5px; }

/* 品牌覆盖层 */
.brand-overlay {
  position: absolute; top: 26px; left: 28px; z-index: 1200;
  display: flex; align-items: center; gap: 13px;
  background: rgba(10,13,19,.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 12px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.brand-overlay__badge { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--gold-300), var(--gold-600)); display: flex; align-items: center; justify-content: center; }
.brand-overlay__badge svg { width: 24px; height: 24px; }
.brand-overlay__cn { font-family: var(--font-serif); font-size: 20px; font-weight: 700; letter-spacing: .08em; color: #fff; line-height: 1.2; }
.brand-overlay__en { font-size: 10px; letter-spacing: .3em; color: var(--gold-300); margin-top: 2px; }

/* 右侧信息面板 */
.info-panel {
  position: absolute; top: 50%; right: 34px; transform: translateY(-50%); z-index: 1200;
  width: min(360px, calc(100vw - 68px));
  background: rgba(10,13,19,.68); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 30px 30px 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  color: #fff;
}
/* 收起/展开按钮（桌面端也提供，方便随时最小化面板） */
.info-panel__collapse {
  position: absolute; top: 10px; right: 12px; z-index: 5;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
}
.info-panel__collapse:hover { background: rgba(201,168,106,.4); }
.info-panel__body { transition: opacity .3s ease, max-height .3s ease; }
.info-panel.is-collapsed { padding: 0; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; }
.info-panel.is-collapsed .info-panel__body { opacity: 0; max-height: 0; pointer-events: none; }
.info-panel.is-collapsed .info-panel__collapse { top: 11px; right: 11px; background: rgba(201,168,106,.5); }
.info-panel__kicker { font-size: 11px; letter-spacing: .3em; color: var(--gold-300); text-transform: uppercase; margin-bottom: 12px; }
.info-panel__title { font-family: var(--font-serif); font-size: 34px; color: #fff; margin-bottom: 14px; font-weight: 600; }
.info-panel__desc { font-size: 14px; color: rgba(255,255,255,.8); line-height: 1.9; margin-bottom: 20px; }
.info-panel__facts { list-style: none; margin-bottom: 24px; }
.info-panel__facts li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,.85); padding: 7px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--gold-500)); flex: none; box-shadow: 0 0 10px var(--c, var(--gold-500)); }
.info-panel__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.info-panel__note { margin-top: 18px; font-size: 12px; color: rgba(255,255,255,.5); }

/* 地标 dock */
.places-dock {
  position: absolute; right: 34px; bottom: 26px; z-index: 1200;
  width: min(300px, calc(100vw - 68px));
  background: rgba(10,13,19,.7); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.places-dock__head { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; font-size: 13.5px; color: var(--gold-300); letter-spacing: .06em; cursor: pointer; }
.places-dock__toggle { background: none; border: 0; color: var(--gold-300); font-size: 14px; transition: transform .25s; }
.places-dock.is-collapsed .places-dock__toggle { transform: rotate(-90deg); }
.places-dock__list { list-style: none; max-height: 220px; overflow-y: auto; transition: max-height .3s; }
.places-dock.is-collapsed .places-dock__list { max-height: 0; }
.places-dock__list::-webkit-scrollbar { width: 6px; }
.places-dock__list::-webkit-scrollbar-thumb { background: rgba(201,168,106,.4); border-radius: 3px; }
.places-dock__list li { padding: 11px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 12px; cursor: pointer; transition: background .2s; font-size: 13.5px; color: rgba(255,255,255,.85); }
.places-dock__list li:hover { background: rgba(201,168,106,.12); color: #fff; }
.places-dock__list li .p-tag { margin-left: auto; font-size: 10px; color: var(--gold-300); border: 1px solid rgba(201,168,106,.4); padding: 1px 7px; border-radius: 999px; flex: none; }
.places-dock__list li .p-emoji { font-size: 16px; }

/* 加载 */
.loading {
  position: fixed; inset: 0; z-index: 100; background: var(--space-950);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  color: rgba(255,255,255,.7); font-size: 14px; letter-spacing: .1em;
  transition: opacity .6s ease;
}
.loading.is-done { opacity: 0; pointer-events: none; }
.loading__spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid rgba(201,168,106,.25); border-top-color: var(--gold-500);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   手机端适配（≤ 760px）
   ============================================================ */
@media (max-width: 760px) {
  /* —— 3D 星空舞台 —— */
  .stage3d__hud { left: 5vw; right: 5vw; bottom: 7vh; max-width: none; }
  .stage3d__title { font-size: 36px; }
  .stage3d__sub { font-size: 14px; }
  .stage3d__actions .btn { width: 100%; text-align: center; }
  .stage3d__live { font-size: 11px; }

  /* —— 品牌栏 —— */
  .brand-overlay { top: 12px; left: 12px; padding: 8px 14px; border-radius: 14px; gap: 10px; }
  .brand-overlay__badge { width: 32px; height: 32px; }
  .brand-overlay__badge svg { width: 19px; height: 19px; }
  .brand-overlay__cn { font-size: 16px; }
  .brand-overlay__en { font-size: 8px; }

  /* —— 信息面板：底部紧凑卡片，可收起 —— */
  .info-panel {
    top: auto; bottom: 14px; left: 12px; right: 12px;
    transform: none; width: auto;
    padding: 16px 18px 14px;
    border-radius: 16px;
    max-height: 44vh; overflow-y: auto;
  }
  .info-panel__title { font-size: 24px; margin-bottom: 8px; }
  .info-panel__desc { font-size: 13px; line-height: 1.7; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .info-panel__facts { margin-bottom: 12px; }
  .info-panel__facts li { font-size: 12px; padding: 4px 0; }
  .info-panel__actions .btn { padding: 11px 20px; font-size: 13.5px; }
  .info-panel.is-collapsed { bottom: 14px; right: 12px; left: auto; width: 46px; height: 46px; padding: 0; border-radius: 50%; }

  /* —— Leaflet 控件 —— */
  .leaflet-control-layers { font-size: 11px !important; }
  .leaflet-control-layers-expanded { padding: 6px 10px !important; }
  .leaflet-bottom.leaflet-right { display: none; } /* 隐藏右下角缩放（保留左上角） */
}
