/* ============================================================
   Rail Web — components.css
   通用组件（Vercel/Geist 克制精致）
   - 按钮 / 表单 / 卡片 / Tab / Modal / Toast / Navbar / 空状态 / 徽章
   ============================================================ */

/* ============================================================
   按钮（无主题色，黑白对比 + 危险红）
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 36px;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn:active {
  background: var(--bg-muted);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 主按钮：反相（浅色主题黑底白字，深色主题白底黑字） */
.btn-primary {
  background: var(--text-primary);
  color: var(--bg-base);
  border-color: var(--text-primary);
}

.btn-primary:hover {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
  color: var(--bg-base);
}

.btn-primary:active {
  background: var(--text-muted);
  border-color: var(--text-muted);
}

/* 描边按钮（次级操作） */
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

/* 危险按钮（删除等） */
.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
}

[data-theme="dark"] .btn-danger:hover {
  background: #EF4444;
  border-color: #EF4444;
}

/* 危险描边按钮 */
.btn-danger-outline {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}

.btn-danger-outline:hover {
  background: var(--error-bg);
}

/* 幽灵按钮（极简，无背景） */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: transparent;
}

/* 尺寸 */
.btn-sm {
  height: 28px;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  height: 44px;
  padding: 0 var(--space-5);
  font-size: var(--text-md);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* 加载态 */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  color: var(--bg-base);
}

.btn:not(.btn-primary):not(.btn-danger).btn-loading::after {
  color: var(--text-primary);
}

/* 图标按钮（方形） */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}

/* ============================================================
   表单
   ============================================================ */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  line-height: 1.4;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-1);
}

/* CR200J 车组号 → 车型 自动匹配提示条（强化内联，info 浅底，无镶边） */
.train-unit-match-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-2);
  padding: 8px 10px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  animation: tum-in 0.15s ease-out;
}
@keyframes tum-in {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}
.train-unit-match-hint .tum-icon {
  display: inline-flex;
  color: var(--text-primary);
  flex: 0 0 auto;
}
.train-unit-match-hint .tum-text {
  flex: 1 1 auto;
  line-height: 1.4;
}
.train-unit-match-hint .tum-text strong {
  font-weight: var(--font-semibold, 600);
}
.train-unit-match-hint .tum-actions {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

/* 表格视图的车型匹配提示（只读标记，不写入原值） */
.imp-train-match-note {
  margin-top: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--text-secondary);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-strong);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.05);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(250, 250, 250, 0.08);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--bg-muted);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
  border-color: var(--error);
}

.form-textarea {
  height: auto;
  min-height: 88px;
  padding: var(--space-2) var(--space-3);
  line-height: 1.55;
  resize: vertical;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-6);
}

/* 复选框 */
.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--text-primary);
  cursor: pointer;
}

/* 单选组 */
.form-radio-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.form-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-radio input[type="radio"] {
  accent-color: var(--text-primary);
  cursor: pointer;
}

.form-radio:hover {
  border-color: var(--border-strong);
}

.form-radio.is-active {
  background: var(--bg-base);
  color: var(--text-primary);
  border-color: var(--text-primary);
  font-weight: var(--font-medium);
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-static);
  overflow: hidden;
}

.card-elevated {
  background: var(--bg-elevated);
}

.card-body {
  padding: var(--space-5);
}

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.card-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
}

/* ============================================================
   桌面专用：≤768px 隐藏（手机端屏蔽数据清洗工具，维持原站点管理体验）
   ============================================================ */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}

/* ============================================================
   徽章 / 标签
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: 1.4;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  /* 中文字统一用阿里巴巴普惠体，防止继承 mono */
  font-family: 'Alibaba PuHuiTi', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 退票/改签等状态徽章置灰样式（浅底 + 深字，避免太灰看不清） */
.badge-muted {
  background: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* 退改状态徽章：加粗黑色（改签原票 / 变更到站原票，已作废但需醒目） */
.badge-refund-strong {
  background: transparent;
  color: var(--text-primary);
  border: none;
  padding-left: 0;
  padding-right: 0;
  font-weight: var(--font-semibold);
}

/* 退改状态徽章统一加粗（已退票红 / 新票蓝 / 原票黑） */
.badge-error,
.badge-accent {
  font-weight: var(--font-semibold);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: transparent;
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
  border-color: transparent;
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: transparent;
}

/* 静音车厢徽章：黄色 */
.badge-quiet {
  background: rgba(217, 119, 6, 0.12);
  color: #B45309;
  border-color: transparent;
}
[data-theme="dark"] .badge-quiet {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
}

/* 始发改签/变更到站：用品牌强调色令牌（深浅主题自动切换） */
.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

/* 行程详情-信息Tab：改签情况不用徽章样式（无底色、字号与其他信息值一致），仅保留语义文字色。
   注意：这里必须用 .badge-plain 精确命中改签徽章，不能用 .badge 通配——同一容器
   （车型行也走 info-value-with-action）里的「第 N 次乘坐该车型」徽章需要保留浅底/强调底色。 */
.info-value-with-action .badge-plain {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}
[data-theme="dark"] .info-value-with-action .badge-plain {
  background: transparent;
}

/* 已收藏：与始发改签徽章同形状，仅换收藏金色 */
.badge-fav {
  background: rgba(245, 166, 35, 0.12);
  color: #B97A16;
  border-color: transparent;
}
[data-theme="dark"] .badge-fav {
  background: rgba(245, 166, 35, 0.16);
  color: #F5C069;
}

/* 列车色徽章（用于车型小标识） */
.badge-train {
  background: transparent;
  border: 1px solid currentColor;
}

/* 联程徽章（P4-1） */
.badge-connect {
  background: rgba(16, 163, 127, 0.10);
  color: #0F9D76;
  border-color: transparent;
}
[data-theme="dark"] .badge-connect {
  background: rgba(45, 212, 191, 0.16);
  color: #5EEAD4;
}

/* 联程行程区块（P4-1） */
.connected-block { margin-top: 4px; }

/* 车型「第 N 次乘坐」标记：普通态用浅底深字；里程碑/首次(=1)用强调色（沿用 .badge-accent 蓝调 token） */
.badge-muted {
  background: var(--bg-muted, #f3f4f6);
  color: var(--text-primary);
  border-color: transparent;
  font-weight: var(--font-medium, 500);
}
[data-theme="dark"] .badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.badge-ride {
  background: rgba(245, 166, 35, 0.12);
  color: #B97A16;
  border-color: transparent;
  font-weight: var(--font-semibold);
}
[data-theme="dark"] .badge-ride {
  background: rgba(245, 166, 35, 0.16);
  color: #F5C069;
}
.connected-title { margin: 14px 0 8px; }
.connected-list { display: flex; flex-direction: column; gap: 8px; }
.connected-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-muted);
}
.connected-item-missing { color: var(--text-muted); font-size: var(--text-base); }
.connected-item-main { min-width: 0; flex: 1; }
.connected-item-route { font-size: var(--text-base); font-weight: 600; color: var(--text-primary); }
.connected-item-meta { font-size: var(--text-base); color: var(--text-muted); margin-top: 2px; }
/* 联程选择列表：车次号提升显示层级，置于区间左侧 */
.connect-train {
  flex: none;
  align-self: center;
  min-width: 64px;
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

/* 联程：第N程切换 + 分段行程时间轴 */
.journey-switch {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 10px 0 12px;
}
.journey-tab {
  font-size: var(--text-xs);
  padding: 4px 12px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.journey-tab:hover { border-color: var(--border-strong); }
.journey-tab.is-active {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--bg-muted);
  font-weight: var(--font-semibold);
}

/* 联程视角横幅：提示当前查看的是第几程 */
.leg-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md, 10px);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.leg-banner:empty { display: none; margin: 0; padding: 0; }
.leg-timeline {
  margin: 4px 0 2px;
  border-left: 2px solid var(--border);
  padding-left: var(--space-4);
  display: flex;
  flex-direction: column;
}
.leg-item {
  position: relative;
  padding: var(--space-2) 0;
}
.leg-item.is-active .leg-route { color: var(--text-primary); font-weight: var(--font-semibold); }
.leg-dot {
  position: absolute;
  left: calc(var(--space-4) * -1 - 5px);
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 2px solid var(--text-muted);
}
.leg-item.is-active .leg-dot { border-color: var(--text-primary); background: var(--text-primary); }
.leg-route {
  font-size: var(--text-sm);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.leg-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
}
.leg-transfer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 2px 0 2px var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.leg-transfer-name { color: var(--text-secondary); }
.leg-transfer-gap { color: var(--text-muted); }

/* 详情标题区：联程多段路线链（替换单段 A→B） */
.detail-route-multi {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.detail-route-multi .arrow { color: var(--text-muted); margin: 0 4px; }
.detail-route-stops {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--font-normal);
  margin-bottom: 2px;
}

/* 关于页超链接：黑字下划线 */
.about-link {
  color: var(--text-primary) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.about-link:hover {
  text-decoration-thickness: 2px;
}

/* 关于页来源列表 */
.about-source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-base);
  line-height: 1.9;
  color: var(--text-secondary);
}
.about-source-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.about-source-list li:last-child { border-bottom: none; }
.about-source-label {
  flex: 0 0 auto;
  min-width: 72px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================
   Tab
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.tab:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.tab-panel {
  display: none !important;
  padding: var(--space-5) 0;
}

.tab-panel.is-active {
  display: block !important;
  animation: fadeIn var(--transition) ease-out;
}

.flat-mode .tab-panel {
  padding: var(--space-3) 0;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  transform: translateY(8px) scale(0.98);
  transition: transform var(--transition);
}

.modal-backdrop.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal.modal-lg { max-width: 720px; }
.modal.modal-xl { max-width: 880px; }
.modal.modal-sm { max-width: 360px; }
.modal.modal-auto { max-width: 480px; max-height: none; }
.modal.modal-auto .modal-body { overflow-y: visible; flex: 0 0 auto; }

.modal-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.modal-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.modal-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* 移动端底部贴底 */
@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
  }
  .modal-backdrop.is-open .modal {
    transform: translateY(0);
  }
}

/* ============================================================
   Image Lightbox（统一图片灯箱，取代 .ach-lightbox/.sub-lightbox/.photo-lightbox）
   由 assets/js/lightbox.js 的 window.openImageLightbox 渲染，统一淡入 + 缩放动画。
   ============================================================ */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.image-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.image-lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  /* 图片显式垫底，避免大图在移动端盖住/拦截关闭与切换按钮的点击 */
  position: relative;
  z-index: 0;
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-modal);
  transform: scale(0.98);
  transition: transform var(--transition);
}
.image-lightbox.is-open img {
  transform: scale(1);
}
.image-lightbox .lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  /* 按钮始终位于图片/说明之上，手机端不被遮挡 */
  z-index: 20;
  transition: background var(--transition-fast);
}
.image-lightbox .lb-btn:hover { background: rgba(255, 255, 255, 0.28); }
.image-lightbox .lb-close { top: 16px; right: 18px; width: 40px; height: 40px; font-size: 22px; }
.image-lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 26px; }
.image-lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 26px; }
.image-lightbox .lb-bar {
  position: absolute;
  top: 16px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  /* 顶部信息条同样提级，不被图片盖住 */
  z-index: 20;
}
.image-lightbox .lb-count { color: #fff; font-size: var(--text-base); opacity: 0.85; }
.image-lightbox .lb-full {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: var(--text-base);
  transition: background var(--transition-fast);
}
.image-lightbox .lb-full:hover { background: rgba(255, 255, 255, 0.28); }
.image-lightbox .lb-cap {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: var(--text-base);
  opacity: 0.9;
  padding: 0 24px;
}
.image-lightbox .lb-loading {
  position: absolute;
  bottom: 54px;
  display: none;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: var(--text-base);
}
.image-lightbox .lb-loading.is-on { display: flex; }
.image-lightbox .lb-loading .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lb-spin 0.8s linear infinite;
}
@keyframes lb-spin { to { transform: rotate(360deg); } }

/* ============================================================
   上传弹窗内容（window.openUploadModal，承载于 modal.js 的 .modal 内）
   取代 upload-modal.js 原 injectStyle() 注入的 .upload-modal-overlay/.um-* 内联样式。
   ============================================================ */
.um-body { display: flex; flex-direction: column; }
.um-drop {
  margin: 14px 16px;
  padding: 26px 12px;
  border: 2px dashed var(--border-strong, #cbd5e1);
  border-radius: var(--radius-md, 10px);
  text-align: center;
  cursor: pointer;
  color: var(--text-muted, #9ca3af);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.um-drop:hover, .um-drop.um-drag { background: var(--bg-hover, #f8fafc); border-color: var(--text-primary, #111); }
.um-drop-icon { font-size: 28px; line-height: 1; margin-bottom: 6px; }
.um-drop-text { font-size: var(--text-base); }
.um-file { display: none; }
.um-preview { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px; }
.um-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-muted, #f3f4f6);
}
.um-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.um-thumb-rm {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff; font-size: var(--text-base); line-height: 1;
  cursor: pointer;
}
.um-thumb-ok, .um-thumb-er {
  position: absolute;
  left: 2px; bottom: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  color: #fff; font-size: var(--text-base);
  display: flex; align-items: center; justify-content: center;
}
.um-thumb-ok { background: #16a34a; }
.um-thumb-er { background: #dc2626; }
.um-thumb.um-thumb-error { outline: 2px solid #dc2626; }
.um-caption {
  margin: 12px 16px 0;
  width: calc(100% - 32px);
  resize: vertical;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: var(--text-base);
  color: var(--text-primary, #111);
  background: var(--bg-card, #fff);
}
.um-progress { margin: 14px 16px 0; display: flex; align-items: center; gap: 10px; }
.um-progress-bar { height: 6px; flex: 1; background: var(--bg-muted, #eef2f7); border-radius: 999px; overflow: hidden; }
.um-progress-bar > i { display: block; height: 100%; width: 0; background: var(--text-primary, #111); transition: width 0.2s; }
.um-progress-text { font-size: var(--text-base); color: var(--text-muted, #9ca3af); min-width: 34px; text-align: right; }
.um-error { margin: 10px 16px 0; color: #dc2626; font-size: var(--text-base); }
.um-hint { font-size: var(--text-base); color: var(--text-muted, #9ca3af); }

/* ============================================================
   头像裁切（openAvatarCropper，承载于 modal.js 的 .modal 内）
   仅保留裁切交互专属样式；面板/遮罩/缩放/淡入动画由 modal.js + .modal-* 提供。
   原 .crop-overlay/.crop-dialog/.crop-head/.crop-foot 已删除，统一复用模态系统。
   ============================================================ */
.crop-stage { position: relative; width: 280px; height: 280px; margin: 0 auto; border-radius: var(--radius-md, 10px); overflow: hidden; background: var(--bg-muted); user-select: none; touch-action: none; cursor: grab; }
.crop-stage.is-dragging { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.crop-frame { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); }
.crop-frame::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.9); }
.crop-zoom-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.crop-zoom-row svg { width: 18px; height: 18px; color: var(--text-secondary); flex: none; }
.crop-zoom { flex: 1; accent-color: var(--text-primary); }
.crop-hint { margin-top: 10px; font-size: var(--text-xs); color: var(--text-muted); text-align: center; }

/* ============================================================
   联程关联弹窗（页面式列表选择）
   复用现有设计语言：搜索框用 .form-input，列表项复用 .connected-item，
   选中态沿用 .trip-card.selected 的 --text-primary 描边，推荐标记用 .badge-connect
   ============================================================ */
.connect-search {
  position: relative;
  margin-bottom: var(--space-4);
}
.connect-search .form-input {
  padding-left: 36px; /* 给搜索图标留位 */
}
.connect-search .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
/* 可点击选择的联程候选：沿用 .connected-item 外观，增加指针与选中态 */
.connect-list .connected-item.selectable {
  cursor: pointer;
  /* 不覆盖 justify-content（沿用 .connected-item 的 space-between，使勾选标记右对齐） */
  gap: var(--space-3);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.connect-list .connected-item.selectable:hover {
  border-color: var(--border-strong);
}
.connect-list .connected-item.selectable.is-selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--text-primary) inset, var(--shadow-hover);
}
/* 联程选择：推荐行程 / 其他行程 两个分组，各为一个带分割线的大容器 */
.connect-group-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 14px 0 8px;
}
.connect-group-title:first-child { margin-top: 0; }
.connect-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  overflow: hidden;
}
.connect-group .connected-item.selectable {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.connect-group .connected-item.selectable:last-child {
  border-bottom: none;
}
.connect-group .connected-item.selectable:hover {
  background: var(--bg-card);
}
.connect-group .connected-item.selectable.is-selected {
  background: var(--bg-card);
  box-shadow: inset 3px 0 0 var(--text-primary);
}
.connect-item-refund {
  flex: none;
}
/* 圆形勾选标记，沿用主题色（--text-primary），不使用强调蓝 */
.ci-check {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-card);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.ci-check svg {
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.connect-group .connected-item.selectable.is-selected .ci-check {
  background: var(--text-primary);
  border-color: var(--text-primary);
}
.connect-group .connected-item.selectable.is-selected .ci-check svg {
  opacity: 1;
}
.connect-group .connected-item.selectable.is-selected {
  border-bottom-color: transparent;
}
.connect-empty-tip {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
}

/* ============================================================
   Toast
   ============================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + var(--space-3));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  max-width: 360px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-toast);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  pointer-events: auto;
  /* 滑入动画：0.2s 太短、位移太小，视觉上接近"直接出现"；加长 + 更大位移 + 柔和缓动，
     让右侧滑入感清晰可见（both 保证动画开始前即处于起点，避免闪烁） */
  animation: toastIn 0.32s cubic-bezier(0.21, 1.02, 0.73, 1) both;
  font-size: var(--text-sm);
  color: var(--text-primary);
  min-width: 280px;
}

.toast.is-leaving {
  /* 淡出时长与滑入一致，节奏统一 */
  animation: toastOut 0.32s ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(28px); }
}

.toast-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
  line-height: 1.5;
}

.toast-close {
  flex-shrink: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  margin: -2px;
  border-radius: var(--radius-sm);
}

.toast-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--text-secondary); }

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-navbar);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-height);
  display: flex;
  align-items: center;
}

.navbar-inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.navbar-brand {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.navbar-brand:hover {
  color: var(--text-secondary);
}

/* 品牌名中文小字使用阿里巴巴普惠体（英文走 mono） */
.navbar-brand small {
  font-family: 'Alibaba PuHuiTi', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.navbar-link {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.navbar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.navbar-link.is-active {
  color: var(--text-primary);
  background: var(--bg-muted);
}

/* 禁用态 tab（如未上线的统计页）：置灰、禁止点击、无交互反馈 */
.navbar-link.is-disabled,
.mobile-tabs a.is-disabled {
  color: var(--text-muted);
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.navbar-link.is-disabled:hover,
.mobile-tabs a.is-disabled:hover {
  color: var(--text-muted);
  background: transparent;
}

/* 顶部右侧「管理 / 公告」图标在对应页面高亮（与左侧 tab 一致） */
.navbar-right .btn.is-active {
  color: var(--text-primary);
  background: var(--bg-muted);
}
.nav-bell.is-active {
  color: var(--text-primary);
  background: var(--bg-muted);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* 通知铃铛 */
.nav-bell {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
}

.nav-bell svg {
  width: 15px;
  height: 15px;
}

.nav-bell:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-bell-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--error);
  border: 1.5px solid var(--bg-base);
  box-sizing: content-box;
}

/* 移动端底部导航 tab（行程/我的） */
.mobile-tabs {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-navbar) - 1);
  height: 54px;
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.mobile-tabs a svg {
  width: 17px;
  height: 17px;
}

.mobile-tabs a.is-active {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
}

/* 主题切换按钮 */
.theme-toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* 用户菜单（头像下拉） */
.user-menu {
  position: relative;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  color: var(--bg-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: opacity var(--transition-fast);
}

.user-avatar:hover {
  opacity: 0.85;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: var(--space-1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: var(--z-dropdown);
}

.user-menu.is-open .user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-1);
}

.user-dropdown-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: 1.4;
}

.user-dropdown-email {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-align: left;
}

.user-dropdown-item:hover {
  background: var(--bg-hover);
}

.user-dropdown-item.is-danger {
  color: var(--error);
}

.user-dropdown-item.is-danger:hover {
  background: var(--error-bg);
}

/* 移动端：navbar / tab / 工具栏响应式 */
@media (max-width: 640px) {
  /* ---- 导航栏 ---- */
  .navbar-inner {
    padding: 0 var(--space-3);
    gap: var(--space-2);
  }
  /* 品牌名隐藏中文小字 */
  .navbar-brand small {
    display: none;
  }
  /* 顶部 tab 移入底部导航（.mobile-tabs） */
  .navbar-nav {
    display: none;
  }
  /* 右侧按钮紧凑化：隐藏「退出/返回旧版」文字，只留图标 */
  .navbar-right {
    gap: var(--space-1);
  }
  .navbar-right .btn-sm {
    padding: 4px 8px;
    font-size: var(--text-sm);
  }
  .navbar-right .btn-sm svg {
    width: 14px;
    height: 14px;
  }
  .navbar-right .btn-sm .btn-text {
    display: none;
  }
  /* 移动端显示底部导航 tab */
  .mobile-tabs {
    display: flex;
    /* 全面屏左右留安全距离，防止边缘误触 */
    left: env(safe-area-inset-left, 0);
    right: env(safe-area-inset-right, 0);
    padding: 0 8px;
  }
  body.has-mobile-tabs {
    padding-bottom: 54px;
  }
  /* 有底部导航条时，sticky 的 .action-bar / .imp-footer 抬到导航条上方，避免被遮挡
     （添加/编辑行程等表单页的「下一步/取消/上一步」否则会被盖住） */
  body.has-mobile-tabs .action-bar,
  body.has-mobile-tabs .imp-footer {
    bottom: calc(54px + env(safe-area-inset-bottom));
  }
  /* 铃铛保持桌面端尺寸 */

  /* ---- 详情页 tab（车票信息/列车时刻表）---- */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox 隐藏滚动条 */
  }
  .tabs::-webkit-scrollbar {
    display: none;                  /* Safari/Chrome 隐藏滚动条 */
  }
  .tab {
    padding: 8px 12px;
    font-size: var(--text-base);
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ---- 时刻表工具栏（经停站数 + 按钮）---- */
  #sched-toolbar {
    gap: 6px !important;
    white-space: nowrap;
  }
  #sched-toolbar .btn-sm {
    padding: 4px 8px;
    font-size: var(--text-sm);
  }
  #sched-toolbar .text-sm {
    font-size: var(--text-base);
  }
}

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--text-secondary);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-3);
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-md);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

/* ============================================================
   分隔符
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: var(--space-4) 0;
}

.divider-vertical {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 var(--space-2);
}

/* ============================================================
   标题（页面级）
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ============================================================
   行程分组（行程中 / 待出行 / 2026年7月...）
   ============================================================ */
.trip-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 12px;
  padding-left: 2px;
}
.trip-group-title {
  font-family: 'Alibaba PuHuiTi', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  white-space: nowrap;
}
.trip-group-bar {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   行程卡片（trips 首页 P1 风格）
   ============================================================ */
.trip-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-static);
  padding: var(--space-4) var(--space-5);
  padding-left: calc(var(--space-5) + 4px);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.trip-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--train-color, var(--train-default));
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.trip-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.trip-card:hover::before {
  width: 5px;
}

.trip-card:active {
  transform: scale(0.997);
}

/* 退票卡片：整体置灰 + 镶边变灰 */
.trip-card.refunded {
  opacity: 0.6;
  filter: grayscale(0.4);
  background: var(--bg-muted);
}
.trip-card.refunded::before {
  background: var(--text-muted) !important;
}

.app-card-revoked {
  opacity: 0.55;
  filter: grayscale(0.5);
}

.trip-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.trip-card-header-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* 收藏星标：默认克制灰描边，收藏后金色填充 */
.trip-card-fav {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.trip-card-fav:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.trip-card-fav.is-fav {
  color: #f5a623;
}
.trip-card-fav.is-fav:hover {
  background: color-mix(in srgb, #f5a623 12%, transparent);
}

/* lucide SVG 图标按钮：用于编辑时刻表的锁/上移/下移/删除等小图标按钮 */
.sched-icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sched-icon-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sched-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.sched-icon-btn i[data-lucide] {
  width: 14px;
  height: 14px;
}

/* lucide star 实心/空心：未收藏线框灰，已收藏实心金色 */
.trip-card-fav i[data-lucide] {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  transition: fill .15s;
}
.trip-card-fav.is-fav i[data-lucide] {
  fill: currentColor;
  stroke: currentColor;
}

.trip-card-train {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 2px;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.trip-card-date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-feature-settings: 'tnum';
}

.trip-card-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-2) 0;
}

.trip-card-station {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-shrink: 0;
}

.trip-card-station-name {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-card-station-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.trip-card-arrow {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 var(--space-2);
  min-width: 0;
}

.trip-card-duration {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-feature-settings: 'tnum';
}

.trip-card-arrow-line {
  width: 100%;
  height: 1px;
  background: var(--border-strong);
  position: relative;
}

.trip-card-arrow-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid var(--border-strong);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

.trip-card-train-type {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.trip-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.trip-card-time-range {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
}

/* 联程合并卡底部：分段明细 + 中转 + 总票价（复用 token，无强调色） */
.trip-card-price {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  font-feature-settings: 'tnum';
  margin-left: auto;
}
.merged-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.merged-legs {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-feature-settings: 'tnum';
}
.merged-stop {
  color: var(--text-muted);
}
/* 联程合并卡：逐段列出全部行程（修复「只显示首尾2张」），复用现有 token */
.merged-legs-list {
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px dashed var(--border-color);
  padding-top: var(--space-2);
}
.merged-leg {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.4;
}
.merged-leg-idx {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.merged-leg-train {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  font-feature-settings: 'tnum';
}
.merged-leg-route {
  flex: 1 1 auto;
  color: var(--text-primary);
}
.merged-leg-time {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-feature-settings: 'tnum';
}

/* ============================================================
   行程多选
   ============================================================ */
.trip-card.selectable {
  padding-left: 42px;
  cursor: pointer;
}

/* 勾选框（左上角，浮在列车色条之上） */
.trip-card-check {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.trip-card-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--text-primary);
}

/* 选中态：主题色描边 + 轻微底色 */
.trip-card.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--text-primary) inset, var(--shadow-hover);
}
.trip-card.selected::before {
  width: 5px;
}

/* 底部多选操作栏 */
.selection-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900; /* 低于 --z-modal-backdrop(1000)，避免弹窗确认时 toolbar 盖在 modal 按钮上 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.10);
}
.selection-toolbar .sel-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.selection-toolbar .sel-all {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: var(--text-base);
  color: var(--text-primary);
  user-select: none;
}
.selection-toolbar .sel-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--text-primary);
  cursor: pointer;
}
.selection-toolbar .sel-count {
  font-size: var(--text-base);
  color: var(--text-secondary);
}
.selection-toolbar .sel-actions {
  display: flex;
  gap: var(--space-2);
}
.selection-toolbar .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 选择模式下给页面底部留出操作栏空间 */
body.has-selection-toolbar .page-container {
  padding-bottom: 84px;
}

@media (max-width: 600px) {
  .selection-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .selection-toolbar .sel-actions {
    justify-content: space-between;
  }
  .selection-toolbar .sel-actions .btn {
    flex: 1;
  }
}

/* ============================================================
   行程详情顶部车票卡
   ============================================================ */
.ticket-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-static);
  padding: var(--space-5) var(--space-6);
  padding-left: calc(var(--space-6) + 4px);
  margin-bottom: var(--space-5);
  overflow: hidden;
}

.ticket-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--train-color, var(--train-default));
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

/* 票面卡片首行：日期（含退改徽章）居左，检票口徽章钉在右上角。
   装不下时（如日期 + 退改徽章较长）整枚徽章换到下一行，靠 margin-left:auto 保持右对齐；
   徽章自身 nowrap + flex-shrink:0，绝不逐字换行或压扁（与「票面明细」行 .kv-line 同一套处理）。 */
.ticket-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px var(--space-3);
  margin-bottom: var(--space-3);
}

.ticket-card-head .ticket-card-date {
  margin-bottom: 0;
}

.ticket-card-gate {
  margin-left: auto;              /* 单行时钉右上；换行后仍靠右 */
  flex-shrink: 0;                 /* 不被压缩变形 */
  white-space: nowrap;            /* 「检票口」/值 不拆行 */
  max-width: 100%;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.ticket-card-gate-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: 0.2px;
  font-feature-settings: 'tnum';
}

.ticket-card-date {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  font-feature-settings: 'tnum';
}

.ticket-card-train {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -1px;
  margin-bottom: var(--space-4);
  line-height: 1;
}

.ticket-card-route {
  display: flex;
  align-items: center;       /* 与首页 .trip-card-route 保持一致：箭头居中于站名/时间列 */
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.ticket-card-station {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex-shrink: 0;
}

.ticket-card-station-time {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
  font-feature-settings: 'tnum';
}

.ticket-card-station-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.ticket-card-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  /* padding-top 移除：父级已 align-items:center，中部内容自身也居中，
     保留 padding-top 会把箭头整体往下推，导致不对齐。 */
}

.ticket-card-duration {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-feature-settings: 'tnum';
}

.ticket-card-arrow-line {
  width: 100%;
  height: 1px;
  background: var(--border-strong);
  position: relative;
}

.ticket-card-arrow-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid var(--border-strong);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.ticket-card-train-type {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.ticket-card-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

.ticket-card-seat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.ticket-card-seat-info {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.ticket-card-car {
  /* 中文「车」字用普惠体；数字部分由内层 .mono 单独走等宽终端体 */
  font-family: 'Alibaba PuHuiTi', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: var(--text-md);
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  white-space: nowrap;        /* 「2车」「10车」等永远黏死，不被 CJK 断行拆开 */
  flex-shrink: 0;             /* 位置信息不被压缩裁切 */
}

.ticket-card-seat {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  white-space: nowrap;        /* 座位号（如 12F / 06A）不拆行 */
  flex-shrink: 0;
}

.ticket-card-seat-type {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;        /* 席别（二等座等）不被拆行 */
}

.ticket-card-seat-tags {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-2);
  flex-wrap: nowrap;            /* 多个标签（靠窗/静音车厢）永不彼此拆行，整体作为一个单元 */
  white-space: nowrap;
}

/* 座位信息按语义分两组：主=车厢+座位（位置），次=席别+标签 */
.ticket-card-seat-primary {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-3);
}
.ticket-card-seat-secondary {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;              /* 仅当「席别+标签组」整体过宽时，才把标签组作为整体换到下一行，标签之间不拆 */
}

.ticket-card-price {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  font-feature-settings: 'tnum';
}

/* ============================================================
   时刻表（详情页 Tab 内容）
   ============================================================ */
.sched-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--page-padding, 20px) * -1);
  padding: 0 var(--page-padding, 20px);
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.schedule-table th,
.schedule-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.schedule-table th {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  background: var(--bg-muted);
  position: sticky;
  top: 0;
  padding: 5px 10px;
  border-bottom: 2px solid var(--border-strong);
}

.schedule-table td {
  color: var(--text-primary);
}

.schedule-table td.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
}

/* 车次变更提示条：展示在变更站与下一站之间，样式紧凑、与 12306 对齐 */
/* 车次变更提示：内嵌于站名单元格的第二行，紧凑弱提示（不再独占一行） */
.schedule-table .sched-station-name { font-weight: var(--font-medium); }
/* 车次变更提示条：位于变更站上方，跨列弱提示（视图只读 / 编辑可改） */
.schedule-table tr.sched-change-row > td {
  padding: 4px 12px;
  border-top: none;
  background: var(--bg-muted);
}
.schedule-table .sched-change-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text-secondary);
}
.schedule-table .sched-change-banner svg { flex: 0 0 auto; width: 14px; height: 14px; color: var(--text-secondary); }
.schedule-table .sched-change-banner b { color: var(--text-primary); font-weight: var(--font-semibold); margin: 0 2px; }
/* 视图态跨行变号提示默认隐藏：桌面用单元格内 .sched-change-inline，仅移动端显示跨行（见 media query） */
.schedule-table:not(.sched-edit-table) tr.sched-change-row { display: none; }
/* 视图态变更提示：内嵌在「站名」单元格内（只读），与编辑态 .sched-change-banner 输入框区分 */
.schedule-table .sched-change-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
  font-size: var(--text-base);
  line-height: 1.4;
  color: var(--text-secondary);
}
.schedule-table .sched-change-inline svg { flex: 0 0 auto; color: var(--text-muted); }
.schedule-table .sched-change-inline b {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  margin: 0 1px;
}
.schedule-table .sched-change-banner .sched-change-input {
  width: 92px;
  padding: 2px 6px;
  font-size: var(--text-base);
}
.schedule-table .sched-change-remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-md);
  line-height: 1;
  padding: 1px 4px;
}
.schedule-table .sched-change-remove:hover { color: var(--error); }
/* 编辑态「添加车次变更事件」下拉面板：列出所有站供选择，按需添加（避免每行都铺按钮） */
.sched-change-picker {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 200px;
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-static);
  padding: 6px;
}
.sched-change-picker-title {
  font-size: var(--text-base);
  color: var(--text-muted);
  padding: 2px 6px 6px;
}
.sched-change-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;                       /* 兜底 */
  max-height: min(260px, 55vh);            /* 小屏按视口高度自适应，避免撑出屏幕 */
  overflow-y: auto;
}
.sched-change-picker-search {
  margin-bottom: 6px;
}
.sched-change-pick-item {
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.4;             /* 防止中文/数字混排被上下裁切 */
  min-height: 32px;             /* 保证触控目标高度 */
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}
.sched-change-pick-item:hover { background: var(--bg-muted); }
.sched-change-picker-empty {
  padding: 8px;
  font-size: var(--text-base);
  color: var(--text-muted);
  text-align: center;
}
.sched-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.schedule-table tr.is-current {
  background: var(--bg-hover);
}

.schedule-table tr.is-current td {
  font-weight: var(--font-semibold);
}

/* 时刻表：高亮出发站 → 到达站区间（含两端及中间站）。灰色层级，与表头区分 */
.schedule-table tr.is-route {
  background: var(--bg-hover);
}
.schedule-table tr.is-endpoint {
  background: var(--bg-muted);
}
.schedule-table tr.is-endpoint td {
  font-weight: var(--font-semibold);
  /* 两端站即使相邻也保留表格分割线，不被同色背景吞掉 */
  border-bottom: 1px solid var(--border);
}

/* 编辑模式：站名限宽，避免挤压停靠/状态列 */
.schedule-table .sched-name-cell {
  width: 130px;
  max-width: 130px;
}
.schedule-table .sched-name-cell .form-input {
  width: 100%;
}
.schedule-table .sched-status-cell {
  width: 140px;
  min-width: 140px;
}
.schedule-table .sched-status-cell select.form-input {
  width: 100%;
}
/* 单列「状态」：下拉 + 数字 + 「分」字 紧凑横排 */
.sched-status-row {
  display: flex;
  align-items: center;
  gap: 3px;
}
.sched-status-row .sched-status-select {
  flex: 0 0 58px;
  width: 58px;
  padding: 4px 4px;
  font-size: var(--text-base);
}
.sched-status-row .sched-delay-input {
  flex: 0 0 42px;
  width: 42px;
  padding: 4px 4px;
  font-size: var(--text-base);
}
.sched-status-row .sched-delay-input:disabled {
  background: var(--bg-muted, #f5f5f5);
  color: var(--text-muted, #999);
  cursor: not-allowed;
}
.sched-status-row .sched-unit {
  font-size: var(--text-base);
  color: var(--text-muted);
}
/* 旧 sched-delay 样式保留以防他处引用 */
.sched-delay-cell {
  width: 80px;
  min-width: 80px;
}
.sched-delay-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sched-delay-row .form-input {
  width: 48px;
  flex: 0 0 auto;
}
/* 拖动手柄列 */
.sched-handle-cell {
  width: 24px;
  cursor: grab;
  text-align: center;
  color: var(--text-muted);
  user-select: none;
  font-size: var(--text-base);
  line-height: 1;
  padding: 5px 4px !important;
}
.sched-handle-cell:active { cursor: grabbing; }
/* 操作列：上移/下移/删除 */
.sched-actions-cell {
  width: 76px;
  white-space: nowrap;
  text-align: center;
  padding: 4px 4px !important;
}
.btn-sched-move,
.btn-sched-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: var(--text-base);
  line-height: 1;
  border-radius: 3px;
  color: var(--text-secondary);
  vertical-align: middle;
}
.btn-sched-move:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.btn-sched-move:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.btn-sched-del {
  color: var(--error);
  font-size: var(--text-base);
}
.btn-sched-del:hover {
  background: var(--error-bg);
}
/* 拖动中的行 */
.schedule-table tr.is-dragging {
  opacity: 0.4;
}
.schedule-table tr.is-drag-over {
  background: var(--bg-hover) !important;
}
.sched-unit {
  font-size: var(--text-base);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================
   详情 Tab 信息行（车票信息 tab 内容）
   ============================================================ */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: 1.2;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 80px;
  line-height: 1.2;
}

.info-value {
  color: var(--text-primary);
  font-weight: var(--font-medium);
  text-align: right;
  word-break: break-word;
  line-height: 1.2;
}

.info-value.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
}

/* 带行内编辑按钮的值域（文字 + 笔紧贴，间距 4px） */
.info-value-with-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.info-value-with-action > span {
  line-height: 1.2;
  vertical-align: middle;
}

/* ============================================================
   行程详情「票面明细」：光板两列网格
   —— 无卡片容器、无分组标题；值统一主黑、统一字重；窄屏塌成一列。
   层级不靠字重（实测等宽字体栈 400–700 同一张脸、CDN 中文字体未加载时
   500/600 也会塌成同一档）：交给「标签小灰字 / 值大黑字 + 车组号等宽
   + 异常退改的既有语义色」。
   只服务 trip-detail.html；上面的 .info-list/.info-row 保持原样（me.html 仍在用）。
   ============================================================ */
.kv-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.kv-row:last-child { border-bottom: none; }
.kv-row.single { grid-template-columns: 1fr; }

.kv-cell { min-width: 0; padding: var(--space-3) 0; }

.kv-k { font-size: var(--text-xs); color: var(--text-muted); }

.kv-v {
  margin-top: 4px;
  font-size: var(--text-md);   /* 桌面 15px（旧列表是 --text-sm 13px，放大一档看得见） */
  font-weight: var(--font-medium);
  color: var(--text-primary);
  line-height: 1.3;
}
.kv-v.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum';
}

/* 值 + 行内动作（徽章 / 按钮）同排；塞不下时整块换行，绝不压缩或词内拆行 */
.kv-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 4px;
  font-size: var(--text-md);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  line-height: 1.3;
}
.kv-line > * {
  flex-shrink: 0;
  white-space: nowrap;
}
.kv-line .push { margin-left: auto; }
/* 车组号用等宽（不加粗：等宽栈未必有多档字重，加了也看不出来） */
.kv-line .info-unit {
  font-family: var(--font-mono);
}
/* 退改状态徽章沿用「无底色、继承字号」的既有写法（原规则挂在 .info-value-with-action 上） */
.kv-line .badge-plain {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}
[data-theme="dark"] .kv-line .badge-plain { background: transparent; }

/* 手机（≤768px）：--text-md 会跳到 17px，收一档用 --text-base(16px) */
@media (max-width: 768px) {
  .kv-v, .kv-line { font-size: var(--text-base); }
}

/* 窄屏（≤360px）：两列塌成一列，避免每列放不下车组号/时间串 */
@media (max-width: 360px) {
  .kv-row { grid-template-columns: 1fr; column-gap: 0; }
}

/* 退改状态为「正常」时的普通文字展示（不加灰徽章） */
.info-text-normal {
  color: var(--text-secondary);
  font-weight: var(--font-medium);
}

/* 推断信息标记（如靠窗/靠过道）：按座位号字母推算，非 12306 票面数据，
   用小号灰 pill 与静音车厢等官方标注区分，明确来源层级 */
.info-inferred {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: var(--text-muted);
  background: var(--bg-muted, rgba(128, 128, 128, 0.12));
  border-radius: var(--radius-full, 999px);
  vertical-align: middle;
  white-space: nowrap;
}

/* 行内编辑按钮（笔图标） */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.icon-btn svg {
  display: block;
  vertical-align: middle;
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
/* 紧贴在值后面的笔按钮 */
.icon-btn-inline {
  width: 18px;
  height: 18px;
}

/* ============================================================
   底部固定操作栏（详情页）
   ============================================================ */
.action-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-base);
  border-top: none;
  padding: var(--space-3) var(--page-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 10;
}
.action-left,
.action-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================================
   概览条（行程首页顶部统计）
   ============================================================ */
.overview-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}

.overview-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.overview-item:last-child {
  border-right: none;
}

.overview-value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
  font-feature-settings: 'tnum';
}

.overview-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ============================================================
   筛选栏
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.filter-input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.filter-select {
  width: auto;
  min-width: 120px;
}

.filter-select-btn {
  margin-left: auto;
}

/* ============================================================
   向导步骤（trip-add 4 步）
   ============================================================ */
.wizard {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-6);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.wizard-step-index {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.wizard-step.is-active .wizard-step-index {
  background: var(--text-primary);
  color: var(--bg-base);
}

.wizard-step.is-done .wizard-step-index {
  background: var(--text-primary);
  color: var(--bg-base);
}

.wizard-step.is-active,
.wizard-step.is-done {
  color: var(--text-primary);
}

.wizard-step-label {
  font-weight: var(--font-medium);
}

.wizard-connector {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 var(--space-2);
}

.wizard-connector.is-done {
  background: var(--text-primary);
}

/* ============================================================
   入口卡片（trip-add Step1 三入口）
   ============================================================ */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  text-align: left;
}

.entry-card:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.entry-card:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.entry-card.is-active {
  border-color: var(--text-primary);
  background: var(--bg-hover);
  box-shadow: 0 0 0 1px var(--text-primary);
}

/* 选中态 hover 时保留高亮边框/环，避免被 .entry-card:hover 的普通边框覆盖 */
.entry-card.is-active:hover {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--text-primary);
  transform: translateY(-1px);
}

.entry-card-icon {
  width: 32px;
  height: 32px;
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
}

.entry-card-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.entry-card-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 640px) {
  /* 手机端三入口卡片紧凑横排：图标缩小至行内、隐藏描述、减少 padding */
  .entry-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }
  .entry-card {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-1);
  }
  .entry-card-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 0;
  }
  .entry-card-title {
    font-size: var(--text-sm);
    margin-bottom: 0;
  }
  .entry-card-desc {
    display: none;
  }
}

/* ============================================================
   我的页（GitHub 风侧边栏）
   ============================================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-6);
  align-items: flex-start;
}

.settings-sidebar {
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-4));
}

.settings-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.settings-sidebar-link:hover,
.settings-sidebar-link.is-active {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.settings-sidebar-link.is-active {
  background: var(--bg-muted);
  font-weight: var(--font-medium);
}

.settings-content {
  min-width: 0;
}

.settings-section {
  margin-bottom: var(--space-6);
}

.settings-section-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.settings-section-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* 账号信息分组标题（与“第三方账号”区块样式统一） */
.card-group-title {
  display: flex;
  align-items: center;
  gap: var(--space-2, 6px);
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: var(--space-5, 22px) 0 var(--space-2, 8px);
}
.card-group-title:first-of-type {
  margin-top: 0;
}
.card-group-title svg {
  opacity: 0.7;
}

/* 车站联想输入 */
.input-with-suggestions {
  position: relative;
}
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-hover);
  z-index: var(--z-modal, 100);
  max-height: 240px;
  overflow-y: auto;
  margin-top: -1px;
}
.suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.suggestion-item .suggestion-name {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
}
.suggestion-item .suggestion-city {
  font-size: var(--text-base);
  color: var(--text-secondary);
  flex-shrink: 0;
}
.suggestion-item:hover,
.suggestion-item.is-active {
  background: var(--bg-hover);
}
.suggestion-item:active {
  background: var(--bg-muted);
}

@media (max-width: 768px) {
  .settings-layout {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  /* 手机端平铺：隐藏侧栏 tab，所有分区直接堆叠显示，无需切换 */
  .settings-sidebar { display: none; }
  .settings-section { display: block !important; }
  .settings-section + .settings-section {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
  }
}

/* ============================================================
   Profile 卡片（我的页顶部）
   ============================================================ */
.profile-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-static);
  margin-bottom: var(--space-5);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  color: var(--bg-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: 1.3;
}

.profile-email {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

.profile-stats {
  display: flex;
  gap: var(--space-5);
  margin-top: var(--space-3);
}

.profile-stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  font-feature-settings: 'tnum';
}

.profile-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: 4px;
}

@media (max-width: 640px) {
  .profile-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .profile-stats {
    gap: var(--space-3);
  }
}

/* ============================================================
   登录页（纯背景，元素自带边框）
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--bg-base);
}

.auth-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-brand {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -1px;
  margin-bottom: var(--space-2);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: var(--space-2) 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.auth-links a:hover {
  color: var(--text-primary);
}

.auth-social {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.btn-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn-social:hover {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.btn-social:active {
  transform: translateY(1px);
}

.btn-social svg {
  flex-shrink: 0;
}

/* OAuth 按钮 disabled 状态：置灰、不可点。
   用途：provider 后台尚未申请但已占位时启用，避免误跳到无密钥的 OAuth 流。 */
.btn-social[disabled],
.btn-social:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
}

.btn-social[disabled]:hover,
.btn-social:disabled:hover {
  /* 覆盖 .btn-social:hover 的 hover 效果，避免视觉"激活"感 */
  background: transparent;
  border-color: var(--border-strong);
}

.auth-theme-toggle {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  gap: var(--space-1);
  z-index: 10;
}

/* 登录页主题切换圆形按钮（参考旧项目 auth-theme-btn） */
.auth-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.auth-theme-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.auth-theme-btn.is-active {
  background: var(--bg-muted);
  color: var(--text-primary);
}

/* ============================================================
   鉴权页（登录/注册/忘记密码）卡片式错误提示
   ============================================================ */
.auth-alert {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--error-bg);
  border: 1px solid color-mix(in srgb, var(--error) 35%, transparent);
  color: var(--error);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.45;
}
.auth-alert.is-visible { display: flex; }
.auth-alert-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: currentColor;
}
.auth-alert-text {
  flex: 1;
  word-break: break-word;
}
.auth-alert.is-shake {
  animation: authAlertShake 0.38s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes authAlertShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.auth-input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* 底部「添加站」按钮：默认（桌面）隐藏，仅 mobile 显示（见下方 media 段） */
.btn-sched-add-bottom { display: none; }

/* ============================================================
   移动端响应：通用
   ============================================================ */
@media (max-width: 640px) {
  :root {
    --page-padding: 16px;
  }
  .page-container {
    padding: var(--space-4) var(--page-padding) var(--space-6);
  }
  .page-title {
    font-size: var(--text-xl);
  }
  .overview-bar {
    padding: var(--space-3);
  }
  .overview-value {
    font-size: var(--text-xl);
  }
  .trip-card {
    padding: var(--space-3) var(--space-4);
    padding-left: calc(var(--space-4) + 4px);
  }
  .trip-card-station-name {
    /* 移动端不再把站名压小：站名是卡片主角，保持中等强调(--text-md=17px)，与桌面一致 */
    font-size: var(--text-md);
  }
  .ticket-card {
    padding: var(--space-4);
    padding-left: calc(var(--space-4) + 4px);
  }
  .ticket-card-train {
    font-size: var(--text-2xl);   /* 24px，保持车次号为视觉主角 */
  }
  .ticket-card-station-time {
    /* 原 --text-md(16px) 在手机上太小；放大到 20px 让到发时间清晰可读 */
    font-size: var(--text-xl);
  }
  .ticket-card-station-name {
    font-size: var(--text-base);  /* 14→16px，手机端站名更清楚 */
  }
  .ticket-card-seat-row {
    flex-wrap: nowrap;            /* 强制价格与座位信息同一行，不允许整行换到下一行 */
  }
  .ticket-card-price {
    white-space: nowrap;          /* ¥金额 不被拆行 */
    flex-shrink: 0;               /* 不被压缩，始终完整 */
    margin-left: auto;            /* 钉在右侧，与座位信息分隔 */
  }
  .ticket-card-seat-info {
    flex: 1 1 auto;               /* 占满剩余空间 */
    min-width: 0;                 /* 允许收缩，不被挤压 */
    flex-wrap: nowrap;            /* 单行：车厢·座位·席别·标签 同处一行，二等座不掉第二行 */
    align-items: baseline;
    gap: var(--space-2);          /* 比桌面 --space-3 收紧，窄屏留余量 */
  }
  .ticket-card-seat-primary,
  .ticket-card-seat-secondary {
    gap: var(--space-2);          /* 组内间距同步收紧，单行装得下（含 2 标签仍 ≤320px） */
  }
  .action-bar {
    padding: var(--space-3) var(--space-4);
  }

  /* ===========================================================
     时刻表移动端样式
     - 视图态（.schedule-table，非编辑）：保持表格，靠外层横向滚动防溢出 + 字号放大
     - 编辑态（.sched-edit-table）：table → cards，每站一张卡片
     =========================================================== */
  .sched-scroll-wrap {
    margin: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

    /* ===========================================================
     编辑态卡片化（仅 .sched-edit-table）
     =========================================================== */
  .sched-edit-table,
  .sched-edit-table tbody,
  .sched-edit-table tr,
  .sched-edit-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  /* 表头在 mobile 隐藏（label 由 ::before 显示） */
  .sched-edit-table thead { display: none; }

  /* 每站卡片 */
  .sched-edit-table tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px 10px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-static);
  }

  /* 卡内行：flex，左 label 右控件 */
  .sched-edit-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border: none;
  }
  .sched-edit-table td[data-label]::before {
    content: attr(data-label);
    flex-shrink: 0;
    width: 44px;
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
  }

  /* 编辑态卡头：sched-handle-cell（用 ⠿ 拖动柄），隐藏 ⠿ 显示"站序 N" */
  .sched-edit-table .sched-handle-cell {
    padding: 2px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
    cursor: grab;
    /* ⠿ 文字隐藏（被 ::before/::after 替代） */
    color: transparent;
    text-shadow: none;
  }
  .sched-edit-table .sched-handle-cell::before {
    content: "站序 " attr(data-no);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
  }
  .sched-edit-table .sched-handle-cell:active { cursor: grabbing; }

  /* 编辑态第二个 # 数字 td：被 sched-handle-cell 合并，隐藏 */
  .sched-edit-table .sched-num-cell {
    display: none !important;
  }

  /* 状态格：column 布局让 row + 解冻按钮 各占一行，避免叠住 select */
  .sched-edit-table .sched-status-cell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .sched-edit-table .sched-status-cell .sched-unfreeze-btn {
    align-self: flex-start;
  }

  /* 站名/到点/开点/停靠 行：底分隔、抬高触控区 */
  .sched-edit-table td[data-label="站名"],
  .sched-edit-table td[data-label="到点"],
  .sched-edit-table td[data-label="开点"],
  .sched-edit-table td[data-label="停靠"] {
    border-bottom: 1px dashed var(--border);
    min-height: 38px;
  }

  /* 站名 td：单独更大字号 */
  .sched-edit-table td[data-label="站名"] .form-input {
    padding: 6px 8px;
  }

  /* 卡内输入框占满右半 */
  .sched-edit-table .form-input {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  /* 不可编辑占位 td（"—"）：单色 mono */
  .sched-edit-table .sched-skip-field {
    color: var(--text-muted);
    font-family: var(--font-mono);
    justify-content: flex-end !important;
  }

  /* 状态行卡内：select 自适应宽度，数字 + 分 同排 */
  .sched-edit-table .sched-status-row {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .sched-edit-table .sched-status-row .sched-status-select {
    flex: 1;
    min-width: 70px;
    padding: 6px 6px;
    font-size: var(--text-base);
  }
  .sched-edit-table .sched-status-row .sched-delay-input {
    flex: 0 0 50px;
    width: 50px;
    padding: 6px 4px;
    font-size: var(--text-base);
  }
  .sched-edit-table .sched-status-row .sched-unit {
    font-size: var(--text-base);
    color: var(--text-secondary);
  }
  .sched-edit-table .sched-status-cell .sched-unfreeze-btn.sched-icon-btn i[data-lucide] {
    width: 12px;
    height: 12px;
  }

  /* 操作行：横向按钮，触控区放大 */
  .sched-edit-table .sched-actions-cell {
    justify-content: flex-end !important;
    padding-top: 8px !important;
    border-top: 1px dashed var(--border) !important;
    margin-top: 4px;
    gap: 8px !important;
  }
  .sched-edit-table .sched-actions-cell::before { display: none; }
  .sched-edit-table .btn-sched-move,
  .sched-edit-table .btn-sched-del {
    width: 32px;
    height: 32px;
    font-size: var(--text-base);
    border-radius: 4px;
  }

  /* 添加站按钮：mobile 放在卡片列表底部，桌面隐藏（用顶部 toolbar 的） */
  #btn-sched-add { display: none !important; }
  .sched-add-bottom-wrap {
    margin-top: 10px;
  }
  .btn-sched-add-bottom {
    display: block !important;
    width: 100%;
    padding: 10px 0;
    font-size: var(--text-base);
  }
}

/* ============================================================
   省成就专属解锁弹窗（全新样式，不复用通用 modal）
   ============================================================ */
.prov-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .24s ease;
}
.prov-unlock-overlay.show { opacity: 1; }
/* 解锁弹窗挂在 body 上（脱离 .ach-page 作用域），统一黑白灰配色（贴合项目主题）。
   高亮色复用 --ach-accent: var(--text-primary)，与成就详情页省级行政区高亮完全一致，
   不在此写死任何颜色，全部走项目主题 token。 */
.prov-unlock-card {
  --ach-accent: var(--text-primary);
  width: min(340px, 100%);
  background: var(--bg-base);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px;
  text-align: center;
  transform: scale(.9) translateY(16px);
  transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
  box-shadow: var(--shadow-modal);
}
.prov-unlock-overlay.show .prov-unlock-card { transform: none; }
.prov-unlock-eyebrow {
  display: inline-block;
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--text-primary);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  margin-bottom: 12px;
}
.prov-unlock-map-wrap {
  width: min(340px, 88vw);
  aspect-ratio: 7 / 5;
  margin: 0 auto;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}
@media (max-width: 640px) {
  .prov-unlock-map-wrap {
    width: 92vw;
    aspect-ratio: 4 / 3;
  }
}
.prov-unlock-map {
  width: 100%;
  height: 100%;
  position: relative;
}
.prov-unlock-map > svg,
.prov-unlock-scs-side > svg,
.prov-unlock-map svg.geo-svg { width: 100%; height: 100%; display: block; }
.prov-unlock-scs-side {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22%;
  max-width: 80px;
  aspect-ratio: 10 / 17;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 10;
}
.prov-unlock-scs-side::after {
  content: '南海诸岛';
  position: absolute;
  left: 0; right: 0; bottom: 1px;
  height: 12px;
  line-height: 12px;
  text-align: center;
  font-size: 9px;
  color: var(--text-secondary);
  pointer-events: none;
}
/* 为底部文字标签预留空间，避免与南海岛礁重叠 */
.prov-unlock-scs-side { padding-bottom: 12px; }
@media (max-width: 768px) {
  .prov-unlock-scs-side::after {
    content: none;
  }
  .prov-unlock-scs-side { padding-bottom: 0; }
}
.prov-unlock-name {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  min-height: 32px;
}
.prov-unlock-std {
  margin-top: 2px;
  font-size: var(--text-base);
  color: var(--text-secondary);
}
.prov-unlock-blurb {
  margin-top: 10px;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-secondary);
}
.prov-unlock-btn {
  margin-top: 16px;
  width: 100%;
  justify-content: center;
}

/* 上传区「加速识别」开关 */
.ocr-accel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  font-size: var(--text-base);
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}
.ocr-accel input {
  width: 16px;
  height: 16px;
  accent-color: var(--text-primary);
  cursor: pointer;
}

/* OCR 识别中：三段阶段点指示器（已上传 → 模型识别中 → 即将完成） */
.ocr-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 18px;
}
.ocr-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 64px;
}
.ocr-step-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: transparent;
  box-sizing: border-box;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.ocr-step-dot svg {
  width: 16px;
  height: 16px;
}
.ocr-step-label {
  font-size: var(--text-base);
  color: var(--text-muted);
  transition: color 0.25s;
}
/* 完成态 */
.ocr-step.done .ocr-step-dot {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-card);
}
.ocr-step.done .ocr-step-label {
  color: var(--text-primary);
}
/* 进行态（脉冲） */
.ocr-step.active .ocr-step-dot {
  border-color: var(--text-primary);
  animation: ocr-step-pulse 1.2s ease-in-out infinite;
}
.ocr-step.active .ocr-step-label {
  color: var(--text-primary);
  font-weight: var(--font-medium);
}
/* 待完成态 */
.ocr-step.pending .ocr-step-dot {
  border-color: var(--border);
}
.ocr-step.pending .ocr-step-label {
  color: var(--text-muted);
}
/* 连接线 */
.ocr-step-line {
  flex: 0 0 40px;
  height: 2px;
  background: var(--border);
  margin: 0 6px 18px;
  transition: background 0.25s;
}
.ocr-step-line.done {
  background: var(--text-primary);
}
@keyframes ocr-step-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.12); }
  70% { box-shadow: 0 0 0 7px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* OCR 识别失败内联错误卡片（替代顶部 long toast） */
.ocr-error-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  border: 1px dashed var(--error);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.ocr-error-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--error);
  margin-bottom: 12px;
}
.ocr-error-icon svg {
  width: 32px;
  height: 32px;
}
.ocr-error-title {
  font-size: 17px;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: 8px;
}
.ocr-error-message {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 420px;
}
.ocr-error-detail-wrap {
  margin-top: 12px;
  width: 100%;
  max-width: 420px;
}
.ocr-error-detail-toggle {
  font-size: var(--text-base);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.ocr-error-detail-toggle:hover {
  color: var(--text-primary);
}
.ocr-error-detail {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
}
.ocr-error-detail.is-open {
  display: block;
}
.ocr-error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

/* OCR 额度进度条（me.html 与 ticket-ocr.js 共用；此前误放 import.css 导致 me.html 无样式） */
.ocr-credit-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.ocr-credit-label {
  font-size: var(--text-base);
  color: var(--text-secondary);
}
.ocr-credit-figure {
  font-size: var(--text-base);
  color: var(--text-secondary);
}
.ocr-credit-figure strong {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}
.ocr-credit-figure > span:not(.ocr-credit-unit) {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.ocr-credit-unit {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-left: 2px;
}
.ocr-credit-bar {
  height: 12px;
  border-radius: 999px;
  background: var(--bg-muted, #ececec);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.ocr-credit-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--text-primary);
  transition: width .35s ease;
  min-width: 2px;
}
.ocr-credit-bar-fill.is-empty { background: var(--error); }
.ocr-credit-hint {
  margin-top: 10px;
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.55;
}

/* 额度卡容器（trip-add.html OCR 模式顶部，与 me.html 的 .card/.card-body 视觉一致） */
.ocr-credit-block {
  background: var(--bg-elevated, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: var(--space-4);
}
.ocr-credit-block .ocr-credit-head { margin-bottom: 10px; }
.ocr-credit-block .ocr-credit-hint { margin-top: 10px; }

/* ============================================================
   站点数据清洗台（仅桌面/平板可见，手机端由 .desktop-only 屏蔽）
   ============================================================ */
.st-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--bg-muted, #f5f5f5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.st-filter-label {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-right: 4px;
}
.st-filter-chip {
  padding: 4px 12px;
  font-size: var(--text-base);
  color: var(--text-secondary);
  background: var(--bg-base, #fff);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.st-filter-chip:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.st-filter-chip.is-active {
  color: var(--bg-base);
  background: var(--text-primary);
  border-color: var(--text-primary);
}

/* 列表项质量小标：紧凑、可换行 */
.st-quality-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* 行内快改（就地展开，不跳页不弹窗） */
.st-inline-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0 4px;
  width: 100%;
}
.st-inline-edit .form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.st-inline-edit .form-row > .form-group { flex: 1; min-width: 120px; margin: 0; }
.st-inline-edit .st-inline-checks { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.st-inline-edit .st-inline-checks label { display: flex; align-items: center; gap: 6px; font-size: var(--text-base); color: var(--text-primary); cursor: pointer; }
.st-inline-edit .st-inline-actions { display: flex; gap: 8px; margin-top: 2px; }

/* 额度卡头部的「自动模型」徽标 */
.ocr-credit-badge {
  display: inline-block;
  flex: none;
  font-size: var(--text-base); font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 999px;
  padding: 2px 10px;
}


/* ============================================================
   行程详情 · 列车时刻表改版（2026-10-03）
   设计文档：docs/superpowers/specs/2026-10-03-timetable-timeline-design.md

   手机端（≤768px）视图态改用「连贯时间轴」，桌面端保持原表格：
   两套结构同时存在于 DOM，靠媒体查询显隐（与「车次变更」的桌面/移动双写法同一套路）。
   时间轴栅格：站名自适应 · 里程 52 · 到点 36 · 开点 36 · 状态 58
   ============================================================ */
:root {
  /* 时间轴专用：轴线与「乘车区间外」灰态。
     轴线不用 --border-strong(#D4D4D4)：2px 下实测几乎不可见，故用更实的 #C0C0C0。
     区间外的正晚点走「红/绿去饱和」（保留色相），纯灰会丢失早/晚点的类别信息。
     饱和与明度：区间内 晚点 hsl(0,72%,51%) / 早点 hsl(142,76%,36%)；
                区间外 晚点 hsl(0,18%,55%) / 早点 hsl(142,18%,40%)。
     早先一版用 23% 饱和、68% 明度，实测「太浅太灰」；收到 45% 后又偏抢眼，
     故降回 18% 左右（明度保持，不回到 68% 那种发白），保留色相但明显去饱和。 */
  --sched-axis: #C0C0C0;
  --sched-out-text: #B0B0B0;
  --sched-out-strong: #B8B8B8;
  --sched-late-muted: #A17878;
  --sched-early-muted: #547861;
}
[data-theme="dark"] {
  --sched-axis: #4A4A4A;
  --sched-out-text: #6E6E6E;
  --sched-out-strong: #616161;
  --sched-late-muted: #B89999;
  --sched-early-muted: #87AB94;
}

/* 标题行：标题 + 数据来源标记（实时 · HH:MM / 图定 / 固写 · MM-DD） */
.sched-view-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}
.sched-view-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold, 600);
  color: var(--text-primary);
}
.sched-src {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 1px 7px 1px 6px;
}
.sched-src .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-primary);
}
.sched-src.is-plan .dot {
  width: 5px;
  height: 5px;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
}
.sched-src.is-frozen { color: var(--text-muted); }
.sched-src.is-frozen .dot { background: var(--border-strong); }

/* 状态色：区间内饱和（类而非内联样式，否则区间外去饱和压不过） */
.st-late { color: var(--error); font-weight: 500; }
.st-early { color: var(--success); font-weight: 500; }
.st-neutral { color: var(--text-primary); }
.st-unknown { color: var(--text-muted); }

/* 时间轴：电脑端同样使用（视图态只有这一种结构）。
   max-width 收敛内容宽度：宽屏把列拉太开会让眼睛在「站名 → 时刻」之间长距离横跳。 */
.sched-tl-wrap { display: block; max-width: 560px; }

/* 列头：与数据行共用列类，只覆盖字号与颜色
   （宽度/间距必须与数据列同源：曾因列头写 36px、数据被 min-content 撑到 44px，逐列错开 8px） */
.sched-tl-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 6px 6px;
  border-bottom: 1px solid var(--border);
}
.sched-tl-head .is-head { font-size: var(--text-xs); color: var(--text-muted); font-weight: 400; }

/* 时间轴本体：逐节点画线（首节点从圆心起、末节点到圆心止，不留线头） */
.sched-tl { position: relative; padding-left: 34px; }
.sched-tl-node { position: relative; padding: 11px 6px; }
.sched-tl-node::after {
  content: '';
  position: absolute;
  left: -18.5px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--sched-axis);
  /* 不用 border-radius：3px 短棒加圆角，相邻两段对接处会收腰，看起来像断点（实测反馈） */
  border-radius: 0;
  z-index: 0;
}
.sched-tl-node.first::after { top: 22px; }
.sched-tl-node.last::after { bottom: calc(100% - 22px); }
/* 乘车区间内：连线改黑（覆盖上一行的灰） */
.sched-tl-node.is-ride::before {
  content: '';
  position: absolute;
  left: -18.5px;
  width: 3px;
  background: var(--text-primary);
  border-radius: 0;
  z-index: 0;
}
.sched-tl-node.is-ride-first::before { top: 22px; bottom: 0; }
.sched-tl-node.is-ride:not(.is-ride-first):not(.is-ride-last)::before { top: 0; bottom: 0; }
.sched-tl-node.is-ride-last::before { top: 0; bottom: calc(100% - 22px); }
.sched-tl-node.first.is-ride-last::before { top: 22px; bottom: calc(100% - 22px); }

/* 圆圈：带字的 22px（尺寸只随类型，不随行变化）；无字的小圆点 12px */
.sched-tl-dot {
  position: absolute;
  left: -28px;
  top: 22px;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 2px solid var(--border-strong);
  box-sizing: border-box;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-muted);
}
.sched-tl-dot.is-plain { width: 12px; height: 12px; margin-top: -6px; left: -23px; }
.sched-tl-node.is-ride .sched-tl-dot.is-plain { border-color: var(--text-primary); }
.sched-tl-dot.is-fill { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg-base); }

/* 数值行：列宽取「真实内容宽度」并显式 min-width:0（否则 flex 项的 min-width:auto
   会把它撑到 min-content，比 basis 宽 → 列头与数据列错开、站名被挤掉。实测「06:24」在
   13px 等宽下正好 44px，故到点/开点 basis 用 44px；里程/状态留出余量。 */
.sched-tl-row { display: flex; align-items: baseline; gap: 6px; }
.sched-tl-st {
  flex: 1;
  min-width: 0;
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-tl-km { flex: 0 0 46px; min-width: 0; text-align: right; font-size: var(--text-sm); color: var(--text-muted); }
.sched-tl-t1,
.sched-tl-t2 { flex: 0 0 44px; min-width: 0; text-align: right; font-size: var(--text-sm); color: var(--text-primary); white-space: nowrap; }
.sched-tl-t1.is-key,
.sched-tl-t2.is-key { font-weight: 700; }
.sched-tl-stt { flex: 0 0 64px; min-width: 0; text-align: right; font-size: var(--text-sm); white-space: nowrap; color: var(--text-secondary); }
.sched-tl-sub { margin-top: 3px; font-size: var(--text-xs); color: var(--text-secondary); }
.sched-tl-sub b { font-family: var(--font-mono); color: var(--text-primary); }

/* 乘车区间不再用底色突出：靠「区段黑线 + 上/下实心圆」已经足够，
   底色反而把行切成块、削弱时间轴的连贯感（2026-10-03 按反馈去掉）。 */

/* 乘车区间外：整行灰态 + 红/绿去饱和（同色相、低饱和） */
.sched-tl-node.is-out .sched-tl-st { color: var(--sched-out-text); font-weight: 400; }
.sched-tl-node.is-out .sched-tl-t1,
.sched-tl-node.is-out .sched-tl-t2 { color: var(--sched-out-text); }
.sched-tl-node.is-out .sched-tl-km,
.sched-tl-node.is-out .sched-tl-sub { color: var(--sched-out-strong); }
.sched-tl-node.is-out .sched-tl-stt { color: var(--sched-out-text); }
/* 关键：内层 span 的类更“近”，必须用 0,3,1 特异性压过去，否则红绿漏到区间外 */
.sched-tl-node.is-out .sched-tl-stt > .st-late { color: var(--sched-late-muted); font-weight: 400; }
.sched-tl-node.is-out .sched-tl-stt > .st-early { color: var(--sched-early-muted); font-weight: 400; }
.sched-tl-node.is-out .sched-tl-stt > .st-neutral,
.sched-tl-node.is-out .sched-tl-stt > .st-unknown { color: var(--sched-out-text); }
/* 区间外「车次变更」的车号（<b> 默认 --text-primary）同样去黑变灰 */
.sched-tl-node.is-out .sched-tl-sub b { color: var(--sched-out-strong); }

/* 窄屏让位规则见文件末尾（≤389 / ≤359）。视图态表格已删除，原 ≤768 显隐切换不再需要。 */

@media (max-width: 389px) {
  /* 窄屏（320/360/375）：不再隐藏里程列——站名已用 ellipsis 兜底，
     改由缩窄固定列（里程/到点/开点）让位，里程仍可见。
     列头与数据行共用同一套类，会一起缩，对齐不受影响。 */
  .sched-tl-km { flex-basis: 40px; }
  .sched-tl-t1, .sched-tl-t2 { flex-basis: 40px; }
  .sched-tl-stt { flex-basis: 62px; }
}

@media (max-width: 359px) {
  /* 再窄一档：状态列收 4px、固定列再收 4px，保证 320px 下 5 字站名仍完整且里程可见 */
  .sched-tl-stt { flex-basis: 58px; }
  .sched-tl-km { flex-basis: 36px; }
  .sched-tl-t1, .sched-tl-t2 { flex-basis: 36px; }
}



/* ============================================================
   行程详情 · 电脑端双列（≥1024px）
   票面卡全宽在最上；下面 左＝基本信息（+ 备注/配图）｜右＝列车时刻表。
   「备注 / 配图」两张卡片由 applyDetailLayout() 在左列与「车票信息」面板之间搬运
   （不渲染两份），窄屏时回到 tab 内，行为不变。
   ============================================================ */
@media (min-width: 1024px) {
  /* 两列需要更宽的容器：基本信息是两列网格、时刻表要放得下五个列 */
  .page-container.is-trip-detail { max-width: 1120px; }
  /* 顶栏同步放宽：内容容器到 1120px 而顶栏仍是 --page-max-width(1024px) 时，
     页面会比顶栏宽出一截，右侧「管理/铃铛」对不齐。挂在 body 上由
     trip-detail.html 的 applyDetailLayout() 统一开关（与 .is-trip-detail 同一处）。 */
  body.is-trip-detail .navbar-inner { max-width: 1120px; }
  .detail-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--space-6, 24px);
    align-items: start;
    margin-top: var(--space-4, 16px);
  }
  .detail-flow > .flow-col { min-width: 0; }
  /* tab 条在网格之外（票面卡之下、网格之上），所以要按页面作用域隐藏 */
  .page-container.is-trip-detail .tabs { display: none; }
  .detail-flow .tab-panel { display: block; }
  /* 左列：基本信息面板之后是备注、配图（搬运过来的），彼此留间距 */
  .detail-flow > .flow-col-info > * + * { margin-top: var(--space-5, 20px); }

  /* ---------- 时刻表编辑弹窗（桌面端） ----------
     编辑表格改在弹窗里展示，避免右栏时刻表被拉得过长、页面整体被撑高。
     表格本身沿用 .sched-edit-table 的桌面横表样式，仅解除负边距并给表头加粘性。 */
  .modal.sched-edit-modal-panel .modal-body {
    /* 弹窗体本身不滚，纵向滚动交给 .sched-scroll-wrap：
       ① sticky 表头需要它当参照容器；
       ② 若体里滚动，工具栏的「添加车次变更事件」下拉浮层会被裁掉。
       为此 modal.sched-edit-modal-panel 改为由内容撑高、整体不设 max-height。 */
    overflow: visible;
    flex: 0 1 auto;
    min-height: 0;
  }
  .modal.sched-edit-modal-panel {
    max-width: 1000px;
    /* 内容（工具栏 + 表格滚动区）自行控制高度，取消视口高度上限，避免双层滚动条 */
    max-height: none;
  }
  .sched-edit-modal-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }
  .sched-edit-modal-hint {
    white-space: nowrap;
  }
  .sched-edit-modal .sched-scroll-wrap {
    /* 解除页面态为抵消 page padding 用的负边距，弹窗体内不需要；
       纵向滚动在此接管，并给表头留出吸顶的空间 */
    margin: 0;
    padding: 0;
    overflow: auto;
    max-height: calc(100vh - 260px);
  }
  .sched-edit-modal .sched-edit-table {
    /* 10 列挤在弹窗里会糊成一团，给个最小宽度让外层横向滚动接手 */
    min-width: 880px;
  }
  .sched-edit-modal .sched-edit-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}
