/* ============================================================
   东南亚两国 11 日行程 · 视觉系统
   清爽明亮 + 系统深浅自适应
   ============================================================ */

:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --surface-2: #f0f4f6;
  --ink: #1c2b31;
  --ink-2: #40565f;
  --muted: #6b838d;
  --accent: #0f7c8a;
  --accent-soft: #e3f1f3;
  --warm: #c2603f;
  --warm-soft: #fbeae3;
  --border: #e1e9ec;
  --shadow: rgba(20, 40, 48, 0.08);
  --shadow-strong: rgba(20, 40, 48, 0.16);

  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui,
    -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;

  --radius: 14px;
  --radius-sm: 10px;
  --sp: 8px;
  --section-gap: 64px;
  --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10171b;
    --surface: #172228;
    --surface-2: #1e2b32;
    --ink: #e6eef2;
    --ink-2: #b8c9d1;
    --muted: #8ba0aa;
    --accent: #4fd1c5;
    --accent-soft: #14312f;
    --warm: #e08a63;
    --warm-soft: #3a2318;
    --border: #26343c;
    --shadow: rgba(0, 0, 0, 0.36);
    --shadow-strong: rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #10171b;
  --surface: #172228;
  --surface-2: #1e2b32;
  --ink: #e6eef2;
  --ink-2: #b8c9d1;
  --muted: #8ba0aa;
  --accent: #4fd1c5;
  --accent-soft: #14312f;
  --warm: #e08a63;
  --warm-soft: #3a2318;
  --border: #26343c;
  --shadow: rgba(0, 0, 0, 0.36);
  --shadow-strong: rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 700; color: var(--ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 16px;
  max-width: var(--maxw); margin: 0 auto; padding: 10px 20px;
}
.brand {
  font-family: var(--font-serif); font-weight: 700; font-size: 17px;
  letter-spacing: .02em; white-space: nowrap;
}
.nav-links {
  display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  padding: 6px 12px; border-radius: 999px; font-size: 14px;
  color: var(--ink-2); white-space: nowrap; transition: background .18s, color .18s;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-links a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.theme-btn {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); border-radius: 999px; padding: 6px 12px;
  font-size: 13px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .18s, border-color .18s;
}
.theme-btn:hover { background: var(--surface-2); }

/* ---------- Hero 封面 ---------- */
.hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--bg) 62%);
}
.hero .label {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}
.hero h1 {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.25;
  margin: 14px 0 12px; letter-spacing: .01em;
}
.hero .lead { font-size: clamp(15px, 2vw, 18px); color: var(--ink-2); max-width: 62ch; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pill {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--ink-2);
}
.pill b { color: var(--ink); }
.date-note {
  margin-top: 20px; padding: 12px 16px; border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px; color: var(--ink-2);
}

/* ---------- Section 通用 ---------- */
.section { padding: var(--section-gap) 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 28px; }
.section-num {
  font-family: var(--font-serif); font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700; color: var(--accent); opacity: .5; line-height: 1;
}
.section-title { flex: 1; }
.section-title .label {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; display: block; margin-bottom: 2px;
}
.section-title h2 {
  font-family: var(--font-serif); font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0; font-weight: 700;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: 0 1px 2px var(--shadow), 0 2px 10px var(--shadow);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 总览表 ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.ov { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
table.ov th, table.ov td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.ov th { background: var(--surface-2); font-weight: 600; color: var(--ink-2); font-size: 13px; }
table.ov tbody tr:last-child td { border-bottom: none; }
table.ov tbody tr:hover { background: var(--surface-2); }
table.ov td.day-cell { font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ---------- 按天浏览 ---------- */
.days-layout { display: grid; grid-template-columns: 210px 1fr; gap: 32px; align-items: start; }
.day-rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; }
.day-rail button {
  text-align: left; border: 1px solid transparent; background: transparent;
  color: var(--ink-2); font-family: inherit; font-size: 14px; cursor: pointer;
  padding: 9px 12px; border-radius: var(--radius-sm); transition: all .16s;
  display: flex; flex-direction: column; gap: 1px;
}
.day-rail button:hover { background: var(--surface-2); }
.day-rail button.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.day-rail button .dnum { font-weight: 700; }
.day-rail button .dcity { font-size: 12px; opacity: .8; }

.day-panel { min-width: 0; }
.day-head { margin-bottom: 20px; }
.day-head .label {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.day-head h3 {
  font-family: var(--font-serif); font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  margin: 4px 0 6px; font-weight: 700;
}
.day-head .sub { font-size: 14px; color: var(--muted); }

/* 时间线 */
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid; grid-template-columns: 96px 1fr; gap: 18px;
  padding: 16px 0; border-bottom: 1px dashed var(--border);
}
.tl-item:last-child { border-bottom: none; }
.tl-time {
  font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent);
  font-size: 14px; padding-top: 2px; white-space: pre-line;
}
.tl-body { min-width: 0; }
.tl-text { font-size: 15px; }
.tl-transport {
  display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--muted);
  background: var(--surface-2); border-radius: 999px; padding: 3px 10px;
}

/* 贴士 */
.tips { margin-top: 28px; background: var(--warm-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.tips .label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--warm); }
.tips ul { margin: 10px 0 0; padding-left: 20px; }
.tips li { margin-bottom: 9px; font-size: 14.5px; color: var(--ink-2); }
.tips li:last-child { margin-bottom: 0; }

/* 子节（如 Day3 备选） */
.sub-box { margin-top: 20px; border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); }
.sub-box h4 { margin: 0 0 10px; font-size: 15px; color: var(--ink); }

/* ---------- 地图 ---------- */
.map-card { margin-top: 24px; padding: 0; overflow: hidden; }
.map-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.map-head .label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
#dayMap { height: 340px; width: 100%; background: var(--surface-2); }
#routeMap { height: 420px; width: 100%; background: var(--surface-2); }
.leaflet-container { font-family: var(--font-sans); background: var(--surface-2); }
.marker-pin {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* ---------- 酒店 / 航班 ---------- */
.hotel-card { display: flex; flex-direction: column; gap: 8px; }
.hotel-card .nights { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: .04em; }
.hotel-card h4 { margin: 0; font-size: 16px; line-height: 1.4; }
.hotel-card .addr { font-size: 13.5px; color: var(--muted); }
.hotel-card .hl { font-size: 13.5px; color: var(--ink-2); }
.hotel-card .phone { font-size: 13.5px; color: var(--ink-2); }

.flight-row { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.flight-row:last-child { border-bottom: none; }
.flight-row .k { color: var(--muted); font-size: 13px; }
.flight-note {
  margin-top: 16px; padding: 12px 16px; background: var(--surface-2);
  border-radius: var(--radius-sm); font-size: 13.5px; color: var(--ink-2);
  border-left: 3px solid var(--warm);
}

/* ---------- 美食 ---------- */
.food-city { margin-bottom: 36px; }
.food-city h3 {
  font-family: var(--font-serif); font-size: 1.3rem; margin: 0 0 4px;
  display: flex; align-items: baseline; gap: 10px;
}
.food-city h3 .cur { font-size: 12px; color: var(--muted); font-family: var(--font-sans); }
.food-group-name { font-size: 13px; font-weight: 700; color: var(--accent); margin: 18px 0 10px; letter-spacing: .04em; }
.food-item { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.food-item:last-child { border-bottom: none; }
.food-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.food-emoji { font-size: 16px; }
.food-name { font-weight: 700; font-size: 15px; }
.food-scores { display: flex; gap: 8px; font-size: 12px; }
.score { background: var(--surface-2); border-radius: 999px; padding: 2px 9px; color: var(--muted); }
.score b { color: var(--ink); }
.food-meta { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.food-tip { font-size: 13px; color: var(--warm); margin-top: 4px; }
.food-tag { font-size: 11.5px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 8px; font-weight: 600; }

/* ---------- 富文本（markdown 渲染） ---------- */
.md-body { font-size: 14.5px; color: var(--ink-2); }
.md-body h4 { font-size: 15.5px; color: var(--ink); margin: 20px 0 8px; }
.md-body h5 { font-size: 14.5px; color: var(--ink); margin: 16px 0 6px; }
.md-body ul { padding-left: 20px; margin: 8px 0; }
.md-body li { margin-bottom: 6px; }
.md-body blockquote {
  margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--accent);
  background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted); font-size: 13.5px;
}
.md-body table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 12px 0; display: block; overflow-x: auto; }
.md-body th, .md-body td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.md-body th { background: var(--surface-2); font-weight: 600; }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.md-body p { margin: 8px 0; }

/* ---------- 清单 ---------- */
.check-group { margin-bottom: 22px; }
.check-group h4 { font-size: 15px; margin: 0 0 10px; color: var(--ink); }
.check-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 7px 0;
  font-size: 14.5px; color: var(--ink-2); cursor: pointer;
}
.check-item input { margin-top: 5px; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.check-item span { flex: 1; }
.check-item input:checked + span { text-decoration: line-through; color: var(--muted); }
.check-progress {
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.progress-bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; max-width: 220px; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width .3s; }
.reset-btn { font-size: 12px; color: var(--muted); background: none; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer; font-family: inherit; }

/* ---------- 页脚 ---------- */
.footer { padding: 36px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  :root { --section-gap: 44px; }
  .days-layout { grid-template-columns: 1fr; gap: 20px; }
  .day-rail {
    position: static; flex-direction: row; overflow-x: auto; gap: 8px;
    padding-bottom: 4px; scrollbar-width: none;
  }
  .day-rail::-webkit-scrollbar { display: none; }
  .day-rail button { flex: 0 0 auto; min-width: 92px; border: 1px solid var(--border); background: var(--surface); text-align: center; align-items: center; }
  .tl-item { grid-template-columns: 1fr; gap: 6px; }
  .tl-time { color: var(--accent); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 32px; }
  .nav-inner { padding: 8px 14px; gap: 10px; }
  .brand { font-size: 15px; }
  #dayMap { height: 260px; }
  #routeMap { height: 320px; }
  .section-head { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
