/* ============================================================
   Travel Planner · 方案 B 柔和擬態
   主要變數都在 :root 與 body[data-style="flat"]，想換色從這裡改。
   ============================================================ */
:root {
  --accent: #1F5A8E;
  --text: #1C2A44;
  --muted: #55627A;
  --bg: #F2EEE7;
  --tile: #F2EEE7;
  --card: #F2EEE7;
  --tile-shadow: 14px 14px 30px rgba(168,152,130,.34), -14px -14px 30px rgba(255,255,255,.95);
  --card-shadow: 6px 6px 14px rgba(168,152,130,.3), -6px -6px 14px rgba(255,255,255,.9);
  --inset: inset 5px 5px 10px rgba(168,152,130,.3), inset -5px -5px 10px rgba(255,255,255,.9);
  --serif: 'Noto Serif TC', 'PMingLiU', 'MingLiU', serif;
  --sans: 'Noto Sans TC', 'Microsoft JhengHei', 'Hiragino Sans', 'Meiryo', sans-serif;
}
body[data-style="flat"] {
  --bg: #F4F6FA;
  --tile: #FFFFFF;
  --card: #F6F8FB;
  --tile-shadow: 0 20px 40px -24px rgba(30,60,120,.3);
  --card-shadow: 0 10px 22px -14px rgba(30,60,120,.35);
  --inset: inset 0 0 0 1.5px #D9E2EE;
}

*, *::before, *::after { box-sizing: border-box; }
/* 有 hidden 屬性的元素一律隱藏（避免被各卡片自己的 display 蓋掉） */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { opacity: .85; }
button { font-family: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.muted { color: var(--muted); font-size: 14px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: #fff; }
.skip:focus { left: 16px; }

/* ---------- 版面骨架 ---------- */
.app {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px;
}
.main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

.tile {
  background: var(--tile);
  box-shadow: var(--tile-shadow);
  border-radius: 44px;
  padding: 10px;
}
.tile--xl { border-radius: 44px; }
.tile--md { border-radius: 40px; }
.tile--sm { border-radius: 36px; padding: 22px; }
.tile__title { font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.3; }
.tile__title--lg { font-size: 30px; line-height: 1.2; }

/* ---------- 側邊欄 / 手機底部導覽 ---------- */
.side {
  position: sticky;
  top: 24px;
  flex: 0 0 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 10px;
  border-radius: 36px;
  background: var(--tile);
  box-shadow: var(--tile-shadow);
}
.side__logo { display: inline-flex; margin-bottom: 8px; }
.side__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 72px; min-height: 78px; border-radius: 22px;
  color: var(--muted); font-size: 12px; font-weight: 500;
}
.side__item[aria-current="page"] {
  background: var(--accent); color: #fff;
  box-shadow: 0 12px 22px -10px rgba(20,40,80,.55);
}
.tabbar { display: none; }

/* ---------- 頂列 ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { font-family: var(--serif); font-weight: 700; font-size: 36px; line-height: 1.2; }
.topbar p { margin-top: 2px; font-size: 15px; color: var(--muted); }
.topbar__tools { flex: 1 1 320px; min-width: 0; max-width: 640px; display: flex; align-items: center; gap: 16px; }
.searchbox {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 0 22px; border-radius: 999px;
  background: var(--card); box-shadow: var(--inset); color: var(--muted);
}
.searchbox input {
  flex: 1 1 0; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 15px; color: var(--text);
}
.searchbox input::placeholder { color: var(--muted); opacity: 1; }
.searchbox:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
/* 新增旅行按鈕（目前只跳提示，表單之後做） */
.add-trip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 0 24px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 12px 22px -10px rgba(20,40,80,.55);
}
.add-trip:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.avatar {
  flex: 0 0 60px; width: 60px; height: 60px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tile); box-shadow: var(--card-shadow);
}
.avatar span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(160deg, #6F9AD0, #3F73B4); color: #fff;
}

/* ---------- 首圖列 ---------- */
.row-hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: stretch; }
.hero-tile { display: flex; }
.hero {
  position: relative; overflow: hidden; flex: 1 1 auto; min-height: 540px;
  border-radius: 36px; display: flex; flex-direction: column; justify-content: space-between;
  color: #fff;
}
.hero__scene {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 72% 70%, rgba(255,240,200,.95), rgba(255,240,200,0) 30%),
    linear-gradient(180deg, #1E4FA6 0%, #4C86D8 40%, #9CC8F4 62%, #FFE6BE 80%);
}
.hero__scene i { position: absolute; display: block; }
.sc-cloud1 { left: 58%; top: 14%; width: 24%; height: 54px; border-radius: 50%; background: rgba(255,255,255,.55); filter: blur(8px); }
.sc-cloud2 { left: 74%; top: 30%; width: 20%; height: 44px; border-radius: 50%; background: rgba(255,255,255,.6); filter: blur(8px); }
.sc-far { left: 0; right: 0; bottom: 22%; height: 40%; background: linear-gradient(180deg, #F4F9FF, #A9C6E8); clip-path: polygon(0 100%,8% 55%,16% 70%,28% 28%,40% 62%,52% 38%,66% 68%,78% 34%,90% 60%,100% 46%,100% 100%); }
.sc-near { left: 0; width: 46%; bottom: 20%; height: 34%; background: linear-gradient(180deg, #8FB0D8, #4F76AA); clip-path: polygon(0 100%,0 40%,16% 22%,34% 46%,56% 100%); }
.sc-sea { left: 0; right: 0; bottom: 0; height: 26%; background: linear-gradient(180deg, #3F86D6, #1F5AAE); }
.sc-shore { left: 0; right: 0; bottom: 0; height: 20%; background: #F7FBFF; clip-path: polygon(100% 100%,100% 18%,86% 32%,70% 64%,58% 100%); }
.hero__photo { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,28,70,.55) 0%, rgba(8,28,70,0) 64%); }
.hero__body { position: relative; z-index: 2; padding: 44px 48px 0; text-shadow: 0 1px 12px rgba(8,28,70,.35); }
.eyebrow { font-size: 13px; letter-spacing: .22em; font-weight: 700; }
.hero__title { margin-top: 10px; font-family: var(--serif); font-weight: 700; font-size: clamp(64px, 7.2vw, 104px); line-height: 1.05; letter-spacing: .02em; }
.hero__title--long { font-size: clamp(40px, 4.8vw, 68px); line-height: 1.15; }
.hero__en { margin-top: 6px; font-size: 22px; }
.hero__meta { margin-top: 14px; font-size: 17px; }
.btn-glass {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 26px;
  min-height: 52px; padding: 0 26px; border: 1.5px solid rgba(255,255,255,.9); border-radius: 999px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(6px);
  color: #fff; font-size: 15px; font-weight: 500; text-shadow: none;
}
/* 海報版：有直式封面時，左文右圖 */
.hero--poster { background: linear-gradient(90deg, #F5ECE2 0%, #EEDDD0 55%, #EBD8CA 100%); color: var(--text); }
.hero--poster .hero__body { text-shadow: none; max-width: 52%; }
.hero--poster .hero__title { font-size: clamp(48px, 5.4vw, 80px); }
.hero--poster .btn-glass { color: var(--accent); border-color: var(--accent); background: rgba(255,255,255,.6); }
.hero__poster { position: absolute; top: 28px; bottom: 28px; right: 32px; aspect-ratio: 2 / 3; border-radius: 22px; background-repeat: no-repeat; background-position: center; background-size: cover; box-shadow: 0 18px 40px rgba(80,50,30,.28), 0 2px 6px rgba(80,50,30,.18); transform: rotate(1.5deg); }
.hero__thumbs { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 0 48px 36px; }
.thumb { display: inline-block; width: 64px; height: 64px; border: 3px solid #fff; border-radius: 50%; }
.thumb--plus { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: rgba(255,255,255,.9); color: var(--text); }

.col-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.wx {
  --wx-sky-top: #2F6BC8; --wx-sky-bot: #7FB3EC;
  position: relative; overflow: hidden; min-height: 240px; padding: 24px 26px;
  border-radius: 32px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(180deg, var(--wx-sky-top) 0%, var(--wx-sky-bot) 100%); color: #fff;
}
.wx[data-kind="moon"], .wx[data-kind="pnight"] { --wx-sky-top: #12214F; --wx-sky-bot: #3F57A0; }
.wx[data-kind="cloudy"] { --wx-sky-top: #5B6B82; --wx-sky-bot: #9AAAC0; }
.wx[data-kind="fog"] { --wx-sky-top: #6E7E90; --wx-sky-bot: #A9B6C3; }
.wx[data-kind="rain"] { --wx-sky-top: #36495F; --wx-sky-bot: #6F88A6; }
.wx[data-kind="snow"] { --wx-sky-top: #5C7594; --wx-sky-bot: #A3BAD3; }
.wx[data-kind="storm"] { --wx-sky-top: #262B40; --wx-sky-bot: #566087; }
.wx__art { position: absolute; right: 4px; top: 14px; width: 160px; height: 120px; pointer-events: none; }
.wx__art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wx__main { position: relative; }
.wx__label { font-size: 13px; letter-spacing: .12em; }
.wx__temp { margin-top: 4px; font-family: var(--serif); font-weight: 700; font-size: 72px; line-height: 1; }
.wx__desc { margin-top: 6px; font-size: 20px; }
.wx__pin {
  position: relative; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.92);
  font-size: 14px; font-weight: 500; color: var(--text);
}
.wx__pin svg { color: var(--accent); }

.upnext { flex: 1 1 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.upnext__row { display: flex; align-items: center; gap: 14px; }
.upnext--cover { position: relative; overflow: hidden; color: #fff; min-height: 210px; }
.upnext--cover .tile__title, .upnext--cover .upnext__name { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.upnext--cover .upnext__line { color: rgba(255,255,255,.92); text-shadow: 0 1px 6px rgba(0,0,0,.25); }
.upnext--cover .round-btn { background: rgba(255,255,255,.9); color: var(--text); }
.upnext--invite { color: #fff; }
.upnext--invite .tile__title, .upnext--invite .upnext__name { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.upnext--invite .upnext__line { color: rgba(255,255,255,.92); }
.invite__act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.invite__btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.invite__btn--ghost { background: rgba(255,255,255,.2); color: #fff; border: 1.5px solid rgba(255,255,255,.85); }
.upnext { transition: opacity .22s ease; }
.upnext.is-fading { opacity: 0; }
.up-dots { display: flex; gap: 4px; margin-top: 10px; }
.up-dot { position: relative; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.up-dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: currentColor; opacity: .35; transition: width .2s, margin .2s, opacity .2s; }
.up-dot[aria-pressed="true"]::after { width: 20px; margin-left: -10px; border-radius: 4px; opacity: .95; }
.upnext--cover .up-dot { color: #fff; }
.upnext:not(.upnext--cover) .up-dot { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .upnext { transition: none; } }
.upnext__thumb { flex: 0 0 76px; width: 76px; height: 76px; border-radius: 20px; }
.upnext__info { flex: 1 1 0; min-width: 0; }
.upnext__name { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.3; }
.upnext__line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.round-btn {
  flex: 0 0 48px; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--card); box-shadow: var(--card-shadow); color: var(--accent);
}
.round-btn--sm { flex-basis: 34px; width: 34px; height: 34px; }

/* ---------- 旅行回顧 ---------- */
.journal { padding: 28px; }
.journal__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow);
  color: var(--accent); font-size: 14px; font-weight: 500; cursor: pointer;
}
.pill-btn[hidden] { display: none; }
.journal__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 290px)); justify-content: start; gap: 20px; margin-top: 22px; }
.trip-card { display: block; min-width: 0; padding: 10px; border-radius: 28px; background: var(--card); box-shadow: var(--card-shadow); }
.trip-card__img { width: 100%; aspect-ratio: 2 / 3; border-radius: 20px; }
.trip-card__body { padding: 12px 6px 4px; }
.trip-card__name { font-family: var(--serif); font-weight: 700; font-size: 18px; line-height: 1.3; }
.trip-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.chip { padding: 3px 12px; border-radius: 999px; background: rgba(28,42,68,.07); font-size: 12px; font-weight: 500; }
.empty { grid-column: 1 / -1; padding: 24px 8px; color: var(--muted); }

/* ---------- 下排 ---------- */
.row-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.col > .tile--xl { flex: 1 1 0; }

.log {
  position: relative; overflow: hidden; height: 100%; min-height: 280px;
  border-radius: 36px; display: flex; flex-direction: column; justify-content: center;
  padding: 32px 36px; color: #fff;
}
.log__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,30,60,.78) 0%, rgba(14,30,60,.2) 80%); }
.log__body { position: relative; max-width: 320px; }
.log__eyebrow { font-size: 12px; letter-spacing: .2em; font-weight: 700; }
.log__quote { margin-top: 12px; font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1.45; }
.log__from { margin-top: 12px; font-size: 14px; }

.budget { padding: 16px 20px; display: flex; align-items: center; gap: 16px; }
.budget__thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 16px; }
.budget__mid { flex: 1 1 0; min-width: 0; }
.budget__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.budget__top strong { font-weight: 700; }
.bar { height: 10px; margin-top: 10px; border-radius: 999px; background: var(--card); box-shadow: var(--inset); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar--over span { background: #C2410C; }
.fab {
  flex: 0 0 52px; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: 0 12px 22px -10px rgba(20,40,80,.55);
}

.quick { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.quick__item { flex: 1 1 100px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.quick__ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--tile); box-shadow: var(--card-shadow); color: var(--accent);
}

.map__inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px; height: 100%; min-height: 300px;
  padding: 24px 24px 24px 30px; border-radius: 36px;
  background: linear-gradient(180deg, #CFE0F5, #E4EEFA); color: #1C2A44;
}
.map__text { flex: 0 0 190px; }
.map__text h2 { font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1.25; }
.map__text p { margin-top: 6px; font-size: 14px; color: #3F4E68; }
.map__btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; background: #fff; box-shadow: 0 10px 20px -10px rgba(20,40,80,.4);
  font-size: 14px; font-weight: 500; color: #1C2A44;
}
.map__btn svg { color: var(--accent); }
.map__svg { flex: 1 1 260px; min-width: 0; }
.map__svg svg { display: block; width: 100%; height: auto; }
.legend { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #3F4E68; }
.legend li { display: flex; align-items: center; gap: 8px; }

/* ---------- 想去的地方 ---------- */
.wish { padding: 40px 0 36px 40px; }
.wish__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-right: 40px; }
.wish__ctrl { display: flex; gap: 12px; }
.circle-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: 1.5px solid rgba(28,42,68,.18); border-radius: 50%; background: var(--card); color: var(--muted); cursor: pointer;
}
.circle-btn--accent { border: 0; background: var(--accent); color: #fff; }
.wish__scroll { display: flex; gap: 20px; margin-top: 32px; padding: 4px 40px 12px 0; overflow-x: auto; }
.wish-card {
  position: relative; flex: 0 0 250px; display: block; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 26px; color: #fff;
}
.wish-card__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,20,40,.8) 0%, rgba(10,20,40,0) 55%); }
.wish-card__text { position: absolute; left: 20px; right: 20px; bottom: 18px; }
.wish-card__text h3 { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.3; }
.wish-card__text p { font-size: 14px; }

/* ---------- 頁尾與外觀設定 ---------- */
.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 0 8px 8px; }
.prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--card); box-shadow: var(--inset); }
.seg button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.swatches { display: flex; gap: 4px; }
.swatch { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.swatch i { display: block; width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); }
.swatch[aria-pressed="true"] i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

/* ---------- 對話框與提示 ---------- */
dialog {
  width: min(420px, calc(100vw - 32px)); padding: 28px; border: 0; border-radius: 32px;
  background: var(--bg); color: var(--text); box-shadow: var(--tile-shadow);
}
dialog::backdrop { background: rgba(20,32,52,.45); }
.dlg { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field input, .field select {
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 18px;
  background: var(--card); box-shadow: var(--inset); font: inherit; font-size: 16px; color: var(--text);
}
.dlg__hint { font-size: 13px; }
.dlg__err { min-height: 0; font-size: 14px; color: #B24A2A; }
.dlg__err:empty { display: none; }
.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; }
.pill-btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* 新增旅行對話框 */
dialog.trip-dlg { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.trip-dlg__body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.trip-dlg__fields { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row .field { min-width: 0; }
.field input { width: 100%; min-width: 0; }
.cover-slot { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.cover-slot__box {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 2 / 3; border-radius: 22px; overflow: hidden; cursor: pointer;
  background: var(--card); box-shadow: var(--inset); color: var(--accent);
  outline: 2px dashed rgba(85,98,122,.35); outline-offset: -10px;
}
.cover-slot__box:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.cover-slot__box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--card); }
.cover-slot__empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; text-align: center; }
.cover-slot__empty small { font-size: 12px; font-weight: 400; color: var(--muted); }
.cover-slot__act { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cover-slot__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; color: var(--muted); }
.palette-pick { border: 0; margin: 0; padding: 0; }
.kind-pick { border: 0; margin: 0; padding: 0; }
.kind-pick legend { padding: 0; margin-bottom: 6px; }
.kind-pick .seg { align-self: flex-start; }
.kind-pick .seg label { position: relative; cursor: pointer; }
.kind-pick .seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); }
.kind-pick .seg input:checked + span { background: var(--accent); color: #fff; }
.kind-pick .seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.palette-pick legend { padding: 0; margin-bottom: 6px; }
.palette-pick__list { display: flex; flex-wrap: wrap; gap: 10px; }
.palette-pick__item { position: relative; cursor: pointer; }
.palette-pick__item span { display: block; width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg); }
.palette-pick__item input:checked + span { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.palette-pick__item input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 5px; }
@media (max-width: 640px) {
  dialog.trip-dlg { padding: 22px 18px; border-radius: 28px; }
  .trip-dlg__body { grid-template-columns: 1fr; gap: 16px; }
  .cover-slot__box { width: 140px; }
  .field-row { grid-template-columns: 1fr; }
}
.dlg__act { display: flex; justify-content: flex-end; gap: 12px; }
.btn-primary {
  min-height: 44px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer;
  box-shadow: 0 12px 22px -10px rgba(20,40,80,.55);
}
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 50; transform: translate(-50%, 12px);
  max-width: calc(100vw - 32px); padding: 10px 20px; border-radius: 999px;
  background: #1C2A44; color: #fff; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 響應式 ---------- */
@media (max-width: 1180px) {
  .row-hero { grid-template-columns: minmax(0, 1fr); }
  .col-side { flex-direction: row; }
  .col-side > * { flex: 1 1 0; }
  .row-bottom { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 899px) {
  .app { display: block; padding: 16px 16px 112px; }
  .main { gap: 16px; }
  .side { display: none; }
  .tabbar {
    position: fixed; left: 16px; right: 16px; bottom: 12px; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; padding: 10px;
    border-radius: 36px; background: var(--tile); box-shadow: var(--tile-shadow);
  }
  .tabbar__item {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 60px; border-radius: 24px; color: var(--muted); font-size: 11px; font-weight: 500;
  }
  .tabbar__item[aria-current="page"] { background: var(--accent); color: #fff; box-shadow: 0 12px 22px -10px rgba(20,40,80,.55); }
  .toast { bottom: 108px; }

  .tile, .tile--xl { border-radius: 36px; padding: 8px; }
  .tile--md { border-radius: 32px; }
  .tile--sm { border-radius: 30px; padding: 16px; }
  .topbar h1 { font-size: 28px; }
  .topbar__tools { flex-basis: 100%; max-width: none; }
  .searchbox { min-height: 52px; }
  .add-trip { min-height: 52px; width: 52px; padding: 0; justify-content: center; }
  .add-trip__text { display: none; }

  .hero { min-height: 470px; border-radius: 30px; }
  .hero__body { padding: 30px 26px 0; }
  .hero__en { font-size: 19px; }
  .hero__meta { font-size: 15px; }
  .btn-glass { min-height: 48px; padding: 0 22px; margin-top: 20px; }
  .hero__thumbs { padding: 0 26px 26px; gap: 10px; }
  .hero--poster { min-height: 0; display: flex; flex-direction: column; }
  .hero--poster .hero__body { max-width: none; padding-bottom: 8px; }
  .hero__poster { position: relative; order: 2; top: auto; bottom: auto; right: auto; width: min(72%, 280px); height: auto; margin: 8px auto 28px; }
  .thumb { width: 52px; height: 52px; }
  .thumb--plus { width: 38px; height: 38px; }

  .col-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .wx { min-height: 200px; padding: 18px; border-radius: 26px; }
  .wx__temp { font-size: 52px; }
  .wx__desc { font-size: 16px; }
  .wx__pin { padding: 5px 10px 5px 8px; font-size: 11px; gap: 4px; max-width: 100%; white-space: nowrap; overflow: hidden; }
  /* 手機上卡片窄：天氣圖示縮小放右上角，文字不被壓住 */
  .wx__art { width: 60px; height: 45px; top: 12px; right: 8px; }
  .wx__label { padding-right: 52px; font-size: 12px; letter-spacing: .02em; }
  .wx__temp { margin-top: 18px; }
  .upnext__row { flex-direction: column; align-items: stretch; gap: 8px; }
  .upnext__thumb { flex-basis: 64px; width: 100%; height: 64px; border-radius: 16px; }
  .upnext__row .round-btn { display: none; }
  .upnext__name { font-size: 17px; }
  .upnext__line { font-size: 12px; }

  .journal { padding: 20px 0 20px 20px; }
  .journal__head { padding-right: 20px; }
  .tile__title--lg { font-size: 24px; }
  .journal__grid { display: flex; gap: 14px; margin-top: 12px; padding: 6px 20px 10px 0; overflow-x: auto; }
  .trip-card { flex: 0 0 190px; padding: 8px; border-radius: 24px; }
  .trip-card__img { aspect-ratio: 2 / 3; border-radius: 18px; }
  .trip-card__name { font-size: 16px; }

  .row-bottom { gap: 16px; }
  .col { gap: 16px; }
  .log { min-height: 240px; padding: 26px; border-radius: 30px; }
  .log__body { max-width: 240px; }
  .log__quote { font-size: 22px; }
  .budget { padding: 14px 16px; gap: 14px; }
  .budget__thumb { display: none; }
  .fab { flex-basis: 48px; width: 48px; height: 48px; }
  .quick { flex-wrap: nowrap; gap: 8px; padding: 0 4px; }
  .quick__item { flex-basis: 0; font-size: 13px; gap: 8px; }
  .quick__ico { width: 68px; height: 68px; }
  .quick__ico svg { width: 28px; height: 28px; }
  .map__inner { min-height: 0; padding: 22px 18px 18px; border-radius: 30px; }
  .map__text { flex-basis: 100%; }
  .legend { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }

  .wish { padding: 28px 0 24px 20px; border-radius: 30px 0 0 30px; }
  .wish__head { padding-right: 20px; }
  .wish__ctrl { display: none; }
  .wish__scroll { gap: 14px; margin-top: 20px; padding: 4px 20px 8px 0; }
  .wish-card { flex-basis: 200px; border-radius: 22px; }
  .wish-card__text { left: 16px; right: 16px; bottom: 14px; }
  .wish-card__text h3 { font-size: 21px; }
  .wish-card__text p { font-size: 13px; }
  .footer { padding: 4px 8px 0; }
}

/* ============================================================
   單趟旅行頁（trip.html）
   ============================================================ */
.tr-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
/* 頂部：封面插圖鋪在右邊當背景，左邊用旅行主題深色漸層蓋住，文字與資訊疊在上面。
   顏色、圖片、露出位置由 trip.js 用 --tr-* 變數帶進來 */
.tr-hero {
  min-height: 340px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 24px;
  color: #fff;
  background:
    linear-gradient(90deg, var(--tr-dark) 0%, var(--tr-dark) 46%, var(--tr-dark-90) 56%, var(--tr-dark-60) 70%, var(--tr-dark-0) 92%),
    var(--tr-img) right var(--tr-pos, 30%) / 56% auto no-repeat,
    var(--tr-dark);
}
.tr-hero--plain { background: linear-gradient(90deg, var(--tr-dark) 0%, var(--tr-dark-90) 46%, var(--tr-dark-0) 100%), var(--tr-grad); }
.tr-hero--missing { min-height: 300px; }
.tr-hero .hero__body { flex: 0 1 40%; min-width: 0; padding: 32px 0 32px 40px; text-shadow: 0 1px 10px rgba(0,0,0,.3); }
.tr-hero .hero__title { margin-top: 6px; font-size: clamp(40px, 4.2vw, 60px); }
.tr-hero .hero__en { font-size: 18px; }
.tr-hero .hero__meta { margin-top: 10px; font-size: 15px; }
.tr-count { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.tr-count strong { font-family: var(--serif); font-weight: 700; font-size: 40px; line-height: 1; }
.tr-count span { font-size: 15px; font-weight: 500; }
.tr-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.tr-stats li { padding: 5px 14px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 13px; font-weight: 500; text-shadow: none; }

/* 頂部中間的天氣、匯率、時差：透明、無框 */
.tr-info {
  --wx-sky-top: var(--tr-dark);
  flex: 0 1 24%; min-width: 0; display: flex; flex-direction: column; gap: 18px;
  padding: 24px 0; text-shadow: 0 1px 10px rgba(0,0,0,.45);
}
.tr-info__label { font-size: 12px; font-weight: 700; letter-spacing: .14em; opacity: .8; }
.tr-info__row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.tr-info__art { flex: 0 0 auto; display: inline-flex; width: 64px; height: 48px; margin-left: -6px; }
.tr-info__art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tr-info__big { font-family: var(--serif); font-weight: 700; font-size: 40px; line-height: 1.1; }
.tr-info__mid { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.35; }
.tr-info__sub { font-size: 14px; }
.tr-info__sub b { font-variant-numeric: tabular-nums; }
.tr-utc { font-size: 12px; opacity: .8; }
.tr-missing { padding-bottom: 44px; }

/* 錨點按鈕列：捲動時黏在畫面上方 */
.tr-jump {
  position: sticky; top: 12px; z-index: 30;
  display: flex; gap: 8px; padding: 8px; overflow-x: auto;
  border-radius: 999px; background: var(--tile); box-shadow: var(--card-shadow);
  scrollbar-width: none;
}
.tr-jump::-webkit-scrollbar { display: none; }
.tr-jump__btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.tr-jump__btn svg { color: var(--accent); }
.tr-jump__btn[aria-current="true"] { background: var(--accent); color: #fff; }
.tr-jump__btn[aria-current="true"] svg { color: #fff; }

/* 段落 */
.tr-sec { padding: 28px; scroll-margin-top: 88px; }
.tr-sec__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tr-sec__title { margin-bottom: 4px; }
.tr-sec__sub { margin-top: 2px; }
.tr-sec code, .tr-empty code { padding: 1px 6px; border-radius: 6px; background: rgba(28,42,68,.07); font-size: 13px; }
.tr-empty { margin-top: 14px; padding: 22px; border-radius: 24px; box-shadow: var(--inset); color: var(--muted); font-size: 14px; }
.tr-note { margin-top: 8px; font-size: 13px; color: var(--muted); }
.tr-sample { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #FDE8C8; color: #8A4B10; font-size: 11px; font-weight: 700; vertical-align: middle; }

.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 20px; margin-top: 18px; }
.tr-card { min-width: 0; padding: 22px; border-radius: 28px; background: var(--card); box-shadow: var(--card-shadow); }
.tr-card__label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.tr-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 500; }

/* 行前準備 */
.tr-prep { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 18px; align-items: start; }
.tr-prep--one { grid-template-columns: minmax(0, 1fr); }
.tr-log { min-height: 200px; margin-top: 18px; }
.tr-fx__calc { margin-top: 12px; }
.tr-fx__out { margin-top: 8px; font-size: 18px; font-weight: 700; color: var(--accent); }
.tr-todo__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tr-todo__list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-todo__item { display: flex; align-items: center; gap: 8px; }
.tr-todo__item label { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: 15px; }
.tr-todo__item input { flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--accent); }
.tr-todo__item input:checked + span { color: var(--muted); text-decoration: line-through; }
.tr-todo__add { display: flex; gap: 8px; margin-top: 12px; }
.tr-todo__add input {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 16px; border: 0; border-radius: 16px;
  background: var(--bg); box-shadow: var(--inset); font: inherit; font-size: 15px; color: var(--text);
}
.tr-icon-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.tr-icon-btn:hover { background: rgba(28,42,68,.07); }
.tr-icon-btn--accent { background: var(--accent); color: #fff; }
.tr-icon-btn--accent:hover { background: var(--accent); opacity: .9; }

/* 航班 */
.tr-flight__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tr-flight__no { font-family: var(--serif); font-size: 24px; line-height: 1.2; letter-spacing: .03em; }
.tr-flight__airline { font-size: 14px; font-weight: 500; color: var(--muted); }
.tr-flight__gap { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: rgba(28,42,68,.07); font-size: 12px; font-weight: 500; }
.tr-flight__date { margin-left: auto; font-size: 14px; font-weight: 500; }
.tr-flight__route { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; margin-top: 20px; }
.tr-flight__end { display: flex; flex-direction: column; min-width: 0; }
.tr-flight__end--r { text-align: right; }
.tr-flight__code { font-family: var(--serif); font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: .04em; }
.tr-flight__end .muted { font-size: 13px; }
/* 中間：航線（兩端圓點＋虛線＋飛機），下面一顆「飛行時間 · 直飛」膠囊 */
.tr-flight__mid { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding-top: 12px; }
.tr-flight__line { align-self: stretch; display: flex; align-items: center; gap: 6px; color: var(--accent); }
.tr-flight__line span { flex: 1 1 0; border-top: 2px dashed rgba(28,42,68,.25); }
.tr-flight__line i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--accent); }
.tr-flight__pill { max-width: 100%; padding: 4px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-flight__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed rgba(28,42,68,.15); }
.tr-flight__foot > div { display: flex; flex-direction: column; min-width: 0; }
.tr-flight__arr { text-align: right; align-items: flex-end; }
.tr-flight__time { font-size: 24px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.tr-flight__time sup { margin-left: 2px; font-size: 11px; color: #B24A2A; }
.tr-flight__foot .muted { font-size: 13px; }
.tr-flight__meta { margin-top: 6px; font-size: 13px; }


/* 住宿 */
.tr-stay__name { margin-top: 12px; font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; }
.tr-stay__name + .muted { margin-top: 4px; }
.tr-stay__dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 12px; }
.tr-stay__dates > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 18px; box-shadow: var(--inset); }
.tr-stay__dates strong { font-size: 17px; }
.tr-stay__dates .muted { font-size: 13px; }
.tr-stay__map { margin-top: 12px; }

/* 每日行程 */
.tr-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 18px; }
.tr-day { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 88px; }
.tr-day.is-today { box-shadow: var(--card-shadow), 0 0 0 3px var(--accent); }
.tr-day__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tr-day__no { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.tr-day__date { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.3; }
.tr-day__wx { font-size: 13px; text-align: right; }
.tr-day__empty { padding: 14px; border-radius: 18px; box-shadow: var(--inset); color: var(--muted); font-size: 13px; text-align: center; }
.tr-ev__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tr-ev { display: grid; grid-template-columns: 46px 28px minmax(0, 1fr) auto; align-items: start; gap: 6px; font-size: 14px; }
.tr-ev__time { padding-top: 3px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.tr-ev__ico { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(28,42,68,.07); color: var(--accent); }
.tr-ev--auto .tr-ev__ico { background: var(--accent); color: #fff; }
.tr-ev__body { display: flex; flex-direction: column; min-width: 0; padding-top: 3px; }
.tr-ev__title { font-weight: 500; overflow-wrap: anywhere; }
.tr-ev__place { font-size: 12px; overflow-wrap: anywhere; }
.tr-ev__map { display: inline-flex; vertical-align: middle; color: var(--accent); }

/* 行程輸入：新增 / 修改按鈕與視窗 */
.tr-edit { width: 36px; height: 36px; margin: -6px -8px -6px 0; }
.tr-ev .tr-edit { margin: -4px -8px -4px 0; opacity: .55; }
.tr-ev:hover .tr-edit, .tr-edit:focus-visible { opacity: 1; }
.tr-day__add {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin-top: auto; padding: 0 14px;
  border: 1.5px dashed rgba(28,42,68,.22); border-radius: 18px; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
}
.tr-day__add:hover { border-color: var(--accent); color: var(--accent); }
.tr-tabs { align-self: flex-start; }
.tr-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.tr-form .field select { width: 100%; }
dialog .tr-del { margin-right: auto; color: #B24A2A; }
.tr-backup { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tr-backup .pill-btn { cursor: pointer; }
.tr-backup label:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }

/* 預算與記帳 */
.tr-add { display: inline-flex; align-items: center; gap: 6px; }
.tr-money { margin-top: 18px; }
.tr-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tr-stack { display: flex; height: 12px; margin-top: 16px; border-radius: 999px; overflow: hidden; background: rgba(28,42,68,.08); }
.tr-stack span { display: block; height: 100%; }
.tr-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 0; font-size: 13px; }
.tr-legend li { display: inline-flex; align-items: center; gap: 6px; }
.tr-legend i, .tr-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tr-claim { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip--claim { background: rgba(31,106,79,.14); color: #1F6A4F; }
.tr-claimtag { padding: 0 6px; border-radius: 6px; background: rgba(31,106,79,.14); color: #1F6A4F; font-size: 11px; font-weight: 700; }
.tr-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.tr-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.tr-explist { margin-top: 18px; }
.tr-expday { margin-top: 14px; }
.tr-expday__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 14px; font-size: 14px; }
.tr-exp__list { list-style: none; margin: 6px 0 0; padding: 0; }
.tr-exp { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 40px; align-items: center; gap: 12px; padding: 6px 4px 6px 14px; border-bottom: 1px solid rgba(28,42,68,.08); font-size: 14px; }
.tr-exp__main { display: flex; flex-direction: column; min-width: 0; }
.tr-exp__note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-exp__sub { font-size: 12px; }
.tr-exp__amt { font-variant-numeric: tabular-nums; }
.tr-exp .tr-edit { margin: 0; opacity: .55; }
.tr-exp:hover .tr-edit, .tr-exp .tr-edit:focus-visible { opacity: 1; }

@media (max-width: 1180px) {
  .tr-prep { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  /* 手機：插圖鋪滿整塊、整體壓暗，文字在上、資訊在下 */
  .tr-hero {
    min-height: 0; flex-direction: column; align-items: stretch; gap: 0;
    background:
      linear-gradient(180deg, var(--tr-dark-90) 0%, var(--tr-dark-90) 55%, var(--tr-dark-60) 100%),
      var(--tr-img) center var(--tr-pos, 30%) / cover no-repeat,
      var(--tr-dark);
  }
  .tr-hero--plain { background: linear-gradient(180deg, var(--tr-dark-90), var(--tr-dark-60)), var(--tr-grad); }
  .tr-hero .hero__body { flex: 0 0 auto; padding: 26px 24px 0; }
  .tr-info { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; gap: 14px 24px; padding: 20px 24px 26px; }
  .tr-info__big { font-size: 32px; }
  .tr-info__mid { font-size: 17px; }
  .tr-count strong { font-size: 34px; }
  .tr-jump { top: 8px; }
  .tr-jump__btn { padding: 0 14px; font-size: 13px; }
  .tr-sec { padding: 20px 16px; scroll-margin-top: 76px; }
  .tr-grid, .tr-days { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tr-card { padding: 18px; border-radius: 24px; }
  .tr-flight__code { font-size: 28px; letter-spacing: .02em; }
  .tr-flight__time { font-size: 20px; }
  .tr-flight__route { gap: 8px; }
  .tr-flight__pill { padding: 3px 9px; font-size: 12px; overflow: visible; max-width: none; }
  .tr-flight__line { gap: 4px; }
  .tr-flight__date { flex-basis: 100%; margin-left: 0; }
  .tr-exp { padding-left: 6px; }
  .tr-expday__head { padding: 0 6px; }
}
