/* =========================================================
   行迹 · 旅行行程生成器
   视觉：旅行杂志 / 手帐。米白纸面、深墨绿、赭石橙。
   ========================================================= */

:root {
  --bg: #faf7f2;
  --paper: #fffdfa;
  --paper-2: #f6f1e7;
  --ink: #1f3b34;
  --ink-2: #3b524b;
  --text: #333a37;
  --muted: #8b8276;
  --muted-2: #a99f90;
  --line: #e7ded1;
  --line-2: #d9cdba;
  --ochre: #c2703d;
  --ochre-deep: #a75a2c;
  --ochre-wash: #f6e9dd;
  --green-wash: #e9efe7;
  --shadow-s: 0 1px 1px rgba(60, 48, 32, 0.03), 0 10px 30px -24px rgba(60, 48, 32, 0.55);
  --shadow-m: 0 2px 4px rgba(60, 48, 32, 0.04), 0 24px 48px -34px rgba(60, 48, 32, 0.5);
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", "Noto Serif CJK SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --radius: 15px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 极淡的纸纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(194, 112, 61, 0.045), transparent 42%),
    radial-gradient(circle at 82% 8%, rgba(31, 59, 52, 0.04), transparent 38%);
}

[hidden] { display: none !important; }

.sprite { display: none; }

svg { display: block; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.005em;
}

p { margin: 0; }

.kicker {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ochre);
  font-weight: 600;
  margin: 0 0 10px;
}

/* ================= 顶栏 ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 247, 242, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  color: var(--ink);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
}

.brand-mark svg { width: 22px; height: 22px; }

.brand-text {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.14em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-text em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: 0.24em;
  color: var(--muted);
  transform: translateY(-1px);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.mode-badge[data-mode="live"] {
  color: var(--ink);
  border-color: #b9cbbd;
  background: var(--green-wash);
}

.mode-badge[data-mode="live"] .mode-dot { background: #4c7a5f; }

.mode-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ochre);
  flex: none;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}

.ghost-btn svg { width: 15px; height: 15px; }

.ghost-btn:hover {
  border-color: var(--ink-2);
  color: var(--ink);
  background: rgba(255, 253, 250, 0.9);
}

.top-btn { height: 34px; }

/* ================= 屏幕 ================= */
.screen {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ================= Hero ================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: 52px;
  padding: 34px 0 22px;
}

.hero-copy h1 {
  font-size: clamp(34px, 4.1vw, 50px);
  line-height: 1.22;
  letter-spacing: 0.015em;
  margin-bottom: 14px;
}

.lede {
  max-width: 430px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

/* 明信片 */
.postcard {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 412px;
  transform: rotate(-1.6deg);
}

.postcard-paper {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 12px 12px 0;
  box-shadow: var(--shadow-m);
}

.postcard-top {
  display: flex;
  justify-content: space-between;
  padding: 2px 3px 10px;
  font-size: 8.5px;
  letter-spacing: 0.22em;
  color: var(--muted-2);
}

.postcard-map {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
}

.postcard-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 3px 13px;
  gap: 12px;
}

.pc-quote {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink);
}

.pc-date {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}

.stamp {
  position: absolute;
  right: -18px;
  top: -24px;
  width: 82px;
  height: 94px;
  background: rgba(255, 253, 250, 0.94);
  border: 1px dashed var(--ochre);
  color: var(--ochre);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transform: rotate(7deg);
  box-shadow: 0 6px 16px -12px rgba(60, 48, 32, 0.6);
}

.stamp span {
  font-size: 8px;
  letter-spacing: 0.14em;
  writing-mode: horizontal-tb;
}

.stamp b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ================= 表单 ================= */
.planner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 38px 22px;
  box-shadow: var(--shadow-s);
  position: relative;
}

.planner-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 20px;
}

.planner-head .kicker { margin: 0; }

.planner-head h2 {
  font-size: 26px;
  letter-spacing: 0.02em;
}

.field { margin-bottom: 18px; }

.field:last-of-type { margin-bottom: 0; }

.field-label {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 12px;
  letter-spacing: 0.13em;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.field-label span {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.city-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.input-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
  max-width: 330px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  color: var(--ochre);
  pointer-events: none;
}

.input-wrap input,
.text-input {
  width: 100%;
  height: 50px;
  padding: 0 14px 0 42px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.03em;
  transition: border-color 0.18s, background 0.18s;
}

.text-input {
  font-family: var(--sans);
  font-size: 14px;
  padding-left: 14px;
  height: 46px;
  letter-spacing: 0;
}

.input-wrap input::placeholder,
.text-input::placeholder {
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.input-wrap input:focus,
.text-input:focus {
  outline: none;
  border-color: var(--ink-2);
  background: var(--paper);
}

.city-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: var(--shadow-m);
  padding: 4px;
}

.city-suggest button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 7px;
  text-align: left;
  color: var(--ink);
}

.city-suggest button:hover,
.city-suggest button:focus-visible {
  background: var(--paper-2);
}

.city-suggest svg {
  width: 15px;
  height: 15px;
  color: var(--ochre);
  flex: none;
}

.city-suggest span {
  font-family: var(--serif);
  font-size: 15px;
}

.city-suggest em {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: all 0.16s ease;
  flex: none;
}

.chip:hover {
  border-color: var(--ink-2);
  background: var(--paper-2);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #f7f2e8;
}

.chip .chip-sub {
  color: var(--muted-2);
  font-size: 10.5px;
  margin-left: 6px;
}

.chip[aria-pressed="true"] .chip-sub { color: rgba(247, 242, 232, 0.62); }

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 34px;
}

.seg {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.seg button {
  width: 40px;
  height: 38px;
  border-radius: 6px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink-2);
  transition: all 0.15s ease;
}

.seg button:hover { background: var(--paper-2); }

.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: #f7f2e8;
}

.pace-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 380px;
}

.pace-opt {
  text-align: left;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 9px 13px 10px;
  background: transparent;
  transition: all 0.16s ease;
  min-height: 50px;
}

.pace-opt b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.pace-opt span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 1px;
}

.pace-opt:hover { border-color: var(--ink-2); }

.pace-opt[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--green-wash);
}

.pace-opt[aria-pressed="true"] b { color: var(--ink); }

.pref-row .chip[aria-pressed="true"] {
  background: var(--ochre);
  border-color: var(--ochre);
  color: #fff8f1;
}

.planner-foot {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 30px;
  background: var(--ink);
  color: #f9f4e9;
  border-radius: 10px;
  font-size: 14.5px;
  letter-spacing: 0.14em;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 12px 24px -18px rgba(31, 59, 52, 0.9);
}

.primary-btn svg {
  width: 19px;
  height: 19px;
  transition: transform 0.24s ease;
}

.primary-btn:hover {
  background: #2a4c43;
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -18px rgba(31, 59, 52, 0.85);
}

.primary-btn:hover svg { transform: translateX(4px); }

.primary-btn:active { transform: translateY(0); }

.primary-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.primary-btn.small {
  min-height: 42px;
  padding: 0 20px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  gap: 8px;
}

.foot-hint {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.foot-hint b {
  font-weight: 500;
  color: var(--ochre-deep);
}

.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 26px 2px 40px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

/* ================= 加载 ================= */
.loading-screen {
  min-height: calc(100vh - 64px);
  padding: 34px 28px 70px;
}

.loading-box {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 28px;
  text-align: center;
}

.loading-route {
  width: 220px;
  height: 120px;
  margin: 0 auto 22px;
}

.loading-route .lr-dot {
  animation: travel 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  offset-path: path("M14 98C50 92 50 40 96 42s48 44 110 22");
}

@keyframes travel {
  0% { offset-distance: 0%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

.loading-box h2 {
  font-size: 25px;
  margin-bottom: 10px;
}

.loading-step {
  font-size: 12.5px;
  color: var(--ochre-deep);
  letter-spacing: 0.06em;
  min-height: 20px;
}

.bar {
  height: 2px;
  background: var(--line);
  margin: 22px auto 16px;
  overflow: hidden;
  border-radius: 2px;
}

.bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ochre);
  transition: width 0.5s ease;
}

.loading-tip {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

/* 骨架屏：地图占位 + 3 张日程卡 */
.skeleton {
  display: grid;
  grid-template-columns: 46% minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.sk-map,
.sk-card {
  background-color: #efe9df;
  background-image: linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.55) 40%, rgba(255, 255, 255, 0) 60%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.sk-map {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.sk-list {
  display: grid;
  gap: 14px;
  align-content: start;
}

.sk-card {
  height: 118px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -80% 0; }
}

/* ================= 结果：摘要 ================= */
.result-screen { padding-bottom: 60px; }

.summary {
  border-bottom: 1px solid var(--line);
  padding: 34px 0 0;
  margin-bottom: 26px;
}

.summary-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 0.9fr);
  gap: 34px;
  align-items: center;
  padding-bottom: 26px;
}

.sum-head h2 {
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.sum-head h2 .sum-days {
  font-size: 18px;
  color: var(--ochre);
  margin-left: 12px;
  letter-spacing: 0.16em;
}

.sum-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.sum-stats {
  display: flex;
  gap: 30px;
  padding: 0 6px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.stat b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.stat i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-top: 7px;
}

.sum-weather {
  justify-self: end;
  min-width: 0;
}

.sum-weather-title {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.weather-row {
  display: flex;
  gap: 16px;
}

.wx-item {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "icon day" "icon temp";
  column-gap: 6px;
  align-items: center;
  min-width: 0;
}

.wx-item svg {
  grid-area: icon;
  width: 24px;
  height: 24px;
  color: var(--ochre);
}

.wx-item[data-wx="cloud"] svg,
.wx-item[data-wx="rain"] svg { color: var(--ink-2); }

.wx-day {
  grid-area: day;
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.wx-temp {
  grid-area: temp;
  font-family: var(--serif);
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
}

.summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.sum-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.sum-note .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ochre);
  flex: none;
}

.sum-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sum-actions .ghost-btn { height: 34px; font-size: 12px; }

.export { position: relative; }

.export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 150px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: var(--shadow-m);
  padding: 6px;
}

.export-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.export-menu button:hover { background: var(--paper-2); color: var(--ink); }

/* ================= 结果：布局 ================= */
.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.map-panel {
  position: sticky;
  top: 84px;
  height: min(calc(100vh - 106px), 640px);
  min-height: 460px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-s);
}

.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.map-head .kicker { margin: 0 0 3px; font-size: 9px; }

.map-head h3 {
  font-size: 17px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.map-head h3 span {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-left: 8px;
}

.map-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  flex: none;
}

.map-switch button {
  min-width: 38px;
  height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.map-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: #f7f2e8;
}

.map-canvas {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: #fcfaf5;
}

.map-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  background: rgba(252, 250, 245, 0.72);
}

.map-legend {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.map-legend::-webkit-scrollbar { display: none; }

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.map-foot-note {
  flex: none;
  padding: 0 18px 10px;
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

/* SVG 地图元素 */
.mp-bg { fill: #fcfaf5; }
.mp-grid-dot { fill: #ded3c1; opacity: 0.55; }
.mp-blob { fill: #e9eee3; opacity: 0.55; }
.mp-scale { stroke: #b8ab97; stroke-width: 1; }
.mp-scale-label { fill: #8b8276; font-size: 9px; letter-spacing: 0.08em; font-family: var(--sans); }
.mp-compass { fill: none; stroke: #b8ab97; stroke-width: 1; opacity: 0.8; }
.mp-compass-label { fill: #8b8276; font-size: 9px; letter-spacing: 0.1em; font-family: var(--serif); }
.mp-route {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mp-route-glow {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.1;
}
.mp-marker { cursor: pointer; }
.mp-marker circle.mk {
  stroke: #fffdfa;
  stroke-width: 2;
}
.mp-marker text {
  fill: #fffdfa;
  font-family: var(--serif);
  font-size: 11px;
  text-anchor: middle;
  pointer-events: none;
}
.mp-marker .mk-label {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 10px;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #fcfaf5;
  stroke-width: 3px;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.16s;
}
.mp-marker:hover .mk-label,
.mp-marker:focus .mk-label { opacity: 1; }

.mp-marker .mk-label.always { opacity: 0.88; }

.mp-caption-en {
  fill: #8b8276;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.34em;
}

.mp-caption-coord {
  fill: #b2a795;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.mp-note-kicker {
  fill: #c2703d;
  font-family: var(--sans);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.mp-note-title {
  fill: #1f3b34;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.mp-note-sub {
  fill: #8b8276;
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.mp-marker.is-meal circle.mk {
  fill: #fffdfa;
  stroke-width: 1.6;
}
.mp-marker.is-meal text { fill: var(--ink); }
.mp-marker.is-meal text.mp-bowl { font-size: 9px; }

.mp-lead {
  stroke-width: 1;
  stroke-dasharray: 2 2;
  opacity: 0.5;
}

@keyframes mkPop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}

.mp-marker .mk-group {
  transform-box: fill-box;
  transform-origin: center;
  animation: mkPop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.mp-day-tag {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.1em;
  fill: #8b8276;
}

/* ================= 时间轴 ================= */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  padding-bottom: 40px;
}

.day-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.day-card.is-active {
  border-color: var(--line-2);
  box-shadow: var(--shadow-m);
}

.reveal { animation: fadeUp 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.day-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(246, 241, 231, 0.55), rgba(255, 253, 250, 0));
}

.day-index {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  color: var(--ochre);
  letter-spacing: -0.02em;
  padding-top: 2px;
}

.day-title { min-width: 0; }

.day-title h3 {
  font-size: 19px;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.day-title p {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.day-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.day-wx {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}

.day-wx svg { width: 19px; height: 19px; color: var(--ochre); }
.day-wx[data-wx="cloud"] svg,
.day-wx[data-wx="rain"] svg { color: var(--ink-2); }

.day-facts {
  display: flex;
  gap: 12px;
  font-size: 10.5px;
  color: var(--muted);
}

.day-facts span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.day-facts svg { width: 12px; height: 12px; }

.day-body { padding: 4px 22px 8px; }

/* 单个点 */
.stop {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
}

.stop-time {
  text-align: right;
  padding-top: 1px;
}

.stop-time b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.stop-time span {
  display: block;
  font-size: 9.5px;
  color: var(--muted-2);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.stop-body {
  position: relative;
  padding: 0 0 2px 24px;
  border-left: 1px dashed var(--line-2);
  min-width: 0;
}

.stop:last-child .stop-body { border-left-color: transparent; }

.stop-dot {
  position: absolute;
  left: -11px;
  top: 0;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 10px;
  color: #fffdfa;
  line-height: 1;
  border: 1px solid transparent;
}

.stop-dot svg { width: 11px; height: 11px; }

.stop--meal .stop-dot {
  background: var(--paper);
  border-color: var(--ochre);
  color: var(--ochre);
}

.stop--meal .stop-body {
  background: rgba(246, 233, 221, 0.42);
  border-radius: 9px;
  padding: 10px 12px 10px 34px;
  margin-left: 0;
  border-left-color: transparent;
}

.stop--meal .stop-dot { left: 10px; top: 12px; }

.stop-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.stop-head h4 {
  font-size: 16.5px;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.tag {
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  background: var(--bg);
}

.stop--meal .tag {
  color: var(--ochre-deep);
  border-color: #e7cdb8;
  background: transparent;
}

.stay {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stay b {
  font-weight: 500;
  color: var(--muted);
}

.stop-why {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #5c615c;
  overflow-wrap: anywhere;
}

.stop-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stop-text {
  flex: 1 1 auto;
  min-width: 0;
}

.stop-photo-wrap {
  flex: 0 0 auto;
  margin-top: 2px;
}

.stop-photo {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.poi-rating,
.poi-cost {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.poi-rating {
  color: var(--ochre-deep);
}

.poi-rating svg {
  width: 11px;
  height: 11px;
}

.poi-cost {
  color: var(--muted);
}

.leg {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}

.leg svg { width: 13px; height: 13px; flex: none; }

.leg b {
  font-weight: 500;
  color: var(--muted);
}

.leg .leg-to { color: var(--muted-2); }

.leg .leg-deg { color: var(--ochre-deep); }

.day-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 22px 13px;
  border-top: 1px solid var(--line);
  background: rgba(246, 241, 231, 0.35);
  font-size: 10.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.day-foot .text-btn {
  font-size: 10.5px;
  color: var(--ochre-deep);
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(194, 112, 61, 0.35);
  padding: 0 0 1px;
}

.day-foot .text-btn:hover { border-bottom-color: var(--ochre-deep); }

/* ================= 浮层 ================= */
.tooltip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  background: var(--ink);
  color: #faf7f2;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 8px 20px -10px rgba(31, 59, 52, 0.8);
  max-width: 240px;
  transform: translate(-50%, -140%);
}

.tooltip small {
  display: block;
  font-size: 9px;
  color: rgba(250, 247, 242, 0.6);
  margin-top: 1px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(8px);
  z-index: 95;
  background: var(--ink);
  color: #faf7f2;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  max-width: calc(100vw - 40px);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================= 弹窗 ================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 38, 0.34);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 26px 28px 22px;
  box-shadow: 0 40px 80px -40px rgba(20, 30, 26, 0.6);
  animation: fadeUp 0.3s both;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.modal-head h2 { font-size: 23px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  flex: none;
}

.icon-btn:hover { background: var(--paper-2); color: var(--ink); }

.icon-btn svg { width: 17px; height: 17px; }

.modal-desc {
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 18px;
}

.modal-desc b { color: var(--ink-2); font-weight: 500; }

.modal-card .field-label { margin-bottom: 8px; }

.key-status {
  min-height: 18px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted-2);
    letter-spacing: 0.02em;
}

.key-status.ok { color: #3c6c51; }
.key-status.err { color: #a04b3c; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.modal-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--muted-2);
}

/* ================= 响应式 ================= */
@media (max-width: 1080px) {
  .hero { gap: 34px; }
  .summary-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .sum-weather { grid-column: 1 / -1; justify-self: start; }
  .weather-row { flex-wrap: wrap; gap: 14px 26px; }
}

@media (max-width: 900px) {
  .topbar-inner { padding: 0 18px; height: 58px; }
  .screen { padding: 0 18px; }
  .hero { grid-template-columns: 1fr; padding: 38px 0 30px; gap: 26px; }
  .hero-copy h1 { font-size: clamp(32px, 8vw, 44px); margin-bottom: 16px; }
  .postcard { display: none; }
  .planner { padding: 26px 22px 24px; border-radius: 15px; }
  .result-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .map-panel {
    position: relative;
    top: 0;
    height: 38vh;
    min-height: 260px;
    max-height: 360px;
    border-radius: 13px;
  }
  .map-head { padding: 11px 14px 10px; }
  .map-head h3 { font-size: 15px; }
  .map-head h3 span { display: none; }
  .map-legend { padding: 9px 14px; }
  .map-foot-note { display: none; }
  .summary { padding-top: 24px; }
  .summary-inner { gap: 20px; padding-bottom: 18px; }
  .sum-head h2 { font-size: 31px; }
  .sum-stats { gap: 22px; }
  .stat b { font-size: 30px; }
  .day-head { padding: 16px 16px 14px; gap: 12px; }
  .day-index { font-size: 28px; }
  .day-title h3 { font-size: 17px; }
  .day-meta { align-items: flex-end; }
  .day-body { padding: 2px 16px 6px; }
  .day-foot { padding: 10px 16px 12px; }
  .stop { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .stop-body { padding-left: 19px; }
  .stop-dot { left: -10px; width: 19px; height: 19px; font-size: 9.5px; }
  .stop--meal .stop-body { padding: 9px 10px 9px 31px; }
  .stop--meal .stop-dot { left: 8px; top: 10px; }
  .stop-time b { font-size: 14.5px; }
  .stop-why { font-size: 12px; }
  .timeline { gap: 16px; }
  .skeleton { grid-template-columns: 1fr; }
  .sk-map { min-height: 210px; }
  .sk-card { height: 96px; }
}

@media (max-width: 720px) {
  .brand-text em { display: none; }
  .top-btn span { display: none; }
  .top-btn { width: 34px; padding: 0; }
  .mode-badge { font-size: 9.5px; padding: 0 8px; gap: 5px; }
  .field-grid { grid-template-columns: 1fr; gap: 24px; }
  .field { margin-bottom: 24px; }
  .planner-head { margin-bottom: 22px; }
  .planner-head h2 { font-size: 22px; }
  .planner-head { flex-direction: column; gap: 4px; align-items: flex-start; }
  .input-wrap { max-width: none; flex-basis: 100%; }
  .city-row { gap: 12px; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(to right, #000 0, #000 94%, transparent 100%); mask-image: linear-gradient(to right, #000 0, #000 94%, transparent 100%); }
  .chip-row::-webkit-scrollbar { display: none; }
  .city-row .chip-row { width: 100%; }
  .chip { height: 44px; }
  .seg { width: 100%; }
  .seg button { flex: 1; height: 44px; width: auto; }
  .pace-row { max-width: none; }
  .pace-opt { min-height: 54px; }
  .planner-foot { gap: 12px; margin-top: 26px; padding-top: 22px; }
  .planner-foot .primary-btn { width: 100%; min-height: 52px; }
  .foot-hint { font-size: 11px; }
  .summary-inner { grid-template-columns: 1fr; gap: 16px; }
  .sum-head h2 { font-size: 29px; }
  .sum-head h2 .sum-days { font-size: 15px; margin-left: 9px; }
  .sum-stats { gap: 26px; }
  .weather-row { gap: 12px 20px; }
  .sum-weather { justify-self: stretch; }
  .summary-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .sum-actions { justify-content: flex-start; }
  .day-head { grid-template-columns: auto minmax(0, 1fr); }
  .day-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 3px;
  }
  .map-switch button { min-width: 34px; padding: 0 6px; }
  .site-foot { padding: 20px 2px 30px; font-size: 10px; }
}

@media (max-width: 400px) {
  .topbar-inner { padding: 0 14px; gap: 8px; }
  .screen { padding: 0 14px; }
  .brand-text { font-size: 16px; letter-spacing: 0.1em; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .mode-badge { font-size: 9px; letter-spacing: 0.02em; }
  .ghost-btn { height: 36px; padding: 0 11px; }
  .hero { padding-top: 30px; }
  .planner { padding: 22px 16px 20px; }
  .stat b { font-size: 27px; }
  .stat i { font-size: 9px; }
  .sum-stats { gap: 20px; }
  .day-facts { font-size: 10px; gap: 9px; }
  .stop { grid-template-columns: 48px minmax(0, 1fr); }
  .stop-head h4 { font-size: 15.5px; }
  .toast {
    top: calc(62px + env(safe-area-inset-top));
    bottom: auto;
    transform: translateX(-50%) translateY(-8px);
  }
  .toast.show { transform: translateX(-50%) translateY(0); }
}

/* ================= 减弱动效 ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .loading-route .lr-dot { offset-distance: 50%; }
  .sk-map, .sk-card { animation: none; }
}

/* ================= 打印 ================= */
@media print {
  @page { margin: 14mm 12mm; }

  html, body { background: #fff !important; color: #111; }
  body::before { display: none; }

  .topbar,
  .input-screen,
  .loading-screen,
  .map-panel,
  .summary-bar .sum-actions,
  .mode-badge,
  .site-foot,
  .toast,
  .tooltip,
  .stamp,
  .day-foot .text-btn { display: none !important; }

  .screen { max-width: none; padding: 0; }
  .result-screen { padding: 0; }
  .summary { border-bottom: 1px solid #bbb; padding: 0 0 6mm; margin-bottom: 6mm; }
  .summary-inner { display: block; padding: 0; }
  .sum-head h2 { font-size: 26pt; }
  .sum-head h2 .sum-days { color: #555; }
  .sum-sub { color: #444; }
  .sum-stats { margin-top: 4mm; gap: 14mm; }
  .stat b { font-size: 22pt; color: #111; }
  .stat i { color: #444; }
  .sum-weather { margin-top: 4mm; }
  .wx-item svg { display: none; }
  .wx-item { display: flex; gap: 3mm; }
  .wx-day, .wx-temp { color: #222; }
  .result-grid { display: block; }
  .timeline { display: block; padding: 0; }
  .day-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #999;
    margin-bottom: 6mm;
    border-radius: 0;
  }
  .day-card, .day-head, .day-foot { background: #fff !important; }
  .day-head { border-bottom: 1px solid #bbb; padding: 4mm 5mm; }
  .day-body { padding: 1mm 5mm 2mm; }
  .day-foot { border-top: 1px solid #bbb; padding: 2mm 5mm; color: #444; }
  .day-index, .sum-days { color: #333 !important; }
  .day-title h3, .stop-head h4, .stop-time b { color: #111; }
  .stop-why { color: #333; }
  .stop { break-inside: avoid; page-break-inside: avoid; }
  .stop-body { border-left-color: #bbb; }
  .stop-dot { background: #333 !important; color: #fff !important; border-color: #333 !important; }
  .stop--meal .stop-body { background: #f4f4f4 !important; }
  .tag { border-color: #bbb; color: #333; background: #fff; }
  .leg svg { display: none; }
  .stop-photo-wrap { display: none !important; }
  .reveal { animation: none !important; }
  .mp-marker, .map-canvas { display: none; }
}
