/* 足迹页：封面卡片 + 日期分组 + 横排时间卡片 + 地图面板 */

.fp-page { --fp-thumb-w: 104px; --fp-thumb-h: 62px; }

.fp-h1 {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 封面卡片 ---------- */
.fp-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 164px; padding: 19px 18px 16px;
  border-radius: calc(var(--radius) + 4px);
  color: #fff;
  background:
    radial-gradient(120% 110% at 6% -10%, rgba(255, 255, 255, 0.3), transparent 56%),
    radial-gradient(100% 100% at 104% 112%, rgba(0, 0, 0, 0.3), transparent 62%),
    linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 16px 34px -26px var(--accent-glow);
}
.fp-hero::after {
  content: ""; position: absolute; top: -46px; right: -34px; z-index: -1;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 68%);
}
.fp-hero-route {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .5; pointer-events: none; z-index: -1;
}

.fp-hero-body { display: flex; flex-direction: column; min-width: 0; }
.fp-hero-kicker {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .16em;
  color: rgba(255, 255, 255, 0.8);
}
.fp-hero-kicker i { font-size: 13px; letter-spacing: 0; }

.fp-hero-title {
  margin: 8px 0 0; font-size: 16px; font-weight: 500;
  letter-spacing: .01em; color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.14);
}
.fp-hero-title b {
  font-size: 30px; font-weight: 800; line-height: 1;
  margin: 0 3px; color: #fff;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.fp-hero-sub {
  margin: 7px 0 0; max-width: calc(100% - 92px);
  font-size: 12px; line-height: 1.65; color: rgba(255, 255, 255, 0.72);
}

.fp-hero-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-top: auto;
}
.fp-hero-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-stat {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.fp-stat b { font-size: 13px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }

/* 唯一的地图入口 */
.fp-hero-cta {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1;
  color: #fff; cursor: pointer;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .2s, border-color .2s;
}
.fp-hero-cta i { font-size: 14px; }
.fp-hero-cta:hover { background: rgba(255, 255, 255, 0.3); border-color: rgba(255, 255, 255, 0.5); }
.fp-hero-cta:active { background: rgba(255, 255, 255, 0.38); }
.fp-hero-cta:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 2px; }

/* 示例数据提示 */
.fp-tip {
  display: flex; align-items: flex-start; gap: 6px;
  margin: 12px 0 0; padding: 9px 12px; border-radius: 10px;
  font-size: 12px; line-height: 1.6; color: var(--accent-strong);
  background: var(--accent-soft);
}
.fp-tip i { font-size: 14px; margin-top: 1px; }

/* ---------- 日期分组 ---------- */
.fp-timeline { margin-top: 22px; }
.fp-day + .fp-day { margin-top: 6px; }

.fp-day-head {
  display: flex; align-items: center; gap: 8px;
  margin: 20px 0 6px; padding: 0 8px;
}
.fp-day-date {
  margin: 0; padding: 0;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--text-secondary); font-variant-numeric: tabular-nums;
}
.fp-day-week { font-size: 11.5px; font-weight: 500; color: var(--text-light); }
.fp-day-year { font-size: 11px; font-weight: 600; color: var(--text-light); }
.fp-day-rule { flex: 1; height: 1px; background: var(--border); opacity: .9; }
.fp-day-count { font-size: 11px; color: var(--text-light); white-space: nowrap; }

/* ---------- 时间卡片 ---------- */
.fp-place {
  display: flex; align-items: center; gap: 13px;
  padding: 9px 8px; border-radius: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  -webkit-tap-highlight-color: transparent;
}
.fp-place + .fp-place { margin-top: 2px; }
.fp-place:hover {
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(0, 0, 0, 0.045);
}
html.dark .fp-place:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.06);
}
.fp-place:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 缩略图：第一张照片；没有照片就用城市首字 */
.fp-thumb {
  position: relative; flex: none;
  width: var(--fp-thumb-w); height: var(--fp-thumb-h);
  border-radius: 9px; overflow: hidden;
  margin: 0 !important; padding: 0;
  max-width: none !important;
  background: rgba(0, 0, 0, 0.05);
  display: block !important;
}
html.dark .fp-thumb { background: rgba(255, 255, 255, 0.06); }
.fp-thumb .photo-item {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  aspect-ratio: auto !important;
  border-radius: 0; opacity: 1; transform: none;
}
.fp-thumb .photo-item.is-extra { display: none; }
.fp-thumb .photo-item img {
  width: 100% !important; height: 100% !important;
  object-fit: cover !important; border-radius: 0 !important;
}
.fp-thumb.no-img {
  display: flex !important; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.fp-thumb-letter {
  font-size: 19px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}
.fp-thumb-more {
  position: absolute; right: 5px; bottom: 5px; z-index: 2;
  padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 600; line-height: 1.5; color: #fff;
  background: rgba(20, 26, 36, 0.6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

.fp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fp-place-name {
  margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.5;
  color: var(--text);
  display: flex; align-items: baseline; gap: 1px; min-width: 0;
}
.fp-place-name i { font-style: normal; font-weight: 400; color: var(--text-light); }
.fp-place-name span {
  font-weight: 500; color: var(--text-secondary); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-note {
  margin: 0; font-size: 12.5px; line-height: 1.65;
  color: var(--text-secondary); word-break: break-word;
}
.fp-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-light); }
.fp-tag {
  padding: 1px 6px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 600;
}
html.dark .fp-tag { color: var(--accent); }
.fp-meta-n { font-variant-numeric: tabular-nums; }

.fp-arrow {
  flex: none; font-size: 17px; color: var(--text-light);
  opacity: 0; transition: opacity .2s, transform .2s;
}
.fp-place:hover .fp-arrow { opacity: 1; transform: translateX(2px); }

/* ---------- 空状态 ---------- */
.fp-empty { padding: 52px 0 30px; text-align: center; }
.fp-empty-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 25px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 7%, transparent);
}
.fp-empty-title { margin: 16px 0 0; font-size: 14px; font-weight: 600; color: var(--text); }
.fp-empty-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--text-secondary); }

/* ---------- 地图面板 ---------- */
.fp-backdrop {
  position: fixed; inset: 0; z-index: 1080;
  background: rgba(10, 14, 22, 0.34);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .26s;
}
.fp-backdrop.is-open { opacity: 1; }
body.fp-sheet-open { overflow: hidden; }

.fp-sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 1090;
  width: min(680px, 100%);
  padding: 9px 15px calc(15px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: rgba(253, 254, 255, 0.98);
  box-shadow: 0 -24px 62px -34px rgba(10, 20, 35, 0.65);
  transform: translate(-50%, 105%);
  transition: transform .34s cubic-bezier(.22, 1, .36, 1);
}
html.dark .fp-sheet { background: #1a1f29; }
.fp-sheet.is-open { transform: translate(-50%, 0); }

.fp-sheet-grip {
  display: block; width: 38px; height: 4px; margin: 1px auto 13px;
  border-radius: 999px; background: rgba(0, 0, 0, 0.12);
}
html.dark .fp-sheet-grip { background: rgba(255, 255, 255, 0.18); }

.fp-sheet-head {
  display: flex; flex-direction: column; gap: 3px;
  padding: 0 4px 12px; min-width: 0;
}
.fp-sheet-kicker {
  font-size: 10px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-light);
}
.fp-sheet-titlerow { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fp-sheet-title {
  margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fp-sheet-sub { flex: none; font-size: 11.5px; color: var(--text-light); font-variant-numeric: tabular-nums; }

.fp-sheet-stage { position: relative; }
.fp-map {
  position: relative; height: 340px; border-radius: 18px; overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  isolation: isolate;
}
html.dark .fp-map { background: rgba(255, 255, 255, 0.05); }
.fp-map.is-loading::before {
  content: '地图加载中…'; position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-light);
  background: color-mix(in srgb, #fdfeff 62%, transparent);
  animation: fpPulse 1.4s ease-in-out infinite;
}
@keyframes fpPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.fp-map .leaflet-container { background: #eef1f4; }
html.dark .fp-map .leaflet-tile { filter: brightness(0.82) saturate(0.85); }
html.dark .fp-map .leaflet-container { background: #20242e; }

/* 关闭键浮在地图右上角 */
.fp-sheet-close {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  width: 34px; height: 34px; padding: 0;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 6px 16px -8px rgba(10, 20, 35, 0.6);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .18s, color .18s, transform .18s;
}
html.dark .fp-sheet-close {
  background: rgba(26, 31, 41, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  color: #d6dae2;
}
.fp-sheet-close:hover { background: #fff; color: var(--accent-strong); transform: rotate(90deg); }
html.dark .fp-sheet-close:hover { background: #232a36; color: var(--accent); }

.fp-sheet-foot {
  margin: 10px 4px 0; font-size: 11.5px; line-height: 1.6;
  color: var(--text-light);
}

/* 地图上的城市标签 */
.fp-map .leaflet-tooltip.fp-tip-label {
  padding: 4px 9px; border: 0; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; color: #fff;
  background: rgba(30, 38, 52, 0.86);
  box-shadow: 0 2px 8px -2px rgba(10, 20, 35, 0.5);
}
.fp-map .leaflet-tooltip.fp-tip-label::before { display: none; }
html.dark .fp-map .leaflet-tooltip.fp-tip-label { background: rgba(250, 250, 252, 0.94); color: #1d2330; }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .fp-page { --fp-thumb-w: 88px; --fp-thumb-h: 54px; }
  .fp-hero { min-height: 150px; padding: 17px 16px 14px; border-radius: var(--radius); gap: 12px; }
  .fp-hero-title { font-size: 15px; }
  .fp-hero-title b { font-size: 26px; }
  .fp-hero-sub { max-width: calc(100% - 20px); font-size: 11.5px; }
  .fp-hero-foot { align-items: center; }
  .fp-hero-cta { padding: 7px 12px 7px 10px; font-size: 12px; }

  .fp-timeline { margin-top: 16px; }
  .fp-day-head { margin: 16px 0 4px; padding: 0 6px; }
  .fp-place { gap: 11px; padding: 8px 6px; }
  .fp-place-name { font-size: 13px; }
  .fp-note { font-size: 12px; }
  .fp-arrow { display: none; }
  .fp-thumb { border-radius: 8px; }

  .fp-sheet { padding: 7px 10px calc(12px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
  .fp-sheet-title { font-size: 16px; }
  .fp-map { height: 300px; border-radius: 16px; }
  .fp-sheet-close { top: 8px; right: 8px; width: 32px; height: 32px; }
  .fp-empty { padding: 40px 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .fp-place, .fp-hero-cta, .fp-arrow, .fp-sheet, .fp-sheet-close { transition: none; }
  .fp-map.is-loading::before { animation: none; }
}
