:root {
  --cream: #f6efe2;
  --paper: #fffaf0;
  --ink: #10244a;
  --ink-soft: #52607a;
  --line: #e2d8c4;
  --navy: #10244a;
  --navy-2: #1d3a6d;
  --coral: #d9431f;
  --coral-hover: #bd3614;
  --sun: #f8b65a;
  --on-accent: #ffffff;
  --good: #116149;
  --good-bg: #d8efe3;
  --warn: #7c5200;
  --warn-bg: #fbeac2;
  --bad: #a4361a;
  --bad-bg: #fbe2d8;
  --field: #ffffff;
  --shadow-1: 0 2px 6px rgba(16, 36, 74, .07);
  --shadow-2: 0 18px 44px rgba(16, 36, 74, .18);
  --serif: "Noto Serif TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --mono: Consolas, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #0e1a33;
    --paper: #182746;
    --ink: #f1f4fa;
    --ink-soft: #aab6cc;
    --line: #2d3f63;
    --coral: #ff7f58;
    --coral-hover: #ff9a7a;
    --on-accent: #2a0d03;
    --good: #84e0ba;
    --good-bg: #173c30;
    --warn: #f4cf7a;
    --warn-bg: #3a2e12;
    --bad: #ffab92;
    --bad-bg: #4a2318;
    --field: #101d38;
    --shadow-1: none;
    --shadow-2: 0 18px 44px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }

.defs { position: absolute; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 640px;
  padding-bottom: 170px;
  background: var(--navy);
  color: #fdf6ea;
}
.hero-hotels .hero-photo { object-position: 50% 42%; }
.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 18, 42, .55) 0%, rgba(8, 18, 42, .05) 34%, rgba(8, 18, 42, 0) 60%, rgba(8, 18, 42, .45) 100%),
    linear-gradient(90deg, rgba(8, 18, 42, 0) 30%, rgba(8, 18, 42, .5) 62%);
}
.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .1em;
  text-decoration: none;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f0603a;
  color: #fff;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}
.page-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(8, 18, 42, .55);
  backdrop-filter: blur(6px);
}
.page-tabs a {
  min-width: 76px;
  padding: 7px 18px;
  border-radius: 999px;
  color: #eef2f9;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.page-tabs a:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.page-tabs a[aria-current="page"] { background: #fdf6ea; color: #10244a; }
.nav-links { display: flex; gap: 28px; font-size: 15px; }
.nav-links a { padding: 6px 0; color: #eef2f9; text-decoration: none; }
.nav-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 6px; }

.hero-copy { width: min(580px, 100%); margin-left: auto; padding-top: 44px; text-shadow: 0 2px 16px rgba(8, 18, 42, .6); }
.eyebrow { color: var(--sun); font-size: 15px; font-weight: 700; letter-spacing: .12em; }
.hero h1 {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: .02em;
}
.lede { margin-top: 16px; color: #f2f5fa; font-size: 18px; }

/* Search */
.search-section { position: relative; z-index: 3; margin-top: -130px; }
.search {
  padding: 20px 24px 24px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-2);
}
.search-options { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 16px; }
.switch { display: flex; flex-wrap: wrap; gap: 8px; }
.switch button {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.switch button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; }

.search-grid {
  display: grid;
  grid-template-columns: 1.3fr 44px 1.3fr 1fr 1fr 148px;
  gap: 10px;
  align-items: end;
}
.hotel-grid { grid-template-columns: 1.6fr 1fr 1fr .8fr 148px; }
.search-grid.one-way { grid-template-columns: 1.3fr 44px 1.3fr 1.4fr 148px; }
.field { display: grid; gap: 4px; min-width: 0; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
}
.field select {
  width: 100%;
  min-height: 52px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
}
.field input::placeholder { color: var(--ink-soft); font-weight: 400; opacity: .85; }
.field input[aria-invalid="true"] { border-color: var(--coral); }
.swap {
  width: 44px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}
.swap:hover { border-color: var(--ink); }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--coral);
  color: var(--on-accent);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.primary:hover { background: var(--coral-hover); }
.primary:disabled { opacity: .65; cursor: progress; }
.form-error { margin-top: 12px; color: var(--bad); font-size: 15px; font-weight: 500; }

.trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 28px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 15px;
}
.trust li::before { content: "✓"; margin-right: 6px; color: var(--good); font-weight: 700; }

.schedule {
  margin-top: 20px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.schedule-title { color: var(--coral); font-size: 14px; font-weight: 700; letter-spacing: .1em; }
.schedule ul { display: flex; flex-wrap: wrap; gap: 4px 32px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 15px; }
.schedule strong { margin-right: 8px; }
.schedule-note { margin-top: 6px; color: var(--ink-soft); font-size: 14px; }

.notice {
  margin-top: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-radius: 12px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 15px;
}
.notice strong { font-weight: 700; }

/* Sections */
.band { padding-top: 64px; }
.kicker { color: var(--coral); font-size: 14px; font-weight: 700; letter-spacing: .14em; }
.band h2, .how h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: clamp(25px, 3.4vw, 34px);
  font-weight: 700;
  line-height: 1.35;
}
.band-head { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.updated { color: var(--ink-soft); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Posters */
.posters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.poster {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.posters.posters-3 { grid-template-columns: repeat(3, 1fr); }
.poster-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--navy-2); }
.poster-body { display: grid; gap: 2px; padding: 14px 16px 16px; }
.poster-city { font-family: var(--serif); font-size: 22px; font-weight: 700; line-height: 1.3; }
.poster-airport { color: var(--ink-soft); font-size: 14px; }
.poster-pitch { margin-top: 6px; font-size: 14px; line-height: 1.55; }
.poster-price { margin-top: 8px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.poster-price small { color: var(--ink-soft); font-size: 13px; font-weight: 500; }
.poster-price.pending { color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.poster-date { color: var(--ink-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.poster:hover { box-shadow: var(--shadow-2); }
.poster[aria-pressed="true"] { border-color: var(--coral); }

/* Results */
.result-head { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.result-tools { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--coral); }
.select-field { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 14px; }
.select-field select {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.airlines { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; }

.insight {
  margin-bottom: 14px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
}
.insight-low { background: var(--good-bg); color: var(--good); }
.insight-typical { background: var(--paper); color: var(--ink-soft); }
.insight-high { background: var(--bad-bg); color: var(--bad); }

.results { display: grid; gap: 14px; }
.ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-1);
}
.ticket-main { min-width: 0; padding: 20px 24px; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.route-code { font-family: var(--mono); font-size: 27px; font-weight: 700; letter-spacing: .04em; }
.route-arrow { color: var(--coral); font-size: 20px; }
.route-times { color: var(--ink-soft); font-size: 15px; font-variant-numeric: tabular-nums; }
.route-city { margin-bottom: 12px; color: var(--ink-soft); font-size: 15px; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.facts li { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.airline-logo { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; background: #fff; }

.ticket-stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 18px 20px;
  border-left: 2px dashed var(--line);
}
.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  left: -11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cream);
}
.ticket-stub::before { top: -11px; }
.ticket-stub::after { bottom: -11px; }
.price { font-size: 28px; font-weight: 700; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price small { color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.price-note { color: var(--ink-soft); font-size: 13px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.badge-low { background: var(--good-bg); color: var(--good); }
.badge-typical { background: var(--cream); color: var(--ink-soft); }
.badge-high { background: var(--bad-bg); color: var(--bad); }
.book { width: 100%; min-height: 44px; margin-top: 8px; font-size: 16px; }

.hotel-card { grid-template-columns: 220px minmax(0, 1fr) 232px; }
.hotel-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 190px;
  aspect-ratio: auto;
  object-fit: cover;
  background: var(--navy-2);
}
.stars { color: #c98a14; font-size: 14px; letter-spacing: .08em; }
.hotel-name { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.4; }
.hotel-card .route-city { margin-bottom: 8px; }
.hotel-amenities { margin-top: 6px; color: var(--ink-soft); font-size: 14px; }
.hotel-sources { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.hotel-sources li {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cross-sell {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-radius: 18px;
  background: var(--navy);
  color: #fdf6ea;
  text-decoration: none;
}
.cross-sell strong { display: block; font-family: var(--serif); font-size: 23px; line-height: 1.4; }
.cross-sell span span { color: #c9d3e6; font-size: 16px; }
.cross-sell-action {
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--sun);
  color: #10244a;
  font-weight: 700;
  white-space: nowrap;
}
.cross-sell:hover .cross-sell-action { background: #ffc87a; }

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 20px;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink-soft);
  text-align: center;
}
.empty strong { color: var(--ink); font-family: var(--serif); font-size: 21px; }
.empty .primary { min-height: 46px; }
.ghost {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.skeleton { height: 130px; border-radius: 16px; background: var(--paper); opacity: .7; }

/* How it works */
.how { margin-top: 72px; padding: 60px 0; background: var(--navy); color: #fdf6ea; }
.how .kicker { color: var(--sun); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 28px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; align-content: start; gap: 4px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  color: var(--sun);
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.1;
}
.steps strong { font-size: 19px; }
.steps span { color: #c9d3e6; font-size: 16px; }

/* FAQ */
.faq h2 { margin-bottom: 20px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { padding: 15px 4px; font-size: 17px; font-weight: 500; cursor: pointer; }
.faq details p { padding: 0 4px 16px; color: var(--ink-soft); font-size: 16px; }

/* Footer */
.footer { margin-top: 72px; padding: 36px 0; background: var(--navy); color: #fdf6ea; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px 56px; justify-content: space-between; }
.tagline { margin-top: 6px; color: var(--sun); font-size: 15px; }
.footer-notes { max-width: 600px; color: #c9d3e6; font-size: 14px; }
.footer-notes p + p { margin-top: 4px; }
.credits { margin-top: 10px; }
.credits summary { cursor: pointer; }
.credits ul { margin: 8px 0; padding-left: 18px; }
.credits a { color: #fdf6ea; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
main :focus-visible { outline-color: var(--coral); }

@media (max-width: 1000px) {
  .hotel-grid { grid-template-columns: 1.4fr 1fr 1fr .8fr; }
  .hotel-card { grid-template-columns: 180px minmax(0, 1fr) 208px; }
  .search-grid { grid-template-columns: 1fr 44px 1fr 1fr 1fr; }
  .search-grid.one-way { grid-template-columns: 1fr 44px 1fr 1fr; }
  .search-submit { grid-column: 1 / -1; }
  .posters { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .nav-links { display: none; }
  .page-tabs a { min-width: 62px; padding: 6px 14px; font-size: 15px; }
  .hotel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-city { grid-column: 1 / -1; }
  .hotel-card { grid-template-columns: minmax(0, 1fr); }
  .hotel-photo { height: 170px; min-height: 0; }
  .cross-sell { padding: 20px; }
  .cross-sell strong { font-size: 20px; }
  .hero { min-height: 0; padding-bottom: 120px; }
  .hero-photo { object-position: 16% 30%; }
  .hero::after { background: linear-gradient(180deg, rgba(8, 18, 42, .62) 0%, rgba(8, 18, 42, .42) 55%, rgba(8, 18, 42, .55) 100%); }
  .hero-copy { margin-left: 0; padding-top: 20px; }
  .lede { font-size: 17px; }
  .search-section { margin-top: -96px; }
  .search { padding: 16px; }
  .search-grid, .search-grid.one-way { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-from, .field-to { grid-column: 1 / -1; }
  .field input[type="date"] { padding: 0 8px; font-size: 15px; }
  .poster-price small { display: block; }
  .poster-pitch { font-size: 13px; }
  .swap { display: none; }
  .band { padding-top: 48px; }
  .posters { gap: 12px; }
  .posters.posters-3 { grid-template-columns: minmax(0, 1fr); }
  .poster-body { padding: 10px 12px 12px; }
  .poster-city { font-size: 19px; }
  .poster-price { font-size: 19px; }
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .ticket-main { padding: 16px; }
  .ticket-stub { padding: 16px; border-left: 0; border-top: 2px dashed var(--line); }
  .ticket-stub::before, .ticket-stub::after { top: -11px; bottom: auto; }
  .ticket-stub::after { left: auto; right: -11px; }
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .how { margin-top: 56px; padding: 44px 0; }
  .footer { margin-top: 56px; }
}

@media (prefers-reduced-motion: no-preference) {
  .poster { transition: box-shadow .18s ease, transform .18s ease; }
  .poster:hover { transform: translateY(-3px); }
  .primary, .chip { transition: background-color .15s ease, border-color .15s ease; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
