/* ============================================================
   Travel Story（geojsoncn 子功能）— 样式
   设计语言移植自 wang-bool/Travel-Story（MIT License）：
   暖纸底 + 墨色 + 朱砂红；衬线大标题 + 等宽小字。
   字体走系统栈（国内无 Google Fonts 依赖）。
   ============================================================ */

:root {
  --paper: #F6F1E4;
  --paper-2: #EFE8D8;
  --ink: #26211A;
  --ink-soft: #4A4440;
  --muted: #8A8172;
  --accent: #E4572E;
  --line: #DCCFB4;
  --card: #FFFDF7;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(38, 33, 26, 0.08), 0 10px 34px rgba(38, 33, 26, 0.10);
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-mono: "Cascadia Mono", Consolas, "JetBrains Mono", "Courier New", monospace;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* 作者样式（display:flex 等）会压过 hidden 属性的 UA 样式，必须显式兜底 */
[hidden] { display: none !important; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
h1, h2, h3, .font-display { font-family: var(--font-display); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- 启动屏 ---------- */
.boot-splash {
  min-height: 70vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
}
.boot-kicker { font-family: var(--font-mono); letter-spacing: 0.3em; color: var(--muted); }
.boot-hint { color: var(--muted); }

/* ---------- 页头 ---------- */
.ts-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 228, 0.92); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 50;
}
.ts-brand {
  font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.18em;
  font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.ts-brand-mark { color: var(--accent); font-size: 16px; }
.ts-nav { display: flex; gap: 18px; align-items: center; font-family: var(--font-mono); font-size: 13px; }
.ts-nav a { color: var(--muted); padding: 4px 2px; border-bottom: 2px solid transparent; }
.ts-nav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.ts-nav a.ts-back:hover { color: var(--ink); }

/* ---------- 首页 ---------- */
.home { max-width: 1080px; margin: 0 auto; padding: 0 26px 60px; }
.hero { padding: 72px 0 56px; text-align: left; }
.hero-title { font-size: clamp(30px, 5vw, 52px); line-height: 1.25; margin: 14px 0 18px; font-weight: 600; }
.hero-sub { color: var(--ink-soft); margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin-top: 18px; font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

.trips-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 16px; }
.trips-head h2 { margin: 0; font-size: 24px; }
.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.trip-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.trip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.trip-card-cover { height: 96px; position: relative; }
.trip-card-no { position: absolute; left: 14px; top: 10px; font-size: 12px; color: rgba(255, 253, 247, 0.95); text-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.trip-card-days { position: absolute; right: 14px; top: 10px; font-size: 12px; color: rgba(255, 253, 247, 0.95); text-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.trip-card-body { padding: 14px 16px 16px; position: relative; }
.trip-card-body h3 { margin: 0 0 4px; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-card-body p { margin: 0 0 6px; font-size: 12px; }
.trip-card-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-card-stops { font-size: 12.5px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.trip-card-delete {
  position: absolute; right: 12px; top: 12px; border: none; background: transparent;
  color: var(--muted); font-size: 12px; padding: 4px 6px; border-radius: 6px;
}
.trip-card-delete:hover { color: var(--accent); background: rgba(228, 87, 46, 0.08); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); grid-column: 1 / -1; }
.home-foot {
  margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  border-radius: 10px; padding: 9px 18px; font-size: 14px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #FFFDF7; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  border-radius: 7px; width: 26px; height: 26px; line-height: 1; font-size: 13px; padding: 0;
}
.icon-btn:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 13, 10, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 460px; max-height: 86vh; overflow: auto; padding: 22px 24px;
}
.modal-wide { max-width: 620px; }
.modal h3 { margin: 0 0 14px; font-size: 20px; }
.modal label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.modal input[type="text"], .modal input[type="date"], .modal textarea, .modal select {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
  color: var(--ink);
}
.modal textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- 搜索 ---------- */
.search-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-size: 15px;
}
.search-input:focus { outline: 2px solid rgba(228, 87, 46, 0.35); border-color: var(--accent); }
.search-results { margin: 12px 0; max-height: 320px; overflow: auto; }
.search-hint { padding: 14px 4px; font-size: 13px; }
.search-item {
  position: relative; padding: 10px 88px 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent;
}
.search-item:hover { background: var(--paper); border-color: var(--line); }
.search-item-name { font-weight: 600; }
.search-item-sub { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-type {
  position: absolute; right: 10px; top: 12px; font-size: 11px; color: var(--accent);
  border: 1px solid rgba(228, 87, 46, 0.4); border-radius: 20px; padding: 1px 8px;
}
.search-manual {
  border-top: 1px dashed var(--line); padding-top: 12px; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.search-manual input {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper);
}

/* ---------- 规划页 ---------- */
.plan { display: grid; grid-template-columns: 400px 1fr; height: calc(100vh - 55px); }
.plan-panel { overflow-y: auto; border-right: 1px solid var(--line); background: var(--paper-2); }
.plan-panel-inner { padding: 20px 18px 40px; }
.plan-head h2 { margin: 6px 0 4px; font-size: 24px; overflow-wrap: anywhere; }
.plan-head p { margin: 0 0 10px; font-size: 12px; }
.plan-desc { font-size: 13px; color: var(--ink-soft); }
.plan-back { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.plan-back:hover { color: var(--ink); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.plan-actions .btn { padding: 7px 14px; font-size: 13px; }

.plan-day { margin-bottom: 18px; }
.plan-day-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-bottom: 2px solid var(--ink); margin-bottom: 10px;
}
.plan-day-no { font-weight: 700; font-size: 13px; letter-spacing: 0.08em; }
.plan-day-date { font-size: 12px; color: var(--muted); flex: 1; }

.stop-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 2px; cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.stop-card:hover { border-color: var(--ink-soft); }
.stop-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(228, 87, 46, 0.35); }
.stop-badge { flex: none; line-height: 0; padding-top: 2px; }
.stop-main { flex: 1; min-width: 0; }
.stop-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-meta { font-size: 11px; }
.stop-media { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; position: relative; }
.stop-thumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line);
  background: var(--paper-2); display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px;
}
.stop-media-del {
  border: none; background: rgba(38,33,26,0.55); color: #FFFDF7; width: 14px; height: 14px;
  border-radius: 50%; font-size: 10px; line-height: 1; padding: 0; margin-top: 26px;
}
.stop-ops { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex: none; }
.mini-select {
  border: 1px solid var(--line); background: var(--card); border-radius: 7px;
  font-size: 11px; color: var(--muted); padding: 2px 4px; max-width: 70px;
}
.seg-row {
  display: flex; align-items: center; gap: 8px; padding: 2px 6px 2px 24px; margin: 2px 0;
}
.seg-line { flex: 1; height: 0; border-top: 1px dashed var(--line); }
.seg-select {
  border: 1px solid var(--line); background: var(--card); border-radius: 20px;
  font-size: 12px; padding: 3px 10px; color: var(--ink);
}
.seg-dist { font-size: 11px; white-space: nowrap; }
.add-stop {
  width: 100%; margin-top: 8px; padding: 9px; border: 1px dashed var(--line);
  background: transparent; border-radius: 10px; color: var(--muted); font-size: 13px;
}
.add-stop:hover { color: var(--accent); border-color: var(--accent); }
.plan-foot { font-size: 11px; color: var(--muted); margin-top: 24px; line-height: 1.8; }

/* ---------- 地图通用 ---------- */
.plan-map, .map-host { position: relative; }
.map-host { position: absolute; inset: 0; }
.map-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-align: center;
  background: var(--paper-2); z-index: 5;
}
.map-fallback h3 { margin: 6px 0; }
.map-fallback p { color: var(--muted); font-size: 13px; max-width: 320px; }
.ts-basemode {
  position: absolute; top: 12px; right: 12px; z-index: 20;
  display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: rgba(255, 253, 247, 0.92); box-shadow: 0 2px 8px rgba(38,33,26,0.12);
}
.ts-basemode button {
  border: none; background: transparent; padding: 6px 14px; font-size: 12.5px; color: var(--muted);
}
.ts-basemode button.on { background: var(--ink); color: var(--paper); }
/* 播放/录制页：底图切换下移，避开顶部退出栏 */
.play .ts-basemode { top: 64px; right: 16px; }
.ts-markers { position: absolute; inset: 0; z-index: 10; pointer-events: none; overflow: hidden; }
.ts-marker {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ts-marker-badge { line-height: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3)); transition: transform 0.15s ease; }
.ts-marker:hover .ts-marker-badge, .ts-marker.active .ts-marker-badge { transform: scale(1.18); }
.ts-marker.active .ts-marker-badge { filter: drop-shadow(0 0 5px rgba(228, 87, 46, 0.8)); }
.ts-marker-name {
  background: rgba(15, 13, 10, 0.72); color: var(--paper); font-size: 11px;
  padding: 1px 8px; border-radius: 20px; white-space: nowrap;
}
.ts-marker-day {
  font-size: 9px; color: var(--accent); background: rgba(255,253,247,0.9);
  border-radius: 20px; padding: 0 6px; line-height: 1.5;
}

/* ---------- 播放 / 录制 ---------- */
.play { position: relative; height: calc(100vh - 55px); overflow: hidden; background: #0F0D0A; }
.film-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 15; pointer-events: none; display: block;
}
.play-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 12px 18px;
  background: linear-gradient(rgba(15,13,10,0.55), transparent); pointer-events: none;
}
.play-top > * { pointer-events: auto; }
.play-exit { color: var(--paper); border-color: rgba(246,241,228,0.4); }
.play-exit:hover { border-color: var(--paper); }
.play-progress {
  flex: 1; height: 3px; background: rgba(246,241,228,0.25); border-radius: 3px; overflow: hidden;
}
.play-progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease; }
.play-counter { color: rgba(246,241,228,0.9); font-size: 12px; }
.play-prewarm {
  position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center;
  background: rgba(15,13,10,0.72); color: var(--paper); padding: 20px;
}
.play-prewarm h2 { margin: 4px 0; color: var(--paper); }
.play-prewarm p { max-width: 460px; color: rgba(246,241,228,0.75); font-size: 13.5px; }
.rec-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(246,241,228,0.25); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.play-end {
  position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  /* 0.78 + blur：高德底图自带的深色 POI 大字标注透出来会和标题缠成重影，
     必须压够深让地图退成纹理 */
  background: rgba(15, 13, 10, 0.78);
  backdrop-filter: blur(5px);
  color: var(--paper);
}
.play-end[hidden] { display: none; }
.play-end h2 { color: var(--paper); font-size: 34px; margin: 4px 0 14px; }
.play-end-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.play-end .btn-ghost { color: var(--paper); border-color: rgba(246,241,228,0.4); }
.play-end .btn-ghost:hover { border-color: var(--paper); }
.slate-dom {
  min-height: 60vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.slate-dom .title { font-size: 34px; margin: 4px 0 10px; }

/* 录制面板 */
.rec-panel {
  position: absolute; top: 60px; left: 18px; z-index: 30; width: 330px;
  background: rgba(255, 253, 247, 0.96); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
}
.rec-panel h3 { margin: 0 0 12px; font-size: 18px; }
.rec-form label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 10px; }
.rec-form select {
  display: block; width: 100%; margin-top: 3px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
}
.rec-note { font-size: 12px; margin: 4px 0 12px; }
.rec-progress { margin: 10px 0 6px; background: rgba(38,33,26,0.12); }
#r-phase { font-size: 12px; margin: 4px 0 10px; }
#r-start { width: 100%; justify-content: center; }
.rec-done-title { font-weight: 700; color: var(--accent); margin: 8px 0 4px; }
#r-fileinfo { font-size: 12px; margin: 0 0 12px; }
#r-save { display: inline-flex; margin-right: 8px; }
.rec-preview {
  position: absolute; right: 18px; bottom: 18px; z-index: 30;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow); background: #0F0D0A;
}
.rec-canvas { display: block; width: min(44vw, 560px); height: auto; }
@media (max-width: 760px) {
  .rec-canvas { width: 72vw; }
  .rec-panel { width: calc(100vw - 36px); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .plan { grid-template-columns: 1fr; grid-template-rows: 42vh 1fr; height: calc(100vh - 55px); }
  .plan-panel { order: 2; border-right: none; }
  .plan-map { order: 1; position: relative; }
  .hero { padding: 44px 0 36px; }
}

/* ---------- 静态说明区（2026-09-30 新增）----------
   放在 #app 之后：上方应用整体占满一屏（顶栏 55px + .plan 100vh-55px = 100vh），
   所以本区天然落在首屏以下，不改变应用的任何首屏布局。
   复用应用自身的 --paper / --ink / --line 等变量，视觉与站内保持一致。 */
.ts-seo {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  padding: 40px 20px 56px;
  font-size: 15px;
  line-height: 1.8;
}
.ts-seo-in { max-width: 820px; margin: 0 auto; }
.ts-crumb { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.ts-crumb a, .ts-rel a, .ts-foot a { color: #B4763A; text-decoration: none; }
.ts-crumb a:hover, .ts-rel a:hover, .ts-foot a:hover { text-decoration: underline; }
.ts-seo h1 { margin: 0 0 14px; font-size: 27px; line-height: 1.4; font-weight: 700; }
.ts-lead { margin: 0 0 8px; font-size: 15px; color: var(--ink-soft); }
.ts-seo h2 {
  margin: 34px 0 10px; padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 19px; font-weight: 700;
}
.ts-steps, .ts-feat { margin: 0 0 8px; padding-left: 22px; }
.ts-steps li, .ts-feat li { margin-bottom: 8px; }
.ts-faq details {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0 14px; margin-bottom: 9px; background: var(--paper);
}
.ts-faq summary {
  cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 14.5px;
  list-style: none;
}
.ts-faq summary::-webkit-details-marker { display: none; }
.ts-faq summary::before {
  content: "Q"; display: inline-block; width: 21px; height: 21px; line-height: 21px;
  text-align: center; border-radius: 50%; background: #EFE6D8; color: #8A5A2B;
  font-size: 12px; font-weight: 700; margin-right: 9px; vertical-align: 1px;
}
.ts-faq .ans { padding: 0 0 13px 30px; font-size: 14px; color: var(--ink-soft); }
.ts-rel, .ts-foot { font-size: 14px; color: var(--ink-soft); }
.ts-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

@media (max-width: 760px) {
  .ts-seo { padding: 30px 16px 40px; font-size: 14.5px; }
  .ts-seo h1 { font-size: 21px; }
  .ts-seo h2 { font-size: 17px; }
  .ts-faq .ans { padding-left: 0; }
}
