:root {
  --paper: #f4efe6;
  --paper-deep: #ebe4d6;
  --ink: #1f1a14;
  --ink-2: #4a4338;
  --muted: #7a7166;
  --line: #e2d8c8;
  --card: #fffdf8;
  --terracotta: #b5522a;
  --terracotta-d: #8c3d1c;
  --sand: #ead7c0;
  --forest: #3d5c45;
  --forest-s: #e7f0e8;
  --navy: #2c4a6e;
  --navy-s: #e8eef5;
  --gold: #c9a227;
  --danger: #9b2c2c;
  --radius: 16px;
  --max: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "PingFang SC", "Hiragino Sans GB", serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, .sans, .nav-tabs, .stat-row, .tag, .day-btn, .detail-meta {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ===== Hero ===== */
.hero {
  background:
    linear-gradient(180deg, rgba(31,26,20,0.55) 0%, rgba(31,26,20,0.78) 100%),
    radial-gradient(1200px 500px at 20% 10%, #6b8f71 0%, transparent 55%),
    radial-gradient(900px 400px at 90% 80%, #b5522a 0%, transparent 50%),
    linear-gradient(135deg, #2c241c, #3d3228 40%, #1f1a14);
  color: #f8f1e7;
  padding: 48px 20px 40px;
}
.hero-inner { max-width: var(--max); margin: 0 auto; }
.kicker {
  font-family: "PingFang SC", sans-serif;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
}
.hero-dates {
  font-family: "PingFang SC", sans-serif;
  margin-top: 10px;
  opacity: 0.85;
  font-size: 0.92rem;
}
.hero-lead {
  max-width: 720px;
  margin-top: 18px;
  font-size: 0.98rem;
  line-height: 1.85;
  color: rgba(248,241,231,0.88);
}
@media (min-width: 900px) {
  .hero {
    padding: 56px 28px 48px;
  }
  .hero-dates {
    max-width: none;
    font-size: 1rem;
    line-height: 1.75;
  }
  .hero-lead {
    max-width: none;
    font-size: 1.02rem;
    line-height: 1.9;
  }
  .hero-tags {
    margin-top: 22px;
  }
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-tag {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.75rem;
  padding: 5px 12px;
  border: 1px solid rgba(248,241,231,0.28);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 28px;
}
.stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 14px 12px;
}
.stat .n {
  font-size: 1.45rem;
  font-weight: 700;
  color: #f3d7a0;
  line-height: 1.2;
}
.stat .l { font-size: 0.72rem; opacity: 0.7; margin-top: 4px; }

.route-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 2px;
  margin-top: 22px;
  font-family: "PingFang SC", sans-serif;
  font-size: 0.82rem;
}
.route-chip {
  background: rgba(255,255,255,0.12);
  padding: 4px 10px;
  border-radius: 6px;
}
.route-arrow { opacity: 0.45; padding: 0 4px; }

/* ===== Highlights ===== */
.highlights {
  max-width: var(--max);
  margin: -28px auto 0;
  padding: 0 20px 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  position: relative;
  z-index: 2;
}
.hl-card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(31,26,20,0.06);
}
.hl-card h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--terracotta-d);
}
.hl-card p {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.8rem;
  color: var(--ink-2);
  line-height: 1.65;
}

/* ===== Nav ===== */
.nav-tabs {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  overflow-x: auto;
  background: rgba(244,239,230,0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs button {
  flex-shrink: 0;
  padding: 14px 18px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.92rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.nav-tabs button.active {
  color: var(--terracotta);
  border-bottom-color: var(--terracotta);
  font-weight: 600;
}

/* ===== Panels ===== */
.panel {
  display: none;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 20px 48px;
}
.panel.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 1.15rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.card-lead {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.88rem;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--terracotta-d);
  margin-right: 6px;
}
.tag-holiday { background: #f8e4e0; color: var(--danger); }
.tag-nature { background: var(--forest-s); color: var(--forest); }
.tag-food { background: #fbe9dc; color: var(--terracotta); }
.tag-culture { background: var(--navy-s); color: var(--navy); }
.tag-brand { background: #eeeae2; color: var(--ink-2); }

/* ===== Day selector ===== */
.day-selector {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 4px 0 16px;
  scrollbar-width: none;
}
.day-selector::-webkit-scrollbar { display: none; }
.day-btn {
  flex-shrink: 0;
  min-width: 72px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  color: var(--ink-2);
}
.day-btn .date { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.day-btn .sub { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.day-btn.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}
.day-btn.active .date,
.day-btn.active .sub { color: #fff; }

/* ===== Day article ===== */
.day-cover {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.day-cover-top {
  padding: 22px 22px 18px;
  background:
    linear-gradient(120deg, rgba(181,82,42,0.12), rgba(61,92,69,0.1)),
    var(--card);
  border-bottom: 1px solid var(--line);
}
.day-cover-top h2 {
  font-size: 1.35rem;
  margin: 8px 0 6px;
}
.cover-meta {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.cover-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}
.cover-stat {
  background: var(--card);
  padding: 12px;
  text-align: center;
}
.cover-stat .n { font-size: 1.2rem; font-weight: 700; color: var(--terracotta-d); }
.cover-stat .l {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.7rem;
  color: var(--muted);
}

.stay-banner {
  margin: 0;
  padding: 16px 22px;
  background: var(--navy-s);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.stay-banner .stay-kicker {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--navy);
}
.stay-banner .stay-name { font-size: 1.05rem; font-weight: 700; }
.stay-banner .stay-info {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.stay-banner.home { background: var(--forest-s); }
.stay-banner.home .stay-kicker { color: var(--forest); }

/* ===== Timeline ===== */
.timeline { position: relative; padding: 8px 0 0 8px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--line);
}
.tl-node { position: relative; padding: 0 0 22px 56px; }
.tl-node:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: 14px;
  top: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--terracotta-d);
  font-family: "PingFang SC", sans-serif;
  font-size: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border: 2px solid var(--card);
}
.tl-dot.drive { background: #e8e0d4; color: #5c5348; }
.tl-dot.scenic { background: var(--forest-s); color: var(--forest); }
.tl-dot.meal { background: #fbe9dc; color: var(--terracotta); }
.tl-dot.hotel { background: var(--navy-s); color: var(--navy); }
.tl-dot.rest { background: #eee8f5; color: #5b4570; }
.tl-dot.walk { background: #e4f2f3; color: #2a6b70; }
.tl-dot.arrive { background: var(--forest-s); color: var(--forest); }

.tl-header { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.tl-time {
  font-family: "PingFang SC", sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--terracotta);
  font-size: 0.88rem;
}
.tl-label { font-weight: 700; }
.tl-text {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.88rem;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.detail-card {
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.detail-card.hotel-card { border-left: 3px solid var(--navy); }
.detail-card.meal-card { border-left: 3px solid var(--terracotta); }
.detail-card.scenic-card { border-left: 3px solid var(--forest); }
.detail-card.disabled { opacity: 0.5; }
.detail-name { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.rating { color: #b45309; font-weight: 700; }
.detail-row {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.detail-tip {
  margin-top: 8px;
  font-family: "PingFang SC", sans-serif;
  font-size: 0.8rem;
  background: var(--paper);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--forest);
}
.price-inline { font-weight: 700; color: var(--terracotta-d); }
.price-holiday { color: var(--danger); }

/* ===== Map / lists ===== */
#map {
  height: 380px;
  border-radius: 12px;
  background: var(--paper-deep);
}
.map-fallback {
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  padding: 20px;
}
.attraction-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-family: "PingFang SC", sans-serif;
}
.attraction-item:last-child { border-bottom: 0; }
.attraction-item input { margin-top: 4px; accent-color: var(--terracotta); }

.calc-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-family: "PingFang SC", sans-serif;
  font-size: 0.9rem;
}
.calc-group select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.calc-group input[type=range] { width: 140px; accent-color: var(--terracotta); }
.calc-total {
  margin-top: 16px;
  background: var(--ink);
  color: #f8f1e7;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
}
.calc-label { font-family: "PingFang SC", sans-serif; font-size: 0.8rem; opacity: 0.75; }
.calc-total .big { font-size: 2.3rem; font-weight: 700; margin: 4px 0; color: #f3d7a0; }
.calc-breakdown { font-family: "PingFang SC", sans-serif; font-size: 0.78rem; opacity: 0.75; }
.price-row {
  display: flex;
  justify-content: space-between;
  font-family: "PingFang SC", sans-serif;
  font-size: 0.9rem;
  padding: 6px 0;
}
.price-row .amount { font-weight: 700; }
.budget-ok { color: var(--forest); }
.budget-warn { color: var(--danger); }

.packing-list { list-style: none; }
.packing-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-family: "PingFang SC", sans-serif;
  font-size: 0.9rem;
}
.packing-list li:last-child { border-bottom: 0; }
.packing-list span { color: var(--muted); font-size: 0.84rem; }

.advice-item {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.88rem;
  padding: 10px 12px;
  background: #fbf6ea;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
}
.footnote {
  font-family: "PingFang SC", sans-serif;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.6;
}

@media (max-width: 860px) {
  .stat-row, .highlights { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-top: 32px; }
  .highlights { margin-top: 16px; }
}
@media (min-width: 768px) {
  #map, .map-fallback { height: 480px; }
}

/* ===== Map extras ===== */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-family: "PingFang SC", sans-serif;
  font-size: 0.78rem;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.map-legend span { display: flex; align-items: center; gap: 6px; }
.lg {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.lg-city { background: var(--terracotta); }
.lg-hotel { background: var(--navy); }
.lg-scenic { background: var(--forest); }
.lg-line {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--terracotta);
  border: 0;
  box-shadow: none;
}

.map-day-row {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 0 0 12px;
  scrollbar-width: none;
}
.map-day-row::-webkit-scrollbar { display: none; }
.map-day-chip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 6px 10px;
  font-family: "PingFang SC", sans-serif;
  font-size: 0.75rem;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.map-day-chip strong { display: block; color: var(--ink); font-size: 0.8rem; }
.map-day-chip.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}
.map-day-chip.active strong { color: #fff; }

.stop-item {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: "PingFang SC", sans-serif;
}
.stop-item:last-child { border-bottom: 0; }
.stop-item:disabled { opacity: 0.45; cursor: default; }
.stop-kind {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: #fff;
  margin-top: 2px;
}
.stop-kind.city { background: var(--terracotta); }
.stop-kind.hotel { background: var(--navy); }
.stop-kind.scenic { background: var(--forest); }
.stop-item strong { display: block; font-size: 0.9rem; color: var(--ink); }
.stop-item small { color: var(--muted); font-size: 0.75rem; }

/* ===== Phone ===== */
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }

  body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    font-size: 15px;
  }
  .hero {
    padding: calc(20px + env(safe-area-inset-top, 0px)) 16px 20px;
  }
  .kicker { font-size: 0.66rem; letter-spacing: 0.16em; }
  .hero h1 { font-size: 1.55rem; letter-spacing: 0.04em; }
  .hero-dates {
    font-size: 0.84rem;
    line-height: 1.65;
    margin-top: 8px;
  }
  .hero-lead {
    max-width: none;
    font-size: 0.86rem;
    margin-top: 12px;
    line-height: 1.7;
  }
  .hero-tags { gap: 6px; margin-top: 14px; }
  .hero-tag { font-size: 0.72rem; padding: 5px 10px; }
  .stat-row { gap: 8px; margin-top: 16px; }
  .stat { padding: 10px 8px; }
  .stat .n { font-size: 1.15rem; }
  .stat .l { font-size: 0.68rem; }
  .route-strip {
    margin-top: 16px;
    font-size: 0.76rem;
    gap: 4px 1px;
  }
  .route-chip { padding: 3px 8px; }
  .highlights { padding: 0 16px 4px; gap: 8px; margin-top: 12px; }
  .hl-card { padding: 12px; }
  .hl-card h3 { font-size: 0.9rem; }
  .hl-card p { font-size: 0.78rem; }
  .nav-tabs {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    border-bottom: 0;
    border-top: 1px solid var(--line);
    padding: 0 2px env(safe-area-inset-bottom, 0px);
    background: rgba(244, 239, 230, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .nav-tabs button {
    flex: 1;
    min-height: 44px;
    padding: 8px 2px 6px;
    font-size: 0.72rem;
    border-bottom: 0;
    border-top: 2px solid transparent;
    text-align: center;
  }
  .nav-tabs button.active {
    border-bottom-color: transparent;
    border-top-color: var(--terracotta);
  }
  .panel { padding: 14px 14px 28px; }
  .card-title { font-size: 1.05rem; }
  .day-selector { padding-bottom: 12px; }
  .day-btn {
    min-width: 60px;
    min-height: 52px;
    padding: 8px 6px;
  }
  .day-btn .date { font-size: 0.9rem; }
  .day-cover-top { padding: 16px; }
  .day-cover-top h2 { font-size: 1.12rem; }
  .cover-stat { padding: 10px 6px; }
  .cover-stat .n { font-size: 1.05rem; }
  .cover-stat .l { font-size: 0.66rem; }
  .stay-banner { padding: 12px 16px; }
  .tl-node { padding-left: 50px; }
  .tl-header { flex-wrap: wrap; gap: 2px 8px; }
  .tl-time { font-size: 0.84rem; }
  .tl-text { font-size: 0.84rem; }
  .detail-card { padding: 12px; }
  .detail-name { font-size: 0.95rem; }
  .detail-meta { gap: 6px; font-size: 0.76rem; }
  #map, .map-fallback { height: 260px; }
  .map-legend { gap: 6px 10px; font-size: 0.72rem; margin-bottom: 8px; }
  .map-day-chip { padding: 8px 10px; min-height: 44px; }
  .stop-item { padding: 12px 2px; }
  .attraction-item {
    gap: 14px;
    padding: 14px 0;
    align-items: flex-start;
  }
  .attraction-item input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
  }
  .calc-group label {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 0;
  }
  .calc-group select { width: 100%; }
  .calc-group input[type=range] { width: 100%; }
  .calc-total { padding: 18px 16px; }
  .calc-total .big { font-size: 1.9rem; }
  .price-row { font-size: 0.84rem; gap: 8px; }
  .card { padding: 14px; }
  .footnote { font-size: 0.72rem; }
}