/* ============================================================
 * 行程 App 样式 —— 手机优先（iPhone 375px 基准）
 * ============================================================ */

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #eef0f4;
  color: #1f2430;
  line-height: 1.55;
  min-height: 100vh;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 14px calc(28px + env(safe-area-inset-bottom));
  padding-top: calc(14px + env(safe-area-inset-top));
}

.loading { text-align: center; color: #8a90a0; padding: 60px 0; }

/* ---------- 行程切换 ---------- */

.trip-switch {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 6px;
  scrollbar-width: none;
}
.trip-switch::-webkit-scrollbar { display: none; }

.trip-pill {
  flex: none; padding: 6px 14px; border-radius: 999px;
  border: 1px solid #d5d9e2; background: #fff;
  font-size: 13px; color: #5b6270; white-space: nowrap; cursor: pointer;
}
.trip-pill.active {
  background: #4f46e5; border-color: #4f46e5; color: #fff; font-weight: 600;
}

/* ---------- 头部 ---------- */

.hero { padding: 10px 2px 12px; }
.hero h1 { font-size: 24px; font-weight: 700; letter-spacing: .5px; }
.hero-date { margin-top: 2px; color: #6b7280; font-size: 14px; }

/* ---------- 预算汇总 ---------- */

.budget {
  background: #fff; border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(31, 36, 48, .06); margin-bottom: 14px;
}
.budget summary {
  cursor: pointer; font-weight: 600; font-size: 15px;
  list-style: none; display: flex; align-items: center; gap: 4px;
}
.budget summary::-webkit-details-marker { display: none; }
.budget summary::after {
  content: "▾"; margin-left: auto; color: #9aa1b0; font-size: 12px; transition: transform .2s;
}
.budget:not([open]) summary::after { transform: rotate(-90deg); }
.budget-body { margin-top: 8px; border-top: 1px solid #f0f1f5; padding-top: 8px; }
.budget-row {
  display: flex; justify-content: space-between; font-size: 14px; color: #4b5261; padding: 3px 0;
}
.budget-row b { font-variant-numeric: tabular-nums; }
.budget-rate { margin-top: 6px; font-size: 12px; color: #9aa1b0; }

/* ---------- Day 标签页 ---------- */

.day-tabs {
  display: flex; gap: 8px; overflow-x: auto;
  position: sticky; top: 0; z-index: 10;
  padding: 8px 2px; margin: 0 -4px;
  background: linear-gradient(#eef0f4 82%, rgba(238, 240, 244, 0));
  scrollbar-width: none;
}
.day-tabs::-webkit-scrollbar { display: none; }

.day-tab {
  flex: none; min-width: 64px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid #d5d9e2; background: #fff; text-align: center; cursor: pointer;
}
.day-tab b { display: block; font-size: 15px; color: #2a3040; }
.day-tab span { display: block; font-size: 11px; color: #8a90a0; margin-top: 1px; }
.day-tab.active {
  background: #1f2430; border-color: #1f2430;
}
.day-tab.active b, .day-tab.active span { color: #fff; }

/* ---------- 当天头部 ---------- */

.day-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 2px 10px;
}
.city-chip {
  background: #4f46e5; color: #fff; font-size: 12px; font-weight: 600;
  border-radius: 6px; padding: 2px 8px;
}
.day-theme { font-size: 13px; color: #6b7280; }
.day-total {
  margin-left: auto; font-size: 12px; color: #b45309; background: #fef3c7;
  border-radius: 6px; padding: 2px 8px; font-variant-numeric: tabular-nums;
}

/* ---------- 条目卡片 ---------- */

.card {
  background: #fff; border-radius: 14px; padding: 12px 14px;
  margin-bottom: 10px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(31, 36, 48, .06);
  transition: transform .08s;
}
.card:active { transform: scale(.985); }

.card-intercity {
  border: 1.5px solid #6366f1;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.card-top { display: flex; align-items: flex-start; gap: 10px; }

.card-icon {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}

.card-main { flex: 1; min-width: 0; }
.card-title-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; }
.card-time {
  font-size: 12px; font-weight: 700; color: #4f46e5;
  font-variant-numeric: tabular-nums;
}
.card-badge {
  font-size: 11px; color: #fff; background: #6366f1; border-radius: 5px;
  padding: 1px 6px; align-self: center;
}
.card-title { font-size: 15px; font-weight: 600; word-break: break-word; }
.card-title-sub {
  margin-top: 2px; font-size: 12.5px; color: #7c8494; word-break: break-word;
}

.card-cost {
  flex: none; font-size: 13px; font-weight: 700; color: #374151;
  font-variant-numeric: tabular-nums;
}

.card-addr { margin-top: 6px; font-size: 13px; color: #6b7280; word-break: break-all; }
.card-note {
  margin-top: 6px; font-size: 13px; color: #4f46e5;
  background: #eef2ff; border-radius: 8px; padding: 5px 9px; word-break: break-word;
}

.card-actions { margin-top: 8px; display: flex; gap: 8px; }
.btn-nav {
  border: none; background: #1f2430; color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 8px; padding: 6px 14px; cursor: pointer;
}
.btn-nav:active { background: #37415a; }

/* ---------- 空状态 / 页脚 ---------- */

.empty {
  text-align: center; padding: 44px 20px; color: #8a90a0;
  background: #fff; border-radius: 14px; margin-bottom: 10px;
}
.empty-icon { font-size: 34px; margin-bottom: 8px; }
.empty h3 { font-size: 16px; color: #4b5261; margin-bottom: 4px; }
.empty p { font-size: 13px; }

.foot { text-align: center; font-size: 12px; color: #a5abba; padding: 16px 0 4px; }

/* ---------- 导航动作面板（底部弹出） ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(20, 24, 34, .45);
  z-index: 100; opacity: 0; transition: opacity .2s;
}
.sheet-backdrop:not([hidden]) { opacity: 1; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 101;
  max-width: 520px; margin: 0 auto;
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .2s ease-out;
}
.sheet.open { transform: translateY(0); }

.sheet-title { font-size: 16px; font-weight: 700; text-align: center; padding: 6px 10px 2px; word-break: break-word; }
.sheet-addr { font-size: 12px; color: #8a90a0; text-align: center; padding: 0 10px 8px; word-break: break-all; }

.sheet-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; margin-top: 8px; border-radius: 12px;
  background: #f5f6fa; border: none; text-decoration: none; cursor: pointer;
  font-size: 15px; color: #1f2430; text-align: left;
}
.sheet-btn:active { background: #e8eaf1; }
.sheet-btn-icon { flex: none; font-size: 18px; width: 24px; text-align: center; }
.sheet-btn-text { flex: 1; }
.sheet-btn-text em { display: block; font-style: normal; font-size: 11px; color: #9aa1b0; }

.sheet-cancel {
  width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px;
  border: none; background: #fff; color: #8a90a0; font-size: 15px; cursor: pointer;
}
.sheet-cancel:active { background: #f5f6fa; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(10px);
  background: rgba(31, 36, 48, .92); color: #fff;
  font-size: 13px; border-radius: 10px; padding: 9px 16px;
  max-width: 86vw; text-align: center; word-break: break-all;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
