/* 空中群島｜品牌色取自 international.isu.edu.tw */
:root {
  --indigo: #36348E;
  --indigo-deep: #23215F;
  --gold: #FFC53A;
  --gold-soft: #FFE3A3;
  --periwinkle: #CDD4FB;
  --mist: #B7D8EF;
  --logo-blue: #00ADEF;
  --ink: #292929;
  --ink-soft: #545454;
  --paper: rgba(255, 255, 255, 0.78);
  --paper-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(54, 52, 142, 0.14);
  --shadow: 0 18px 50px -18px rgba(35, 33, 95, 0.45), 0 2px 8px rgba(35, 33, 95, 0.08);
  --radius: 22px;
  --font-zh: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --font-head: 'Work Sans', 'Noto Sans TC', sans-serif;
  --font-body: 'Inter', 'Noto Sans TC', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #A9CBEB; color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
html[lang^='zh'] body { font-family: var(--font-zh); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: var(--indigo); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
#ui > * { pointer-events: auto; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--indigo); color: #fff; }
.noscript a { color: var(--gold); }

/* ---------- cloud wipe transition ---------- */
#wipe {
  position: fixed; inset: -10%; z-index: 4; pointer-events: none; opacity: 0;
  background:
    radial-gradient(circle at 30% 40%, #fff 0 18%, transparent 42%),
    radial-gradient(circle at 70% 55%, #fff 0 20%, transparent 46%),
    radial-gradient(circle at 50% 50%, #F6F1EA 0 35%, rgba(246, 241, 234, 0.92) 60%, rgba(246, 241, 234, 0.85) 100%);
  filter: blur(6px);
  transform: scale(1.25);
  transition: opacity 0.7s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
#wipe.on { opacity: 1; transform: scale(1); }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, #5E8FD0, #A9CBEB 55%, #F6E3CF); z-index: 10; transition: opacity 0.8s ease; }
.loader.done { opacity: 0; pointer-events: none; }
.loader-inner { display: grid; gap: 18px; justify-items: center; color: #fff; }
.loader img { width: 180px; height: auto; filter: drop-shadow(0 4px 12px rgba(35, 33, 95, 0.35)); }
.loader-bar { width: 160px; height: 2px; background: rgba(255, 255, 255, 0.35); border-radius: 2px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: #fff; transition: width 0.3s ease; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: calc(14px + var(--safe-t)); left: 16px; right: 16px; display: flex; align-items: center; gap: 12px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; height: 44px; padding: 0 14px 0 10px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(54, 52, 142, 0.92), rgba(35, 33, 95, 0.9));
  box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand img { height: 30px; width: auto; display: block; }
.progress { display: flex; gap: 6px; align-items: center; margin: 0 auto; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 6px 24px -12px rgba(35, 33, 95, 0.4); transition: opacity .5s ease; }
.progress[hidden] { display: flex; opacity: 0; pointer-events: none; }
.progress .step { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: rgba(54, 52, 142, 0.45); letter-spacing: 0.02em; white-space: nowrap; }
.progress .step i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: block; transition: transform .4s ease; }
.progress .step.done { color: rgba(54, 52, 142, 0.75); }
.progress .step.now { color: var(--indigo); }
.progress .step.now i { background: var(--gold); transform: scale(1.5); box-shadow: 0 0 0 3px rgba(255, 197, 58, 0.3); }
.progress .step span { display: none; }
.progress .step.now span { display: inline; }
.tools { display: flex; gap: 8px; }
.pill {
  height: 40px; min-width: 40px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255, 255, 255, 0.7); color: var(--indigo); font-weight: 600; font-size: 13px; letter-spacing: 0.02em;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 6px 24px -12px rgba(35, 33, 95, 0.45);
  transition: background .2s ease, transform .2s ease;
}
.pill:hover { background: #fff; }
.pill:active { transform: scale(0.96); }
.pill.active { background: var(--indigo); color: #fff; }
.pill svg { width: 16px; height: 16px; }

/* ---------- title screen ---------- */
.title {
  position: fixed; inset: 0; display: grid; align-content: end; justify-items: center; text-align: center; gap: 22px;
  padding: 24px 24px calc(56px + var(--safe-b));
  background: linear-gradient(180deg, rgba(35, 33, 95, 0) 35%, rgba(35, 33, 95, 0.55) 78%, rgba(35, 33, 95, 0.78));
  color: #fff; transition: opacity 0.9s ease;
}
.title.out { opacity: 0; pointer-events: none; }
.title .wordmark { width: min(260px, 64vw); height: auto; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.25)); }
.title h1 { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: clamp(44px, 9vw, 92px); line-height: 0.95; letter-spacing: -0.02em; text-shadow: 0 6px 40px rgba(35, 33, 95, 0.5); }
html[lang^='zh'] .title h1 { font-family: var(--font-zh); font-weight: 900; letter-spacing: 0.06em; }
.title .sub { margin: 0; font-size: clamp(15px, 2.2vw, 19px); opacity: 0.92; letter-spacing: 0.04em; }
.title .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.title .meta { font-size: 12px; opacity: 0.7; letter-spacing: 0.08em; text-transform: uppercase; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px;
  background: var(--gold); color: var(--indigo-deep); font-weight: 700; font-size: 16px; letter-spacing: 0.02em;
  box-shadow: 0 14px 30px -12px rgba(255, 197, 58, 0.75), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 18px 36px -14px rgba(255, 197, 58, 0.85), inset 0 -2px 0 rgba(0, 0, 0, 0.08); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn.ghost { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.55); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.26); }
.btn.indigo { background: var(--indigo); color: #fff; box-shadow: 0 14px 30px -14px rgba(54, 52, 142, 0.8); }
.btn.quiet { background: transparent; color: var(--indigo); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }

.lang-switch { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.lang-switch button { padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
.lang-switch button.on { background: #fff; color: var(--indigo); }

/* ---------- panel ---------- */
.panel {
  position: fixed; right: 20px; top: calc(76px + var(--safe-t)); bottom: 20px; width: min(420px, calc(100vw - 40px));
  display: flex; flex-direction: column; border-radius: var(--radius); background: var(--paper);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, 0.6);
  transform: translateX(24px); opacity: 0; transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .45s ease;
  overflow: hidden;
}
.panel.in { transform: none; opacity: 1; }
/* dvh = the visible height: on iPad Safari and phones in landscape 100vh includes the area behind the toolbar,
   which pushed the overview panels (Taiwan, Kaohsiung, Guanyin) up under the top buttons. Same numbers on desktop. */
.panel.compact { top: auto; max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px - var(--safe-t)); }
.panel-scroll { overflow-y: auto; padding: 26px 26px 18px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.panel-foot { padding: 14px 26px calc(18px + var(--safe-b)); display: flex; gap: 10px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.45); }
.panel-foot .spacer { flex: 1; }

.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--indigo); opacity: 0.7; margin: 0 0 10px; }
.panel h2 { margin: 0 0 10px; font-family: var(--font-head); font-size: 30px; line-height: 1.12; color: var(--indigo-deep); letter-spacing: -0.01em; }
html[lang^='zh'] .panel h2 { font-family: var(--font-zh); font-weight: 900; letter-spacing: 0.02em; }
.panel h3 { margin: 20px 0 8px; font-size: 15px; color: var(--indigo); }
.panel p { margin: 0 0 12px; line-height: 1.7; font-size: 15px; color: var(--ink); }
.lead { font-size: 16px !important; color: var(--ink-soft) !important; }
.note { font-size: 13px !important; color: var(--ink-soft) !important; }

.photo { position: relative; margin: 2px 0 16px; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--periwinkle); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.04); transition: transform 1.2s ease, opacity .6s ease; opacity: 0; }
.photo img.ready { transform: none; opacity: 1; }

/* chips & option cards */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); color: var(--indigo-deep); font-size: 14px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, color .2s, box-shadow .2s, transform .15s;
}
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--indigo); }
.chip:active { transform: scale(0.97); }
.chip.on { background: var(--indigo); color: #fff; box-shadow: none; }
.chip.blocked { color: #9A9AAE; background: rgba(240, 240, 245, 0.7); box-shadow: inset 0 0 0 1px #E0E0E8; text-decoration: line-through; text-decoration-color: rgba(154, 154, 174, 0.6); cursor: not-allowed; }
.chip.blocked:hover { box-shadow: inset 0 0 0 1px #E0E0E8; }
.chip-why { margin: 8px 2px 0; font-size: 12px; color: #A64410; line-height: 1.5; }

.options { display: grid; gap: 10px; }
.option {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.82); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, transform .15s, background .2s;
}
.option:hover { box-shadow: inset 0 0 0 1.5px var(--indigo); }
.option:active { transform: scale(0.99); }
.option.on { background: #fff; box-shadow: inset 0 0 0 2px var(--indigo), 0 10px 26px -16px rgba(54, 52, 142, 0.6); }
.option .dot { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.option .t { font-weight: 700; font-size: 15px; color: var(--indigo-deep); }
.option .s { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.option .chev { opacity: 0.35; }
.option .check { width: 24px; height: 24px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px #C5C9D7; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; }
.option.on .check { background: var(--indigo); box-shadow: none; }

.options.grid2 { grid-template-columns: 1fr 1fr; gap: 8px; }
.options.grid2 .option { grid-template-columns: auto 1fr; padding: 10px 12px; gap: 10px; }
.options.grid2 .option .chev { display: none; }
.options.grid2 .option .dot { width: 28px; height: 28px; border-radius: 10px; font-size: 12px; }
.options.grid2 .option .t { font-size: 14px; }
.options.grid2 .option .s { font-size: 12px; }
.qblock { margin-bottom: 18px; }
.look { display: grid; gap: 10px; margin: 4px 0 18px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 1px var(--line); }
.look .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.look .row span { width: 44px; font-size: 12px; font-weight: 700; color: var(--indigo); }
.swatch { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 1px var(--line); transition: transform .15s, box-shadow .15s; }
.swatch.on { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--indigo); transform: scale(1.08); }
.hotspot.you .bubble { background: var(--gold); color: var(--indigo-deep); padding: 5px 11px; font-size: 12px; }
.qblock .qt { font-weight: 700; color: var(--indigo-deep); margin: 0 0 10px; font-size: 15px; }

/* bridge reveal */
.bridge-card { border-radius: 18px; padding: 18px; color: #fff; margin: 4px 0 14px; position: relative; overflow: hidden; }
.bridge-card::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.bridge-card .bn { font-family: var(--font-head); font-size: 26px; font-weight: 800; margin: 0 0 2px; }
html[lang^='zh'] .bridge-card .bn { font-family: var(--font-zh); font-weight: 900; }
.bridge-card .bt { font-size: 13px; opacity: 0.9; margin: 0 0 10px; letter-spacing: 0.04em; }
.bridge-card p { color: #fff !important; margin: 0 0 6px !important; }
.bridge-card p:not(.bn):not(.bt) { font-size: 14px !important; }
.bridge-card .bn { font-size: 28px !important; line-height: 1.1; margin-bottom: 4px !important; }
.bridge-card .bt { font-size: 12.5px !important; opacity: 0.9; letter-spacing: 0.06em; }
.mini-bridges { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-bridge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; }
.mini-bridge i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.mini-bridge.on { box-shadow: inset 0 0 0 2px currentColor; }
.mini-bridge.off { opacity: 0.5; }
.mini-bridge.on.off { opacity: 0.8; }
.bridge-switch { margin: 0 0 14px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.7); box-shadow: inset 0 0 0 1px var(--line); }
.bridge-switch .qt { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--indigo-deep); }
.bridge-switch small { display: block; margin-top: 8px; font-size: 11px; color: var(--ink-soft); }
.tap-hint { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #FFF5D5; color: #5D4311; font-size: 13.5px; font-weight: 700; }
.tap-hint svg { flex: none; width: 20px; height: 20px; }
.bridge-warn { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: #FFF3E8; border: 1px solid #F0B98A; }
.bridge-warn b { display: block; color: #A64410; font-size: 13.5px; margin-bottom: 4px; }
.bridge-warn p { margin: 4px 0 0 !important; font-size: 13px !important; line-height: 1.6; color: #5B4130 !important; }
.mainland-warn { margin: 0 0 12px; padding: 14px 16px; border-radius: 14px; background: #FDECEC; border: 1.5px solid #C8323C; }
.mainland-warn b { display: block; color: #A1222B; font-size: 14.5px; margin-bottom: 4px; }
.mainland-warn b::before { content: '!'; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; background: #C8323C; color: #fff; font-size: 13px; vertical-align: 1px; }
.mainland-warn p { margin: 4px 0 0 !important; font-size: 13px !important; line-height: 1.6; color: #5B2A2E !important; }
.mainland-warn .contact { font-weight: 700; color: #A1222B !important; }
.mainland-warn button { margin-top: 10px; padding: 8px 14px; border-radius: 999px; border: 0; background: #C8323C; color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.mainland-warn button:hover { background: #A1222B; }
.bridge-more summary { cursor: pointer; color: var(--indigo); font-weight: 700; font-size: 14px; padding: 6px 0; }

/* program list */
.programs { display: grid; gap: 8px; }
.program { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.82); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, opacity .2s; }
.program:hover { box-shadow: inset 0 0 0 1.5px var(--indigo); }
.program.off { opacity: 0.55; }
.program.on { box-shadow: inset 0 0 0 2px var(--gold), 0 10px 26px -16px rgba(255, 197, 58, 0.9); background: #fff; }
.program .pn { font-weight: 700; font-size: 14px; color: var(--indigo-deep); line-height: 1.35; }
.program .pf { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.program .flags { display: flex; gap: 4px; }
.program .flags i { width: 10px; height: 14px; display: block; clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%); }
.program .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(54, 52, 142, 0.07); color: var(--indigo); }
.tag.gold { background: rgba(255, 197, 58, 0.25); color: #7A5600; }

/* stations */
.stations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 18px; }
.station { padding: 10px 6px; border-radius: 12px; text-align: center; font-size: 12px; font-weight: 700; color: rgba(54, 52, 142, 0.5); background: rgba(255, 255, 255, 0.5); box-shadow: inset 0 0 0 1px var(--line); }
.station.now { color: var(--indigo); background: #fff; box-shadow: inset 0 0 0 2px var(--indigo); }
.station.done { color: #fff; background: var(--indigo); box-shadow: none; }
.timeline { list-style: none; padding: 0; margin: 6px 0 14px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--gold), var(--indigo)); border-radius: 2px; }
.timeline li { position: relative; padding: 6px 0 10px 30px; font-size: 14.5px; line-height: 1.5; opacity: 0; transform: translateY(6px); animation: rise .5s ease forwards; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 9px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--indigo); }
.timeline li b { color: var(--indigo-deep); }
.day { display: grid; gap: 10px; margin: 6px 0 12px; }
.day .moment { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.8); box-shadow: inset 0 0 0 1px var(--line); opacity: 0; transform: translateY(6px); animation: rise .5s ease forwards; }
.day .moment .clock { font-family: var(--font-head); font-weight: 800; font-size: 13px; color: var(--indigo); text-align: center; }
@keyframes rise { to { opacity: 1; transform: none; } }

.badge { display: grid; place-items: center; gap: 8px; margin: 10px 0 16px; text-align: center; }
.badge .medal { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 28px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12), 0 16px 32px -14px rgba(35, 33, 95, 0.6); animation: pop .7s cubic-bezier(.2, 1.4, .3, 1) both; }
@keyframes pop { from { transform: scale(0.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* support dock */
.dock { position: fixed; left: 20px; bottom: calc(20px + var(--safe-b)); display: flex; gap: 8px; transition: opacity .4s ease; }
.dock[hidden] { display: flex; opacity: 0; pointer-events: none; }

/* hotspot labels in 3D */
.hotspot {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  will-change: transform; transition: opacity .35s ease;
}
.hotspot.hide { opacity: 0; pointer-events: none; }
.hotspot .bubble {
  padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); color: var(--indigo-deep); font-weight: 700; font-size: 13.5px; white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(35, 33, 95, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .2s ease, background .2s ease;
}
.hotspot:hover .bubble { transform: translateY(-2px); background: #fff; }
.hotspot.seen .bubble { background: var(--indigo); color: #fff; }
.hotspot .stem { width: 2px; height: 18px; background: linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0)); }
.hotspot .pulse { position: absolute; bottom: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(255, 197, 58, 0.7); animation: ping 2s infinite; }
.hotspot.seen .pulse { animation: none; background: #fff; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 197, 58, 0.7); } 80%, 100% { box-shadow: 0 0 0 14px rgba(255, 197, 58, 0); } }
.hotspot.tag-only .stem, .hotspot.tag-only .pulse { display: none; }
.hotspot.recommended .bubble { background: #C8323C; color: #fff; box-shadow: 0 8px 22px -8px rgba(200, 50, 60, 0.7); }
.hotspot .bubble small { display: block; font-size: 10.5px; font-weight: 600; opacity: 0.65; letter-spacing: 0.06em; }
.hotspot.island .bubble { display: grid; justify-items: center; gap: 1px; padding: 6px 12px 7px; border-radius: 12px; font-size: 13px; }
.hotspot.island.dim { opacity: 0.55; }
.hotspot.island.target .bubble { background: var(--gold); color: var(--indigo-deep); }

/* narration caption */
.caption {
  position: fixed; left: 50%; bottom: calc(48px + var(--safe-b)); transform: translate(-50%, 10px); max-width: min(720px, calc(100vw - 40px)); text-align: center;
  font-size: clamp(18px, 2.6vw, 26px); font-weight: 700; color: #fff; text-shadow: 0 2px 24px rgba(35, 33, 95, 0.55), 0 1px 2px rgba(35, 33, 95, 0.5);
  opacity: 0; transition: opacity .9s ease, transform .9s ease; pointer-events: none; line-height: 1.45;
}
html[lang^='zh'] .caption { letter-spacing: 0.06em; }
.caption.in { opacity: 1; transform: translate(-50%, 0); }

.toast { position: fixed; left: 50%; top: calc(80px + var(--safe-t)); transform: translate(-50%, -10px); padding: 12px 18px; border-radius: 999px; background: var(--indigo); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); opacity: 0; transition: all .5s ease; pointer-events: none; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }

/* route card */
.route-wrap { display: grid; gap: 14px; }
.route-preview { width: auto; max-width: 100%; max-height: 44vh; margin: 0 auto; aspect-ratio: 9 / 16; object-fit: contain; border-radius: 18px; box-shadow: 0 20px 40px -20px rgba(35, 33, 95, 0.6); display: block; background: var(--indigo); }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: var(--indigo); letter-spacing: 0.06em; }
.field input { height: 46px; border-radius: 12px; border: 0; padding: 0 14px; font: inherit; font-size: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); outline: none; }
.field input:focus { box-shadow: inset 0 0 0 2px var(--indigo); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .btn { width: 100%; padding: 0 12px; font-size: 14px; }
.actions .full { grid-column: 1 / -1; }

.globe-hint { position: fixed; left: 50%; top: calc(84px + var(--safe-t)); transform: translateX(-50%); color: #fff; font-size: 13px; opacity: 0.8; letter-spacing: 0.06em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4); pointer-events: none; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .topbar { left: 10px; right: 10px; top: calc(10px + var(--safe-t)); gap: 8px; }
  .brand { height: 38px; padding: 0 10px 0 8px; }
  .brand img { height: 24px; }
  .progress { padding: 7px 10px; gap: 5px; }
  .progress .step.now span { display: none; }
  .pill { height: 36px; min-width: 36px; padding: 0 11px; font-size: 12px; }
  .pill .label { display: none; }
  .panel, .panel.compact {
    left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 54dvh; border-radius: 24px 24px 0 0; transform: translateY(30px);
  }
  .panel.tall { max-height: 72dvh; }
  .panel.in { transform: none; }
  .panel-scroll { padding: 22px 20px 14px; }

  .panel h2 { font-size: 24px; }
  .panel-foot { padding: 12px 20px calc(14px + var(--safe-b)); }
  .photo { aspect-ratio: 16 / 8; }
  .dock { left: auto; right: 10px; bottom: auto; top: calc(56px + var(--safe-t)); flex-direction: column; align-items: flex-end; gap: 6px; }
  .dock .pill { height: 32px; padding: 0 10px; }
  .caption { bottom: calc(40vh + 16px); }
  .caption.free { bottom: calc(48px + var(--safe-b)); }
  .hotspot .bubble { font-size: 12.5px; padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Program houses and their directory share the same light signal. */
:focus-visible { outline: 3px solid #A86A1E; outline-offset: 4px; }
.program-directory { gap: 9px; }
.program-choice { position: relative; padding-left: 36px; }
.program-choice .pn { line-height: 1.5; }
.program-lamp { position: absolute; left: 14px; top: 22px; width: 10px; height: 10px; border-radius: 50%; background: #7F8899; box-shadow: inset 0 0 0 2px #fff8; }
.program-lamp.on { background: #F7BB32; box-shadow: 0 0 0 4px #FFC53A22, 0 0 14px #E8B24B88; }
.program-choice.lit { background: #FFFCF1; box-shadow: inset 0 0 0 1px #D0AF5C88; }
.program-choice.on { background: #FFF4C9; box-shadow: inset 0 0 0 2px #9D741E; }
.program-heading { border-left: 4px solid var(--island-color); padding-left: 12px; margin-bottom: 14px; }
.program-heading .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.program-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 18px 0; padding: 4px; background: #36348E0C; border-radius: 13px; }
.program-tabs button { padding: 10px 4px; min-height: 48px; border-radius: 9px; color: var(--indigo); font-size: 12px; font-weight: 700; line-height: 1.4; }
.program-tabs button.on { background: var(--indigo); color: white; }
.program-detail { min-height: 160px; }
.skill-list { padding-left: 22px; line-height: 1.8; font-size: 14px; }
.admission-status { margin: 18px 0 10px; padding: 14px; background: #E4E8EE; color: #364156; border-radius: 14px; font-size: 13px; line-height: 1.6; }
.admission-status.ready { background: #FCEDBB; color: #614B16; }
.admission-status p { margin: 5px 0 0; font-size: 12px; color: inherit; }
.directory-count { font-variant-numeric: tabular-nums; margin: 10px 0 !important; font-size: 12px !important; }
.empty-state { padding: 22px 16px; background: white; border-radius: 12px; }
.program-filters { margin-top: 8px; }
.program-filters .chip { padding: 8px 12px; min-height: 40px; font-size: 12px; }
.other-programs { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.other-programs summary { cursor: pointer; color: var(--indigo); font-weight: 700; font-size: 14px; padding: 8px 0; }
.route-current { font-size: 12px !important; padding: 10px 14px; background: #FFF4CF; border-radius: 12px; color: #725220 !important; }
.catalog-scope, .scenario-note { font-size: 11px !important; line-height: 1.7; }
.hotspot.program-pin .bubble { border-radius: 12px; max-width: 138px; white-space: normal; text-align: center; font-size: 11px; line-height: 1.3; padding: 7px 10px; background: #F0F2F7EF; }
.hotspot.program-pin .bubble small { font-size: 9px; margin-bottom: 2px; }
.hotspot.program-pin .pulse { animation: none; background: #8590A8; box-shadow: none; width: 9px; height: 9px; }
.hotspot.program-pin.lit .pulse { background: #FFC53A; box-shadow: 0 0 12px #FFC53A; }
.hotspot.program-pin.lit .bubble { background: #FFF5D5F5; box-shadow: 0 0 0 1px #D5A83E, 0 6px 16px #23215F22; }
.hotspot.program-pin.selected .bubble { background: var(--indigo); color: white; }
.hotspot.foundation .bubble { background: #D5F1D9; border: 1px solid #3E9E86; }
.hotspot.foundation.industry .bubble { background: #FCE3E0; border-color: #C8323C; color: #8E1F27; }
.hub-first { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: #FDF0EE; border: 1px solid #E8A8A2; }
.hub-first b { display: block; color: #8E1F27; font-size: 13px; margin-bottom: 4px; }
.hub-first p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink); }
.pathway-cards { display: grid; gap: 8px; margin: 14px 0 22px; }
.pathway-card { display: flex; align-items: center; gap: 12px; padding: 14px; text-align: left; background: #FFFEF9; border: 1px solid #C5C9D7; border-radius: 15px; }
.pathway-card:hover { border-color: var(--indigo); background: white; }
.pathway-card strong { display: block; color: var(--indigo-deep); font-size: 14px; }
.pathway-card small { display: block; margin-top: 5px; font-size: 11px; color: var(--ink-soft); line-height: 1.5; }
.pathway-symbol { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; background: #E3EFE2; border-radius: 12px; font-size: 20px; color: #296B52; }
.pathway-card:nth-child(2) .pathway-symbol { background: #FCE3E0; color: #A3262F; }
.route-ribbon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; }
.route-ribbon span { padding: 8px 10px; background: #E3EFE7; border-radius: 10px; color: #29634C; font-size: 12px; font-weight: 700; }
.route-ribbon span + span::before { content: '→ '; }
.partner-list { margin-bottom: 12px; }
.panel-foot { flex-wrap: wrap; }
.panel-foot .btn { font-size: 13px; min-height: 46px; padding: 0 18px; }

/* The guide remains available outside the content panel. */
.narration { position: fixed; top: calc(70px + var(--safe-t)); left: 16px; z-index: 5; color: var(--indigo-deep); }
.voice-bar { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 3px 4px 3px 3px; border-radius: 999px; background: rgba(255, 254, 242, 0.86); border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: 0 8px 26px -14px rgba(35, 33, 95, 0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.voice-play { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--indigo); color: #fff; flex: 0 0 auto; transition: transform .2s ease, background .3s ease; }
.voice-play:active { transform: scale(.94); }
.voice-ring { position: absolute; inset: -3px; width: 44px; height: 44px; transform: rotate(-90deg); pointer-events: none; }
.voice-ring circle { fill: none; stroke-width: 2.6; }
.voice-ring .track { stroke: transparent; }
.voice-ring .bar { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .3s linear; }
.voice-glyph { width: 0; height: 0; margin-left: 3px; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.narration.playing .voice-glyph { width: 11px; height: 12px; margin: 0; border: 0; border-left: 3.5px solid currentColor; border-right: 3.5px solid currentColor; }
.narration.busy .voice-glyph { width: 12px; height: 12px; margin: 0; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: voiceSpin .8s linear infinite; }
.narration.off .voice-play { background: rgba(54, 52, 142, 0.5); }
.narration.failed .voice-play { background: #B8574A; }
@keyframes voiceSpin { to { transform: rotate(360deg); } }
.voice-label { font-size: 12px; font-weight: 700; padding: 0 4px 0 8px; white-space: nowrap; letter-spacing: .02em; }
.voice-more { width: 30px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; color: var(--indigo); }
.voice-more i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }
.voice-more:hover, .narration.open .voice-more { background: rgba(54, 52, 142, .08); }
.voice-pop { margin-top: 8px; width: 286px; max-width: calc(100vw - 20px); padding: 12px; border-radius: 16px; background: rgba(255, 254, 242, 0.96); border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: popIn .22s ease; }
.voice-pop[hidden] { display: none; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } }
.voice-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.voice-pop-row + .voice-pop-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.voice-languages { display: flex; padding: 2px; border-radius: 9px; background: rgba(54, 52, 142, .07); }
.voice-languages button { min-width: 44px; min-height: 32px; padding: 0 9px; font-size: 12px; font-weight: 700; border-radius: 7px; color: var(--indigo); }
.voice-languages .on { background: var(--indigo); color: #fff; }
.voice-replay { min-height: 34px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--indigo); background: rgba(54, 52, 142, .07); }
.voice-auto { font-size: 12px; font-weight: 600; cursor: pointer; }
.voice-switch { position: relative; width: 40px; height: 24px; border-radius: 999px; background: rgba(54, 52, 142, .2); flex: 0 0 auto; transition: background .25s ease; }
.voice-switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); transition: transform .25s ease; }
.voice-switch[aria-checked="true"] { background: var(--indigo); }
.voice-switch[aria-checked="true"] i { transform: translateX(16px); }
.narration summary { cursor: pointer; font-size: 11px; font-weight: 600; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); opacity: .8; }
.narration details p { font-size: 13px; line-height: 1.75; margin: 8px 2px 0; max-height: 28vh; overflow: auto; }
.voice-status { display: block; font-size: 11px; line-height: 1.5; margin-top: 8px; color: #8A3F35; }
.voice-status:empty { display: none; }
@media (max-width: 760px) {
  .narration { top: calc(56px + var(--safe-t)); left: 10px; }
  .voice-bar { height: 40px; }
  .voice-play { width: 34px; height: 34px; }
  .voice-ring { width: 40px; height: 40px; }
  .voice-label { display: none; }
  .voice-more { width: 26px; }
  .panel.tall { max-height: 67dvh; }
  .hotspot.program-pin .bubble { font-size: 9px; max-width: 95px; padding: 5px 7px; }
  .hotspot.program-pin .stem { height: 10px; }
  .pathway-card { padding: 12px; }
  .program-tabs button { font-size: 11px; }
  .program-choice { padding-left: 34px; }
}
.pin-compact { display: none; }
@media (max-width: 760px) {
  .program-pin .pin-full, .program-pin .bubble small { display: none; }
  .program-pin .pin-compact { display: block; }
  .hotspot.program-pin .bubble { white-space: nowrap; max-width: none; padding: 6px 8px; }
}

/* Photo-led prelude chapters. */
.chapter-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 18px; }
.chapter-photo { margin: 0; min-width: 0; }
.chapter-photo.hero { grid-column: 1 / -1; }
.chapter-photo button { position: relative; padding: 0; width: 100%; display: block; overflow: hidden; border-radius: 14px; background: #E1E5EC; }
.chapter-photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.chapter-photo.hero img { aspect-ratio: 16 / 10; }
.chapter-photo figcaption { font-size: 10px; color: #545469; line-height: 1.5; margin-top: 6px; }
.photo-expand { position: absolute; bottom: 7px; right: 7px; background: #FFFE; color: var(--indigo); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.photo-viewer { width: min(1100px, 94vw); max-height: 94dvh; border: 0; padding: 42px 18px 18px; border-radius: 18px; background: #FEFDF8; color: var(--indigo-deep); box-shadow: var(--shadow); }
.photo-viewer::backdrop { background: #14172EE0; backdrop-filter: blur(5px); }
.photo-viewer img { display: block; max-width: 100%; max-height: 70dvh; width: auto; margin: auto; object-fit: contain; }
.photo-viewer p { font-size: 14px; text-align: center; margin: 14px 0 6px; }
.photo-viewer small { display: block; font-size: 11px; color: #616174; margin-top: 5px; }
.photo-viewer > a { display: block; text-align: center; font-size: 12px; }
.viewer-close { position: absolute; top: 5px; right: 10px; font-size: 30px; width: 36px; height: 36px; }
.history-timeline { list-style: none; padding: 0; margin: 24px 0; }
.history-timeline li { display: grid; grid-template-columns: 85px 1fr; gap: 15px; padding: 12px 0; border-bottom: 1px solid #36348E20; font-size: 13px; line-height: 1.6; }
.history-timeline b { font-family: var(--font-head); font-size: 17px; color: var(--indigo); }
.chapter-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 2px; }
.chapter-section p { font-size: 14px; }
.group-sectors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.group-sectors > div { padding: 12px; border-radius: 14px; background: #FFFFFFB0; border: 1px solid var(--line); }
.group-sectors h3 { margin-top: 0; }
.group-sectors p { font-size: 12px; margin: 0; }
.chapter-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.chapter-links .btn { font-size: 12px; padding: 0 14px; min-height: 40px; }
.transit-guide { margin: 14px 0 18px; padding: 12px; border-radius: 12px; background: #FFFFFFAD; border: 1px solid var(--line); }
.transit-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 11px; font-weight: 700; color: #33364E; }
.transit-legend span { display: inline-flex; align-items: center; gap: 5px; }
.transit-legend i { width: 20px; height: 4px; border-radius: 4px; }
.transit-guide small { display: block; font-size: 9px; color: #666879; margin-top: 8px; }
/* Lit options retain their full colour; every other choice stays readable and clickable. */
.program-choice.muted { background: #E8EBEDF0; border-color: #C5C9CD; box-shadow: inset 0 0 0 1px #CBD0D4; }
.program-choice.muted .pn { color: #4E545C; }
.program-choice.muted .pf { color: #626870; }
.program-choice.muted .tag { color: #515963; background: #DDE1E5; }
.program-choice.muted.on { background: #DEE2E6; box-shadow: inset 0 0 0 2px #737C87; }
.program-choice.lit { background: #FFFEF6; box-shadow: 0 3px 18px #D5AD4318, inset 0 0 0 1.5px #D4AD45; }
.hotspot.program-pin:not(.lit) .bubble { background: #DDE1E5F5; color: #4E555F; box-shadow: 0 5px 18px #17223120; }
.hotspot.program-pin.selected:not(.lit) .bubble { background: #5C6570; color: white; }
.hotspot.program-pin.selected.lit .bubble { background: #FFF4C3; color: #473815; box-shadow: 0 0 0 2px #AF841B, 0 0 20px #F5BD4D66; }
.hotspot.campus-building .bubble { font-size: 11px; border: 1px solid #CBAF8B; background: #FFF8EAEE; }
@media (max-width:760px) { .hotspot.campus-building .bubble { font-size: 9px; padding: 6px 8px; white-space: normal; max-width: 95px; } }
.chapter-gallery.gallery-pair .hero { grid-column: auto; }
.chapter-gallery.gallery-pair .hero img { aspect-ratio: 4 / 3; }
.hotspot.prelude-topic .bubble { max-width: 175px; white-space: normal; text-align: center; font-size: 12px; line-height: 1.35; }
@media(max-width:760px) { .hotspot.prelude-topic .bubble { max-width: 105px; font-size: 10px; padding: 6px 8px; } }

/* Admission routes outside the ordinary department choices. */
.other-options { margin: 20px 0; padding: 16px; border: 1.5px solid #8F9DAB; border-radius: 18px; background: #F4F6F8C7; }
.other-options > h3 { margin: 0 0 7px; font-family: var(--font-head); font-size: 16px; letter-spacing: .04em; color: #394C62; }
.other-options > .note { font-size: 12px !important; margin-bottom: 12px; }
.other-options .pathway-cards { margin: 0; }
.program-other-options { display: grid; gap: 10px; margin: 9px 0 0; padding: 13px; }
.program-other-options > .note { margin: 0; }
.home-button { background: #FFF3D2; border: 1px solid #BE8F2F; color: #5D4311; white-space: nowrap; }
.home-short { display: none; }
.hotspot.rail-end .bubble { color: #A64410; border: 1px solid #DE8249; background: #FFF7E9; font-size: 10px; padding: 5px 8px; }
@media(max-width:760px) {
  .progress { display: none; }
  .tools { margin-left: auto; gap: 5px; }
  .home-button { padding: 0 9px; }
  .home-long { display: none; }
  .home-short { display: inline; }
  .other-options { padding: 13px; }
  .hotspot.rail-end { display: none; }
}
@media(max-width:760px) { .progress, .progress[hidden] { display:none; } }
.topbar { z-index:6; }

.phase-ribbon { padding:10px 13px; border-radius:12px; background:#DDEAF3; color:#355269 !important; font-size:12px !important; font-weight:700; }
.program-choice.preview { background:#FFFFFFDF; box-shadow:inset 0 0 0 1px #BECAD4; }
.program-choice.preview .program-lamp { background:#B6C8D3; }
.hotspot.program-pin.preview .bubble { background:#F6FBFFF2; color:#34495B; box-shadow:0 0 0 1px #BED0DD; }
.admission-status.preview { background:#E3EEF5; color:#355269; }
.chapter-like-row { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; padding:11px 12px; border:1px solid #DFC3CC; border-radius:14px; background:#FFF7F9D9; margin:2px 0 15px; }
.chapter-like-row p { margin:0; font-size:11px; line-height:1.6; color:#735361; }
.heart-button { display:inline-flex; align-items:center; gap:6px; min-height:42px; padding:0 12px; border:1px solid #CA8C9E; border-radius:999px; background:#FFF; color:#A44865; font-size:12px; font-weight:700; white-space:nowrap; }
.heart-button > span:first-child { font-size:25px; line-height:1; }
.heart-button.on { background:#B94F70; border-color:#B94F70; color:#FFF; }
.journey-summary { padding:16px; border:1px solid #D9B5C2; border-radius:17px; background:#FFF6F9EA; }
.journey-summary h3 { margin:0 0 10px; color:#974563; font-size:15px; }
.journey-summary ul { margin:0 0 12px; padding-left:18px; font-size:12px; line-height:1.8; }
.journey-summary li { margin:5px 0; color:#614651; }
.journey-summary .summary-choice { font-size:13px; line-height:1.6; border-top:1px solid #DFC3CC; padding-top:10px; margin-bottom:10px; }
.journey-summary .summary-encouragement { font-size:12px; line-height:1.75; color:#755964; margin-bottom:0; }
.journey-summary.compact { margin-top:18px; padding:13px; }
@media(max-width:760px) { .chapter-like-row { gap:8px; padding:9px 10px; }.heart-button{padding:0 10px;}.journey-summary{padding:13px;} }
.program-choice.preview.on { background:#EAF4FB; box-shadow:inset 0 0 0 2px #5D8EAD; }
.hotspot.program-pin.preview.selected:not(.lit) .bubble { background:#E5F2FB; color:#355269; box-shadow:0 0 0 2px #7DABC7; }
.phase-ribbon { display:flex; align-items:center; gap:9px; }
.phase-ribbon svg { width:32px; height:27px; flex-shrink:0; }
.anchor-hint { padding:12px 14px; border-radius:12px; background:#FFF2C8; color:#73531C !important; font-size:12px !important; line-height:1.7; }
/* Saved hearts stay visible in the list as well as inside the topic. */
.topic-choices { display:grid; gap:8px; margin:8px 0 16px; }
.topic-choice { display:flex; align-items:stretch; border:1px solid #CCD0EA; border-radius:18px; overflow:hidden; background:#FFFFFFBD; }
.topic-choice .topic-open { flex:1; min-width:0; text-align:left; box-shadow:none; border-radius:0; background:transparent; padding:12px 14px; }
.topic-choice .topic-open.on { background:#36348E; color:#FFF; }
.topic-choice.saved { border-color:#BC6985; background:#FFF0F5; box-shadow:inset 0 0 0 1px #BC6985; }
.topic-heart { flex-shrink:0; width:48px; min-width:48px; padding:0; border:0; border-left:1px solid #E5CCD5; border-radius:0; background:#FFF7FA; justify-content:center; }
.topic-heart.on { background:#B94F70; }
.chapter-like-row .heart-button:not(.on) .heart-icon { animation:heart-invite 1.5s ease-in-out infinite; }
.topic-heart:not(.on) .heart-icon { animation:heart-invite-small 2s ease-in-out infinite; }
@keyframes heart-invite { 0%,65%,100%{transform:translateY(0) scale(1)} 25%{transform:translateY(-6px) scale(1.16)} 43%{transform:translateY(0) scale(1.04)} }
@keyframes heart-invite-small { 0%,75%,100%{transform:translateY(0)} 30%{transform:translateY(-3px)} }
.summary-life { padding:10px 0; margin-bottom:8px !important; font-size:13px !important; border-top:1px solid #DFC3CC; color:#674B58 !important; }
@media(prefers-reduced-motion:reduce) { .heart-icon { animation:none !important; } }
.map-tools { position:fixed;left:20px;bottom:78px;display:flex;gap:7px;z-index:4; }
.map-tools .btn { min-height:40px;padding:0 14px;font-size:12px;background:#FFFFF4ED;box-shadow:var(--shadow); }
.connection-controls { margin:12px 0 18px;padding:12px;border:1px solid #B6C8D7;border-radius:14px;background:#F2F8FDDD; }
.connection-controls .note { font-size:11px!important;margin-bottom:8px; }
.connection-controls .chip { padding:8px 11px;font-size:12px;min-height:38px; }
@media(max-width:760px) { .map-tools {top:142px;bottom:auto;left:10px;flex-wrap:wrap;max-width:calc(100vw - 100px);}.map-tools .btn{font-size:10px;min-height:34px;padding:0 10px;} }
.route-requirement { padding:12px 14px; border:1px solid #C99439; border-radius:12px; background:#FFF1CE; color:#6E4A15!important; font-size:12px!important; line-height:1.7; }
.selected-route { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.selected-route .btn { min-height:32px; font-size:11px; padding:0 10px; }
.chip[data-map-filter=en].on { background:#3477B7; color:#FFF; }
.chip[data-map-filter=zh].on { background:#AA5845; color:#FFF; }
.chip[data-map-filter=ifp].on { background:#2B8068; color:#FFF; }
.chip[data-map-filter=intense].on { background:#A77722; color:#FFF; }


/* ---------- view dock: bird's-eye · tilt · orbit · zoom · home ---------- */
.view-dock {
  position: fixed; left: 18px; top: 50%; transform: translateY(-50%); z-index: 4;
  display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 12px 34px -16px rgba(35, 33, 95, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}
.view-dock .sep { height: 1px; margin: 3px 6px; background: rgba(54, 52, 142, 0.14); }
.view-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--indigo);
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
.view-btn svg { width: 20px; height: 20px; }
.view-btn:hover { background: rgba(54, 52, 142, 0.08); }
.view-btn:active { transform: scale(0.94); }
.view-btn.on { background: var(--indigo); color: #fff; }
.view-btn .view-label {
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translate(-4px, -50%); white-space: nowrap; pointer-events: none;
  padding: 6px 10px; border-radius: 9px; background: var(--indigo-deep); color: #fff; font-size: 12px; font-weight: 600; opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.view-btn:hover .view-label, .view-btn:focus-visible .view-label { opacity: 1; transform: translate(0, -50%); }
.map-tools { display: none !important; }
@media (max-width: 760px) {
  /* a short row under the narration button: the right column belongs to the support dock,
     and a row stays clear of the bottom panel even on short phones */
  .view-dock { left: 10px; top: calc(104px + var(--safe-t)); transform: none; flex-direction: row; gap: 2px; padding: 4px; border-radius: 15px; }
  .view-btn { width: 36px; height: 36px; border-radius: 11px; }
  .view-btn .view-label { display: none; }
  /* pinch zooms on touch screens, so the dock keeps only the view switches */
  .view-btn[data-icon="plus"], .view-btn[data-icon="minus"], .view-dock .sep { display: none; }
}

/* ---------- unified back step + breadcrumb ---------- */
.btn.back-step { padding-left: 12px; }
.btn.back-step svg { width: 16px; height: 16px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin: -4px 0 12px; font-size: 12px; color: rgba(54, 52, 142, 0.6); }
.crumbs button { padding: 2px 4px; border-radius: 6px; color: var(--indigo); font-weight: 600; }
.crumbs button:hover { background: rgba(54, 52, 142, 0.08); }
.crumbs .here { color: var(--indigo-deep); font-weight: 700; }
.crumbs .gt { opacity: 0.45; }
.route-learn { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.route-learn button { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--indigo); box-shadow: inset 0 0 0 1px var(--line); }
.route-learn button:hover { background: rgba(54, 52, 142, 0.07); }
.route-note { margin-top: 4px !important; padding: 10px 12px; border-radius: 12px; background: rgba(54, 52, 142, 0.06); }


/* ---------- foldable panel ---------- */
.panel-handle { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 22px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.4); flex: 0 0 auto; cursor: default; touch-action: none; }
.ph-grip { display: none; }
.ph-title { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: rgba(54, 52, 142, 0.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--indigo); background: rgba(54, 52, 142, 0.07); transition: background .2s ease; }
.ph-toggle:hover { background: rgba(54, 52, 142, 0.13); }
.ph-chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .3s ease; }
.ph-label-show { display: none; }
/* header "Bird's-eye map": folds the panel and shows the whole map (only where the view dock offers it) */
.ph-bird { display: none; align-items: center; gap: 6px; flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--indigo-deep); background: var(--gold); box-shadow: 0 6px 14px -8px rgba(35, 33, 95, 0.6); white-space: nowrap; transition: transform .15s ease, filter .15s ease; }
.ph-bird:hover { filter: brightness(1.05); transform: translateY(-1px); }
.ph-bird:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.ph-bird svg { width: 17px; height: 17px; }
.can-bird .ph-bird { display: inline-flex; }
.panel.collapsed .ph-bird { display: none; }
.panel.collapsed { top: calc(76px + var(--safe-t)) !important; bottom: auto !important; max-height: none !important; }
.panel.collapsed .panel-scroll, .panel.collapsed .panel-foot { display: none; }
.panel.collapsed .panel-handle { border-bottom: 0; cursor: pointer; padding-top: 12px; padding-bottom: 12px; }
.panel.collapsed .ph-label-hide { display: none; }
.panel.collapsed .ph-label-show { display: inline; }
.panel.collapsed .ph-chev { transform: rotate(-135deg) translate(-2px, -2px); }
.panel.collapsed .ph-title { color: var(--indigo-deep); font-size: 13px; }
@media (max-width: 760px) {
  .panel-handle { flex-direction: row; padding: 16px 12px 8px 18px; }
  .ph-grip { display: block; position: absolute; left: 50%; top: 6px; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: rgba(54, 52, 142, 0.2); }
  .ph-label-hide { display: none; }
  .ph-toggle { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .panel.collapsed { top: auto !important; bottom: 0 !important; }
  .panel.collapsed .ph-toggle { width: auto; padding: 0 14px; white-space: nowrap; background: var(--indigo); color: #fff; }
  .panel.collapsed .panel-handle { padding-bottom: calc(12px + var(--safe-b)); }
}

/* typed hometown */
.home-type { margin-top: 14px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 1px var(--line); }
.home-type.on { box-shadow: inset 0 0 0 1.5px var(--indigo); }
.home-type label { display: block; font-size: 12px; font-weight: 700; color: var(--indigo-deep); margin-bottom: 8px; }
.home-row { display: flex; gap: 8px; }
.home-input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 16px; color: var(--ink); }
.home-input:focus { outline: 2px solid var(--indigo); outline-offset: 1px; }
.home-found { margin: 8px 2px 0; }
.summary-from { padding: 10px 0 2px; margin: 0 !important; font-size: 13px !important; border-top: 1px solid #DFC3CC; color: #674B58 !important; }
.summary-from + .summary-life { border-top: 0; padding-top: 2px; }

/* Route card: the preview opens full size */
.route-preview-open { position: relative; display: block; margin: 0 auto; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 18px; max-width: 100%; }
.route-preview-open:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.route-preview-open .photo-expand { bottom: 12px; right: 12px; width: 34px; height: 34px; font-size: 17px; box-shadow: 0 4px 10px rgba(35, 33, 95, 0.3); }
.route-preview-hint { text-align: center; margin-top: -6px; }
.card-viewer { width: fit-content; max-width: 94vw; padding: 44px 14px 10px; overflow: auto; }
.card-viewer img { max-height: calc(94dvh - 110px); border-radius: 14px; cursor: zoom-in; }
.card-viewer.zoomed { width: min(1080px, 94vw); }
.card-viewer.zoomed img { width: max(100%, 720px); max-width: none; max-height: none; cursor: zoom-out; } /* phones: about 2× with scrolling */

/* ---------- phones: the map comes first ----------
   Panels open as a lower-third sheet (about 42% of the screen) so most of the screen stays on the map.
   "展開" (or a swipe up on the header) grows the sheet for reading; "縮小" / swipe down brings the map back. */
.ph-expand { display: none; }
@media (max-width: 760px) {
  .panel, .panel.compact, .panel.tall { max-height: max(42dvh, 300px); transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .45s ease, max-height .35s ease; }
  .panel.expanded, .panel.compact.expanded, .panel.tall.expanded { max-height: calc(100dvh - 60px - var(--safe-t)); }
  .panel-scroll { padding-top: 14px; }
  .panel-scroll > .eyebrow { display: none; } /* the chapter name is already in the header */
  .panel h2 { font-size: 21px; }
  .panel:not(.collapsed) .ph-title { display: none; } /* the heading below repeats it; room for the buttons */
  .panel-handle { padding-top: 14px; padding-bottom: 6px; }
  .ph-expand { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--indigo); background: rgba(54, 52, 142, 0.07); white-space: nowrap; }
  .ph-up { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-135deg) translate(-1px, -1px); transition: transform .3s ease; }
  .ph-label-shrink { display: none; }
  .panel.expanded .ph-label-grow { display: none; }
  .panel.expanded .ph-label-shrink { display: inline; }
  .panel.expanded .ph-up { transform: rotate(45deg) translate(-2px, -2px); }
  .panel.collapsed .ph-expand { display: none; }
  .caption { bottom: calc(max(42dvh, 300px) + 12px); }
  .panel[data-key="globe-look"] .look > .qt { display: none; } /* the heading already says it */
}

/* tablets in portrait (iPad): a narrower side panel leaves more of the map visible; desktop (>1024px) is unchanged */
@media (min-width: 761px) and (max-width: 1024px) {
  .panel { width: min(360px, 46vw); right: 12px; }
  .panel-scroll { padding: 20px 20px 14px; }
  .panel h2 { font-size: 25px; }
}
