:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-soft: #F1EEE7;
  --ink: #1A221E;
  --ink-2: #525E58;
  --ink-3: #86918B;
  --line: rgba(26, 34, 30, 0.09);

  --lj: #2C556B;
  --lj-bg: #EBF2F6;
  --bn: #1E6348;
  --bn-bg: #E9F3EE;
  --amber: #B86B22;
  --amber-bg: #FDF3E6;
  --danger: #B84233;
  --danger-bg: #FCECE9;

  --amap: #1677FF;
  --xhs: #FF2442;
  --dy: #161823;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 2px 10px rgba(20, 28, 24, 0.04);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: #ECEAE3;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, a {
  font-family: inherit;
}

.app-shell {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  padding-bottom: calc(74px + var(--safe-bottom));
}

/* 顶部吸顶概览栏 */
.top-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + var(--safe-top)) 16px 10px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.eyebrow {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.2px;
}

.app-title {
  margin: 1px 0 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.badge-5d5n {
  flex-shrink: 0;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.active-stay-bar {
  margin-top: 8px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
}

.stay-pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.stay-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stay-chip-lj { color: var(--lj); }
.stay-chip-bn { color: var(--bn); }

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.stay-arrow {
  color: var(--ink-3);
  font-size: 11px;
  flex-shrink: 0;
}

.stay-edit-hint {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-bg);
  padding: 2px 7px;
  border-radius: 6px;
}

/* 内容容器 */
.main-content {
  padding: 12px 14px 20px;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
  animation: fadeIn 0.18s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 紧迫提醒 */
.urgent-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--danger-bg);
  border: 1px solid rgba(184, 66, 51, 0.18);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.urgent-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.urgent-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
}

.urgent-desc {
  font-size: 12px;
  color: #6B2D25;
  margin-top: 2px;
  line-height: 1.45;
}

/* 路线引擎卡片 */
.route-engine-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 13px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.engine-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.engine-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--bn);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.engine-summary {
  font-size: 13px;
  color: var(--ink);
  margin-top: 3px;
  line-height: 1.45;
}

.btn-ghost-sm {
  flex-shrink: 0;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.transfer-toggle-wrap {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.transfer-label {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}

.segmented, .segmented-sm {
  display: inline-flex;
  background: var(--surface-soft);
  padding: 3px;
  border-radius: 9px;
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.segmented-sm .seg-btn {
  font-size: 11.5px;
  padding: 4px 8px;
}

.seg-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 天数滚动栏 */
.day-scroller {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.day-scroller::-webkit-scrollbar { display: none; }

.day-pill {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 11px;
  padding: 7px 11px;
  cursor: pointer;
  text-align: left;
  min-width: 78px;
}

.day-pill.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.day-pill-num {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.78;
}

.day-pill-date {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 1px;
}

/* 每日卡片 */
.day-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}

.day-card-head {
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.day-card-head.is-lj { background: linear-gradient(135deg, #F3F8FA 0%, #FFFFFF 100%); }
.day-card-head.is-bn { background: linear-gradient(135deg, #F1F8F4 0%, #FFFFFF 100%); }

.day-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.city-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}
.city-pill-lj { background: var(--lj-bg); color: var(--lj); }
.city-pill-bn { background: var(--bn-bg); color: var(--bn); }

.day-date-text {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
}

.day-title {
  margin: 5px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.day-subtip {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-2);
}

.day-weather-box {
  flex-shrink: 0;
  text-align: right;
  font-size: 11.5px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
}

.day-weather-temp {
  font-weight: 700;
  color: var(--ink);
}

/* 时间线节点 */
.timeline {
  padding: 6px 14px 12px;
}

.tl-item {
  position: relative;
  padding: 11px 0 11px 16px;
  border-left: 1.5px solid var(--line);
}

.tl-item:last-child {
  padding-bottom: 4px;
}

.tl-dot {
  position: absolute;
  left: -5.5px;
  top: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--ink-3);
}

.tl-item.kind-photo .tl-dot { border-color: var(--amber); background: var(--amber-bg); }
.tl-item.kind-food .tl-dot { border-color: var(--bn); background: var(--bn-bg); }
.tl-item.kind-flight .tl-dot { border-color: var(--lj); background: var(--lj-bg); }

.tl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tl-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}

.tl-commute {
  font-size: 11px;
  color: var(--lj);
  background: var(--lj-bg);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.tl-name {
  font-size: 15px;
  font-weight: 700;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kind-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
}
.kind-tag-photo { background: var(--amber-bg); color: var(--amber); }
.kind-tag-food { background: var(--bn-bg); color: var(--bn); }
.kind-tag-stay { background: var(--lj-bg); color: var(--lj); }

.tl-note {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.5;
}

.tl-photo-tip {
  margin-top: 6px;
  font-size: 12px;
  color: #6B4317;
  background: var(--amber-bg);
  padding: 6px 9px;
  border-radius: 8px;
  line-height: 1.45;
}

/* 统一操作按钮行（高德/小红书/抖音/电话） */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
}

.act-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.act-amap {
  background: #EEF5FF;
  border-color: rgba(22, 119, 255, 0.22);
  color: var(--amap);
}

.act-xhs {
  background: #FFF0F2;
  border-color: rgba(255, 36, 66, 0.22);
  color: var(--xhs);
}

.act-dy {
  background: #F2F2F5;
  border-color: rgba(22, 24, 35, 0.16);
  color: var(--dy);
}

.act-tel {
  background: var(--bn-bg);
  border-color: rgba(30, 99, 72, 0.25);
  color: var(--bn);
}

/* Tab 2: 酒店选宿 */
.section-intro {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  margin-bottom: 14px;
}

.section-intro h2 {
  margin: 0;
  font-size: 16px;
}

.section-intro p {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--ink-2);
}

.city-group {
  margin-bottom: 18px;
}

.city-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  padding: 0 2px;
}

.city-tag {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 7px;
}
.city-tag-lj { background: var(--lj-bg); color: var(--lj); }
.city-tag-bn { background: var(--bn-bg); color: var(--bn); }

.city-sub {
  font-size: 11.5px;
  color: var(--ink-3);
}

.hotel-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}

.hotel-card.is-selected {
  border-color: var(--ink);
  box-shadow: 0 4px 14px rgba(26, 34, 30, 0.08);
}

.hotel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.hotel-area-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-bg);
  padding: 2px 7px;
  border-radius: 5px;
}

.hotel-name {
  margin: 5px 0 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
}

.hotel-price {
  flex-shrink: 0;
  text-align: right;
}

.hotel-price-main {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.hotel-price-sub {
  font-size: 11px;
  color: var(--ink-3);
}

.hotel-meta {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  display: grid;
  gap: 4px;
}

.hotel-meta-line strong {
  color: var(--ink);
  font-weight: 600;
}

.hotel-route-impact {
  margin-top: 8px;
  background: var(--surface-soft);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.45;
}

.hotel-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-select-hotel {
  width: 100%;
  margin-top: 9px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hotel-card.is-selected .btn-select-hotel {
  background: var(--ink);
  color: #fff;
}

/* Tab 3: 出片与美食 */
.filter-sticky {
  position: sticky;
  top: 96px;
  z-index: 20;
  background: var(--bg);
  padding: 2px 0 10px;
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.spot-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.spot-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.spot-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.spot-name {
  margin: 5px 0 0;
  font-size: 15.5px;
  font-weight: 700;
}

.spot-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.meta-chip {
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--surface-soft);
  padding: 3px 8px;
  border-radius: 6px;
}

.spot-summary {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

.spot-expand-btn {
  margin-top: 7px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--lj);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.spot-details {
  display: none;
  margin-top: 8px;
  padding: 9px 10px;
  background: var(--surface-soft);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.55;
}

.spot-card.is-open .spot-details {
  display: block;
}

.spot-details div + div {
  margin-top: 5px;
}

/* Tab 4: 机票与行前 */
.prep-section {
  margin-bottom: 18px;
}

.prep-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.prep-sub {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.flight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 9px;
  box-shadow: var(--shadow);
}

.flight-leg {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--lj);
}

.flight-route {
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.flight-cities {
  font-size: 16px;
  font-weight: 700;
}

.flight-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--amber);
}

.flight-info {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

.budget-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  box-shadow: var(--shadow);
}

.budget-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

.budget-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.budget-total {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  padding-top: 9px;
}

.checklist-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 6px 14px;
  box-shadow: var(--shadow);
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.check-item:last-child { border-bottom: 0; }

.check-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--bn);
  flex-shrink: 0;
}

.check-text {
  font-size: 13.5px;
  color: var(--ink);
}

.check-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

.check-item.is-done .check-text {
  text-decoration: line-through;
  color: var(--ink-3);
}

.pitfall-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  margin-bottom: 8px;
}

.pitfall-title {
  font-size: 13.5px;
  font-weight: 700;
}

.pitfall-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.45;
}

/* 底部导航栏 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + var(--safe-bottom));
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item.is-active {
  color: var(--ink);
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(82px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(26, 34, 30, 0.92);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 60;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
