:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ed;
  --line-strong: #cbd4df;
  --blue: #155eef;
  --blue-deep: #0b3ea8;
  --blue-soft: #eaf1ff;
  --green: #147a5b;
  --green-soft: #e8f7f1;
  --amber: #a15c05;
  --amber-soft: #fff3df;
  --red: #b42318;
  --red-soft: #fff0ef;
  --shadow: 0 10px 30px rgba(34, 54, 80, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 99;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { transform: translateY(0); }

.site-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: env(safe-area-inset-top) 14px calc(32px + env(safe-area-inset-bottom));
}

.trip-header { padding: 22px 4px 18px; }
.brand-row, .title-row, .next-topline, .section-heading, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
}
.destination-clock {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.title-row { align-items: flex-end; margin-top: 24px; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(28px, 6vw, 48px); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 23px; line-height: 1.25; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.trip-dates { margin: 7px 0 0; color: var(--muted); }
.trip-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.meta-chip, .status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #43506a;
  font-size: 13px;
  white-space: nowrap;
}
.status-chip.confirmed { border-color: #bce4d4; background: var(--green-soft); color: var(--green); }
.status-chip.pending { border-color: #f1d39b; background: var(--amber-soft); color: var(--amber); }

.next-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0b3ea8 0%, #155eef 64%, #3977f5 100%);
  color: white;
  box-shadow: 0 18px 44px rgba(21, 94, 239, .24);
}
.next-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 50%;
}
.next-card > * { position: relative; z-index: 1; }
.next-kicker { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #70f0c3; box-shadow: 0 0 0 6px rgba(112,240,195,.14); }
.next-date { color: rgba(255,255,255,.76); font-size: 13px; }
.next-grid { display: grid; gap: 20px; margin-top: 28px; }
.next-grid h2 { max-width: 18ch; font-size: clamp(27px, 7vw, 42px); }
.next-place { margin: 10px 0 0; color: rgba(255,255,255,.8); }
.next-action { margin: 14px 0 0; padding-left: 11px; border-left: 2px solid #70f0c3; font-weight: 650; }
.countdown-wrap { align-self: end; }
.countdown-label { display: block; color: rgba(255,255,255,.68); font-size: 13px; }
.countdown { display: block; margin-top: 2px; font-size: clamp(34px, 10vw, 58px); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.button-inverse { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.12); color: white; backdrop-filter: blur(10px); }
.button:hover { transform: translateY(-1px); }
.is-hidden { display: none !important; }

.quick-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 0 26px;
  padding: 6px;
  border: 1px solid rgba(203,212,223,.82);
  border-radius: 15px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 26px rgba(42,61,89,.08);
  backdrop-filter: blur(16px);
}
.quick-nav a {
  min-width: 0;
  padding: 9px 4px;
  border-radius: 10px;
  color: #4b5870;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.quick-nav a:hover, .quick-nav a:focus-visible { background: var(--blue-soft); color: var(--blue); outline: none; }

.overview-grid, .bottom-grid { display: grid; gap: 14px; }
.panel, .day-card, .hike-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel { padding: 20px; }
.section-heading { align-items: flex-end; }
.section-note, .section-intro { color: var(--muted); font-size: 13px; }
.section-intro { max-width: 440px; margin: 0; text-align: right; }
.journey-route { display: grid; gap: 0; margin-top: 24px; }
.journey-step { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; min-height: 72px; }
.journey-step:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 33px; bottom: 0; width: 2px; background: var(--line); }
.journey-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #a9c2ff; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 800; }
.journey-content strong { display: block; }
.journey-content span { color: var(--muted); font-size: 13px; }

.booking-list { display: grid; gap: 10px; margin-top: 18px; }
.booking-item { padding: 13px 0; border-top: 1px solid var(--line); }
.booking-item:first-child { border-top: 0; padding-top: 0; }
.booking-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.booking-type { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.booking-meta { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.booking-note { margin: 7px 0 0; color: #4a5870; font-size: 14px; }

.days-section, .hike-section { margin-top: 42px; }
.section-heading-main { margin-bottom: 16px; padding: 0 4px; }
.day-list { display: grid; gap: 16px; }
.day-card { overflow: hidden; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px; border-bottom: 1px solid var(--line); }
.day-id { display: flex; align-items: center; gap: 12px; }
.day-number { display: grid; place-items: center; min-width: 52px; height: 52px; border-radius: 15px; background: var(--ink); color: white; font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.day-date { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.day-summary { color: var(--muted); font-size: 13px; text-align: right; }
.timeline { padding: 4px 18px 10px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 56px 18px minmax(0,1fr); gap: 8px; padding: 17px 0; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 64px; top: 34px; bottom: -6px; width: 1px; background: var(--line); }
.timeline-time { padding-top: 1px; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.timeline-marker { position: relative; z-index: 1; width: 9px; height: 9px; margin: 7px auto 0; border: 2px solid #9aa8ba; border-radius: 50%; background: white; }
.timeline-item.key .timeline-marker { width: 12px; height: 12px; margin-top: 5px; border-color: var(--blue); background: var(--blue); box-shadow: 0 0 0 5px var(--blue-soft); }
.timeline-item.danger .timeline-marker { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }
.timeline-body { min-width: 0; }
.timeline-place { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--blue); font-size: 14px; font-weight: 650; text-decoration: none; }
.timeline-description { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.timeline-action { margin: 8px 0 0; padding: 8px 10px; border-radius: 9px; background: var(--blue-soft); color: var(--blue-deep); font-size: 13px; font-weight: 650; }
.timeline-item.danger .timeline-action { background: var(--red-soft); color: var(--red); }
.item-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.route-action { padding: 0 18px 18px; }
.route-action .button { width: 100%; margin-top: 0; }
.day-image { width: 100%; max-height: 320px; object-fit: cover; display: block; }

.hike-card { overflow: hidden; }
.hike-card + .hike-card { margin-top: 14px; }
.hike-card-head { padding: 20px; background: linear-gradient(135deg, #182231, #293a4d); color: white; }
.hike-card-head p { margin: 5px 0 0; color: rgba(255,255,255,.68); }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid var(--line); }
.metric { padding: 15px; border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
.metric:nth-child(2n) { border-right: 0; }
.metric:nth-child(-n+2) { border-top: 0; }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 3px; font-size: 17px; }
.hike-details { display: grid; gap: 12px; padding: 18px; }
.warning-box { padding: 13px; border: 1px solid #f0c5c1; border-radius: 12px; background: var(--red-soft); }
.warning-box span { display: block; color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.warning-box strong { display: block; margin-top: 4px; font-size: 14px; }
.checkpoint-list { display: grid; gap: 0; padding: 0 18px 18px; }
.checkpoint { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.checkpoint time { color: var(--blue); font-size: 14px; font-weight: 800; }
.checkpoint span { color: var(--muted); font-size: 13px; }

.bottom-grid { margin-top: 42px; }
.todo-list { display: grid; gap: 4px; margin-top: 16px; }
.todo-item { display: grid; grid-template-columns: 24px 1fr auto; align-items: start; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); }
.todo-item:first-child { border-top: 0; }
.todo-check { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 2px; border: 1.5px solid var(--line-strong); border-radius: 6px; color: white; font-size: 13px; }
.todo-item.done .todo-check { border-color: var(--green); background: var(--green); }
.todo-item.done .todo-text { color: var(--muted); text-decoration: line-through; }
.todo-group { color: var(--muted); font-size: 12px; }
.info-list { margin: 16px 0 0; }
.info-row { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.info-row:first-child { border-top: 0; }
.info-row dt { color: var(--muted); font-size: 13px; }
.info-row dd { margin: 0; font-size: 14px; font-weight: 620; }
.info-row a { color: var(--blue); }
footer { margin-top: 34px; padding: 22px 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (min-width: 680px) {
  .site-shell { padding-left: 24px; padding-right: 24px; }
  .next-card { padding: 28px; }
  .next-grid { grid-template-columns: minmax(0,1.4fr) auto; align-items: end; }
  .overview-grid, .bottom-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
  .metric:nth-child(n) { border-right: 1px solid var(--line); border-top: 0; }
  .metric:last-child { border-right: 0; }
  .day-head { padding: 20px 24px; }
  .timeline { padding-left: 24px; padding-right: 24px; }
  .timeline-item { grid-template-columns: 64px 24px minmax(0,1fr); gap: 10px; }
  .timeline-item:not(:last-child)::after { left: 75px; }
  .route-action { padding-left: 24px; padding-right: 24px; }
  .route-action .button { width: auto; }
}

@media (max-width: 679px) {
  .title-row { align-items: flex-start; flex-direction: column; }
  .trip-meta { justify-content: flex-start; }
  .section-heading-main { align-items: flex-start; flex-direction: column; }
  .section-intro { text-align: left; }
  .day-head { align-items: flex-start; }
  .day-summary { max-width: 105px; }
  footer { align-items: flex-start; flex-direction: column; gap: 3px; }
}

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