/* Totrip audio v2 — styles.
 *
 * Palette and type scale follow the design brief:
 *   bg #FFFFFF · text #17231E · muted #59675F · pine #0F5C4C · divider #E3E9E5
 *   mobile: heading 32/38 · attraction name 22/28 · body 16/24 · small 14/20
 * Restrained: no hero, no carousel, no filters, no heavy card shadows.
 * Hairline borders and one accent colour do the work.
 */

:root {
  --bg: #ffffff;
  --ink: #17231e;
  --muted: #59675f;
  --pine: #0f5c4c;
  --pine-press: #0a4338;
  --line: #e3e9e5;
  --tint: #f4f7f5;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --pad: 20px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
}

img { max-width: 100%; display: block; }

a { color: var(--pine); }

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
  border-radius: 4px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ---------------------------------------------------------------- header */

.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  max-width: 1080px;
  margin: 0 auto;
}

.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
  line-height: 20px;
}

.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }

/* ----------------------------------------------------------------- main */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 16px 40px;
}

h1 {
  font-size: 32px;
  line-height: 38px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 12px;
  color: var(--muted);
  max-width: 62ch;
}

.cn {
  font-weight: 500;
  color: var(--muted);
  margin-left: 8px;
  font-size: 0.72em;
  vertical-align: 0.12em;
}

/* ------------------------------------------------------------- directory */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.18s ease;
}

.card:hover { border-color: var(--pine); }

/* The frame is the 4:3 box. The image is absolutely filled and cropped, so a
   square or portrait source cannot stretch the card into a tall portrait. */
.card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}

.card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

/* Honest missing-photo state: no image is borrowed from another attraction
   and no map is passed off as a photo. */
.card-photo-missing {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 16px;
  background: var(--tint);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.card-photo-missing strong {
  display: block;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink);
}

.card-body { padding: 8px 12px 10px; }

.card-title {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.card-intro {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 16px;
  line-height: 24px;
}

.card-langs {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.card-cta {
  display: inline-block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 650;
  color: var(--pine);
}

.card-cta::after { content: " →"; }

/* ------------------------------------------------------------ guide page */

.crumb {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 20px;
}

.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--pine); }

.crumb img,
.langs-label img {
  display: inline-block;
  vertical-align: -3px;
  margin-right: 4px;
  opacity: 0.6;
}

.meta {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.guide-intro {
  margin: 0 0 24px;
  max-width: 62ch;
}

.langs {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 24px;
  background: var(--tint);
}

.langs-label {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 650;
  margin-bottom: 10px;
}

.lang-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.lang-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.lang-btn[aria-pressed="true"] {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}

/* ------------------------------------------------------------- map stage */

/* The v7.2 map-first layout: a full-bleed AMap base map with a separate
   route-image layer (the printed route map with numbered, image-relative
   pins) on top of it. The two layers never mix — no stop is drawn on the
   AMap canvas, because the published data carries no stop coordinates. */

.map-stage {
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
}

.map-frame-area { position: relative; }

.map-base {
  position: relative;
  height: 46vh;
  min-height: 260px;
  max-height: 420px;
  background: #e8eef2;
}

.map-base .amap-container { background: transparent !important; }
.map-base .amap-logo,
.map-base .amap-copyright { opacity: 0.6; }

.route-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  background: var(--bg);
}

.route-layer.show { display: flex; }

.route-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.route-frame { position: relative; width: 100%; }

.route-frame img { width: 100%; height: auto; }

.pins { position: absolute; inset: 0; }

.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
}

.pin[aria-current="true"] {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
  width: 30px;
  height: 30px;
}

.route-layer figcaption {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.map-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.map-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 650;
  color: var(--ink);
}

.map-btn[aria-pressed="true"] {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}

.map-btn[disabled] { opacity: 0.45; cursor: default; }

.map-note {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #6a7682;
  background: var(--tint);
  padding: 4px 8px;
  border-radius: 6px;
}

.map-status {
  margin: 0;
  padding: 0 14px 12px;
  font-size: 13px;
  line-height: 19px;
  color: var(--muted);
}

.map-status:empty { display: none; }

/* The visitor's own position on the AMap base map. */
.myou {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2b8aef;
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

/* ---------------------------------------------------------------- player */

.player {
  position: sticky;
  bottom: 0;
  z-index: 5;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  padding: 14px 16px 12px;
  margin: 0 0 20px;
}

.now { margin: 0 0 10px; min-height: 24px; }

.now-title {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-cn { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); }

.times {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin: 2px 0 8px;
}

.bar {
  position: relative;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  margin: 0 0 12px;
}

.bar > i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--pine);
  border-radius: 2px;
}

.ctrls {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  gap: 4px;
}

.ctl {
  position: relative;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.ctl img { width: 22px; height: 22px; }

.ctl[disabled] { opacity: 0.3; cursor: default; }

.ctl.play {
  height: 56px;
  width: 56px;
  justify-self: center;
  border-radius: 50%;
  background: var(--pine);
}

.ctl.play img { width: 24px; height: 24px; filter: brightness(0) invert(1); }

.ctl.list[aria-expanded="true"] { background: var(--pine); }
.ctl.list[aria-expanded="true"] img { filter: brightness(0) invert(1); }

.ten {
  position: absolute;
  right: 2px;
  bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.toast {
  margin-top: 10px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  min-height: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.toast.show { opacity: 1; }

/* -------------------------------------------------------------- stop list */

.list { margin: 0; }

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.list-head h2 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 650;
  margin: 0;
}

.list-head span { font-size: 14px; line-height: 20px; color: var(--muted); }

.stops { list-style: none; margin: 0; padding: 0; }

.stop {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 4px 0;
}

.stop-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 8px 6px;
  border-radius: 10px;
  min-width: 0;
}

.stop-btn[aria-current="true"] { background: var(--tint); }

.stop-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.stop-btn[aria-current="true"] .stop-num {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}

.stop-text { min-width: 0; }

.stop-title {
  display: block;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-cn {
  display: block;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.stop-file {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 4px;
}

.stop-file img { width: 16px; height: 16px; }

.stop-file:hover { color: var(--pine); }

/* ---------------------------------------------------------------- footer */

.foot {
  border-top: 1px solid var(--line);
  padding: 18px var(--pad) 30px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.foot-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
}

.foot a { color: var(--muted); }

/* ------------------------------------------------------------- utilities */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.more {
  margin: 40px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 20px;
}

.more ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }

/* ------------------------------------------------------------ responsive */

@media (min-width: 760px) {
  :root { --pad: 32px; }

  main { padding-top: 44px; }

  .grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }

  .card-photo { aspect-ratio: 4 / 3; }

  .guide { display: block; }

  .player { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .card:hover { border-color: var(--line); }
}

/* ------------------------------------------------- map-first guide stage */

body.is-guide {
  height: 100%;
  overflow: hidden;
  background: #e8eef2;
}

.stage {
  position: fixed;
  inset: 0;
  background: #e8eef2;
}

.stage .map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #e8eef2;
}

.map-status {
  position: absolute;
  left: 12px;
  right: 72px;
  top: 118px;
  z-index: 2;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  pointer-events: none;
}

.map-status:empty { display: none; }

.top {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 8px;
  z-index: 5;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.top-bar h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back, #v2-about-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  line-height: 20px;
}

.upnext {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
}

.up-lbl { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 650; }
.up-name { font-size: 16px; line-height: 22px; font-weight: 700; }

.about {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  max-height: 36vh;
  overflow: auto;
}

.about .meta, .about .guide-intro { margin: 0 0 8px; font-size: 14px; line-height: 20px; color: var(--muted); }
.about .guide-intro { color: var(--ink); font-size: 16px; line-height: 24px; }

.fabs {
  position: absolute;
  right: 12px;
  bottom: 188px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fab {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 750;
  color: var(--ink);
}

.fab[aria-pressed="true"], .lang-fab[aria-expanded="true"] {
  background: var(--pine);
  color: #fff;
  border-color: var(--pine);
}

.lang-sheet { position: absolute; inset: 0; z-index: 30; }
.lang-scrim { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(10, 10, 10, 0.45); }
.lang-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 12px 16px 16px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.lang-head { display: flex; align-items: center; justify-content: space-between; }
.lang-head h2 { margin: 0; font-size: 16px; line-height: 24px; }
.lang-x { width: 36px; height: 36px; font-size: 22px; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow: auto; margin-top: 10px; }
.lang-opt {
  position: relative;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-align: left;
  background: #fff;
}
.lang-opt .nm { display: block; font-size: 16px; line-height: 22px; font-weight: 650; }
.lang-opt .en { display: block; font-size: 12px; line-height: 16px; color: var(--muted); }
.lang-opt[aria-checked="true"] { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }

.route-sheet {
  position: absolute;
  left: 12px;
  right: 68px;
  top: 168px;
  bottom: 188px;
  z-index: 4;
}

.route-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.route-view { flex: 1; overflow: auto; }
.route-zoom { position: relative; transform-origin: top center; }
.route-zoom img { width: 100%; height: auto; }
.pins { position: absolute; inset: 0; }
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}
.pin.is-current, .pin.is-next { width: 26px; height: 26px; background: var(--pine); color: #fff; border-color: var(--pine); }
.pin-name {
  position: absolute;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  max-width: 120px;
  padding: 2px 6px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-tools { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--line); }
.route-tools button { min-width: 36px; min-height: 32px; border: 1px solid var(--line); border-radius: 8px; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  height: 168px;
  padding: 8px 12px 10px;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
}
.sheet.expand { height: min(72vh, 560px); }
.sheet .now { min-width: 0; }
.sheet .now-title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .now-cn { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.sheet .times { display: flex; justify-content: space-between; margin: 2px 0 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.sheet .bar { position: relative; height: 3px; margin: 6px 0; background: rgba(0, 0, 0, 0.12); border-radius: 2px; }
.sheet .bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--pine); }
.sheet .ctrls { display: grid; grid-template-columns: repeat(6, 1fr); align-items: center; }
.sheet .ctl { height: 44px; display: grid; place-items: center; position: relative; }
.sheet .play { width: 56px; height: 56px; border-radius: 50%; background: var(--pine); justify-self: center; }
.sheet .ten { position: absolute; right: 6px; bottom: 4px; font-size: 9px; font-weight: 800; }
.sheet .list { overflow: auto; margin-top: 8px; }
.sheet .toast { min-height: 0; font-size: 13px; color: var(--muted); }
.sheet .toast:empty { display: none; }
