:root {
  --primary: #2c3e50;
  --accent: #d4a373;
  --accent-soft: #e8c9a8;
  --bg: #fdfaf6;
  --card: #ffffff;
  --card-border: #eceff3;
  --ink: #333;
  --ink-soft: #777;
  --transport: #1e272e;
  --green: #27ae60;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  background: var(--bg);
  margin: 0;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ===== 顶部功能标签（sticky） ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}
.topbar-brand {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.9;
}
.topbar-tabs { display: flex; gap: 8px; }
.tab-btn {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(26, 26, 26, 0.72);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}
.tab-btn--active {
  background: var(--accent);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.12);
}
.topbar--scrolled {
  background: rgba(253, 250, 246, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}
.topbar--scrolled .topbar-brand { color: var(--primary); opacity: 1; }
.topbar--scrolled .tab-btn {
  background: rgba(44, 62, 80, 0.08);
  border-color: rgba(44, 62, 80, 0.14);
  color: var(--primary);
}
.topbar--scrolled .tab-btn--active {
  background: var(--accent);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.12);
}

/* ===== Hero（手机 190–240px） ===== */
.hero {
  position: relative;
  margin-top: -54px;
  color: #fff;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg svg { width: 100%; height: 100%; display: block; }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.28) 45%, rgba(0, 0, 0, 0.62));
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 78px 16px 36px;
  max-width: 720px;
  margin: 0 auto;
}
.hero-date { margin: 0; font-size: 0.74rem; letter-spacing: 3px; opacity: 0.85; font-weight: 600; }
.hero-title { margin: 6px 0 2px; font-size: 1.9rem; font-weight: 800; letter-spacing: 0.5px; }
.hero-sub { margin: 0; font-size: 0.95rem; opacity: 0.9; letter-spacing: 1px; }

/* ===== 主内容（手机近全宽 14–18px 留白） ===== */
.main-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 140px;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 日期标题 ===== */
.day-section { margin-bottom: 54px; scroll-margin-top: 76px; }
.day-header {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
  opacity: 0.45;
  transition: opacity 0.3s ease, transform 0.3s ease;
  flex-wrap: wrap;
}
.day-header.in-view { opacity: 1; transform: translateY(-2px); }
.day-header.in-view::after {
  content: "";
  position: absolute;
  left: -8px; right: -8px; bottom: -8px; height: 18px;
  background: radial-gradient(ellipse at center, rgba(255, 214, 102, 0.42) 0%, rgba(255, 214, 102, 0.2) 35%, rgba(255, 214, 102, 0) 70%);
  pointer-events: none;
}
.day-num { font-size: 2.9rem; font-weight: 900; color: var(--accent); opacity: 0.25; line-height: 1; letter-spacing: -1px; }
.day-info { font-size: 1.12rem; font-weight: 700; color: var(--primary); min-width: 0; }
.day-date { font-weight: 700; }
.day-title { font-weight: 600; color: var(--primary); }
.day-progress {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(212, 163, 115, 0.18);
  color: #8a6a45;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.day-theme {
  margin: 8px 0 16px;
  padding-left: 2px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.reset-day-btn {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(44, 62, 80, 0.18);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}
.reset-day-btn:active { background: rgba(44, 62, 80, 0.08); }

/* ===== 交通卡（深色） ===== */
.transport-card {
  background: var(--transport);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin-bottom: 16px;
  border-left: 5px solid var(--accent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.transport-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.transport-mode { font-size: 0.92rem; font-weight: 800; letter-spacing: 0.3px; }
.transport-tag {
  font-size: 0.68rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); color: #ddd; white-space: nowrap;
}
.transport-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  margin-bottom: 12px;
}
.route-end { min-width: 0; }
.route-end--right { text-align: right; }
.route-code {
  display: block; font-size: 1.02rem; font-weight: 800; letter-spacing: 0.5px; color: #fff;
  overflow-wrap: break-word;
}
.route-sub { display: block; font-size: 0.72rem; color: #b9c3cd; margin-top: 3px; }
.route-mid {
  display: grid; grid-template-rows: 1.3rem 0.85rem; align-items: center; justify-items: center;
  row-gap: 4px; min-width: 84px; text-align: center;
}
.route-icon { font-size: 1.15rem; line-height: 1; }
.route-dur { font-size: 0.68rem; color: #ffb347; font-weight: 700; white-space: normal; text-align: center; line-height: 1.25; }
.transport-note {
  font-size: 0.76rem; color: #c4ccd4; line-height: 1.55;
  border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 10px; margin-top: 2px;
}
/* 窄屏：交通卡路线改纵向堆叠，避免挤压 */
@media (max-width: 400px) {
  .transport-route {
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 10px;
    text-align: center;
  }
  .route-end, .route-end--right { text-align: center; }
  .route-mid { grid-template-columns: auto auto; grid-template-rows: none; column-gap: 8px; align-items: center; }
}

/* ===== 事件卡片 ===== */
.event-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--card-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}
.event-title { font-size: 1.02rem; font-weight: 800; margin: 0 0 10px; color: var(--primary); }

/* ===== 行程清单 ===== */
.trip-list { list-style: none; padding: 0; margin: 0; }
.trip-list li {
  margin-bottom: 8px;
  border-radius: 12px;
  background: #f7f8fa;
  overflow: hidden;
}
.todo-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.55;
  min-height: 44px;
}
.todo-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin: 2px 0 0;
  appearance: none; -webkit-appearance: none;
  border: 2px solid #c9d0d8;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.todo-check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.todo-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #1a1a1a; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.todo-text { min-width: 0; flex: 1; }
.spot-line { display: block; overflow-wrap: break-word; }
.spot-name { font-weight: 700; color: var(--primary); }
.todo.done .todo-text, .todo.done .next-row, .todo.done .next-note { opacity: 0.48; }
.todo.done .spot-line { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: rgba(0,0,0,0.35); }

.mini-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 999px;
  background: #eef2f7;
  color: #2c3e50;
  text-decoration: none;
  border: 1px solid #dde3ea;
  min-height: 30px;
  line-height: 1.2;
}
.mini-btn:active { background: var(--accent); color: #000; }
.mini-btn--place { margin-left: 8px; }

.next-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 10px 40px;
  flex-wrap: wrap;
}
.next-text { font-size: 0.76rem; color: var(--ink-soft); min-width: 0; }
.next-row .mini-btn { margin-top: 0; }
.next-note { padding: 0 10px 10px 40px; font-size: 0.76rem; color: var(--ink-soft); line-height: 1.5; }

/* ===== 地点概览轮播 ===== */
.photo-carousel {
  position: relative;
  margin: 0 -16px 4px;
  border-radius: var(--radius);
  overflow: hidden;
}
.photo-carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.photo-carousel-track::-webkit-scrollbar { display: none; }
.photo-carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
.cover-emoji { font-size: 3.2rem; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.25)); }
.cover-label {
  font-size: 0.82rem; font-weight: 700; color: rgba(255, 255, 255, 0.92); letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.28); padding: 5px 14px; border-radius: 999px;
  backdrop-filter: blur(4px); max-width: 86%; text-align: center;
}
.photo-carousel-dots { position: absolute; right: 12px; bottom: 12px; z-index: 2; }
.photo-carousel-counter {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 4px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.42); color: #fff;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.4px;
  backdrop-filter: blur(4px); font-variant-numeric: tabular-nums;
}
.cover { background: linear-gradient(150deg, #2c3e50, #34495e); }

/* ===== 地图 ===== */
.map-panel { padding-top: 4px; }
.map-header { margin-bottom: 12px; }
.map-title { font-size: 1.25rem; font-weight: 800; color: var(--primary); margin: 0 0 6px; }
.map-hint { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.map-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-btn {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.3px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid #dde3ea; background: #fff; color: var(--primary);
  cursor: pointer; font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}
.filter-btn--active { background: var(--primary); color: #fff; border-color: var(--primary); }
.map {
  height: 62vh;
  min-height: 340px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  background: #e9ecef;
}
.map-offline-hint { font-size: 0.76rem; color: var(--ink-soft); margin-top: 8px; }
.map-marker {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-size: 0.72rem; font-weight: 800;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.28);
}
.map-marker--node { width: 24px; height: 24px; font-size: 0.8rem; background: #5c636a; }
.map-popup { font-size: 0.8rem; line-height: 1.45; }
.map-popup b { color: var(--primary); }
.map-popup-meta { color: #777; font-size: 0.72rem; margin-top: 2px; }
.map-popup-next { color: #444; font-size: 0.72rem; margin-top: 4px; }
.map-popup .mini-btn { margin-top: 6px; }

/* ===== 底部导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(26, 26, 26, 0.92);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 8px;
  border-radius: 50px;
  display: flex;
  gap: 4px;
  width: calc(100% - 32px);
  max-width: 420px;
  justify-content: space-around;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}
.bottom-nav a {
  flex: 1;
  color: #fff;
  text-decoration: none;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 11px 0;
  border-radius: 30px;
  opacity: 0.45;
  transition: opacity 0.3s ease, background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.bottom-nav a.active {
  opacity: 1;
  background: var(--accent);
  color: #1a1a1a;
  transform: scale(1.06);
}

/* ===== 无障碍 ===== */
.tab-btn:focus-visible, .bottom-nav a:focus-visible,
.todo-check input:focus-visible, .filter-btn:focus-visible, .mini-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .hero-content { padding-left: 32px; padding-right: 32px; }
  .photo-carousel { margin-left: 0; margin-right: 0; }
  .main-content { padding-left: 24px; padding-right: 24px; }
}

/* ===== 酒店卡片 ===== */
.hotel-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--card-border);
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}
.hotel-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(150deg, #2c3e50, #34495e);
}
.hotel-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hotel-body { padding: 14px 16px; }
.hotel-name { font-size: 1.05rem; font-weight: 800; color: var(--primary); margin: 0 0 4px; }
.hotel-addr { font-size: 0.8rem; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.4; }
.hotel-meta {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 10px;
}
.hotel-meta span {
  background: #f4f6f8; padding: 3px 10px; border-radius: 999px;
}
.hotel-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== 当天摘要 ===== */
.day-summary {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  margin-bottom: 14px; font-size: 0.78rem;
}
.day-summary span {
  background: rgba(212,163,115,0.12); color: #7a5c3a;
  padding: 5px 12px; border-radius: 999px;
  font-weight: 700; letter-spacing: 0.3px;
}

/* ===== 时间分段 ===== */
.time-seg {
  list-style: none; padding: 10px 0 4px; margin: 0;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 1.5px;
  color: var(--accent); opacity: 0.7;
  border-bottom: 1px dashed rgba(212,163,115,0.25);
  margin-bottom: 6px;
}

/* ===== 地点图片 ===== */
.spot-img-wrap {
  width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  margin-bottom: 10px; background: linear-gradient(150deg, #2c3e50, #34495e);
}
.spot-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spot-img-wrap.img-fallback { background: linear-gradient(150deg, #3a4a5c, #2c3e50); }

.spot-note { display: block; font-size: 0.84rem; color: var(--ink-soft); margin-top: 2px; }
.spot-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.spot-details {
  margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px;
  background: #f0f2f5; font-size: 0.8rem; color: #555; line-height: 1.55;
}
.spot-details div { margin-bottom: 3px; }
.spot-tips { color: #7a6a4a; margin-top: 4px; }

/* ===== 餐厅卡片 ===== */
.restaurant-card { margin-top: 14px; }
.restaurant-list { display: flex; flex-direction: column; gap: 14px; }
.restaurant-item {
  border-left: 3px solid var(--accent); padding-left: 12px;
}
.restaurant-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.restaurant-meal { font-size: 0.75rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }
.restaurant-time { font-size: 0.75rem; color: var(--ink-soft); }
.restaurant-name { font-size: 1rem; font-weight: 800; color: var(--primary); }
.restaurant-en { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 4px; }
.restaurant-meta { font-size: 0.78rem; color: #666; margin-bottom: 4px; }
.restaurant-dishes { font-size: 0.8rem; color: #555; margin-bottom: 4px; }
.restaurant-distance { font-size: 0.76rem; color: var(--ink-soft); margin-bottom: 6px; }
.restaurant-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.tag {
  font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: #eef2f7; color: #4a5568; border: 1px solid #dde3ea;
}
.restaurant-backup {
  display: block; font-size: 0.75rem; color: #777; margin-top: 6px;
  padding: 6px 10px; background: #f7f8fa; border-radius: 8px;
}
.restaurant-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ===== 当天路线按钮 ===== */
.day-route-btn { display: block; width: 100%; text-align: center; margin-bottom: 14px; }

/* ===== 地图降级 ===== */
#mapFallback { padding: 16px; }
.map-fallback-head { margin-bottom: 16px; }
.map-fallback-head h3 { font-size: 1.1rem; color: var(--primary); margin: 0 0 6px; }
.map-fallback-head p { font-size: 0.82rem; color: var(--ink-soft); margin: 0; }
.fallback-day { margin-bottom: 18px; padding: 14px; background: #f7f8fa; border-radius: 12px; }
.fallback-day h4 { font-size: 0.95rem; color: var(--primary); margin: 0 0 10px; }
.fallback-day ol { padding-left: 20px; margin: 0 0 10px; font-size: 0.85rem; line-height: 1.7; }
.fallback-day ol li { margin-bottom: 2px; }
.fallback-arrow { list-style: none; color: var(--accent); font-weight: 700; padding-left: 20px; margin: 2px 0; }

/* ===== 地图 Popup 升级 ===== */
.map-popup-img {
  width: 100%; height: 120px; object-fit: cover; border-radius: 10px;
  margin-bottom: 8px; display: block;
}
.map-popup-btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ===== 地图 Marker 类型 ===== */
.map-marker--food { font-size: 0.68rem; }
.map-marker--hotel { font-size: 0.68rem; }
.map-marker--transit { font-size: 0.68rem; background: #5c636a; }

/* ===== Hero 真实图片支持 ===== */
.hero-bg-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-bg-img::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.28) 45%, rgba(0,0,0,0.62));
}
