:root {
  --bg: #FAF6F0;           /* 暖白沙底（非纯白，柔和） */
  --bg-2: #EDE6DB;         /* 抽屉/面板容器，更深沙色 */
  --card: #FFFDFA;         /* 暖白卡片 */
  --card-2: #F3EDE4;       /* 嵌套控件/导航行 */
  --line: #EAE3D8;         /* 1px 分隔，柔和沙线 */
  --line-2: #DCD2C4;       /* hover/active 边框 */
  --text: #2E2A24;         /* 暖近黑棕，非纯黑（不刺眼） */
  --muted: #6E6860;        /* 次要，暖灰棕 */
  --faint: #9C958B;        /* 最弱/占位 */
  --accent: #E0601A;       /* 日落橙（鲜明主强调） */
  --accent-2: #F4A93C;
  --accent-ink: #AE3A0E;   /* 浅底上的强调文字（深锈，AA） */
  --accent-soft: rgba(224,96,26,.14);
  --green: #1F9D57;        /* 浅底可读成功绿 */
  --red: #DD3B30;          /* 浅底可读危险红 */
  --blue: #2B73A8;
  --shadow-sm: 0 1px 2px rgba(40,38,32,.06), 0 2px 10px rgba(40,38,32,.05);
  --radius: 18px;
  --radius-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.62;
  padding-bottom: calc(66px + var(--safe-b));
  -webkit-font-smoothing: antialiased;
  letter-spacing: .1px;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }

.ic { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; vertical-align: -3px; }

/* ---------- 顶栏 ---------- */
.app-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: max(10px, var(--safe-t));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
}
.app-bar__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-bar__logo {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(140deg, var(--accent), var(--accent-ink));
  display: flex; align-items: center; justify-content: center; color: #fffdf8;
}
.app-bar__logo svg { width: 19px; height: 19px; }
.app-bar__name { font-weight: 600; font-size: 15.5px; letter-spacing: .3px; }
.app-bar__sub { font-size: 11px; color: var(--muted); }
.app-bar__search-btn {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s;
}
.app-bar__search-btn svg { width: 18px; height: 18px; }
.app-bar__search-btn:active { border-color: var(--accent); color: var(--accent); }

/* ---------- 检索栏 ---------- */
.search-bar {
  position: sticky; top: 0; z-index: 25;
  display: flex; gap: 8px; padding: 10px 14px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.search-bar input {
  flex: 1; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 10px 14px; font-size: 15px; outline: none; transition: border-color .2s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar button {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  width: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
}
.search-bar button svg { width: 18px; height: 18px; }

/* ---------- 视图容器 ---------- */
.view { padding: 16px; max-width: 720px; margin: 0 auto; }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- 骨架屏 ---------- */
.skel-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0 14px; margin-bottom: 16px; overflow: hidden; }
.skel { background: linear-gradient(100deg, #eae4da 30%, #f7f2ec 50%, #eae4da 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 8px; }
.skel--hero { height: 140px; border-radius: 0; margin-bottom: 12px; }
.skel--line { height: 12px; margin: 10px 14px 0; }
.w40 { width: 40%; } .w60 { width: 60%; } .w90 { width: 90%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- 概览 ---------- */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px;
  min-height: 160px; display: flex; align-items: flex-end;
  background: linear-gradient(150deg, #FFFAF4, #FCEBD6 55%, #FAF6F0);
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero__overlay { position: relative; padding: 18px; }
.hero__title { font-size: 23px; font-weight: 700; letter-spacing: .3px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  background: rgba(250,246,240,.82); border: 1px solid rgba(66,55,42,.12);
  color: var(--text); border-radius: 999px; padding: 4px 11px; font-size: 12px;
}
.chip--accent { color: var(--accent-ink); border-color: rgba(224,96,26,.45); }

.stat-row { display: flex; gap: 10px; margin-bottom: 16px; }
.stat {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 10px; text-align: center;
}
.stat__num { font-size: 21px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat__label { font-size: 11px; color: var(--muted); margin-top: 3px; }

.summary-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; color: var(--muted); font-size: 13.5px; margin-bottom: 20px; line-height: 1.7;
}
.section-title { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin: 18px 4px 10px; font-weight: 600; }
.section-title .ic { color: var(--accent); width: 16px; height: 16px; }

/* ---------- 路线时间轴 ---------- */
.route { position: relative; padding-left: 22px; }
.route::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
}
.route__item { position: relative; margin-bottom: 16px; }
.route__dot {
  position: absolute; left: -19px; top: 18px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 3px var(--accent-soft);
}
.route__card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; transition: border-color .2s, transform .12s;
}
.route__card:active { transform: scale(.99); border-color: var(--line-2); }
.route__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.route__day { font-weight: 600; font-size: 14px; }
.route__date { font-size: 11px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.route__leg { color: var(--text); margin-top: 5px; font-size: 14px; }
.route__leg b { color: var(--text); font-weight: 600; }
.route__sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- 每日卡片 ---------- */
.day {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 20px;
  animation: rise .42s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.day__hero { position: relative; height: 142px; display: flex; align-items: flex-end;
  background: linear-gradient(150deg, #FFFAF4, #FCEBD6 55%, #FAF6F0); }
.day__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.day__grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,16,20,0) 35%, rgba(14,16,20,.78)); }
.day__herotext { position: relative; padding: 13px 15px; width: 100%; }
.day__tag { font-size: 11px; color: var(--text); background: rgba(250,246,240,.82); padding: 3px 9px; border-radius: 999px; display: inline-block; }
.day__city { font-size: 21px; font-weight: 700; margin: 7px 0 0; letter-spacing: .3px; color: #fffdf8; }
.day__pill { display: inline-block; margin-top: 6px; font-size: 11.5px; color: var(--accent-ink);
  background: var(--accent-soft); border: 1px solid rgba(224,96,26,.45); padding: 3px 10px; border-radius: 999px; }

.day__main { padding: 4px 15px 6px; }

/* 今日主线 */
.lead {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card-2); border: 1px solid var(--line); border-top: 2px solid var(--accent-soft);
  border-radius: var(--radius-sm); padding: 12px 13px; margin: 12px 0;
}
.lead__row { display: flex; align-items: center; gap: 7px; font-size: 14.5px; }
.lead__row .ic { color: var(--accent); width: 20px; height: 20px; }
.lead__from, .lead__to { font-weight: 600; }
.lead__sub { font-size: 12px; color: var(--muted); flex-basis: 100%; margin-top: 2px; }

/* 信息块 */
.block { padding: 11px 0; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: none; }
.block__t { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; letter-spacing: .3px; }
.block__t .ic { width: 16px; height: 16px; }
.block__b { font-size: 14px; color: var(--text); white-space: pre-wrap; line-height: 1.68; }

/* 导航段 */
.navsec { margin-top: 4px; }
.navsec__t { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.navsec__t .ic { width: 16px; height: 16px; }
.navrow {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 8px; transition: border-color .2s, transform .12s;
}
.navrow:active { transform: scale(.99); border-color: var(--accent); }
.navrow__leg { font-size: 13.5px; min-width: 0; }
.navrow__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.navrow__pills { display: flex; gap: 6px; flex-wrap: wrap; }
.navrow__leg b { font-weight: 600; }
.navrow__leg .ic { color: var(--accent); width: 16px; height: 16px; vertical-align: -4px; }

/* 导航按钮：纯箭头圆钮 */
.navbtn {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fffdf8;
  width: 38px; height: 38px; border-radius: 50%;
}
.navbtn .ic { width: 18px; height: 18px; stroke-width: 2.5px; }

/* 距离/耗时药丸 */
.pill {
  display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  white-space: nowrap; line-height: 1.4;
}
.pill--km { background: rgba(43,115,168,.12); color: var(--blue); }
.pill--time { background: var(--accent-soft); color: var(--accent-ink); }
.navrow--miss { color: var(--faint); font-size: 12.5px; }
.navrow__miss { color: var(--red); }

.flight { display: flex; align-items: center; gap: 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.flight .pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--blue); }
.flight .pill .ic { width: 15px; height: 15px; color: var(--blue); }
.flight__time { font-size: 13px; color: var(--muted); }

/* 住宿 */
.lodge { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; margin-top: 8px; }
.lodge:first-of-type { margin-top: 0; }
.lodge__name { font-weight: 600; font-size: 14px; }
.lodge__src { font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 500; }
.lodge__meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.lodge__price { color: var(--green); font-weight: 700; font-size: 13.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }

.day__open {
  margin: 4px 15px 15px; width: calc(100% - 30px); min-height: 44px; background: transparent;
  border: 1px solid var(--line-2); color: var(--accent-ink); border-radius: 12px;
  padding: 11px; font-size: 13.5px; font-weight: 600; transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.day__open:active { background: var(--accent-soft); }

/* ---------- 景点 ---------- */
.filterbar {
  display: flex; gap: 8px; padding: 10px 4px 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filterbar::-webkit-scrollbar { display: none; }
.filterbar__btn {
  flex-shrink: 0; min-height: 40px; padding: 8px 16px; border-radius: 999px; font-size: 13px;
  font-weight: 500; border: 1.5px solid var(--line); background: var(--card);
  color: var(--muted); cursor: pointer; transition: all .2s;
  white-space: nowrap; line-height: 1.3;
  display: inline-flex; align-items: center;
}
.filterbar__btn:hover { border-color: var(--line-2); color: var(--text); }
.filterbar__btn.is-active {
  background: var(--accent-soft); border-color: rgba(224,96,26,.45);
  color: var(--accent-ink); font-weight: 600;
}
.filterbar__btn:active { transform: scale(.96); }
.spot-group__title { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin: 16px 4px 8px; font-weight: 600; }
.spot-group__title .ic { color: var(--accent); width: 16px; height: 16px; }
.spot {
  display: flex; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; align-items: flex-start;
  transition: border-color .2s, transform .12s;
}
.spot:active { transform: scale(.99); border-color: var(--line-2); }
.spot__main { flex: 1; min-width: 0; }
.spot__name { font-weight: 600; font-size: 14.5px; }
.spot__note { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.spot__cat { font-size: 11px; color: var(--muted); margin-top: 5px; }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; border: 1px solid transparent; }
.badge--ban { background: rgba(232,115,106,.15); color: var(--red); border-color: rgba(232,115,106,.4); }
.badge--warn { background: var(--accent-soft); color: var(--accent-ink); border-color: rgba(224,96,26,.45); }
.badge--ok { background: rgba(88,192,138,.15); color: var(--green); border-color: rgba(88,192,138,.4); }

/* ---------- 贴士 ---------- */
.tip { background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.tip__head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.tip__cat { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.tip__cat .ic { width: 16px; height: 16px; }
.tip__loc { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.tip__loc .ic { width: 13px; height: 13px; }
.tip__text { font-size: 13.5px; color: var(--text); line-height: 1.7; }

/* ---------- AI 助手 ---------- */
.ai-box { display: flex; flex-direction: column; min-height: calc(100vh - 220px); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 4px 2px; }
.ai-msg { margin-bottom: 10px; max-width: 88%; }
.ai-msg--bot { align-self: flex-start; }
.ai-msg--user { align-self: flex-end; margin-left: auto; }
.ai-bubble { padding: 10px 13px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.65; }
.ai-msg--bot .ai-bubble { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg--user .ai-bubble { background: var(--accent); color: #fffdf8; border-bottom-right-radius: 4px; font-weight: 500; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 12px; }
.ai-suggest button { background: var(--card-2); border: 1px solid var(--line); color: var(--accent-ink); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; }
.ai-input { display: flex; gap: 8px; padding: 10px 0; }
.ai-input textarea { flex: 1; background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 10px 12px; font-size: 14px; resize: none; outline: none; max-height: 96px; }
.ai-input textarea:focus { border-color: var(--accent); }
.ai-input button { background: var(--accent); color: #fffdf8; border: none; border-radius: 12px; padding: 0 16px; font-weight: 700; font-size: 14px; }
.ai-input button:disabled { opacity: .5; }
.ai-empty { color: var(--muted); text-align: center; padding: 30px 16px; font-size: 13px; line-height: 1.7; }
.ai-empty .ic { width: 30px; height: 30px; color: var(--accent); margin-bottom: 10px; }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tab {
  flex: 1; background: none; border: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 6px; font-size: 11px;
}
.tab__ic { display: flex; }
.tab__ic svg { width: 21px; height: 21px; }
.tab.is-active { color: var(--accent-ink); }

/* ---------- 抽屉 ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet__mask { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  background: var(--bg-2); border-top-left-radius: 22px; border-top-right-radius: 22px;
  border-top: 1px solid var(--line); padding: 18px 16px calc(26px + var(--safe-b));
  animation: slideUp .24s cubic-bezier(.2,.7,.3,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet__close {
  position: absolute; top: 12px; right: 14px; background: var(--card); border: 1px solid var(--line);
  color: var(--muted); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 2;
}
.sheet__close svg { width: 16px; height: 16px; }
.sheet__hero { height: 132px; border-radius: 14px; overflow: hidden; position: relative; margin-bottom: 12px;
  background: linear-gradient(150deg, #FFFAF4, #FCEBD6); display: flex; align-items: flex-end; }
.sheet__hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .6; }
.sheet__hero-grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,16,20,0) 40%, rgba(14,16,20,.7)); }
.sheet__herotext { position: relative; padding: 12px; width: 100%; }
.sheet__herotext h2 { margin: 0; font-size: 19px; font-weight: 700; color: #fffdf8; }
.sheet__herotext .sub { font-size: 12px; color: rgba(255,253,248,.82); margin-top: 3px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv__k { color: var(--muted); flex-shrink: 0; }
.kv__v { text-align: right; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; font-size: 13px; }

/* 柔和投影：用层次替代纯描边，提升现代感 */
.day, .stat, .summary-card, .route__card, .spot, .tip, .lodge, .navrow, .flight,
.ai-msg--bot .ai-bubble, .skel-card, .sheet__panel {
  box-shadow: var(--shadow-sm);
}

/* ---------- 无障碍：焦点环（§10） ---------- */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
.tab:focus-visible, .filterbar__btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px;
}
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* ---------- 桌面 hover 反馈 ---------- */
@media (hover: hover) {
  .spot:hover, .route__card:hover, .tip:hover, .lodge:hover,
  .navrow:hover, .flight:hover { border-color: var(--line-2); }
  .app-bar__search-btn:hover { border-color: var(--line-2); color: var(--text); }
  .day__open:hover { background: var(--accent-soft); }
  .filterbar__btn:hover { border-color: var(--line-2); color: var(--text); }
}

@media (prefers-reduced-motion: reduce) {
  .day, .sheet__panel { animation: none; }
  .skel { animation: none; }
}

/* ---------- PWA 添加到主屏幕提示 ---------- */
.install-bar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(78px + var(--safe-b)); z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--card);
  border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 4px 20px rgba(40,38,32,.12);
  transform: translateY(160%); opacity: 0;
  transition: transform .28s cubic-bezier(.2,.7,.3,1), opacity .22s ease;
}
.install-bar.is-show { transform: translateY(0); opacity: 1; }
.install-bar__ic { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; box-shadow: 0 0 0 1px var(--line); }
.install-bar__txt { flex: 1 1 auto; min-width: 0; }
.install-bar__txt b { display: block; font-size: 14px; color: var(--text); }
.install-bar__txt span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.install-bar__btn {
  flex-shrink: 0; border: 0; border-radius: 10px;
  padding: 8px 14px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 13px; line-height: 1.3;
}
.install-bar__x {
  flex-shrink: 0; border: 0; background: transparent; color: var(--faint);
  font-size: 22px; line-height: 1; padding: 4px 6px; margin: -4px -6px -4px 0;
}
@media (min-width: 480px) {
  .install-bar { left: 50%; transform: translate(-50%, 160%); width: min(420px, calc(100% - 24px)); }
  .install-bar.is-show { transform: translate(-50%, 0); }
}
