:root {
  --ink: #1b2421;
  --muted: #6c7772;
  --paper: #f2f0e9;
  --surface: #fbfaf6;
  --line: #d9dbd3;
  --accent: #28745c;
  --accent-dark: #153a2f;
  --soft: #e4eee8;
  --danger: #a24136;
  --radius: 22px;
  font-family: "Geist", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100dvh; background: var(--paper); }
button, input { font: inherit; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.masthead {
  height: 68px;
  padding: max(12px, env(safe-area-inset-top)) 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(27, 36, 33, .09);
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 720; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: var(--accent-dark); color: #fff; }
.brand-mark svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.data-badge { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.data-badge b { width: 1px; height: 11px; background: var(--line); }

main { width: min(100%, 740px); margin: 0 auto; padding: 0 16px 56px; }
.intro { padding: 46px 8px 28px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 10px; font-weight: 760; letter-spacing: .15em; }
.intro h1 { margin: 0; max-width: 100%; font-size: clamp(34px, 9.5vw, 58px); line-height: .98; letter-spacing: -.055em; font-weight: 720; }
.hero-route { display: inline-block; white-space: nowrap; }
.intro-copy { max-width: 36em; margin: 20px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.search-panel {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(27, 36, 33, .11);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 50px -34px rgba(21, 58, 47, .45);
}
.station-pair { display: grid; grid-template-columns: 1fr 44px 1fr; align-items: end; }
.field { position: relative; display: grid; gap: 8px; min-width: 0; }
.field label { color: var(--muted); font-size: 11px; font-weight: 650; }
.field input {
  width: 100%; height: 50px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  outline: none; background: transparent; color: var(--ink); font-size: 22px; font-weight: 670; letter-spacing: -.03em;
  transition: border-color .25s cubic-bezier(.16,1,.3,1);
}
.field input:focus { border-bottom-color: var(--accent); }
.field input::placeholder { color: #a5aca7; font-size: 15px; font-weight: 450; }
.swap-button { display: grid; width: 34px; height: 34px; margin: 0 auto 8px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .25s; }
.swap-button:active { transform: scale(.94) rotate(180deg); }
.swap-button:hover { border-color: var(--accent); }
.swap-button svg, .search-button svg, .filter-note svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.search-button {
  display: flex; width: 100%; height: 52px; margin-top: 22px; align-items: center; justify-content: center; gap: 9px;
  border: 0; border-radius: 14px; background: var(--accent-dark); color: #fff; font-weight: 690; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14); transition: transform .2s cubic-bezier(.16,1,.3,1), background .2s;
}
.search-button:hover { background: #1d4d3e; }
.search-button:active { transform: translateY(1px) scale(.99); }
.filter-note { display: flex; margin-top: 15px; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 11px; }
.filter-note svg { width: 14px; }
.form-error { margin: 12px 0 -5px; color: var(--danger); font-size: 12px; }

.public-service {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 28px;
  margin: 30px 4px 0;
  padding: 26px 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.public-service h2 { margin: 0; max-width: 13em; font-size: 20px; line-height: 1.2; letter-spacing: -.035em; }
.public-service > div:last-child > p:first-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.public-contact { margin: 13px 0 0; color: var(--accent-dark); font-size: 11px; font-weight: 700; }

.suggestions {
  position: absolute; top: 78px; left: -8px; right: -8px; z-index: 2; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 16px 28px -18px rgba(25,35,31,.45);
}
.suggestions button { display: block; width: 100%; padding: 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.suggestions button:hover, .suggestions button:focus { background: var(--soft); outline: none; }

.results { padding: 52px 4px 0; }
.result-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.result-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.result-date { padding-bottom: 2px; color: var(--muted); font-size: 12px; }
.aggregation-note { margin: 12px 0 -8px; padding: 9px 11px; border-radius: 9px; background: var(--soft); color: #355f50; font-size: 11px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; margin-top: 25px; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; padding: 12px 4px; border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs span { display: inline-grid; min-width: 20px; height: 20px; margin-left: 3px; padding: 0 5px; place-items: center; border-radius: 10px; background: #e5e6e0; font-size: 10px; }

.result-list { display: grid; gap: 12px; padding-top: 16px; }
.journey { padding: 19px 18px; border: 1px solid rgba(27,36,33,.11); border-radius: 18px; background: var(--surface); animation: reveal .45s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--index) * 60ms); }
.journey-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.train-no { font-size: 17px; font-weight: 750; letter-spacing: -.025em; }
.duration { color: var(--muted); font-size: 11px; }
.timeline { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-top: 18px; }
.time { font-variant-numeric: tabular-nums; }
.time strong { display: block; font-size: 21px; letter-spacing: -.035em; }
.time span { display: block; max-width: 88px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.time:last-child { text-align: right; }
.rail { position: relative; height: 1px; background: var(--line); }
.rail::before, .rail::after { content: ""; position: absolute; top: -3px; width: 7px; height: 7px; border: 1.5px solid var(--accent); border-radius: 50%; background: var(--surface); }
.rail::before { left: 0; }.rail::after { right: 0; }
.rail span { position: absolute; left: 50%; top: -14px; padding: 0 7px; transform: translateX(-50%); background: var(--surface); color: var(--muted); font-size: 9px; white-space: nowrap; }
.transfer-strip { display: flex; margin: 16px -18px -19px; padding: 11px 18px; align-items: center; justify-content: space-between; border-radius: 0 0 17px 17px; background: var(--soft); color: #355f50; font-size: 11px; }
.transfer-leg + .transfer-leg { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line); }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 38px; fill: none; stroke: #8c9892; stroke-width: 1.3; }
.empty h3 { margin: 14px 0 6px; color: var(--ink); font-size: 16px; }
.empty p { margin: 0; font-size: 12px; line-height: 1.65; }

.loading { padding: 52px 4px 0; }
.skeleton { background: linear-gradient(100deg, #e3e3dc 30%, #efeee8 50%, #e3e3dc 70%); background-size: 300% 100%; animation: shimmer 1.5s infinite; }
.skeleton-head { width: 44%; height: 24px; border-radius: 7px; }
.skeleton-card { display: grid; gap: 12px; margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; }
.skeleton-card i { height: 14px; border-radius: 5px; background: #e4e4de; animation: shimmer 1.5s infinite; }
.skeleton-card i:nth-child(2) { width: 75%; }.skeleton-card i:nth-child(3) { width: 46%; }

footer { padding: 0 20px max(30px, env(safe-area-inset-bottom)); color: #8a928e; text-align: center; font-size: 10px; line-height: 1.5; }
footer p { margin: 2px; }
footer .legal-notice { max-width: 42em; margin: 0 auto 9px; color: #66716c; font-size: 11px; }
footer a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--accent); text-decoration: underline; }

@keyframes breathe { 50% { opacity: .35; transform: scale(.75); } }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } }
@keyframes shimmer { to { background-position-x: -300%; } }

@media (min-width: 768px) {
  .masthead { padding-inline: max(32px, calc((100vw - 1120px) / 2)); }
  main { padding-top: 30px; }
  .intro { padding-top: 62px; padding-left: 0; }
  .search-panel { padding: 28px; }
}

@media (max-width: 520px) {
  .masthead { padding-inline: 14px; }
  .brand { gap: 7px; font-size: 14px; }
  .brand-mark { width: 26px; height: 26px; }
  .data-badge { gap: 5px; font-size: 9px; }
  .hero-route { font-size: clamp(27px, 7.7vw, 34px); letter-spacing: -.06em; }
  .public-service { grid-template-columns: 1fr; gap: 16px; padding-block: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
