/* 手机 H5 版：沿用原图版的蓝白视觉与呼吸/游走光效，
   但正文改为真实 HTML 文字，字号随屏宽自适应，保证小屏也看得清。 */
:root {
  --blue: #0a4f9e;
  --blue-deep: #073c7c;
  --blue-soft: #e8f3ff;
  --blue-line: #d6e7f8;
  --ink: #1b2c40;
  --muted: #62778e;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(10, 79, 158, .1);
}

/* 字号随屏宽线性增长，并设 16px 下限：320~430px 手机均清晰 */
html {
  font-size: clamp(16px, 4.6vw, 20px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.large-text { font-size: clamp(19px, 5.5vw, 24px); }

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% 8%, #e9f4ff 0, #f4f9ff 34%, #eaf2fb 100%);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.app {
  max-width: 640px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 60px rgba(12, 65, 130, .12);
  display: flex;
  flex-direction: column;
}
.view { flex: 1; outline: none; animation: fade .24s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--blue-line);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: .95rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { display: block; font-size: .6rem; color: var(--muted); letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-tools { display: flex; align-items: center; gap: 5px; flex: none; }
.font-btn {
  border: 1px solid var(--blue-line); background: #fff; color: var(--blue-deep);
  font-size: .72rem; font-weight: 800; padding: .36rem .5rem; border-radius: 999px; line-height: 1;
}
.font-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- 地图（可放大） ---------- */
.map-card {
  margin: 0 .75rem 1rem; border: 1px solid var(--blue-line);
  border-radius: var(--radius); background: var(--blue-soft);
  box-shadow: var(--shadow); overflow: hidden;
}
.map-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem .6rem; background: rgba(255,255,255,.85);
}
.map-toolbar .map-tip { font-size: .68rem; color: var(--muted); line-height: 1.4; }
.map-tools { display: flex; gap: .35rem; flex: none; }
.map-tools button {
  border: 1px solid var(--blue-line); background: #fff; color: var(--blue-deep);
  font-size: .72rem; font-weight: 700; padding: .38rem .62rem; border-radius: 999px;
}
.map-tools button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.map-viewport {
  overflow: auto; -webkit-overflow-scrolling: touch;
  max-height: 62vh; overscroll-behavior-x: contain;
}
.map-stage { position: relative; width: 100%; line-height: 0; }
.map-stage > img { display: block; width: 100%; height: auto; }

/* 透明热区 + 呼吸光圈（与原图版一致） */
.hotzone {
  position: absolute; border: 0; padding: 0; background: transparent;
  color: transparent; font-size: 0; outline: none;
  -webkit-appearance: none; appearance: none;
}
.hotzone::after {
  content: ''; position: absolute; inset: 0; border: 2px solid transparent;
  pointer-events: none; transition: border-color .16s, box-shadow .16s;
}
.hotzone.dot {
  left: var(--x); top: var(--y); width: var(--w); aspect-ratio: 1 / 1; height: auto;
  transform: translate(-50%, -50%); z-index: 2;
}
.hotzone.dot::after { border-radius: 50%; inset: -1px; }
.hotzone:hover, .hotzone:focus-visible { z-index: 8; }
.hotzone:hover::after, .hotzone:focus-visible::after {
  border-color: rgba(255,255,255,.9);
  box-shadow: 0 0 0 2px rgba(10,79,158,.35), 0 0 14px rgba(66,165,255,.55);
}
.hotzone.focused { z-index: 7; }
.hotzone.focused::after { border-color: #ff9f1c; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,160,30,.65), 0 0 0 2px #ff9f1c; }
  50% { box-shadow: 0 0 0 9px rgba(255,160,30,0), 0 0 0 2px #ff9f1c; }
}
.glow .hotzone.dot::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(150,215,255,.85);
  box-shadow: 0 0 8px 2px rgba(80,180,255,.55);
  animation: haloBreath 2.8s ease-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes haloBreath {
  0% { transform: scale(.78); opacity: .95; }
  55% { opacity: .4; }
  100% { transform: scale(2.15); opacity: 0; }
}

/* 虚线游走 */
.route-zone { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.route-zone polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.route-zone .route-path { fill: none; stroke: none; }
.route-zone .route-target {
  stroke: transparent; stroke-width: 13px; pointer-events: stroke; cursor: pointer;
  vector-effect: non-scaling-stroke;
}
.route-zone .route-target:hover { stroke: rgba(255,255,255,.16); }
.route-zone .route-glow {
  stroke: rgba(255,255,255,.98); stroke-width: 3.5px; stroke-dasharray: 6 20;
  opacity: .82; pointer-events: none; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(70,170,255,.95));
  animation: routeFlow 11s linear infinite;
}
.route-zone .route-arrow {
  fill: #0a6fd4; stroke: #fff; stroke-width: 2.5px; stroke-linejoin: round;
  pointer-events: none; filter: drop-shadow(0 0 6px rgba(90,190,255,1));
}
@keyframes routeFlow { to { stroke-dashoffset: -330; } }

.map-legend {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .4rem;
  padding: .55rem .7rem; font-size: .7rem; color: var(--muted);
  background: rgba(255,255,255,.8); border-top: 1px solid var(--blue-line);
}
.legend-link {
  border: 0; background: transparent; padding: 0; color: var(--blue);
  font-size: .74rem; font-weight: 700; text-align: left;
}
.legend-link:hover { text-decoration: underline; }

/* ---------- 点位列表 ---------- */
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 1rem .55rem; }
.list-head h2 { margin: 0; font-size: 1.05rem; }
.list-head span { font-size: .7rem; color: var(--muted); }
.spot-list { margin: 0 .75rem .5rem; display: grid; gap: .5rem; }
.spot-item {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .65rem .7rem; border: 1px solid var(--blue-line); border-radius: .85rem;
  background: #fff; text-align: left; color: var(--ink);
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.spot-item:hover, .spot-item:focus-visible { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow); outline: none; }
.spot-item.focused { border-color: #f39c12; background: #fffaf0; }
.spot-item.disabled { opacity: .6; }
.num {
  width: 2.1rem; height: 2.1rem; flex: none; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  border: 1px solid var(--blue-line);
}
.spot-item .labels { min-width: 0; flex: 1; }
.spot-item .labels b { display: block; font-size: .88rem; line-height: 1.45; }
.spot-item .labels small { display: block; font-size: .72rem; color: var(--muted); line-height: 1.45; margin-top: .1rem; }
.spot-item .tag { font-size: .62rem; color: var(--muted); border: 1px solid var(--blue-line); border-radius: 999px; padding: .18rem .4rem; flex: none; }
.spot-item .chev { color: var(--blue); font-size: 1.1rem; flex: none; }

/* ---------- 详情页（真实文字） ---------- */
.detail { padding: 0 .75rem 1.4rem; }
.back-row { display: flex; align-items: center; gap: .6rem; padding: .8rem 0 .6rem; }
.back-btn {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0;
  background: linear-gradient(150deg, #1876d4, var(--blue-deep)); color: #fff;
  font-size: 1.3rem; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 5px 14px rgba(10,79,158,.3);
}
.back-btn:active { transform: scale(.94); }
.back-row .back-label { font-size: .78rem; color: var(--muted); }
.locate {
  margin-left: auto; border: 0; background: var(--blue-soft); color: var(--blue);
  font-size: .72rem; font-weight: 700; padding: .45rem .65rem; border-radius: 999px;
}
.title-bar {
  display: flex; align-items: flex-start; gap: .7rem; padding: .8rem .75rem;
  border-radius: .85rem; background: linear-gradient(100deg, #cfe6ff 0%, #eaf5ff 55%, #f7fbff 100%);
  border-left: 4px solid var(--blue); margin-bottom: .9rem;
}
.title-bar .num-lg {
  width: 2.3rem; height: 2.3rem; flex: none; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: .85rem; font-weight: 800;
  display: grid; place-items: center;
}
.title-bar h1 { margin: 0; font-size: 1.18rem; line-height: 1.4; }
.title-bar .subtitle { margin: .2rem 0 0; font-size: .8rem; color: var(--blue-deep); font-weight: 600; line-height: 1.5; }
.title-bar .theme { margin: .45rem 0 0; font-size: .78rem; color: var(--blue-deep); font-weight: 700; }
.title-bar .theme span { font-weight: 500; color: var(--muted); }

.para { font-size: 1rem; line-height: 1.9; margin: 0 0 .85rem; letter-spacing: .01em; }
.para.zh { text-indent: 2em; }          /* 中文段首行缩进两个字 */
.para.en { font-size: .88rem; line-height: 1.8; color: #4d637c; text-align: justify; }  /* 英文两端对齐 */
.para + .para.en { border-top: 1px dashed var(--blue-line); padding-top: .7rem; }
.note { margin: 0 0 .85rem; padding: .55rem .7rem; font-size: .76rem; line-height: 1.65; color: #8a5a00; background: #fff8e8; border: 1px solid #f4e0b0; border-radius: .6rem; }
.no-detail { padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .9rem; background: var(--blue-soft); border-radius: .85rem; }

.photo-card { margin-top: .3rem; border-radius: .85rem; overflow: hidden; border: 1px solid var(--blue-line); background: var(--blue-soft); box-shadow: var(--shadow); }
.photo-card img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.photo-cap { display: flex; align-items: center; justify-content: space-between; padding: .45rem .65rem; font-size: .7rem; color: var(--muted); background: #fff; }
.photo-cap button { border: 0; background: var(--blue-soft); color: var(--blue); font-size: .7rem; font-weight: 700; padding: .32rem .55rem; border-radius: 999px; }
.long-note { margin: .55rem .15rem 0; font-size: .72rem; color: var(--muted); line-height: 1.6; }

.pager { display: flex; gap: .6rem; margin-top: 1.2rem; }
.pager button {
  flex: 1; min-width: 0; padding: .7rem .5rem; border: 1px solid var(--blue-line);
  border-radius: .75rem; background: #fff; color: var(--blue-deep);
  font-size: .76rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pager button:disabled { opacity: .4; cursor: default; }

/* ---------- 页脚 ---------- */
.footer {
  padding: .9rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--blue-line); background: linear-gradient(180deg, #fff, #f5faff);
  font-size: .68rem; color: var(--muted); line-height: 1.7; text-align: center;
}
.footer b { color: var(--blue-deep); }
.footer a { color: var(--blue); font-weight: 700; text-decoration: none; }

/* ---------- 大图 / 提示 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(5,22,44,.95);
  overflow: auto; -webkit-overflow-scrolling: touch;
}
.lightbox-stage { min-height: 100%; display: flex; align-items: flex-start; justify-content: center; padding: 3rem .4rem 1.5rem; }
.lightbox-stage img { width: 100%; max-width: 900px; height: auto; border-radius: .5rem; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.lightbox-close {
  position: fixed; z-index: 2; top: calc(.6rem + env(safe-area-inset-top)); right: .7rem;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.16);
  color: #fff; font-size: 1.4rem; line-height: 1;
}
.toast {
  position: fixed; z-index: 120; left: 50%; bottom: calc(1.6rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem);
  background: rgba(9,40,78,.94); color: #fff; font-size: .8rem;
  padding: .6rem 1rem; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .hotzone.focused::after, .glow .hotzone.dot::before,
  .route-zone .route-glow { animation: none !important; }
}
