:root {
  --brand: #c8102e;
  --brand-dark: #a00b23;
  --ink: #12213a;
  --ink-2: #4a5a72;
  --ink-3: #8a97ab;
  --bg: #f5f7fa;
  --card: #ffffff;
  --line: #e3e8ef;
  --ok: #0f9d58;
  --warn: #e8890c;
  --bad: #d93025;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(18, 33, 58, .08), 0 8px 24px rgba(18, 33, 58, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #f0523f);
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.logo-text { font-weight: 700; white-space: nowrap; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink-2); font-size: 14.5px; font-weight: 500; }
.nav a.active { color: var(--brand); }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1100px 460px at 82% -8%, rgba(200, 16, 46, .38), transparent 62%),
    radial-gradient(760px 380px at 6% 108%, rgba(48, 106, 200, .30), transparent 66%),
    linear-gradient(158deg, #0d1930 0%, #172a4a 48%, #22395d 100%);
  color: #fff;
  padding: 56px 0 96px;
  position: relative;
  isolation: isolate;
  /* isolation 让 hero 自成一个层叠上下文，内部 .suggest 的 z-index:40 只在 hero 里有效，
     会被后面的 .trust-bar / .section 盖住。这里抬高 hero 自身的层级，
     让下拉菜单能正常显示在下方区块之上。 */
  z-index: 20;
  /* 不用 overflow:hidden —— ::after 装饰层 inset:0 不会溢出，hidden 只会把车站下拉菜单在 hero 下边界处裁掉 */
  overflow: visible;
}
/* 细网格纹理，增加质感又不干扰文字 */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(900px 420px at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(900px 420px at 50% 0%, #000 0%, transparent 78%);
}
.hero::after {
  content: "";
  position: absolute; inset: auto 0 -1px 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  pointer-events: none;
}
.hero .container { position: relative; }

.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.hero-badge {
  font-size: 12.5px; font-weight: 600; letter-spacing: .2px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .17);
  backdrop-filter: blur(6px);
}
.hero-badge b { font-weight: 800; }

.hero h1 {
  font-size: 44px; line-height: 1.13; margin: 0 0 14px; font-weight: 800;
  letter-spacing: -1px; text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(92deg, #ff8a7a 0%, #ff5c73 55%, #ffc2a8 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero p.sub { font-size: 17px; opacity: .82; margin: 0 0 30px; max-width: 640px; line-height: 1.62; }

/* ---------- 热门路线快捷入口（hero 内） ---------- */
.popular-routes { margin-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pr-label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; opacity: .72; white-space: nowrap; }
.pr-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pr-chip {
  display: inline-flex; align-items: baseline; gap: 7px; padding: 7px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
  backdrop-filter: blur(6px);
}
.pr-chip i { font-style: normal; opacity: .55; font-size: 12px; }
.pr-chip:hover {
  background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .45);
  text-decoration: none; transform: translateY(-1px);
}
.pr-chip .pr-t { font-size: 11.5px; font-weight: 500; opacity: .72; }
/* 「全部线路」入口：与普通 chip 区分开，作为强内链引导 */
.pr-chip-all {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 6px 18px -8px rgba(200, 16, 46, .9);
}
.pr-chip-all:hover { background: #a50d26; border-color: #a50d26; }
.pr-chip-all i { opacity: .9; }

/* ---------- 信任条 ---------- */
.trust-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.trust-bar .container {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px;
}
.trust-item { display: flex; gap: 11px; align-items: flex-start; }
.trust-ico {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #fff4f5, #ffe8ea);
  border: 1px solid #f5d6da; color: var(--brand);
}
.trust-ico svg { width: 19px; height: 19px; }
.trust-item b { display: block; font-size: 13.5px; line-height: 1.35; }
.trust-item small { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }

/* ---------- search card ---------- */
.search-card {
  background-color: #fff;
  /* 顶部 3px 品牌渐变条：用 background-image 而非绝对定位伪元素，
     伪元素 inset 在圆角卡片两端会溢出（实测左右各多出约 6px，呈斜切状）。 */
  background-image: linear-gradient(90deg, var(--brand), #ff7a5c 60%, #ffc2a8);
  background-repeat: no-repeat;
  background-size: 100% 3px;
  background-position: top left;
  border-radius: 18px;
  padding: 25px 22px 22px; /* 顶部多 3px，补回渐变条占位 */
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 24px 60px -12px rgba(6, 16, 34, .45), 0 6px 18px rgba(6, 16, 34, .18);
  color: var(--ink);
  position: relative;
}
.search-row { display: grid; grid-template-columns: 1fr 44px 1fr 1fr auto; gap: 12px; align-items: end; }
.field { position: relative; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200, 16, 46, .12); }

.swap {
  height: 44px; width: 44px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; font-size: 16px; color: var(--ink-2);
  display: grid; place-items: center; margin-bottom: 1px;
}
.swap:hover { border-color: var(--brand); color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; font-family: inherit;
  background: var(--brand); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-ghost:hover { background: #fff5f6; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }

.suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); max-height: 320px; overflow: auto; display: none;
  overscroll-behavior: contain;
}
/* 搜索行里 From/To 各占 1fr（桌面约 260px），下拉如果跟着这个宽度，
   城市项里的车站 chip 会挤成竖排。这里让下拉至少 340px，
   但不超过视口 —— 用 min() 保证手机上不会溢出。 */
.search-row .field .suggest {
  min-width: min(340px, calc(100vw - 40px));
}
.suggest.open { display: block; }
.suggest-item { padding: 10px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.suggest-item:hover, .suggest-item.sel { background: #f2f5f9; }
.suggest-item.sel { box-shadow: inset 3px 0 0 var(--brand); }
.suggest-item .cn { color: var(--ink-3); font-size: 13px; }

/* 联想列表：分组标题 / 加载 / 空结果 / 命中高亮 */
.suggest-head {
  padding: 9px 14px 7px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3); background: #fafbfc;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1;
}
.suggest-item .sg-main { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item .sg-code {
  font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em;
  background: #f1f3f6; border-radius: 5px; padding: 2px 6px; flex: none;
}

/* ---------- 同名站城市标签（Suzhou ▸ 苏州 / 宿州 / 肃州） ----------
   全站 88 组站点的英文名完全相同。不加这个标签，三个 "Suzhou"
   在下拉里肉眼无法区分，用户选错就买到 550 公里外。
   用中文名做标签是刻意的：英文名已经撞了，唯一能区分的只有中文。 */
.suggest-item.ambiguous .sg-main { display: flex; align-items: center; gap: 7px; }
.sg-city {
  font-size: 11.5px; font-weight: 600; color: #5a6474;
  background: #eef1f6; border: 1px solid #e2e7ef;
  border-radius: 5px; padding: 1px 6px; flex: none;
  letter-spacing: .01em;
}
.suggest-item.ambiguous.sel .sg-city,
.suggest-item.ambiguous:hover .sg-city { background: #dfe9f7; border-color: #c9d9ef; color: #2c4c76; }

/* ---------- 城市聚合项（"Beijing · All 6 stations"） ----------
   这是搜索体验的核心：外国人不需要理解北京南/北京西，
   默认给他整个城市，具体车站退到下面可选。 */
.suggest-city {
  /* 覆盖 .suggest-item 的 space-between：城市项是「图标 + 内容块 + 代码」三段横向，
     用 space-between 会把内容块压成窄条，导致内部 chip 竖着堆。 */
  display: grid; grid-template-columns: 30px 1fr auto;
  grid-template-areas: "icon body code";
  align-items: start; gap: 9px; padding: 11px 13px;
  background: linear-gradient(180deg, #fbfcfe 0%, #f6f9fd 100%);
  border-bottom: 1px solid var(--line);
}
.suggest-city .sg-icon { grid-area: icon; align-self: start; margin-top: 1px; }
.suggest-city .sg-body { grid-area: body; min-width: 0; }
.suggest-city .sg-code { grid-area: code; align-self: center; }
.suggest-city:hover, .suggest-city.sel { background: #eef4fc; }
.suggest-city .sg-icon {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
}
.suggest-city .sg-icon svg { width: 17px; height: 17px; }
.suggest-city .sg-body { display: flex; flex-direction: column; gap: 4px; }
.suggest-city .sg-main {
  font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px;
  white-space: nowrap; overflow: hidden;
}
/* "All 6 stations" 徽标：把"这是整个城市"这件事说到明面上 */
.sg-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  background: rgba(200, 16, 46, .1); color: var(--brand); white-space: nowrap;
  border-radius: 4px; padding: 2px 5px; flex: none;
}
.suggest-city .sg-sub {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 1px;
}
.suggest-city .sg-chip {
  font-size: 11.5px; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
.suggest-city .sg-code { background: #eef2f7; }

/* 分组分隔："or pick a specific station" */
.suggest-sep {
  padding: 8px 14px 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-3); background: #fafbfc; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); text-transform: none;
}
.suggest mark { background: rgba(200, 16, 46, .1); color: var(--brand); font-weight: 700; border-radius: 2px; padding: 0 1px; }
/* 城市项是主推选项，其中的高亮不要再刷一层品牌色，否则整行过重、反而不像"被选中" */
.suggest-city .sg-main mark { background: transparent; color: inherit; padding: 0; }
.suggest-loading, .suggest-empty {
  padding: 13px 14px; font-size: 13.5px; color: var(--ink-3);
}
.suggest-loading::after {
  content: ''; display: inline-block; width: 11px; height: 11px; margin-left: 7px;
  border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%;
  animation: sgspin .7s linear infinite; vertical-align: -1px;
}
@keyframes sgspin { to { transform: rotate(360deg); } }
.suggest-empty { color: var(--ink-2); font-weight: 600; }
.suggest-empty-tip { padding: 0 14px 13px; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
/* 已有结果时的加载提示：贴在列表顶部的一条细线，不顶掉内容 */
.suggest-loading-bar {
  position: sticky; top: 0; z-index: 1;
  padding: 6px 14px; font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase; color: var(--ink-3);
  background: linear-gradient(#fff, #fff 70%, rgba(255,255,255,.92));
  border-bottom: 1px solid var(--line);
}
/* 失败时的重试按钮：做成文字链接而不是方块按钮，避免在下拉里显得笨重 */
.sug-retry {
  appearance: none; background: none; border: 0; padding: 0;
  font: inherit; color: var(--brand); font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.sug-retry:hover { color: var(--ink); }

/* ---------- sections ---------- */
.section { padding: 54px 0; }
.section h2 { font-size: 26px; margin: 0 0 8px; font-weight: 700; }
.section .lead { color: var(--ink-2); margin: 0 0 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.card:hover { border-color: #ccd8e8; box-shadow: 0 8px 26px -10px rgba(18, 33, 58, .22); transform: translateY(-2px); }
.card h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.2px; }
.card p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.card .ico {
  margin-bottom: 12px;
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; background: linear-gradient(150deg, #fff1f2, #ffe4e6);
  border: 1px solid #f6d3d7; color: var(--brand);
}
.card .ico svg { width: 19px; height: 19px; }
/* "How it works" 三步：左侧渐变序号，强化顺序感 */
#how .grid-3 .card { position: relative; padding-left: 22px; }
#how .grid-3 .card::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px;
  border-radius: 3px; background: linear-gradient(180deg, var(--brand), #ffb199);
}

/* ---------- 区块标题（与旧 .section h2 + .lead 并存）----------
   .lead 原本固定 30px 下边距，标题组和内容之间空隙过大，
   密集的卡片网格显得散。用 .sec-head 包住标题与副标题，统一控制间距。 */
.sec-head { margin-bottom: 26px; }
.sec-head h2 { font-size: 26px; margin: 0 0 6px; font-weight: 700; letter-spacing: -.3px; }
.sec-head .lead { margin: 0; color: var(--ink-2); max-width: 60ch; }

/* ---------- 热门城市入口 ----------
   首页权重最高，把最强的内链给城市枢纽页，修正「法律页 2142 入链、
   枢纽页 1 入链」的倒挂。四列网格在平板上收到三列、手机上两列，
   不做单列 —— 单列时这一块会变成一条很长的滚动走廊，用户走不到底。 */
.hub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hub-card {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px 13px; color: inherit; text-decoration: none;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.hub-card:hover {
  text-decoration: none; border-color: #c9d6e6;
  box-shadow: 0 8px 22px -12px rgba(18, 33, 58, .3); transform: translateY(-2px);
}
.hub-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.2px; color: var(--ink); }
.hub-name i { color: var(--brand); font-style: normal; }
/* 车站行锁死单行。这是三行结构里唯一长度不可控的一行 ——
   「Hongqiao & Shanghai Station」是「South Station」的两倍多，
   不截断就会折行，卡片高度又参差。车站名是次要信息，省略可接受。 */
.hub-station {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 直达城市数：这张卡唯一有说服力的信息，独立成行并用品牌色数字压住。
   原来它混在描述句里，12.5px 灰字，用户扫视时完全看不见。 */
.hub-count {
  margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2); line-height: 1.3;
  white-space: nowrap;
  /* 17px 的数字和 12px 的「direct cities」在同一行，默认基线对齐会让大字
     把行高顶高、小字沉在底部，看着像两个字重各自为政。改成纵向居中对齐，
     数字像一个徽标嵌在说明文字里，重心稳。 */
  display: flex; align-items: baseline; gap: 5px;
}
.hub-count b {
  font-size: 17px; font-weight: 700; color: var(--ink);
  letter-spacing: -.4px; font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hub-card:hover .hub-count b { color: var(--brand); }
.hub-card-all { background: linear-gradient(150deg, #fff6f7, #fff); border-color: #f3d5da; }
.hub-card-all .hub-name { color: var(--brand); }
.hub-card-all .hub-count b { color: var(--brand); }

/* ---------- 指南入口 ----------
   与 .card 区别：这里整张卡可点，所以做 <a>；hover 时给左边一条色条，
   让"这是一条可点的路径"比纯阴影更明确。 */
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.guide-card {
  position: relative; display: block; padding: 20px 22px 20px 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  color: inherit; text-decoration: none; overflow: hidden;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.guide-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand); opacity: 0; transition: opacity .18s;
}
.guide-card:hover {
  text-decoration: none; border-color: #c9d6e6;
  box-shadow: 0 10px 26px -14px rgba(18, 33, 58, .32); transform: translateY(-2px);
}
.guide-card:hover::before { opacity: 1; }
.guide-tag {
  display: inline-block; margin-bottom: 8px; padding: 2px 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand); background: #fff1f2; border: 1px solid #f6d3d7; border-radius: 6px;
}
.guide-card h3 { margin: 0 0 6px; font-size: 16.5px; letter-spacing: -.2px; }
.guide-card p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }

@media (max-width: 980px) {
  .hub-grid { grid-template-columns: repeat(3, 1fr); }
  .guide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .section { padding: 40px 0; }
  .sec-head h2 { font-size: 22px; }
  .hub-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hub-card { padding: 12px 13px 11px; }
  .hub-name { font-size: 14.5px; }
  .hub-station { font-size: 11.5px; }
  .hub-count { margin-top: 5px; padding-top: 7px; font-size: 11px; }
  .hub-count b { font-size: 15.5px; }
}

/* ---------- results ---------- */
.results-head { background: #fff; border-bottom: 1px solid var(--line); padding: 20px 0; }
.results-head h1 { margin: 0 0 4px; font-size: 21px; }
.results-head .meta { color: var(--ink-2); font-size: 14px; }

/* 标题区压缩为一行：
   原先把标题、统计、车站说明、缓存时间堆成四行（桌面 170px / 手机 262px），
   手机上一半屏幕被头部吃掉。现在标题与元信息同行，站点明细收进可展开摘要。 */
.meta-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.meta-row h1 { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.meta-row h1 .arrow { color: var(--ink-3); font-weight: 400; margin: 0 1px; }
.meta-line {
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  color: var(--ink-2); font-size: 13.5px;
}
.meta-line .dot { color: #c9d2e0; }
.meta-line .live { color: var(--ok); display: inline-flex; align-items: center; gap: 5px; }
.meta-line .live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; }
.meta-line .fresh { color: var(--ink-3); cursor: help; border-bottom: 1px dotted #d5dce8; }
/* 结果页标题上的同名站城市徽标（"Shanghai → Suzhou 宿州"） */
.meta-row h1 .title-city {
  font-size: 12.5px; font-weight: 600; color: #5a6474;
  background: #eef1f6; border: 1px solid #e2e7ef;
  border-radius: 5px; padding: 1px 6px; margin-left: 3px;
  vertical-align: 2px; letter-spacing: .01em;
  white-space: nowrap;
}

/* 车站明细：默认收起的一个小胶囊，点开才展开。
   summary 用 inline-flex 保证三角标记和文字基线对齐，不会把整行撑高。 */
.station-fold { margin-top: 9px; }
.station-fold > summary {
  display: inline-flex; align-items: center; gap: 6px;
  list-style: none; cursor: pointer; user-select: none;
  padding: 4px 11px 4px 8px; border-radius: 999px;
  background: #f4f7fc; border: 1px solid #dfe8f4;
  font-size: 12.5px; color: #3c6bb0; line-height: 1.4;
  transition: background .15s ease;
}
.station-fold > summary::-webkit-details-marker { display: none; }
.station-fold > summary:hover { background: #eaf0fa; }
.station-fold > summary svg { width: 13px; height: 13px; flex: none; }
.station-fold > summary .hint { color: var(--ink-3); }
.station-fold[open] > summary .hint { visibility: hidden; width: 0; }
.station-fold-body {
  margin-top: 8px; padding: 10px 13px; border-radius: 9px;
  background: #f9fbfe; border: 1px solid #e6eef8;
  font-size: 12.5px; line-height: 1.7; color: var(--ink-2); max-width: 66ch;
}
.station-fold-body b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.station-fold-body .muted { color: var(--ink-3); margin-top: 2px; }

/* 仅在 12306 慢、数据可能过期时出现；正常缓存不再重复提示 */
.stale-note {
  margin-top: 10px; padding: 7px 12px; border-radius: 8px;
  background: #fff8ec; border: 1px solid #f3e3c3;
  font-size: 12.5px; line-height: 1.5; color: #8a5a12; max-width: 72ch;
}
.stale-note b { color: #6f4708; }

@media (max-width: 640px) {
  /* 手机上标题独占一行，元信息换到下一行，避免挤压换行成三行 */
  .meta-row { gap: 4px; }
  .meta-row h1 { font-size: 19px; flex: 1 0 100%; }
  .meta-line { font-size: 13px; }
  .station-fold > summary { font-size: 12px; }
}

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.chip {
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 13.5px; color: var(--ink-2);
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.train {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 10px; overflow: hidden; transition: box-shadow .15s, border-color .15s;
}
.train:hover { box-shadow: var(--shadow); }
.train.open { border-color: #c9d4e2; }
.train.soldout .train-head { opacity: .62; }

/* 收起态：一行一班车，四要素 = 车次 | 时间 | 车站 | 最低价+状态+箭头 */
.train-head {
  display: grid; grid-template-columns: 118px auto 1fr auto; gap: 18px; align-items: center;
  width: 100%; padding: 14px 18px; background: none; border: none; cursor: pointer;
  text-align: left; font: inherit; color: inherit;
}
.train-head:hover { background: #f8fafc; }
.train-head:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--radius); }
.th-code .tc { font-size: 18px; font-weight: 700; }
.th-code .tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; margin-left: 6px; background: #eef2f7; color: var(--ink-2); vertical-align: 2px; }
.tag.g { background: #e8f2ff; color: #1668c4; }
.tag.d { background: #e9f7ef; color: #0f7a45; }
.tag.k { background: #fdf1e6; color: #b06300; }
.th-times { display: flex; align-items: center; gap: 12px; }
.th-times .t { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.th-mid { text-align: center; color: var(--ink-3); }
.th-mid i { display: block; font-style: normal; font-size: 12px; letter-spacing: 1px; }
.th-mid b { font-size: 12.5px; font-weight: 600; }
.th-route { font-size: 13.5px; color: var(--ink-2); }
/* 同一趟车的其它下车站。合并前它们是独立卡片（C2555 会出现 4 次），
   现在收成路线下面一行小字，视觉权重必须低于主路线 —— 它只是补充，
   不能跟"Beijing South → Tianjin"抢注意力。 */
.th-alts {
  display: block; margin-top: 2px;
  font-size: 11.5px; color: var(--ink-3); line-height: 1.4;
  max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 备选里"不在市区"的站。用弱化斜体打标，不抢价格的注意力，
   但能让用户知道 Binhai/Tanggu 不是天津站本身。 */
.th-alts .off {
  font-style: normal; font-size: 10px; letter-spacing: .2px;
  color: var(--ink-3); opacity: .85; margin-left: 3px;
}
.th-alts .off::before { content: '('; }
.th-alts .off::after { content: ')'; }

/* 主记录停在不属于目的城市的站（G8835 只到北辰）。
   这类卡片必须一眼看出来 —— 用户搜 Tianjin，买到北辰是实实在在的错，
   不是"稍微远一点"。琥珀色警告，位置紧贴路线下方，权重高于备选行。 */
.th-offcity {
  display: block; margin-top: 3px;
  font-size: 11.5px; font-weight: 600; line-height: 1.35;
  color: #9a5b00;
}
.th-offcity::before {
  content: '⚠ ';
  font-weight: 400;
}
.th-right { display: flex; align-items: center; gap: 14px; }
.th-price { font-size: 17.5px; font-weight: 800; color: var(--brand); white-space: nowrap; }
.th-price small { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-right: 4px; }
.th-price.dim { color: var(--ink-3); font-weight: 600; }
.best-badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  color: var(--brand); background: #fdeef0; border: 1px solid #f3ccd2;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.th-status { font-size: 12.5px; font-weight: 700; }
.th-status.ok { color: var(--ok); }
.th-status.bad { color: var(--bad); }
.th-chevron { color: var(--ink-3); font-size: 13px; transition: transform .2s ease; }
.train.open .th-chevron { transform: rotate(180deg); }

/* 展开态：grid-template-rows 0fr -> 1fr，无 JS 计算高度的折叠动画 */
.train-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.train.open .train-body { grid-template-rows: 1fr; }
.tb-inner { overflow: hidden; min-height: 0; }
.train.open .tb-inner { overflow: visible; }
.tb-note { padding: 2px 18px 10px; font-size: 13px; color: var(--ink-2); }

/* 车型信息：数据来自静态车型档案，只覆盖 G/D/C 车次。
   有值才渲染，缺失时整块不出——绝不能把“档案没记录”写成“车上没有”。 */
.tb-meta { padding: 0 18px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tb-meta .mh { font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--ink-3); }
.tb-meta .mchip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: #f4f7fa; border: 1px solid #e3e9f0; border-radius: 999px;
  padding: 3px 10px; white-space: nowrap;
}
.tb-meta .mchip b { font-weight: 800; color: var(--ink); }
/* 复兴号 / 和谐号 是品牌色，需要压过上面的通用规则；b 单独提一级避免被 var(--ink) 吃掉 */
.tb-meta .mchip.fx { background: #eef6ff; border-color: #cfe4fb; color: #17568f; }
.tb-meta .mchip.hx { background: #f2f7f4; border-color: #d6e8dc; color: #25644a; }
.tb-meta .mchip.fx b { color: #17568f; }
.tb-meta .mchip.hx b { color: #25644a; }
.tb-meta .mnote { flex-basis: 100%; font-size: 11.5px; color: var(--ink-3); margin-top: -2px; }
/* 图标用 CSS mask，避免依赖系统 emoji 字体（Linux/老安卓上会渲染成方块） */
.tb-meta .ic {
  width: 13px; height: 13px; display: inline-block; flex: 0 0 13px;
  background: currentColor; opacity: .75;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.tb-meta .ic-dine {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M8.1 13.34 3.91 9.16a4 4 0 0 1 0-5.66l6.9 6.9-6.9 6.9a4 4 0 0 1 0-5.66zm6.32-1.42L21.9 4.44a1 1 0 0 0-1.41-1.41L13 10.5 5.5 3a1 1 0 0 0-1.41 1.41l7.5 7.5-7.5 7.5A1 1 0 0 0 5.5 21L13 13.5l7.49 7.49a1 1 0 0 0 1.41-1.41l-7.48-7.66z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M8.1 13.34 3.91 9.16a4 4 0 0 1 0-5.66l6.9 6.9-6.9 6.9a4 4 0 0 1 0-5.66zm6.32-1.42L21.9 4.44a1 1 0 0 0-1.41-1.41L13 10.5 5.5 3a1 1 0 0 0-1.41 1.41l7.5 7.5-7.5 7.5A1 1 0 0 0 5.5 21L13 13.5l7.49 7.49a1 1 0 0 0 1.41-1.41l-7.48-7.66z'/%3E%3C/svg%3E");
}
.tb-meta .ic-access {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm9 7h-6v9a1 1 0 0 1-1 1h-2.5l-1.8 4.2a1 1 0 1 1-1.8-.8L9.4 19H7a1 1 0 0 1-1-1v-6a3 3 0 0 1 3-3h5V9H9a1 1 0 1 1 0-2h5a3 3 0 0 1 3 3v4h4a1 1 0 1 1 0 2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm9 7h-6v9a1 1 0 0 1-1 1h-2.5l-1.8 4.2a1 1 0 1 1-1.8-.8L9.4 19H7a1 1 0 0 1-1-1v-6a3 3 0 0 1 3-3h5V9H9a1 1 0 1 1 0-2h5a3 3 0 0 1 3 3v4h4a1 1 0 1 1 0 2z'/%3E%3C/svg%3E");
}
.tb-meta .ic-baby {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M9 2a3 3 0 0 1 3 3v1h4a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h1V5a3 3 0 0 1 3-3zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-1 4v3h10V9H7zm0 5v5h10v-5H7z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M9 2a3 3 0 0 1 3 3v1h4a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h1V5a3 3 0 0 1 3-3zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-1 4v3h10V9H7zm0 5v5h10v-5H7z'/%3E%3C/svg%3E");
}

/* 经停时间线。
   只画「上车站 → 下车站」这一段，不画全程。

   布局踩过两个坑（都记在这里，别再踩）：
   ① 绝对定位：行元素没建立定位上下文时，时间和圆点全叠到左上角。
   ② grid 第 4 列给 1fr：停靠时长被拉到 770px 之外，离站名老远，
      视觉上还会和站名粘在一起（"Zhongshan West2 min"）。
   现在改成：站名和停靠时长放进同一个 flex 单元，时长是紧跟站名的小徽章，
      永远贴在一起，且不随容器变宽而漂走。 */
.tb-stops { padding: 0 18px 12px; }
.st-line { display: flex; flex-direction: column; }
.st-row {
  display: grid;
  grid-template-columns: 52px 20px 1fr;
  align-items: center;
  gap: 0 10px;
  min-height: 26px;
  position: relative;
}
/* 竖线画在圆点列正中，高度各占一半拼起来 —— 首行只画下半段、末行只画上半段，
   让线从第一个点连到最后一个点，不出头。 */
.st-row::before {
  content: '';
  grid-column: 2; grid-row: 1;
  justify-self: center;
  width: 2px; height: 100%;
  background: #e2e8f0;
}
.st-row:first-child::before { height: 50%; align-self: end; }
.st-row:last-child::before { height: 50%; align-self: start; }
.st-row:only-child::before { display: none; }

.st-time {
  grid-column: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: -.2px;
}
.st-dot {
  grid-column: 2; grid-row: 1;
  justify-self: center;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff;
  border: 2px solid #c3cedb;
  z-index: 1;
  box-shadow: 0 0 0 2px #fff; /* 用白描边把竖线盖掉，圆点才干净 */
}
/* 站名 + 停靠时长打包在一个单元里，两者永远相邻 */
.st-main { grid-column: 3; display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-name {
  font-size: 14px; color: var(--ink-2); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-halt {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 600;
  color: var(--ink-3);
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 5px;
  font-variant-numeric: tabular-nums;
}

/* 上下车站：实心圆点 + 加粗站名 + 时间也用主色，一眼定位 */
.st-row.is-end .st-dot { border-color: var(--brand, #17568f); background: var(--brand, #17568f); }
.st-row.is-end .st-name { font-weight: 800; color: var(--ink); }
.st-row.is-end .st-time { color: var(--ink); font-weight: 800; }

/* 折叠头：一行摘要 + 箭头。用原生 <details>，不写一行 JS。
   样式上刻意做得"轻"——它是补充信息，不该抢席别和价格的注意力。 */
.st-fold { border: 0; }
.st-fold > summary {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  margin: 0 0 2px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  background: #f7f9fc;
  border: 1px solid #e8eef5;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background .15s ease;
}
.st-fold > summary::-webkit-details-marker { display: none; }
.st-fold > summary:hover { background: #eef3f9; }
/* 箭头用纯 CSS 三角，不依赖 emoji 字体（Linux/老安卓会缺字） */
.st-fold > summary::after {
  content: '';
  margin-left: auto;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #8b9bad;
  transition: transform .2s ease;
}
.st-fold[open] > summary::after { transform: rotate(180deg); }
.st-fold[open] > summary { margin-bottom: 8px; }
/* 摘要里的「7 stops · 4h 54m」用浅色，弱于标题 */
.st-sum {
  font-weight: 500; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .st-row { grid-template-columns: 44px 18px 1fr; gap: 0 8px; }
  .st-time { font-size: 12px; }
  .st-name { font-size: 13.5px; }
}

/* 席别行。
   三列：席别名 | 余票状态 | [价格 + 按钮]。
   原来价格和按钮各占一列（1fr 110px 130px auto），在 1080px 宽屏上
   `1fr` 被撑到 600px+，席别名和价格之间空出一大片 —— 一行看着很散。
   现在把价格和按钮打包到右侧同一组，右对齐，视线从「席别名」直接跳到「价格」。
   行高也从 padding 11px 收到 9px，四行合计少掉约 40px。 */
.seat-list { display: flex; flex-direction: column; gap: 5px; padding: 0 18px 14px; }
.seat-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 104px auto;
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
  transition: border-color .15s, background .15s;
}
.seat-row:hover { border-color: #c9d4e2; background: #f6f9fd; }
.seat-row.sold { opacity: .5; }
.seat-name { font-weight: 600; font-size: 14px; }
/* 价格和按钮绑成一组：价格右对齐贴着按钮，中间不留空隙 */
.seat-right { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.seat-price {
  font-size: 16px; font-weight: 700; line-height: 1.2;
  text-align: right; white-space: nowrap;
}
.seat-price small {
  display: block; font-size: 11px; font-weight: 400;
  color: var(--ink-3); margin-top: 1px;
}
.seat-cta { flex: 0 0 auto; }
.avail { font-size: 13px; font-weight: 600; }
.avail.ok { color: var(--ok); }
.avail.bad { color: var(--bad); }
.avail.warn { color: var(--warn); }

.empty { text-align: center; padding: 70px 20px; color: var(--ink-2); }
.empty h3 { color: var(--ink); margin: 0 0 8px; }

/* ---------- booking ---------- */
.layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 16px; font-size: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.summary { position: sticky; top: 84px; }
.summary .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14.5px; }
.summary .row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 18px; font-weight: 700; }
.summary .muted { color: var(--ink-3); font-size: 13px; }

.passenger { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 12px; background: #fbfcfe; }
.passenger h4 { margin: 0 0 12px; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; }

.note { background: #f7f9fc; border-left: 3px solid var(--brand); padding: 12px 16px; font-size: 14px; color: var(--ink-2); border-radius: 0 8px 8px 0; }

/* ---------- order ---------- */
.status-badge { display: inline-block; padding: 5px 13px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.s-pending_payment { background: #fff4e5; color: #b06300; }
.s-paid { background: #e8f2ff; color: #1668c4; }
.s-ticketing { background: #ece8fd; color: #5b3ec7; }
.s-ticketed { background: #e9f7ef; color: #0f7a45; }
.s-cancelled, .s-failed, .s-refunded { background: #fdeceb; color: #b3261e; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 10px 20px; border-left: 2px solid var(--line); position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline .when { color: var(--ink-3); font-size: 12.5px; }

/* ---------- admin ---------- */
.admin-wrap { padding: 28px 0 60px; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line); }
table.tbl th { background: #f7f9fc; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-2); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi .card .num { font-size: 26px; font-weight: 800; }
.kpi .card .lbl { color: var(--ink-3); font-size: 13px; }

.modal { position: fixed; inset: 0; background: rgba(18, 33, 58, .5); display: none; place-items: center; z-index: 100; padding: 20px; }
.modal.open { display: grid; }
.modal .box { background: #fff; border-radius: 14px; padding: 24px; width: 560px; max-width: 100%; max-height: 88vh; overflow: auto; }
.modal h3 { margin: 0 0 16px; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #a9b6cc; padding: 40px 0 28px; margin-top: 40px; }
.site-footer h4 { color: #fff; font-size: 14px; margin: 0 0 12px; }
.site-footer a { color: #a9b6cc; font-size: 14px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.site-footer .copy { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 28px; padding-top: 18px; font-size: 13px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: all .25s; z-index: 200; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-skel { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 10px; height: 64px; margin-bottom: 10px; border: 1px solid var(--line); }
.skel-note { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; padding: 4px 2px 14px; }
/* 计时器：让"卡住"变成"在动"。等 20 秒时看到一个跳动的秒数，
   比看着一个静止的 spinner 安心得多。 */
.load-timer { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-3, #8a94a6); flex: none; }
.spinner-dark { display: inline-block; width: 15px; height: 15px; border: 2px solid #d8dfe9; border-top-color: var(--ink-2); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (max-width: 900px) {
  .search-row { grid-template-columns: 1fr; }
  .swap { justify-self: center; transform: rotate(90deg); }
  .grid-3, .grid-4, .kpi { grid-template-columns: 1fr 1fr; }
  .layout { grid-template-columns: 1fr; }
  .train-head { grid-template-columns: 110px auto 1fr auto; gap: 12px; }
  .th-route { display: none; } /* 中屏略过车站列，展开后可见 */
  .seat-row { grid-template-columns: 1fr auto; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 34px; letter-spacing: -.6px; }
  .trust-bar .container { grid-template-columns: 1fr 1fr; gap: 18px; }
}

/* ---------- 小屏 / 手机（<=640px） ---------- */
@media (max-width: 640px) {
  .container { padding: 0 16px; }

  /* header：保持单行。nav 横向可滚动，不让 logo 被挤到换行（修复 logo 高度溢出 64px header 的问题） */
  .site-header .container { gap: 12px; height: 58px; }
  /* 静态文档页的 header 只有 logo + 一个按钮，没有 .nav：
     按钮不能继承 .btn 的 width:100%，否则会被挤到第二行、撑破 58px 的固定高度。 */
  .site-header .container > .btn {
    width: auto; flex: 0 0 auto; margin-left: auto;
    padding: 8px 13px; font-size: 13px;
  }
  .logo { font-size: 15px; gap: 8px; flex: 0 0 auto; }
  .logo-mark { width: 28px; height: 28px; border-radius: 7px; font-size: 14px; }
  .logo-text { overflow: hidden; text-overflow: ellipsis; }
  .nav {
    flex-wrap: nowrap; gap: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
    min-width: 0; /* 同上：不归零会撑宽 header 并让整页出现横向滚动 */
    padding-left: 4px; /* 给 focus ring 留位置 */
    /* 靠右对齐，滚动条贴右边缘，视觉上不与 logo 抢位置 */
    justify-content: flex-end;
    scroll-padding-right: 4px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: 13.5px; white-space: nowrap; flex: 0 0 auto; }

  /* hero：压缩留白，让搜索表单尽量进入首屏 */
  .hero { padding: 26px 0 40px; }
  .hero h1 { font-size: 27px; line-height: 1.2; margin-bottom: 10px; letter-spacing: -.5px; }
  .hero p.sub { font-size: 14.5px; margin-bottom: 16px; line-height: 1.55; }
  .hero-badges { margin-bottom: 14px; gap: 6px; }
  .hero-badge { font-size: 11.5px; padding: 4px 10px; }

  /* 信任条：小屏两列，图标缩小 */
  .trust-bar { padding: 16px 0; }
  .trust-bar .container { grid-template-columns: 1fr; gap: 13px; }
  .trust-ico { width: 30px; height: 30px; border-radius: 8px; }
  .trust-ico svg { width: 16px; height: 16px; }
  .trust-item b { font-size: 13px; }
  .trust-item small { font-size: 12px; }

  .search-card { padding: 15px; border-radius: 14px; }
  .search-row { gap: 10px; }

  /* iOS Safari 会对 font-size < 16px 的输入框自动放大页面：这里必须给到 16px */
  .field input, .field select { font-size: 16px; padding: 11px 12px; }
  .field label { font-size: 11.5px; margin-bottom: 5px; }
  .swap { height: 36px; width: 36px; }
  .btn, .btn-lg { width: 100%; justify-content: center; }

  /* 下拉：不要占满整屏，留出上方上下文；条目加高便于手指点按 */
  /* 热门路线：小屏改横向滚动，避免多行堆叠吃掉 hero 首屏 */
  .popular-routes { margin-top: 14px; flex-direction: column; align-items: stretch; gap: 8px; }
  .pr-label { align-self: flex-start; font-size: 11px; }
  .pr-chips {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
    /* flex item 默认 min-width:auto 会把容器撑到 min-content 宽度、导致整页横向滚动；
       min-width 归零后仍需显式给宽度，column 容器的 stretch 不足以约束横向滚动行的盒宽 */
    min-width: 0; width: 100%;
  }
  .pr-chips::-webkit-scrollbar { display: none; }
  .pr-chip { flex: 0 0 auto; padding: 8px 13px; }

  .suggest { max-height: min(320px, 46vh); }
  .suggest-item { min-height: 46px; align-items: center; gap: 8px; }
  .suggest-item .sg-main { font-size: 14px; }
  .suggest-head, .suggest-loading, .suggest-empty { font-size: 11.5px; }

  .grid-3, .grid-4, .kpi { grid-template-columns: 1fr; gap: 12px; }

  /* 静态文档页的 h1（内联写了 margin/font-size，这里用 !important 覆盖）：
     桌面 32px 在 390px 屏上会断成 3 行且词间空隙极不均衡 */
  main h1 { font-size: 26px !important; line-height: 1.22 !important; text-wrap: balance; }

  /* 静态文档页的表格（线路枢纽页/事实表）：小屏隐藏次要列，只保留路线 + 最快用时 + 频次，
     否则 Route 列会被压到逐词换行。 */
  .ttable th:nth-child(n+4), .ttable td:nth-child(n+4) { display: none; }
  .ttable th, .ttable td { padding: 9px 8px; }
  .ttable td:first-child { white-space: nowrap; }

  .site-footer { padding: 30px 0 22px; }
  .site-footer .cols { grid-template-columns: 1fr; gap: 20px; }

  /* 卡片式班次列表在窄屏压缩内层间距 */
  /* 班次卡：小屏两行 —— 左侧车次+时间堆叠，右侧价格+状态 */
  .train-head {
    grid-template-columns: 1fr auto;
    grid-template-areas: "code right" "times right" "route route";
    gap: 4px 12px; padding: 12px 14px;
  }
  .th-code { grid-area: code; }
  .th-times { grid-area: times; gap: 10px; }
  .th-times .t { font-size: 17px; }
  .th-right { grid-area: right; flex-direction: column; align-items: flex-end; gap: 4px; }
  .th-price { font-size: 16px; }
  /* 车站必须在小屏也可见：北京南 / 北京站 / 北京丰台混在一页时，
     不标车站用户根本不知道自己买的是哪个站。之前这里 display:none。 */
  .th-route { grid-area: route; display: block; font-size: 12px; opacity: .75; margin-top: 2px; }
  /* 窄屏：余票状态保留（"3 left" 是决策信息，不能藏），
     只把三列压紧，价格字号降一档。 */
  .seat-row { grid-template-columns: minmax(90px, 1fr) 72px auto; gap: 8px; padding: 8px 11px; }
  .avail { font-size: 12px; }
  .seat-price { font-size: 15px; }
  .seat-price small { font-size: 10.5px; }
  .seat-right { gap: 9px; }
  .toast { left: 16px; right: 16px; transform: translateY(80px); text-align: center; }
  .toast.show { transform: translateY(0); }
}

/* ---------- 车站实景图 ---------- */
.station-photo { margin: 22px 0 26px; max-width: 680px; }
.station-photo figcaption {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-top: 8px;
}
.station-photo .photo-credit { display: block; font-size: 11.5px; color: var(--ink-3); opacity: .8; margin-top: 2px; }
.station-photo .photo-credit a { color: inherit; text-decoration: underline; }
@media (max-width: 700px) {
  .station-photo { max-width: 100%; }
}

/* ---------- 实时数据状态条 ----------
 * 出现在结果列表上方，说明「屏幕上的车次是什么来源」。
 * 两种状态：正在补余票（中性）、只有运行图快照（警示色）。
 * 刻意做得低调：它是解释，不是错误 —— 用户仍然可以正常下单。 */
.live-note {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 14px; padding: 11px 14px;
  border-radius: 10px; font-size: 13.5px; line-height: 1.55;
  background: rgba(59, 130, 246, .07);
  border: 1px solid rgba(59, 130, 246, .18);
  color: var(--ink-2);
}
.live-note.warn {
  background: rgba(202, 138, 4, .08);
  border-color: rgba(202, 138, 4, .22);
  color: var(--ink-2);
}
.live-note .spinner-dark { flex: 0 0 auto; }

/* 没有余票数据的座位行：一条说明 + 一个入口，不留空白 */
.seat-row.tt-only {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.seat-row.tt-only .seat-name { color: var(--ink-3); font-size: 13.5px; }

/* ---------- 语言切换器 ----------
 * 生成页（/es/…）与手写页（/results /book /order）共用。
 * 文字链接 + 小色块：低调，不抢导航的戏，但一眼能认出。 */
.lang-switch {
  display: flex; align-items: center; gap: 2px;
  margin-left: 14px; padding-left: 14px;
  border-left: 1px solid var(--line, #e5e7eb);
}
.lang-switch a {
  padding: 5px 7px; border-radius: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-3); text-decoration: none !important;
}
.lang-switch a:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.lang-switch a[aria-current="true"] {
  color: var(--ink) !important; background: rgba(0,0,0,.06);
}
@media (max-width: 700px) {
  .lang-switch { margin-left: 8px; padding-left: 8px; }
  .lang-switch a { padding: 4px 5px; font-size: 11.5px; }
}

/* 估算价：比精确价更淡，加上 est. 前缀标明 */
.th-price.est { color: var(--ink-3); font-weight: 500; }
.th-price.est small { opacity: .7; }
