/* 旅迹 —— 克制即签名
   字体:Noto Sans SC 全局基础;Noto Serif SC 仅限 AI 游记段落和行程标题
   全局主色:深翠绿 #2e7a5e（贯穿 CTA / 轨迹 / 停留点）
   留白克制,深色模式为长阅读单独调校(暖色深灰,非纯黑) */

:root {
  --primary: #2e7a5e;
  --bg: #FBF8F3;          /* 暖白纸感 */
  --surface: #FFFFFF;
  --text: #2B2723;
  --text-soft: #6E665C;
  --line: #E8E1D6;
  --radius: 12px;
  --serif: 'Noto Serif SC', serif;
  --sans: 'Noto Sans SC', system-ui, sans-serif;
  --gap: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1A17;        /* 暖深灰,非纯黑 */
    --surface: #26231F;
    --text: #ECE6DC;      /* 暖白,非纯白 */
    --text-soft: #A89E90;
    --line: #38332C;
    --primary: #3fa872;   /* 深色下主色提亮,避免发闷 */
  }
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ===== 导入态 ===== */
.dropzone {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 24px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* 背景：浅色光晕 + 极淡纹理，不喧宾夺主 */
.dropzone::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 35% 40%, rgba(46,122,94,.07) 0%, transparent 70%),
    radial-gradient(ellipse 45% 40% at 72% 65%, rgba(46,122,94,.05) 0%, transparent 65%);
  pointer-events: none;
}

/* 装饰性坐标网格线——极淡 */
.dropzone::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(46,122,94,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46,122,94,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.dropzone > * { position: relative; z-index: 1; }

/* 品牌区块：Logo + Tagline 整体上移，留出呼吸 */
.dropzone-brand {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

.brand {
  font-family: var(--sans); font-weight: 900;
  font-size: 52px; letter-spacing: 10px; color: var(--primary);
  line-height: 1;
}

/* 品牌下方英文副标——质感来自克制的细节 */
.brand-en {
  font-family: var(--sans); font-weight: 400;
  font-size: 11px; letter-spacing: 5px;
  color: var(--text-soft); text-transform: uppercase;
  opacity: .7;
}

.tagline {
  font-family: var(--serif); font-size: 17px;
  color: var(--text); width: 100%; max-width: 360px;
  line-height: 1.8; letter-spacing: .5px;
  text-align: center; text-wrap: balance;
}
.hint { font-size: 12px; color: var(--text-soft); opacity: .7; }
.hints { display: flex; flex-direction: column; gap: 4px; }
.scene-list { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 360px; }
.scene-item { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.scene-title { font-size: 13px; font-weight: 600; color: var(--text); }
.scene-desc { font-size: 12px; color: var(--text-soft); line-height: 1.6; }
.scene-note {
  font-size: 13px; color: var(--text); line-height: 1.7;
  width: 100%; max-width: 360px; text-align: left;
  padding-left: 12px; border-left: 2px solid var(--primary);
}
.btn {
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  color: #fff; background: var(--primary);
  border: none; border-radius: 999px;
  padding: 13px 32px; cursor: pointer;
  letter-spacing: .5px;
  box-shadow: 0 4px 16px rgba(46,122,94,.28);
  transition: opacity .2s ease, transform .15s ease, box-shadow .2s ease;
}
.btn:hover { opacity: .93; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(46,122,94,.35); }
.btn:active { transform: translateY(0); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-ghost {
  background: transparent; color: var(--primary);
  border: 1.5px solid rgba(46,122,94,.45);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(46,122,94,.06); box-shadow: none; }
.btn-text { background: none; border: none; color: var(--text-soft); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: var(--primary); }
.hidden { display: none !important; }

/* ===== 展示态 ===== */
.stage { padding: 40px 0 80px; }
.map-wrap { position: relative; }
.map {
  width: 100%; height: 520px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface);
}
/* 字幕:手帐便签 + 顶部和纸胶带 */
.map-caption {
  position: absolute; top: 20px; left: 16px;
  font-family: var(--sans); font-size: 15px; font-weight: 500; color: #2B2723;
  background: #fffdf8; padding: 10px 16px 9px; border-radius: 3px;
  box-shadow: 0 3px 10px rgba(80,60,30,.25);
  opacity: 0; transform: translateY(-4px) rotate(-1.5deg);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none; max-width: 72%;
}
.map-caption::before { /* 压在便签上的胶带 */
  content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(2deg);
  width: 46px; height: 16px; background: rgba(46,122,94,.55);
}
.map-caption.show { opacity: 1; transform: rotate(-1.5deg); }
/* 暗色模式:非 illust 主题用深背景浅字;illust 保持纸张感(浅底深字) */
@media (prefers-color-scheme: dark) {
  .map-caption { background: rgba(38,35,31,.92); color: #ECE6DC; }
  body[data-theme="illust"] .map-caption { background: rgba(255,253,248,.94); color: #2B2723; }
}
/* 外观栏:两行布局——排版/导出在上,地图底图在下 */
.controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.controls-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ctrl-group { display: flex; align-items: center; gap: 8px; }
.ctrl-label { font-size: 12px; color: var(--text-soft); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button {
  font-family: var(--sans); font-size: 13px; color: var(--text-soft);
  background: var(--surface); border: none; padding: 6px 15px; cursor: pointer;
}
.seg button.active { background: var(--primary); color: #fff; }
.btn-export {
  font-family: var(--sans); font-size: 13px; cursor: pointer;
  background: var(--primary); color: #fff; border: none;
  padding: 7px 18px; border-radius: 999px;
}
.btn-export:hover { opacity: .9; }
.btn-record { background: transparent; color: var(--primary); border: 1px solid var(--primary); }

/* 数据横幅 */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin: 20px 0 8px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
}
.stats.show { opacity: 1; transform: none; }
.stat { text-align: center; padding: 14px 6px; }
.stat-v { font-family: var(--sans); font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-u { font-size: 13px; font-weight: 400; color: var(--text-soft); margin-left: 2px; }
.stat-label { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* 标题 */
.trip-header { text-align: center; margin: 12px 0 48px; }
.trip-header h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: 1px; }
.trip-header p { font-size: 14px; color: var(--text-soft); margin-top: 8px; }

/* 按天分段 */
.day-head {
  display: flex; align-items: baseline; gap: 14px;
  margin: 8px 0 4px; padding-top: 28px;
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
}
.day-head.in { opacity: 1; transform: none; }
.day-label { font-family: var(--sans); font-size: 22px; font-weight: 700; color: var(--primary); }
.day-meta { font-size: 13px; color: var(--text-soft); }
.day-summary { font-family: var(--sans); font-size: 15px; color: var(--text-soft); margin: 0 0 24px; white-space: pre-wrap; }

/* ===== 手帐拼贴时间线 ===== */
.timeline { position: relative; }

/* 每个停留点 = 一页手帐贴纸卡 */
.entry {
  position: relative;
  background: #fffdf8;
  border-radius: 4px;
  padding: 30px 24px 24px;
  margin: 30px 0;
  box-shadow: 0 2px 10px rgba(120,100,70,.12), 0 0 0 1px rgba(140,120,90,.06);
  opacity: 0; transform: translateY(18px) rotate(-.3deg);
  transition: opacity .5s ease, transform .5s ease;
}
.entry.in, .closing.in, .day-head.in, .walk-gap.in { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) { .entry { background: #2a2620; } }

/* 和纸胶带:斜贴的地名标签 */
.washi {
  position: absolute; top: -14px; left: 22px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: #fff;
  background: var(--tape); padding: 6px 18px;
  transform: rotate(-2.2deg);
  box-shadow: 0 2px 5px rgba(0,0,0,.15);
  /* 胶带毛边质感 */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4px, #000 calc(100% - 4px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 4px, #000 calc(100% - 4px), transparent 100%);
  opacity: .92;
}
/* 邮戳:时间·海拔 */
.stamp {
  position: absolute; top: 14px; right: 18px;
  font-size: 12px; color: var(--text-soft);
  border: 1.5px dashed rgba(140,120,90,.5); border-radius: 6px;
  padding: 3px 9px; transform: rotate(2deg);
  font-feature-settings: "tnum";
}
/* 拍立得照片:白边 + 轻微斜贴 + 交错叠放 */
.polaroids { display: flex; flex-wrap: wrap; gap: 14px 10px; margin: 18px 0 16px; justify-content: center; }
.polaroid {
  background: #fff; padding: 7px 7px 22px; border-radius: 2px;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  transform: rotate(var(--r, 0));
  transition: transform .2s ease;
  width: calc((100% - 20px) / 3);
}
.polaroid:hover { transform: rotate(0) scale(1.03); z-index: 2; }
.polaroid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
@media (prefers-color-scheme: dark) { .polaroid { background: #f3efe6; } }

.entry-text { font-family: var(--serif); font-size: 15px; line-height: 1.9; color: var(--text); margin-top: 8px; white-space: pre-wrap; }

/* 步行间隔:手写感小标,带虚线 */
.walk-gap {
  text-align: center; font-family: var(--sans); font-size: 12px;
  color: var(--text-soft); margin: 4px 0; letter-spacing: 1px;
  opacity: 0; transform: translateY(10px);
  transition: opacity .4s ease, transform .4s ease;
}

.closing {
  font-family: var(--serif); font-size: 17px; text-align: center;
  color: var(--text-soft); margin: 28px 0 0; padding: 34px 0;
  border-top: 1px dashed var(--line);
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.foot { text-align: center; font-size: 12px; color: var(--text-soft); margin-top: 48px; }

/* 地图上的停留点 */
/* 节点容器:dot + 涟漪叠放 */
.map-dot-wrap { position: relative; width: 24px; height: 24px; }
.map-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff; border: 2px solid #fff;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  animation: dotScaleIn .4s cubic-bezier(.175,.885,.32,1.275) both;
  transform-origin: center;
}
/* 到达涟漪:向外扩散消失 */
.map-dot-ripple {
  position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--ripple-color, var(--primary));
  animation: dotRipple 1s cubic-bezier(.2,.6,.4,1) forwards;
  pointer-events: none;
}
@keyframes dotScaleIn {
  from { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  to { transform: scale(1); opacity: 1; }
}
@keyframes dotRipple {
  0%   { transform: scale(1); opacity: .7; }
  100% { transform: scale(3); opacity: 0; }
}
/* 沿路线滑行的小旅人:地图图钉(水滴形) */
.map-traveler {
  width: 18px; height: 18px;
  background: var(--primary); border: 2.5px solid #fff;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  box-shadow: 0 3px 6px rgba(0,0,0,.35);
}
/* 到点弹出的照片气泡:拍立得(白边 + 下巴 + 轻微斜贴 + 顶部胶带) */
.map-photo {
  width: 150px; background: #fff; padding: 7px 7px 20px;
  border-radius: 2px; box-shadow: 0 6px 18px rgba(0,0,0,.32);
  transform: rotate(-3deg); position: relative;
  animation: photoPop .38s cubic-bezier(.175,.885,.32,1.275) both;
}
.map-photo.photo-exit {
  animation: photoOut .22s ease-in both;
}
.map-photo::before { /* 顶部胶带 */
  content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%) rotate(3deg);
  width: 50px; height: 16px; background: rgba(46,122,94,.6);
}
.map-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
@keyframes photoPop { from { opacity: 0; transform: scale(.75) rotate(-3deg) translateY(14px); } 70% { transform: scale(1.04) rotate(-3deg) translateY(-2px); } to { opacity: 1; transform: rotate(-3deg); } }
@keyframes photoOut { from { opacity: 1; transform: rotate(-3deg) scale(1); } to { opacity: 0; transform: rotate(-3deg) scale(.85) translateY(6px); } }
/* 沿轨迹走的小人 */
.map-walker { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }


/* ===== 现代风格主题 ===== */
/* 插画风:3 张全转插画,跟原图方向(竖图 2:3、横图 3:2) */
body[data-theme="illust"] .polaroid img { aspect-ratio: auto; max-height: 240px; }

/* 标题:Noto Sans SC 900,主色,无描边无投影 */
body[data-theme="modern"] .trip-header h1 {
  font-family: var(--sans); font-weight: 900; font-size: 38px; letter-spacing: 1px;
  color: var(--primary);
}
/* 地名:主色胶囊,白字,轻旋转 */
body[data-theme="modern"] .washi {
  font-family: var(--sans); font-weight: 700; font-size: 14px; color: #fff;
  background: var(--primary); border-radius: 999px;
  padding: 5px 16px; transform: rotate(-2deg); opacity: 1;
  box-shadow: 0 2px 6px rgba(46,122,94,.3);
  -webkit-mask-image: none; mask-image: none;
}
/* 天标签:主色实心胶囊 */
body[data-theme="modern"] .day-label {
  font-family: var(--sans); font-weight: 700; color: #fff;
  background: var(--primary); padding: 2px 16px; border-radius: 8px;
}
/* 地图字幕:白色胶囊,深字 */
body[data-theme="modern"] .map-caption {
  font-family: var(--sans); font-weight: 600; font-size: 14px; color: #2B2723;
  background: rgba(255,255,255,.97); border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
body[data-theme="modern"] .map-caption::before { display: none; }
/* 邮戳:主色实心小标 */
body[data-theme="modern"] .stamp {
  border: none; background: var(--primary); color: #fff; font-weight: 600;
}

/* 状态提示 */
.status {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  font-size: 14px; padding: 10px 20px; border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

/* 导出组:两个按钮并排,跟两个分段选择器平行成第三组 */
.export-group { display: flex; gap: 8px; }

/* 重播按钮:悬浮在地图右上角(它作用在地图上,就近放置) */
.map-actions {
  position: absolute; top: 12px; right: 12px; z-index: 1000;
  display: flex; gap: 8px;
}
.map-replay {
  padding: 7px 14px; border: none; border-radius: 8px; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; font-size: 13px; font-weight: 500;
  backdrop-filter: blur(4px); transition: background .15s;
}
.map-replay:hover { background: rgba(0,0,0,.72); }
.map-replay.btn-record { background: rgba(0,0,0,.38); border: 1px solid rgba(255,255,255,.35); }
.map-replay.btn-clone { background: var(--primary); font-weight: 600; box-shadow: 0 2px 10px rgba(46,122,94,.4); }
.map-replay.btn-clone:hover { background: var(--primary); filter: brightness(1.08); }

/* ===== 三模板的地图节点标记 + 字幕,按模板区分 ===== */
/* 现代:主色底,白字,Noto Sans SC */
body[data-theme="modern"] .map-dot { border: 2px solid #fff; font-family: var(--sans); font-size: 12px; font-weight: 700; }
/* 手帐:暖色 + 手写号码 */
body[data-theme="shouzhang"] .map-dot { font-family: 'Ma Shan Zheng', var(--serif); font-size: 16px; }
/* 插画:干净细边 */
body[data-theme="illust"] .map-dot { border-width: 1.5px; }
body[data-theme="illust"] .map-caption { font-family: var(--sans); font-weight: 500; background: rgba(255,255,255,.95); }

/* ===== 三模板签名字体 + 美术方向 ===== */

/* 现代:全程 Noto Sans SC,无特殊字体 */

/* ===== 手帐风主题:日系旅行日记本质感 ===== */

/* 页面背景:淡米黄,像陈旧的日记本封面 */
body[data-theme="shouzhang"] {
  background: #F5F0E8;
}

/* 行程标题:Ma Shan Zheng + 大字号 + 宽字距 */
body[data-theme="shouzhang"] .trip-header h1 {
  font-family: 'Ma Shan Zheng', var(--serif) !important;
  font-size: 40px !important;
  font-weight: 400;
  letter-spacing: 4px;
  color: var(--primary);
}

/* 天标签:印章感,去掉实心胶囊,改成纯文字大字 */
body[data-theme="shouzhang"] .day-label {
  font-family: 'Ma Shan Zheng', var(--serif) !important;
  font-size: 28px !important;
  font-weight: 400;
  color: var(--primary);
  background: none;
  padding: 0;
  border-radius: 0;
  border-bottom: 2px solid rgba(46,122,94,.25);
  padding-bottom: 2px;
}

/* 停留点卡片:稿纸感 + 横格线纹理 + 虚线边框 + 微旋转 */
body[data-theme="shouzhang"] .entry {
  background-color: #FFFDF5;
  background-image:
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 27px,
      rgba(100,130,200,.08) 27px,
      rgba(100,130,200,.08) 28px
    );
  border: 1px dashed rgba(180,160,120,.4);
  border-radius: 3px;
  box-shadow: 2px 3px 12px rgba(120,100,70,.14), -1px 1px 4px rgba(120,100,70,.06);
  padding: 32px 26px 26px;
}
/* 奇数卡片向左倾,偶数向右 */
body[data-theme="shouzhang"] .entry:nth-child(odd) {
  transform: translateY(18px) rotate(-1.5deg);
}
body[data-theme="shouzhang"] .entry:nth-child(even) {
  transform: translateY(18px) rotate(1.2deg);
}
body[data-theme="shouzhang"] .entry.in:nth-child(odd) {
  transform: rotate(-1.5deg);
}
body[data-theme="shouzhang"] .entry.in:nth-child(even) {
  transform: rotate(1.2deg);
}

/* 和纸胶带:暖色系轮换,字体换成 Ma Shan Zheng,旋转加大 */
body[data-theme="shouzhang"] .washi {
  font-family: 'Ma Shan Zheng', var(--serif) !important;
  font-size: 16px !important;
  font-weight: 400;
  color: #fff;
  transform: rotate(-3.5deg);
  padding: 5px 20px;
}
/* 用 nth-of-type 给不同胶带轮换颜色 */
body[data-theme="shouzhang"] .entry:nth-child(3n+1) .washi { background: #C8815A; }
body[data-theme="shouzhang"] .entry:nth-child(3n+2) .washi { background: #6B8FA5; }
body[data-theme="shouzhang"] .entry:nth-child(3n)   .washi { background: #7A9E7E; }

/* 邮戳:圆形邮戳感 */
body[data-theme="shouzhang"] .stamp {
  font-family: var(--serif) !important;
  font-size: 11px;
  color: #8B3A3A;
  border: 1.5px solid #8B3A3A;
  border-radius: 50%;
  width: 62px; height: 62px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  line-height: 1.3;
  transform: rotate(8deg);
  opacity: .75;
  white-space: normal;
  word-break: break-all;
}

/* 游记正文:Ma Shan Zheng + 宽行距 + 深暖色 */
body[data-theme="shouzhang"] .entry-text {
  font-family: 'Ma Shan Zheng', var(--serif) !important;
  font-size: 16px;
  line-height: 2.1;
  color: #3D3028;
  margin-top: 10px;
}

/* 步行间隔:手写感箭头 + 淡棕色 + Ma Shan Zheng */
body[data-theme="shouzhang"] .walk-gap {
  font-family: 'Ma Shan Zheng', var(--serif) !important;
  font-size: 15px;
  color: #8B7355;
  letter-spacing: 2px;
}

/* 拍立得照片:更宽的下边白框,旋转角度加大 */
body[data-theme="shouzhang"] .polaroid {
  padding: 8px 8px 28px;
}
body[data-theme="shouzhang"] .polaroid:nth-child(odd) {
  transform: rotate(-4.5deg);
}
body[data-theme="shouzhang"] .polaroid:nth-child(even) {
  transform: rotate(3.5deg);
}
body[data-theme="shouzhang"] .polaroid:hover {
  transform: rotate(0) scale(1.04);
}

/* 收尾语 + 天摘要:保持 Noto Serif SC */
body[data-theme="shouzhang"] .day-summary,
body[data-theme="shouzhang"] .day-meta,
body[data-theme="shouzhang"] .closing,
body[data-theme="shouzhang"] .map-caption {
  font-family: var(--serif) !important;
}

/* 插画风:干净通透,大留白,让插画当主角 */
body[data-theme="illust"] .entry { padding: 42px 30px; box-shadow: 0 1px 8px rgba(120,100,70,.08); }
body[data-theme="illust"] .trip-header h1 { font-weight: 500; letter-spacing: 5px; font-size: 28px; }
body[data-theme="illust"] .washi {
  background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border-radius: 6px; font-weight: 600; font-size: 14px; transform: none;
  -webkit-mask-image: none; mask-image: none; padding: 5px 14px;
}
body[data-theme="illust"] .stamp { border-color: rgba(140,120,90,.3); transform: none; }
body[data-theme="illust"] .timeline { margin-top: 8px; }

/* ===== 移动端响应式 ===== */
@media (max-width: 600px) {
  main { padding: 0 14px; }
  .brand { font-size: 34px; }
  .tagline { font-size: 17px; }
  .btn-row { flex-direction: column; width: 100%; }
  .btn { width: 100%; }

  .map { height: 56vh; max-height: 440px; }
  .controls { gap: 12px 14px; margin-bottom: 14px; }
  .ctrl-group { gap: 6px; }
  .ctrl-label { font-size: 11px; }
  .seg button { font-size: 12px; padding: 6px 12px; }
  .btn-export { font-size: 12px; padding: 6px 14px; }

  .trip-header { margin: 26px 0 32px; }
  .trip-header h1,
  body[data-theme="modern"] .trip-header h1,
  body[data-theme="shouzhang"] .trip-header h1 { font-size: 27px !important; }
  body[data-theme="illust"] .trip-header h1 { font-size: 22px !important; }

  .stats { gap: 4px; }
  .stat { padding: 10px 2px; }
  .stat-v { font-size: 21px; }
  .stat-u, .stat-label { font-size: 10px; }

  .day-label { font-size: 20px; }
  .entry { padding: 26px 16px; margin: 24px 0; }
  .washi { font-size: 14px; padding: 5px 12px; }
  .polaroids { gap: 8px 6px; }
  .polaroid { padding: 5px 5px 16px; }
  .entry-text, .stop-text { font-size: 15px; }

  .map-caption { font-size: 12px; max-width: 80%; top: 12px; left: 10px; }
  .map-photo { width: 118px; }
}

/* 尊重"减少动态效果" */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 插画实时生成 banner */
.illust-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-soft);
}
.illust-banner[hidden] { display: none; }
.ib-text { flex: 1; line-height: 1.5; }
.ib-btn {
  padding: 5px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ib-btn:disabled { opacity: 0.5; cursor: default; }

/* ===== 编辑模式 ===== */
.content-toolbar { display: flex; justify-content: flex-end; margin: 16px 0 0; }
.btn-edit {
  font-family: var(--sans); font-size: 12px; cursor: pointer;
  background: transparent; color: var(--text-soft);
  border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-edit.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.timeline.editing .entry-text,
.timeline.editing .day-summary {
  outline: none; border-radius: 4px;
  padding: 4px 6px; margin: -4px -6px;
  background: rgba(46,122,94,.05);
  cursor: text; min-height: 1.4em;
  transition: background .15s, box-shadow .15s;
}
.timeline.editing .entry-text:focus,
.timeline.editing .day-summary:focus {
  background: rgba(46,122,94,.09);
  box-shadow: 0 0 0 2px rgba(46,122,94,.22);
}
/* 地名标签可编辑:保留外观,加虚线轮廓提示 */
.timeline.editing .washi {
  cursor: text; outline: 2px dashed rgba(255,255,255,.7);
  outline-offset: 2px;
}
.timeline.editing .washi:focus {
  outline: 2px solid rgba(255,255,255,.95);
}
/* 标题/副标题编辑态 */
#trip-title[contenteditable],
#trip-sub[contenteditable] {
  outline: none; border-radius: 4px; cursor: text;
  background: rgba(46,122,94,.05); padding: 2px 6px; margin: 0 -6px;
  transition: background .15s;
}
#trip-title[contenteditable]:focus,
#trip-sub[contenteditable]:focus {
  background: rgba(46,122,94,.09);
  box-shadow: 0 0 0 2px rgba(46,122,94,.22);
}

/* ── AI 文字分层揭示 ───────────────────────────────────────────────── */
/* 天概括:从上方淡入滑落 */
.day-summary.summary-in {
  animation: summaryReveal .5s ease both;
}
@keyframes summaryReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* 停留点文字:从下方滑入,带错落延迟 */
.entry-text.text-in {
  animation: textReveal .55s ease both;
  animation-delay: var(--text-reveal-delay, 0ms);
}
@keyframes textReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* 收尾语:整体淡入 */
.closing.closing-in {
  animation: closingReveal .8s ease both;
}
@keyframes closingReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== 他人轨迹封面卡 ===== */
.cover {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 20px; gap: 16px;
}
.cover.hidden { display: none; }
.cover-back {
  align-self: flex-start; max-width: 480px; width: 100%;
  margin: 0 auto;
}
.cover-card {
  width: 100%; max-width: 480px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(43,39,35,.08);
  animation: closingReveal .4s ease both;
}
.cover-map {
  height: 200px; background:
    repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(46,122,94,.05) 24px),
    repeating-linear-gradient(90deg, transparent, transparent 23px, rgba(46,122,94,.05) 24px),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.cover-map canvas { width: 100%; height: 100%; display: block; }
.cover-body { padding: 20px 22px 22px; }
.cover-pub { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cover-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.cover-pub-name { font-size: 13px; color: var(--text-soft); }
.cover-title {
  font-family: var(--serif); font-weight: 600;
  font-size: 22px; color: var(--text); line-height: 1.4;
  margin: 0 0 8px;
}
.cover-sub {
  font-size: 14px; color: var(--text-soft);
  line-height: 1.7; margin: 0 0 16px;
}
.cover-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 14px 0; margin-bottom: 18px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cover-stat { text-align: center; display: flex; flex-direction: column; gap: 3px; }
.cover-stat b {
  font-family: var(--sans); font-weight: 600;
  font-size: 18px; color: var(--text);
}
.cover-stat span { font-size: 11px; color: var(--text-soft); }
.cover-actions { display: flex; gap: 10px; }
.cover-actions .btn { flex: 1; }
.cover-fav.is-fav { color: var(--primary); border-color: var(--primary); }

@media (max-width: 480px) {
  .cover-stat b { font-size: 16px; }
  .cover-title { font-size: 20px; }
}
