:root {
  --blue: #2563eb;
  --bg: #f4f5f7;
  --card: #fff;
  --text: #1a1a1a;
  --sub: #6b7280;
  --line: #e5e7eb;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
}
#app { max-width: 640px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* 顶栏 */
#topbar {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
#brand { font-size: 20px; font-weight: 800; color: var(--blue); }
#top-actions button { margin-left: 8px; }

#view { flex: 1; padding-bottom: 76px; }

/* 底栏 */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
  max-width: 640px; margin: 0 auto;
  display: flex; background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabbar a {
  flex: 1; text-align: center; padding: 12px 0 14px;
  color: var(--sub); text-decoration: none; font-size: 13px;
}
#tabbar a.active { color: var(--blue); font-weight: 600; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px 16px; margin: 12px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.journey-card { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.journey-cover {
  width: 60px; height: 60px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700;
}
.journey-title { font-weight: 700; font-size: 16px; }
.journey-sub { color: var(--sub); font-size: 13px; margin-top: 3px; }

/* 按钮 */
button, .btn {
  border: none; border-radius: 10px; padding: 9px 16px;
  font-size: 14px; cursor: pointer; background: var(--bg); color: var(--text);
}
button.primary, .btn.primary { background: var(--blue); color: #fff; font-weight: 600; }
button.danger { color: #dc2626; }
button.sm { padding: 5px 10px; font-size: 12px; }
button:disabled { opacity: .5; }
.fab {
  position: fixed; right: 20px; bottom: 88px; z-index: 400;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 24px;
  box-shadow: 0 6px 16px rgba(37,99,235,.4);
}

/* 地图 + 时间轴 */
#map { height: 280px; z-index: 1; }
.day-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
  background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line);
  position: sticky; top: 49px; z-index: 400;
}
.day-tab {
  white-space: nowrap; padding: 6px 14px; border-radius: 999px;
  background: #eef0f3; font-size: 13px; cursor: pointer; border: none;
}
.day-tab.active { background: var(--blue); color: #fff; font-weight: 600; }

/* 事件时间轴 */
.event {
  display: flex; gap: 12px; padding: 10px 16px;
}
.event .time-col { width: 44px; text-align: right; flex-shrink: 0; }
.event .time-col .t { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.event .time-col .t2 { font-size: 11px; color: var(--sub); }
.event .body {
  flex: 1; background: var(--card); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.event .name { font-weight: 600; font-size: 15px; }
.event .addr { font-size: 12px; color: var(--sub); margin-top: 2px; }
.event .note { font-size: 12px; color: var(--sub); margin-top: 4px; }
.event .ops { display: flex; gap: 14px; margin-top: 8px; }
.event .ops button { padding: 0; background: none; color: var(--blue); font-size: 12px; }
.tag { display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }

.leg {
  margin: 0 16px 0 60px; padding: 6px 0;
  font-size: 12px; color: var(--sub);
  display: flex; align-items: center; gap: 8px;
}
.leg .mode { font-weight: 600; }
.leg .num { background: var(--blue); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.leg .warn { color: #ea8600; }

.weatherbar {
  margin: 10px 16px 0; padding: 10px 14px;
  background: linear-gradient(135deg, #eff6ff, #e0e7ff);
  border-radius: var(--radius); font-size: 13px;
}
.weatherbar .tips { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.weatherbar .tip { background: rgba(234,134,0,.12); color: #9a3412; padding: 3px 9px; border-radius: 8px; font-size: 12px; }

.live-banner {
  margin: 10px 16px 0; padding: 10px 14px; border-radius: var(--radius);
  background: #ecfdf5; border: 1px solid #a7f3d0; font-size: 13px;
  display: flex; align-items: center; gap: 10px;
}
.live-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* 表单 */
.field { margin: 10px 16px; }
.field label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; background: #fff; font-family: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }

/* 地点勾选 */
.poi-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.poi-item:last-child { border-bottom: none; }
.poi-item .check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cbd5e1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.poi-item.on .check { background: var(--blue); border-color: var(--blue); }
.poi-item .nm { font-size: 14px; }
.poi-item .ad { font-size: 11px; color: var(--sub); }
.poi-item .nocoord { color: #ea8600; font-size: 11px; }

/* 聊天 */
.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - 125px); }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 16px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; margin-bottom: 10px; font-size: 14px; line-height: 1.5; }
.msg.user { margin-left: auto; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.chat-input { display: flex; gap: 8px; padding: 10px 16px; background: #fff; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }

/* 弹层 */
#modal-root .mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 900;
  display: flex; align-items: flex-end; justify-content: center;
}
#modal-root .sheet {
  background: #fff; width: 100%; max-width: 640px; max-height: 82dvh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}
#modal-root .sheet h3 { margin-bottom: 12px; }
.sheet .row { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.sheet .row:last-child { border-bottom: none; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13px; z-index: 999; opacity: 0; pointer-events: none; transition: opacity .25s;
}
#toast.show { opacity: 1; }

/* 海报预览 */
#poster-canvas { width: 100%; border-radius: var(--radius); box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.empty { text-align: center; color: var(--sub); padding: 60px 20px; }
.empty .big { font-size: 40px; margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--sub); padding: 0 16px; line-height: 1.6; }
.warn-list { color: #ea8600; font-size: 12px; padding: 4px 0; }

/* 桌面端适配 */
@media (min-width: 768px) {
  #map { height: 340px; }
}

/* ·߷ */
.variant-row { padding: 10px 16px 0; }
.variant-head { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.variant-head small { color: var(--sub); font-weight: 400; margin-left: 6px; }
.variant-card {
  display: block; width: 100%; text-align: left; background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s;
}
.variant-card b { font-size: 14px; }
.variant-card b i { font-style: normal; font-size: 11px; color: #fff; background: var(--blue); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.variant-card span { display: block; font-size: 12px; color: var(--sub); margin-top: 3px; }
.variant-card em { display: block; font-style: normal; font-size: 11px; color: var(--blue); margin-top: 3px; }
.variant-card.active { border-color: var(--blue); background: #eff6ff; }

/* ·鵼ҳ */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #f1f5f9; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--sub); }
.book-hero h3 { font-size: 18px; }
.book-day .bk-ev { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; font-size: 13px; }
.book-day .bk-t { color: var(--sub); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.book-day .bk-k { border-radius: 4px; padding: 0 6px; font-size: 11px; flex-shrink: 0; }
.book-day .bk-n i { display: block; font-style: normal; color: var(--sub); font-size: 11px; }
.book-day .bk-leg { font-size: 11px; color: var(--sub); padding: 0 0 4px 60px; }
.book-wx { margin: 6px 0; }
.leg button { margin-left: auto; }

/* 㼣ҳ */
#fp-map { height: 300px; margin: 0 16px 12px; border-radius: var(--radius); }
.fp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.fp-item { aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; }
.fp-item img { width: 100%; height: 100%; object-fit: cover; }
