:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1a1f24;
  --ink-soft: #5b6670;
  --brand: #0a6ebd;
  --brand-d: #075a9b;
  --line: #e3e8ee;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(20, 40, 70, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* 顶部栏 */
.topbar {
  background: linear-gradient(135deg, var(--brand), var(--brand-d));
  color: #fff;
  padding: 14px 16px;
}
.topbar-inner { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; }
.logo { font-size: 30px; }
.title-main { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.title-sub { font-size: 13px; opacity: 0.9; margin-top: 2px; }

.banner {
  background: #fff6e0;
  color: #8a5a00;
  font-size: 15px;
  padding: 10px 16px;
  border-bottom: 1px solid #f0e2bd;
  text-align: center;
}

/* 通用屏幕容器 */
.screen { max-width: 760px; margin: 0 auto; padding: 16px 16px 90px; }

/* 路线概览 */
.route-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.rs-item { flex: 1; }
.rs-label { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.rs-value { font-size: 22px; font-weight: 800; word-break: break-all; }
.rs-arrow { font-size: 24px; color: var(--brand); font-weight: 800; }

.hint { font-size: 17px; font-weight: 700; margin: 6px 2px 12px; color: var(--ink); }

/* 搜索 */
.search-wrap { margin-bottom: 14px; }
.search-input {
  width: 100%;
  font-size: 19px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  outline: none;
}
.search-input:focus { border-color: var(--brand); }

/* 车站列表（按线路分组） */
.station-list { display: flex; flex-direction: column; gap: 16px; }
.line-group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.line-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.line-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.line-name { font-size: 17px; font-weight: 800; }
.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.station-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .05s ease, background .15s ease;
  user-select: none;
}
.station-chip:active { transform: scale(0.96); background: #eef6ff; }
.station-chip.selected { border-color: var(--brand); background: #e7f2ff; color: var(--brand-d); }
.station-chip.disabled { opacity: 0.4; }

/* 按钮 */
.btn-reset {
  margin: 18px auto 0;
  display: block;
  font-size: 17px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  cursor: pointer;
}
.btn-back {
  font-size: 17px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}
.btn-lg { font-size: 20px; padding: 16px; border-radius: 14px; font-weight: 800; }
.btn-primary { background: var(--brand); color: #fff; border: none; text-decoration: none; text-align: center; cursor: pointer; display: inline-block; }
.btn-primary:active { background: var(--brand-d); }
.btn-ghost { background: #fff; color: var(--ink-soft); border: 1px solid var(--line); cursor: pointer; }
.result-actions { display: flex; gap: 12px; margin-top: 16px; }
.result-actions .btn-lg { flex: 1; }

/* 凭证卡 */
.result-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rc-head {
  background: linear-gradient(135deg, var(--brand), var(--brand-d));
  color: #fff;
  padding: 18px 20px;
}
.rc-title { font-size: 15px; opacity: 0.9; letter-spacing: 2px; }
.rc-od { font-size: 26px; font-weight: 900; margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.rc-od .od-arrow { font-size: 22px; opacity: 0.85; }
.rc-strip { display: flex; height: 8px; }
.rc-strip span { flex: 1; }

.rc-body { padding: 18px 20px; }
.rc-step { display: flex; gap: 12px; padding: 6px 0; }
.rc-step-icon { width: 34px; flex: none; display: flex; flex-direction: column; align-items: center; }
.rc-dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); margin-top: 4px; }
.rc-line { width: 3px; flex: 1; background: var(--line); margin: 2px 0; }
.rc-step-main { flex: 1; padding-bottom: 8px; }
.rc-step-line { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.rc-step-line .pill { font-size: 13px; color: #fff; padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.rc-step-desc { font-size: 16px; color: var(--ink-soft); margin-top: 4px; }
.rc-transfer { font-size: 16px; font-weight: 700; color: #b8660d; padding: 4px 0 4px 46px; }

.rc-summary { display: flex; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 14px; }
.rc-summary div { flex: 1; text-align: center; }
.rc-summary .s-val { font-size: 22px; font-weight: 900; color: var(--brand-d); }
.rc-summary .s-lab { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

.rc-foot { font-size: 13px; color: var(--ink-soft); padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.rc-foot .note { color: #b8860b; margin-top: 4px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.modal-body {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 420px);
  background: #fff; border-radius: 16px; padding: 18px; text-align: center;
  max-height: 88vh; overflow: auto;
}
.modal-title { font-size: 19px; font-weight: 800; }
.modal-tip { font-size: 14px; color: var(--ink-soft); margin: 8px 0 12px; }
.img-preview { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 56vh; background: #fafbfc; }
.img-preview img { width: 100%; display: block; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions a, .modal-actions button { flex: 1; padding: 13px; border-radius: 12px; font-size: 17px; font-weight: 700; text-decoration: none; }

.foot { text-align: center; font-size: 13px; color: var(--ink-soft); padding: 16px; }
.foot #footHotline { font-weight: 700; color: var(--ink); }
.foot-credit { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.9; color: var(--ink-soft); }
.foot-credit a { color: var(--brand); text-decoration: none; border-bottom: 1px solid rgba(10,110,189,.35); }
.foot-credit a:hover { color: #084e85; border-color: #084e85; }

/* 出行方式 */
.mode-row { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 14px; }
.mode-label { font-size: 14px; color: var(--ink-soft); font-weight: 700; margin-bottom: 8px; display: block; }
.mode-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-chip {
  flex: 1 1 auto;
  min-width: 84px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 6px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.mode-chip:active { transform: scale(0.97); }
.mode-chip.active { border-color: var(--brand); background: #e7f2ff; color: var(--brand-d); }

/* 模糊建议下拉 */
.suggest-list {
  position: relative;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 46vh;
  overflow-y: auto;
}
.suggest-item { padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.suggest-item:last-child { border-bottom: none; }
.suggest-item:active { background: #eef6ff; }
.si-text { font-size: 18px; font-weight: 700; }
.si-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

.btn-toggle {
  width: 100%;
  margin: 4px 0 12px;
  font-size: 16px;
  padding: 10px;
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 12px;
  cursor: pointer;
}

.station-chip.origin-mark { border-color: #c0392b; background: #fdecea; color: #c0392b; }

/* 凭证卡：步骤图标(emoji) */
.rc-dot-ico {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 0 0 2px var(--line);
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: #f3f6f9;
}

/* 凭证卡：出口指引 */
.rc-exit { background: #eaf6ee; border-radius: 12px; padding: 12px 14px; margin: 6px 0 4px; }
.rc-exit-title { font-size: 17px; font-weight: 800; color: #1f7a3d; margin-bottom: 6px; }
.rc-exit-item { font-size: 16px; color: #245c33; line-height: 1.6; }

/* 凭证卡：可编辑备注 */
.rc-note-wrap { margin-top: 10px; }
.rc-note-title { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.rc-note {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: #fffdf5;
  border: 1.5px dashed #e0c878;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 48px;
  outline: none;
}
.rc-note:focus { border-color: var(--brand); }
