:root {
  --ink: #082332;
  --ink-soft: #395663;
  --ocean: #087d88;
  --ocean-deep: #062b3d;
  --aqua: #27c7c4;
  --sun: #ffb84d;
  --coral: #ff6d57;
  --paper: #f7fbfc;
  --white: #ffffff;
  --line: #cfe0e5;
  --shadow: 0 16px 44px rgba(6, 43, 61, .12);
  --radius-lg: 24px;
  --radius-md: 16px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 90% 12%, rgba(39, 199, 196, .13), transparent 24rem),
    var(--paper);
  font-size: 16px;
  line-height: 1.65;
}

button, a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

a { color: inherit; }

.trip-header {
  position: relative;
  min-height: 224px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--white);
  background: var(--ocean-deep);
}

.trip-header__photo,
.trip-header__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.trip-header__photo { object-fit: cover; object-position: center 56%; }

.trip-header__shade {
  background: linear-gradient(90deg, rgba(3, 28, 41, .92), rgba(3, 28, 41, .45) 65%, rgba(3, 28, 41, .12));
}

.trip-header__content {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 30px;
}

.trip-header h1 {
  max-width: 720px;
  margin: 3px 0 2px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -.04em;
}

.trip-header p:last-child { margin: 6px 0 0; font-size: 1.02rem; }

.photo-credit {
  position: absolute;
  right: 12px;
  bottom: 8px;
  z-index: 1;
  font-size: .72rem;
  opacity: .72;
  text-decoration: none;
}

.eyebrow,
.label {
  margin: 0;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow { color: var(--aqua); }
.trip-header .eyebrow { color: #8ff2ef; }
.label { color: var(--ocean); }

.day-tabs {
  position: sticky;
  top: 0;
  z-index: 1000;
  isolation: isolate;
  background: rgba(247, 251, 252, .9);
  border-bottom: 1px solid rgba(207, 224, 229, .8);
  backdrop-filter: blur(14px);
}

.day-tabs__inner {
  display: flex;
  gap: 8px;
  width: min(1180px, 100%);
  margin: auto;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.day-tabs__inner::-webkit-scrollbar { display: none; }

.day-tab {
  flex: 1 0 132px;
  min-height: 56px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .8);
  cursor: pointer;
  text-align: left;
}

.day-tab strong,
.day-tab span { display: block; }
.day-tab strong { color: var(--ink); font-size: .98rem; }
.day-tab span { font-size: .78rem; }

.day-tab[aria-selected="true"] {
  color: var(--white);
  border-color: var(--ocean-deep);
  background: var(--ocean-deep);
  box-shadow: 0 8px 24px rgba(6, 43, 61, .22);
}

.day-tab[aria-selected="true"] strong { color: var(--white); }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 72px;
}

.day-overview {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
}

.day-overview h2 {
  margin: 3px 0 4px;
  font-size: clamp(1.65rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -.03em;
}

.day-summary { max-width: 720px; margin: 0; color: var(--ink-soft); }

.day-metrics { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.metric {
  min-width: 92px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.metric strong,
.metric span { display: block; }
.metric strong { line-height: 1.2; font-size: 1rem; }
.metric span { color: var(--ink-soft); font-size: .74rem; }

.route-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 20px;
  align-items: start;
}

.map-card,
.schedule-card,
.optional-section,
.notes-grid,
.trip-facts {
  min-width: 0;
  border: 1px solid rgba(207, 224, 229, .9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.map-card,
.schedule-card,
.optional-section,
.notes-grid { padding: 20px; }

.schedule-card { position: sticky; top: 88px; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading--compact { margin-bottom: 12px; }

.section-heading h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.3;
}

.ghost-button,
.text-button {
  border: 0;
  color: var(--ocean);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.ghost-button {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.map-frame-wrap {
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  height: 390px;
  border-radius: 18px;
  background: #dcecef;
}

.map-frame {
  width: 100%;
  height: 100%;
}

.map-status {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--white);
  background: rgba(6, 43, 61, .9);
  font-size: .82rem;
  pointer-events: none;
}

.map-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid var(--white);
  border-radius: 50%;
  color: var(--white);
  background: var(--ocean);
  box-shadow: 0 3px 10px rgba(6, 43, 61, .35);
  font-size: .76rem;
  font-weight: 900;
}

.map-marker--optional { background: var(--coral); }

.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 12px 14px; line-height: 1.55; }
.leaflet-popup-content strong { color: var(--ink); font-size: .95rem; }
.leaflet-control-attribution { font-size: 10px; }

.route-stop[aria-current="true"] {
  color: var(--white);
  border-color: var(--ocean);
  background: var(--ocean);
}

.route-stop[aria-current="true"] .route-stop__number {
  color: var(--ocean);
  background: var(--white);
}

.route-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0 6px;
  overflow: visible;
}

.route-stop {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
  font: inherit;
}

.route-stop:not(:last-child)::after {
  content: "›";
  position: absolute;
  right: -8px;
  color: var(--ocean);
}

.route-stop__number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--white);
  background: var(--ocean);
  font-size: .72rem;
}

.route-stop--optional { border-color: rgba(255, 109, 87, .5); }
.route-stop--optional .route-stop__number { background: var(--coral); }

.map-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; }

.map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 15px;
  border-radius: 12px;
  color: var(--ocean-deep);
  background: var(--white);
  border: 1px solid var(--line);
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.map-link[aria-pressed="true"] {
  color: var(--white);
  background: var(--ocean-deep);
  border-color: var(--ocean-deep);
}

.microcopy {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: .78rem;
  line-height: 1.45;
}

.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  color: #075455;
  background: #d8f8f3;
  font-size: .78rem;
  font-weight: 800;
}

.status-pill--warn { color: #8c2e20; background: #ffe3dc; }

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

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px 16px minmax(0, 1fr);
  gap: 10px;
  min-height: 68px;
}

.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 81px;
  top: 28px;
  bottom: -2px;
  width: 2px;
  background: var(--line);
}

.timeline-time {
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.timeline-dot {
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: 7px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--ocean);
  box-shadow: 0 0 0 2px var(--ocean);
}

.timeline-item--optional .timeline-dot { background: var(--coral); box-shadow: 0 0 0 2px var(--coral); }

.timeline-content { padding-bottom: 15px; }
.timeline-content strong { display: block; line-height: 1.35; }
.timeline-content p { margin: 3px 0 0; color: var(--ink-soft); font-size: .86rem; line-height: 1.45; }
.timeline-content .late { color: #a53928; font-weight: 800; }

.optional-section,
.notes-grid,
.trip-facts { margin-top: 20px; }

.section-intro { margin: -7px 0 16px; color: var(--ink-soft); }

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.option-card {
  position: relative;
  min-height: 164px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.option-card:hover { transform: translateY(-2px); }
.option-card:has(input:checked) { border-color: var(--coral); box-shadow: 0 10px 28px rgba(255, 109, 87, .13); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }

.option-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ocean);
  background: var(--paper);
  font-weight: 900;
}

.option-card:has(input:checked) .option-toggle { color: var(--white); border-color: var(--coral); background: var(--coral); }
.option-card:has(input:checked) .option-toggle::before { content: "✓"; }
.option-card:not(:has(input:checked)) .option-toggle::before { content: "+"; }

.option-meta { color: var(--coral); font-size: .76rem; font-weight: 900; letter-spacing: .04em; }
.option-card h4 { margin: 7px 38px 5px 0; font-size: 1.04rem; }
.option-card p { margin: 0; color: var(--ink-soft); font-size: .86rem; line-height: 1.5; }
.option-condition { display: inline-block; margin-top: 10px; color: var(--ocean); font-size: .78rem; font-weight: 800; }

.notes-grid { box-shadow: none; }
.notes-grid__heading { margin-bottom: 12px; }
.notes-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.note {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 13px;
  background: #edf6f7;
  color: var(--ink-soft);
}

.note span:first-child { font-size: 1.15rem; }
.note p { margin: 0; font-size: .86rem; line-height: 1.45; }

.trip-facts { padding: 0; overflow: hidden; box-shadow: none; }

.trip-facts summary {
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 900;
  background: var(--white);
}

.facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 0 20px 20px;
}

.facts-grid h3 { margin: 0 0 7px; font-size: 1rem; }
.facts-grid ul { margin: 0; padding-left: 1.2rem; color: var(--ink-soft); }

footer {
  padding: 28px 16px 38px;
  color: #b9d6de;
  background: var(--ocean-deep);
  text-align: center;
  font-size: .82rem;
}

footer p { margin: 3px; }

@media (max-width: 860px) {
  .day-overview { align-items: flex-start; flex-direction: column; }
  .day-metrics { justify-content: flex-start; }
  .route-layout { grid-template-columns: 1fr; }
  .schedule-card { position: static; }
  .option-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .trip-header { min-height: 190px; }
  .trip-header__content { padding-bottom: 26px; }
  .trip-header h1 { font-size: 2.15rem; }
  .trip-header p:last-child { max-width: 80%; font-size: .9rem; }
  .app-shell { width: min(100% - 20px, 1180px); padding-top: 22px; }
  .day-overview { gap: 14px; }
  .day-metrics { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .metric { min-width: 0; padding: 8px 9px; }
  .metric strong { font-size: .9rem; }
  .map-card, .schedule-card, .optional-section, .notes-grid { padding: 15px; border-radius: 19px; }
  .map-frame-wrap { height: 46vh; min-height: 310px; max-height: 430px; }
  .map-link { flex: 1 1 calc(50% - 8px); }
  .option-grid, .notes-list, .facts-grid { grid-template-columns: 1fr; }
  .option-card { min-height: 142px; }
  .timeline-item { grid-template-columns: 58px 15px minmax(0, 1fr); gap: 8px; }
  .timeline-item:not(:last-child)::after { left: 72px; }
  .facts-grid { gap: 18px; }
}

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