:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1f2733;
  --ink-soft: #5b6675;
  --line: #e7eaef;
  --brand: #2f6df0;
  --brand-soft: #eaf1ff;
  --green: #18a058;
  --blue: #2f6df0;
  --amber: #d98a00;
  --orange: #e8730a;
  --red: #e23b3b;
  --purple: #8b5cf6;
  --shadow: 0 1px 3px rgba(20,30,50,.06), 0 8px 24px rgba(20,30,50,.05);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
.app-shell { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 240px; flex: 0 0 240px; background: var(--panel);
  border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand-mark { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 4px 6px; }
.brand-mark span { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand-mark b { font-size: 17px; letter-spacing: .5px; }
.trip-switch-wrap { margin: 14px 0 6px; }
.trip-switch-wrap select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 14px; }
.trip-switch-wrap #new-trip-btn { margin-top: 8px; width: 100%; color: var(--brand); border-color: #c9d9fb; }
.trip-switch-wrap #new-trip-btn:hover { background: var(--brand-soft); }

/* 新建旅行弹窗 */
.nt-form label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--ink); }
.nt-form label i { color: var(--red); font-style: normal; }
.nt-form input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; box-sizing: border-box; }
.nt-form input:focus { outline: none; border-color: var(--brand); }
.nt-hint { font-size: 12px; color: var(--ink-soft); line-height: 1.7; margin: 10px 0 0; background: #f6f8fb; border-radius: 8px; padding: 8px 10px; }
/* 模板下载 + 示例预览 */
.nt-template { margin-top: 10px; }
.nt-template > a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.nt-tpl-preview { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.nt-tpl-preview summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--brand); background: #fafcfb; user-select: none; }
.nt-tpl-preview summary:hover { background: #f0f6f3; }
.nt-tpl-preview[open] summary { border-bottom: 1px solid var(--line); }
.nt-tpl-body { padding: 10px 12px 12px; }
.nt-tpl-sub { font-size: 12px; color: var(--ink-soft); margin: 0 0 8px; }
.nt-tpl-table { width: 100%; border-collapse: collapse; font-size: 11.5px; table-layout: fixed; }
.nt-tpl-table th { background: #2f5d50; color: #fff; font-weight: 600; padding: 5px 4px; white-space: nowrap; }
.nt-tpl-table td { border: 1px solid #e2e8e4; padding: 5px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-tpl-table td.d { background: #eaf3ef; font-weight: 600; }
.nt-tpl-table tr.sub td { color: var(--ink-soft); }
.nt-tpl-notes { margin: 10px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink-soft); line-height: 1.8; }
.nt-tpl-notes b { color: var(--ink); }
.nt-manage { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 12px; }
.nt-manage-title { font-size: 12px; color: var(--ink-soft); font-weight: 600; margin: 0 0 6px; }
.nt-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.nt-row em { color: var(--ink-soft); font-size: 12px; font-style: normal; }
.main-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.nav-item { text-align: left; padding: 11px 12px; border: 0; background: none; border-radius: 10px; color: var(--ink-soft); font-size: 15px; cursor: pointer; display: flex; align-items: center; }
.nav-item:hover { background: #f1f4f8; }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.sync-state { font-size: 11px; color: var(--ink-soft); margin: 8px 2px 0; line-height: 1.5; }

/* ---------- main ---------- */
.main-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { padding: 22px 30px 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.topbar .eyebrow { margin: 0; font-size: 13px; color: var(--brand); font-weight: 600; letter-spacing: .5px; }
.topbar h1 { margin: 4px 0 2px; font-size: 26px; }
.topbar .subtitle { margin: 0; color: var(--ink-soft); font-size: 14px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.quiet-btn { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); padding: 8px 12px; border-radius: 10px; font-size: 13px; cursor: pointer; }
.quiet-btn:hover { border-color: var(--brand); color: var(--brand); }
.quiet-btn.primary, .primary { background: var(--brand); color: #fff; border: 0; }
.quiet-btn.primary:hover { filter: brightness(1.05); color:#fff; }
.page { padding: 8px 30px 60px; }

/* ---------- cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .sidebar { display:none; } }

h2.section-title { font-size: 18px; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
h2.section-title::before { content:""; width: 4px; height: 18px; background: var(--brand); border-radius: 3px; display:inline-block; }

/* ---------- overview layout ---------- */
/* HERO — 新疆意象深色主视觉 */
.ov-hero {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 28px 30px 22px;
  background:
    radial-gradient(130% 150% at 100% 0%, rgba(255,176,92,.30) 0%, rgba(255,176,92,0) 44%),
    radial-gradient(120% 140% at 0% 0%, #15446b 0%, #1b5a6e 46%, #1f6e60 100%);
  color: #fff;
  box-shadow: 0 18px 42px rgba(20,50,80,.28);
}
.ov-hero-glow {
  position: absolute; right: -70px; top: -90px; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,196,120,.42), rgba(255,196,120,0) 70%);
  filter: blur(6px); pointer-events: none;
}
.ov-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: relative; }
.ov-eyebrow { font-size: 13px; color: rgba(255,255,255,.82); font-weight: 600; letter-spacing: .3px; }
.ov-cta { background: #fff; color: #14506b; border: 0; font-weight: 700; border-radius: 999px; padding: 9px 17px; box-shadow: 0 6px 16px rgba(0,0,0,.18); cursor: pointer; }
.ov-cta:hover { filter: brightness(.96); color: #14506b; }
.ov-title { font-size: 30px; font-weight: 800; margin: 16px 0 5px; letter-spacing: .5px; position: relative; }
.ov-sub { margin: 0; color: rgba(255,255,255,.85); font-size: 14.5px; position: relative; }
.ov-scenic { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; position: relative; }
.ov-scenic-label { font-size: 12px; color: rgba(255,255,255,.7); font-weight: 600; }
.ov-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ov-tag { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 6px 13px; font-size: 13px; backdrop-filter: blur(4px); }
.ov-stats { display: flex; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.18); position: relative; flex-wrap: wrap; }
.ov-stat { flex: 1; min-width: 64px; text-align: center; position: relative; }
.ov-stat:not(:last-child)::after { content:""; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 26px; background: rgba(255,255,255,.16); }
.ov-stat b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.ov-stat span { font-size: 12px; color: rgba(255,255,255,.72); }
.ov-stat--hl b { color: #ffd27a; }

/* next / family */
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.eyebrow-sm { font-size: 12px; color: var(--brand); font-weight: 600; margin: 0 0 6px; }
.family-chip { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 5px 11px; font-size: 12px; margin: 4px 6px 0 0; }
.principles { margin-top: 10px; }

/* day-load heatmap */
.day-load-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
@media (max-width: 760px){ .day-load-list { grid-template-columns: repeat(3,1fr);} }
.day-load-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 6px; cursor: pointer; text-align: center; transition: transform .08s; }
.day-load-btn:hover { transform: translateY(-2px); }
.day-load-btn small { display: block; font-size: 11px; color: var(--ink-soft); }
.day-load-btn b { display: block; font-size: 13px; margin-top: 2px; }
.day-load-btn .lv { height: 5px; border-radius: 3px; margin-top: 6px; }
/* 强度色阶：青绿(轻松) → 琥珀金(适中) → 橙红(较强) → 绯红，呼应 hero 深青绿×金 */
.lv0 { background: #c7d0d2; }
.lv1 { background: linear-gradient(90deg, #34b98c, #1c9a72); }
.lv2 { background: linear-gradient(90deg, #e2ad3f, #d08f1d); }
.lv3 { background: linear-gradient(90deg, #ec7a4e, #dd5f36); }
.lv4 { background: linear-gradient(90deg, #e25a5a, #cd3838); }
.day-load-btn.lv0 { border-color: #d6dcde; background: #f8fafa; }
.day-load-btn.lv1 { border-color: rgba(28,154,114,.38); background: linear-gradient(180deg, #f0faf6, #ffffff 78%); }
.day-load-btn.lv2 { border-color: rgba(208,143,29,.42); background: linear-gradient(180deg, #fdf7ea, #ffffff 78%); }
.day-load-btn.lv3 { border-color: rgba(221,95,54,.40); background: linear-gradient(180deg, #fdf2ed, #ffffff 78%); }
.day-load-btn.lv4 { border-color: rgba(205,56,56,.40); background: linear-gradient(180deg, #fdf0f0, #ffffff 78%); }
.day-load-btn.lv1 b { color: #147a5a; } .day-load-btn.lv2 b { color: #a06a0e; } .day-load-btn.lv3 b { color: #c24e28; } .day-load-btn.lv4 b { color: #b62f2f; }
.day-load-btn.lv1:hover, .day-load-btn.lv2:hover, .day-load-btn.lv3:hover, .day-load-btn.lv4:hover { box-shadow: 0 6px 16px rgba(20,50,80,.10); border-color: currentColor; }

/* ---------- itinerary ---------- */
.day-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; scroll-margin-top: 20px; }
.day-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px dashed var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.day-card-head .d { font-size: 16px; font-weight: 700; }
.day-card-head .date { color: var(--ink-soft); font-size: 14px; }
.day-card-head .route { font-size: 14px; color: var(--ink); flex: 1; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.badge.lv0 { background:#eef1f3; color:#5b6675;} .badge.lv1 { background:#e4f6ee; color:#178a66;} .badge.lv2 { background:#fbf1da; color:#a06a0e;} .badge.lv3 { background:#fdeae2; color:#c24e28;} .badge.lv4 { background:#fde5e5; color:#cc3434;}

.timeline { position: relative; margin-left: 8px; padding-left: 18px; border-left: 2px solid var(--line); }
.tl-item { position: relative; padding: 8px 0 8px 6px; }
.tl-item::before { content:""; position:absolute; left:-27px; top:14px; width:10px; height:10px; border-radius:50%; background:#cdd4de; border:2px solid #fff; }
.tl-item.t-行::before { background: var(--blue);} .tl-item.t-住::before { background: var(--purple);} .tl-item.t-玩::before { background: var(--green);} .tl-item.t-休::before { background: var(--amber);} .tl-item.t-决::before { background: var(--red);}
.tl-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tl-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 92px; color: var(--ink); }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.chip.行 { background:#e8f0ff; color: var(--blue);} .chip.住 { background:#f1e9ff; color: var(--purple);} .chip.玩 { background:#e6f6ec; color: var(--green);} .chip.休 { background:#fdf3e0; color: var(--amber);} .chip.决 { background:#fde5e5; color: var(--red);}
.tl-detail { flex: 1; min-width: 220px; }
.tl-meta { font-size: 12px; color: var(--ink-soft); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-cost { display: inline-block; font-size: 12px; font-weight: 600; color: #a06a0e; background: #fdf6e3; border: 1px solid #efe0bd; border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.tl-note { font-size: 12.5px; color: #6a4b16; background: #fff8ec; border-left: 3px solid #f0c36d; padding: 6px 10px; border-radius: 6px; margin-top: 6px; }
.tl-intensity { font-size: 11px; padding: 2px 7px; border-radius: 6px; }

/* today view */
.day-picker { padding: 10px 12px; border:1px solid var(--line); border-radius:10px; font-size:14px; margin-bottom: 14px; }
.check { margin-right: 8px; transform: scale(1.2); accent-color: var(--brand); }
.done .tl-detail { text-decoration: line-through; opacity: .6; }

/* aux blocks */
.aux-block { margin-bottom: 14px; }
.aux-block h3 { font-size: 16px; margin: 4px 0 8px; }
.aux-block p { margin: 0 0 6px; color: var(--ink); line-height: 1.6; }
.aux-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0 10px; }
.aux-table th, .aux-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.aux-table th { background: #f3f6fb; font-weight: 600; }
.aux-table tr:nth-child(even) td { background: #fafbfc; }
.list-line { padding: 6px 0; border-bottom: 1px dashed var(--line); line-height: 1.6; }
.note-callout { background:#fff8ec; border:1px solid #f3e0bf; border-radius:10px; padding:12px 14px; font-size:13.5px; color:#6a4b16; line-height:1.7; }
.kv { display:flex; gap:10px; padding:6px 0; border-bottom:1px dashed var(--line); }
.kv b { min-width: 96px; color: var(--ink-soft); }
.empty { color: var(--ink-soft); padding: 30px; text-align:center; }
.loading { padding: 40px; text-align:center; color: var(--ink-soft); }

/* ---------- 行程编辑 ---------- */
.itinerary-toolbar { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; flex-wrap: wrap; }
.edit-hint { font-size: 12px; color: var(--amber); }
.ed { cursor: text; border-bottom: 1px dashed transparent; padding: 0 2px; border-radius: 4px; min-width: 14px; display: inline; }
.ed:hover { background: #fff7e6; border-bottom-color: #f0c36d; }
.ed-long { display: block; }
.ed .ph, .ph { color: #aab2bd; font-style: normal; }
.edit-input { width: 100%; font: inherit; padding: 4px 6px; border: 1px solid var(--brand); border-radius: 6px; outline: none; background: #fff; }
.edit-textarea { min-height: 52px; resize: vertical; line-height: 1.5; }
.del-btn { margin-left: auto; border: 0; background: #fde5e5; color: var(--red); width: 22px; height: 22px; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1; flex: 0 0 auto; }
.del-btn:hover { background: var(--red); color: #fff; }
.add-item-btn { margin-top: 10px; border: 1px dashed var(--brand); background: #fff; color: var(--brand); padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.add-item-btn:hover { background: var(--brand-soft); }
.mod-badge { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: #fff3e0; color: var(--amber); margin-left: 6px; vertical-align: middle; }
.mod-badge.add { background: #e6f6ec; color: var(--green); }
.quiet-btn.tiny { padding: 4px 8px; font-size: 11px; }
.tl-note-wrap { margin-top: 6px; }

/* ---------- 推送按钮 ---------- */
.quiet-btn.push { background: var(--green); color: #fff; border-color: var(--green); }
.quiet-btn.push:hover { filter: brightness(1.05); }

/* ---------- 家庭成员编辑 ---------- */
.fam-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.fam-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.fam-row .fam-role { flex: 1.4; }

/* ---------- 行程路线图（用户手绘终版 · 直接引用图片） ---------- */
.route-map-panel { margin-top: 16px; }
.route-map-img-wrap {
  display: block; margin-top: 12px; border-radius: 14px; overflow: hidden;
  border: 1px solid #e7d9b6; background: #f4e9cd;
  box-shadow: 0 6px 18px rgba(80, 50, 20, 0.08);
  transition: transform .15s, box-shadow .15s;
}
.route-map-img-wrap:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(80, 50, 20, 0.16); }
.route-map-img { display: block; width: 100%; height: auto; }
.route-map-note { margin-top: 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
@media (max-width: 720px) {
  .route-map-img-wrap { border-radius: 10px; }
}

/* ---------- 通用模态框 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,28,45,.42); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: var(--panel); border-radius: var(--radius); width: 420px; max-width: 100%; box-shadow: var(--shadow); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px; max-height: 60vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.modal .del-btn { position: static; }


