/* =========================================================
   Love Map · Design B — 高级杂志编辑风
   ========================================================= */
:root {
  --paper: #f7f6f4;
  --paper-pure: #ffffff;
  --graphite: #2c2c2c;
  --ink: #3a3936;
  --ink-soft: #716c66;
  --ink-faint: #77716a;
  --blush: #d4a8a4;
  --blush-deep: #c48f8a;
  --blush-mist: rgba(212, 168, 164, 0.16);
  --future: #a97872;
  --future-deep: #765650;
  --future-rgb: 169, 120, 114;
  --line: rgba(44, 44, 44, 0.08);
  --line-strong: rgba(44, 44, 44, 0.14);
  --shadow: 0 18px 50px rgba(44, 44, 44, 0.08);
  --shadow-soft: 0 8px 28px rgba(44, 44, 44, 0.06);
  --radius: 4px;
  --radius-card: 4px;
  --radius-lg: 10px;
  --nav-h: 74px;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-display: "Cormorant Garamond", "Noto Serif SC", serif;
  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  /* iOS 11.0–11.2 used constant(); modern browsers use env() */
  --safe-top: 0px;
  --safe-top: constant(safe-area-inset-top, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: 0px;
  --safe-right: constant(safe-area-inset-right, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: 0px;
  --safe-bottom: constant(safe-area-inset-bottom, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: 0px;
  --safe-left: constant(safe-area-inset-left, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(212, 168, 164, 0.16);
  background: var(--paper);
}
.hidden { display: none !important; }
button { font: inherit; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--blush-deep);
  outline-offset: 3px;
}

/* ---------- Map atmosphere ---------- */
/* 不用 filter 罩整张 Leaflet 图：滤镜会强制离屏合成，拖/缩卡顿的主因 */
#map {
  position: fixed; inset: 0;
  background: var(--paper);
  touch-action: pan-x pan-y;
  opacity: 0.82;
  transition: opacity 0.35s var(--ease-out);
}
body.mode-map #map,
body.mode-plans #map {
  opacity: 0.98;
}
#map-veil {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  transition: opacity 0.55s ease;
  background:
    radial-gradient(ellipse at 55% 22%, rgba(247, 246, 244, 0.05) 0%, transparent 45%),
    linear-gradient(180deg,
      rgba(247, 246, 244, 0.28) 0%,
      rgba(247, 246, 244, 0.12) 34%,
      rgba(247, 246, 244, 0.55) 68%,
      var(--paper) 92%);
}
body.mode-map #map-veil,
body.mode-plans #map-veil { opacity: 0.12; }
.leaflet-container { background: #eef0f1; font: inherit; touch-action: pan-x pan-y; }
.leaflet-control-attribution { font-size: 9px; opacity: 0.35; font-family: var(--font-sans); }
.leaflet-control-zoom { display: none; }
body.mode-map .leaflet-control-zoom,
body.mode-plans .leaflet-control-zoom { display: block; }
.leaflet-bottom { bottom: max(88px, calc(var(--safe-bottom) + 80px)); }
.leaflet-right { right: max(12px, var(--safe-right)); }
.leaflet-control-zoom a {
  width: 36px !important; height: 36px !important;
  line-height: 36px !important;
  color: var(--graphite) !important;
  border-color: var(--line) !important;
  background: rgba(255,255,255,0.92) !important;
}

.country-label, .province-label { background: none; border: none; }
.country-label-text, .province-label-text {
  display: inline-block;
  transform: translate(-50%, -50%);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.12em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 5px #f7f6f4, 0 0 2px #f7f6f4;
}
.country-label-text { color: rgba(90, 88, 84, 0.38); font-size: 11px; }
.province-label-text { color: rgba(90, 88, 84, 0.3); font-size: 10px; }
.painted-map path.country-fill,
.painted-map path.province-fill { stroke-linejoin: round; stroke-linecap: round; }
.painted-map path.province-fill { pointer-events: none; }
.footprint-line { /* no filter — SVG stroke stays cheap while panning */ }

/* markers — A 风紧凑照片钉（地图态用，不挡视野） */
.photo-marker,
.heart-marker { background: none !important; border: none !important; }
.photo-pin-wrap {
  display: flex; flex-direction: column; align-items: center;
  width: 72px; pointer-events: auto;
}
.photo-pin {
  position: relative;
  width: 44px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s var(--ease-out);
}
.photo-pin-wrap:hover .photo-pin { transform: translateY(-2px) scale(1.04); }
.photo-pin.is-featured::before,
.photo-pin.is-featured::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  border: 1.5px solid rgba(196, 143, 138, 0.55);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
}
.photo-pin.is-featured::before {
  width: 64px; height: 64px;
  animation: feature-ring 0.9s ease-out 1;
}
@media (max-width: 900px) {
  /* 手机上关掉无限环动画，省合成层 */
  .photo-pin.is-featured::before { animation: none; opacity: 0.45; }
  .photo-pin.is-featured::after { opacity: 0.7; }
}
.photo-pin.is-featured::after {
  width: 48px; height: 48px;
  border-color: rgba(196, 143, 138, 0.85);
}
@keyframes feature-ring {
  0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.7; }
  70% { transform: translate(-50%, -50%) scale(1.18); opacity: 0; }
  100% { opacity: 0; }
}
.photo-pin-frame {
  width: 44px; height: 44px;
  padding: 3px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(44, 44, 44, 0.14), 0 1px 0 rgba(44,44,44,0.06);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.photo-pin-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  border-radius: 1px;
}
.photo-pin-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f4f2ef, #ebe6e4);
  color: var(--blush);
  font-family: var(--font-display);
  font-size: 18px; line-height: 1;
}
.photo-pin-heart {
  position: absolute; right: -5px; bottom: 4px; z-index: 2;
  width: 12px; height: 12px;
  background: var(--blush-deep);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #fff;
}
.photo-pin-heart::after {
  content: "";
  position: absolute; left: 50%; top: 52%;
  width: 5px; height: 5px;
  margin: -3px 0 0 -2.5px;
  background: #fff;
  clip-path: path("M2.5 4.2C2.5 4.2 0.2 2.5 0.2 1.2A1.1 1.1 0 0 1 1.4 0.1c0.5 0 0.9 0.3 1.1 0.7C2.7 0.4 3.1 0.1 3.6 0.1A1.1 1.1 0 0 1 4.8 1.2C4.8 2.5 2.5 4.2 2.5 4.2Z");
}
.photo-pin-needle {
  display: block;
  width: 0; height: 0; margin: -1px auto 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--blush-deep);
}
.photo-pin-label {
  margin-top: 4px;
  max-width: 78px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  text-align: center;
  pointer-events: none;
  line-height: 1.25;
}
.photo-pin-place {
  font-family: var(--font-serif);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--graphite);
  white-space: normal;
  word-break: break-word;
  text-shadow: 0 0 4px #f7f6f4, 0 1px 0 #fff, 0 0 2px #f7f6f4;
}
.photo-pin-date {
  font-family: var(--font-sans);
  font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  white-space: nowrap;
  text-shadow: 0 0 4px #f7f6f4, 0 0 2px #f7f6f4;
}
/* 兼容旧 class（庆祝动画等） */
.heart-pin-wrap { display: flex; flex-direction: column; align-items: center; }
.heart-pin {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--blush-deep);
}
@keyframes ripple {
  0% { transform: scale(0.5); opacity: 0.85; }
  100% { transform: scale(1.85); opacity: 0; }
}
@keyframes pin-drop {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes soft-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Loading ---------- */
#loading {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--paper);
  transition: opacity 0.16s ease-out;
}
#loading.fade { opacity: 0; pointer-events: none; }
.loading-mark {
  font-family: var(--font-display);
  font-size: 46px; font-weight: 500;
  letter-spacing: 0.08em; color: var(--graphite);
  animation: fade-up 0.7s var(--ease-out);
}
.loading-rule {
  width: 28px; height: 1px; background: var(--blush);
  animation: soft-in 0.8s ease 0.15s both;
}
.loading-text {
  font-family: var(--font-sans);
  font-size: 11px; letter-spacing: 0.32em;
  color: var(--ink-soft);
  animation: soft-in 0.8s ease 0.2s both;
}

/* ---------- Desktop header ---------- */
.mag-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1100;
  display: none; align-items: flex-end; justify-content: flex-start;
  gap: 0;
  padding: max(26px, calc(var(--safe-top) + 16px)) clamp(40px, 5vw, 72px) 18px;
  pointer-events: none;
}
.mag-header > * { pointer-events: auto; }
.mag-brand { margin-right: auto; max-width: 18em; }
.mag-brand h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 3.4vw, 52px); font-weight: 500;
  letter-spacing: 0.02em; color: var(--graphite); line-height: 1;
}
.mag-brand-en {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--blush);
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.32em; color: var(--ink-soft);
}
.mag-nav {
  display: flex; align-items: center; gap: clamp(28px, 2.8vw, 42px);
  flex-shrink: 0;
}
.mag-nav-item {
  position: relative; border: none; background: transparent;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.22em; color: var(--ink-soft);
  cursor: pointer; padding: 10px 0; touch-action: manipulation;
  transition: color 0.2s ease;
}
.mag-nav-item:hover, .mag-nav-item.is-active { color: var(--graphite); }
.mag-nav-item.is-active::before {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: 4px;
  height: 1.5px; background: var(--blush);
}
.mag-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--blush-deep); background: rgba(255,255,255,0.82);
  font-size: 13px; margin-left: clamp(22px, 2vw, 36px); flex-shrink: 0;
}

/* ---------- Mobile hero ---------- */
.mobile-hero {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: max(10px, calc(var(--safe-top) + 6px)) max(22px, var(--safe-right)) 0 max(24px, var(--safe-left));
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out);
}
body.mode-map .mobile-hero,
body.mode-plans .mobile-hero {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}
.mobile-hero-top {
  display: flex; justify-content: space-between;
  pointer-events: auto; margin-bottom: 20px;
}
.icon-btn {
  width: 44px; height: 44px; border: none; background: transparent;
  color: var(--graphite);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation;
}
#mobile-brand {
  font-family: var(--font-display);
  font-size: clamp(42px, 12.5vw, 56px);
  font-weight: 500; letter-spacing: 0.01em;
  color: var(--graphite); line-height: 1;
  pointer-events: auto; user-select: none;
  animation: fade-up 0.7s var(--ease-out);
}
.mobile-sub {
  margin-top: 12px; max-width: 15em;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 400;
  line-height: 1.75; letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.mobile-stats {
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; color: var(--ink-faint);
}
#anniversary-banner {
  margin-top: 12px; display: inline-block;
  padding: 7px 12px;
  border: 1px solid rgba(212,168,164,0.4);
  color: var(--blush-deep);
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.06em;
  background: rgba(255,255,255,0.6);
}
#anniversary-banner.hidden { display: none; }
body.celebrate-hearts .photo-pin,
body.celebrate-hearts .heart-pin {
  animation: pin-drop 0.5s ease, celebrate-pulse 1.7s ease-in-out infinite;
}
@keyframes celebrate-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ---------- Story rail：小图照片墙（无卡上文案） ---------- */
.story-rail {
  position: fixed; left: 0; right: 0;
  /* 为下方细 ERA 轨留空：nav + scrub(~36) + 间距 */
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 44px);
  z-index: 1050; height: 124px;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.45s var(--ease-out), bottom 0.35s ease;
}
/* 地图态：沉浸地图为主，照片条缩小贴底，方便与 ERA 同步 */
body.mode-map .story-rail {
  opacity: 1;
  transform: none;
  pointer-events: none;
  visibility: visible;
  height: 92px;
}
/* 计划态：收起回忆照片条，露出未来地图 */
body.mode-plans .story-rail {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(12px);
}
body.mode-plans .time-scrub {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden;
}
.story-track {
  height: 100%; display: flex; align-items: center; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: 8px max(16px, var(--safe-right)) 10px max(16px, var(--safe-left));
  pointer-events: auto; scrollbar-width: none;
}
.story-track::-webkit-scrollbar { display: none; }

.story-card {
  flex: 0 0 min(30vw, 118px);
  width: min(30vw, 118px);
  height: 104px;
  scroll-snap-align: center;
  background: var(--paper-pure);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(44,44,44,0.04);
  overflow: hidden;
  display: block;
  cursor: pointer; touch-action: manipulation;
  color: inherit; padding: 0;
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s ease, opacity 0.08s linear;
  position: relative;
  contain: layout paint style;
}
.story-card.is-centered {
  transform: scale(1.04);
  box-shadow: 0 8px 22px rgba(44, 44, 44, 0.12);
  border-color: rgba(212, 168, 164, 0.45);
}
.story-card:active { transform: scale(0.97); }
.story-card:focus-visible {
  outline: 2px solid var(--blush);
  outline-offset: 2px;
}
.story-card-media {
  width: 100%; height: 100%;
  background: #eceae7; overflow: hidden;
}
.story-card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.55s var(--ease-out);
}
.story-card:hover .story-card-media img,
.wall-card:hover .story-card-media img { transform: scale(1.04); }
.story-card-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--blush); font-family: var(--font-display); font-size: 28px;
  background: linear-gradient(160deg, #f4f2ef, #ebe6e4);
}
/* 默认干净：无标题/正文/日期；hover/焦点极淡提示 */
.story-card::after,
.wall-card::after {
  content: attr(data-title);
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 8px 7px;
  font-family: var(--font-sans);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.04em; color: #fff;
  background: linear-gradient(transparent, rgba(40, 36, 34, 0.42));
  opacity: 0; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}
.story-card:focus-visible::after,
.wall-card:focus-visible::after { opacity: 0.9; }
@media (hover: hover) {
  .story-card:hover::after,
  .wall-card:hover::after { opacity: 0.9; }
}

/* ---------- Desktop stage：B-desktop 精选卡片浮于地图之上 ---------- */
.desktop-stage {
  display: none; position: fixed; inset: 0; z-index: 900;
  pointer-events: none;
  padding: 0;
  transition: opacity 0.4s ease;
}
body.mode-map .desktop-stage {
  opacity: 0; visibility: hidden; pointer-events: none;
}

.feature-card {
  pointer-events: auto;
  position: absolute;
  left: clamp(40px, 4.5vw, 72px);
  top: max(118px, calc(var(--safe-top) + 108px));
  width: min(560px, calc(100vw - 200px));
  background: #fff;
  border: 1px solid rgba(44, 44, 44, 0.06);
  border-radius: 2px;
  box-shadow: 0 22px 60px rgba(44, 44, 44, 0.1);
  overflow: hidden;
  animation: fade-up 0.55s var(--ease-out);
  display: flex;
  flex-direction: column;
}
.feature-card.hidden { display: none; }
.feature-hit {
  display: grid;
  grid-template-columns: minmax(200px, 46%) 1fr;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  width: 100%;
}
.feature-media {
  min-height: 240px;
  background: #eceae7;
  overflow: hidden;
  position: relative;
}
.feature-media img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  position: absolute; inset: 0;
  transition: transform 0.7s var(--ease-out);
}
.feature-hit:hover .feature-media img { transform: scale(1.03); }
.feature-media-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f4f2ef, #ebe6e4);
  color: var(--blush);
  font-family: var(--font-display);
  font-size: 42px;
}
.feature-body {
  padding: 22px 24px 8px;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}
.feature-meta {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; color: var(--ink-soft);
}
.feature-meta #feature-place { color: var(--blush-deep); }
#feature-title {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: clamp(22px, 1.7vw, 28px);
  font-weight: 600; line-height: 1.35;
  letter-spacing: 0.04em; color: var(--graphite);
}
#feature-story {
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 13px; line-height: 1.85;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.feature-pager {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 18px 16px 24px;
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; color: var(--ink-soft);
}
.feature-pager button {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: transparent; color: var(--graphite);
  font-size: 18px; line-height: 1; cursor: pointer;
  touch-action: manipulation;
  transition: background 0.18s ease, color 0.18s ease;
}
.feature-pager button:hover {
  background: var(--blush-mist); color: var(--blush-deep);
}
#feature-index { min-width: 4.5em; text-align: center; }

.mag-quote {
  pointer-events: none;
  position: absolute;
  left: clamp(48px, 5vw, 72px);
  bottom: 32px;
  max-width: min(360px, 30vw);
}
.mag-quote-zh {
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.45vw, 22px); color: var(--graphite);
  letter-spacing: 0.06em; line-height: 1.55;
}
.mag-quote-en {
  margin-top: 10px;
  font-family: var(--font-sans);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.26em; color: var(--ink-soft);
}
.mag-seal {
  position: absolute; left: -6px; bottom: -48px;
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid rgba(44,44,44,0.14);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 7.5px; font-weight: 500;
  letter-spacing: 0.14em; line-height: 1.35;
  color: var(--ink-faint); transform: rotate(-8deg);
  opacity: 0.7;
}

.desktop-fabs {
  display: none; position: fixed;
  right: clamp(28px, 3.5vw, 48px);
  bottom: clamp(28px, 3.5vh, 40px);
  z-index: 1200; flex-direction: column; gap: 12px;
}
.circle-fab {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(44,44,44,0.16);
  background: rgba(255,255,255,0.96);
  color: var(--graphite); font-size: 17px;
  cursor: pointer; box-shadow: var(--shadow-soft);
  touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 0; padding: 0;
  transition: transform 0.22s var(--ease-out), background 0.2s ease, box-shadow 0.2s ease;
}
.circle-fab:hover { transform: scale(1.06); }
.circle-fab.primary {
  background: var(--blush); border-color: transparent; color: #fff;
  font-size: 0; line-height: 0;
  box-shadow: 0 12px 28px rgba(196,143,138,0.36);
}
.circle-fab .fab-plus {
  display: block;
  flex-shrink: 0;
}
.circle-fab.on:not(.primary) { background: var(--graphite); border-color: transparent; color: #fff; }
.circle-fab.primary.on {
  background: var(--blush);
  box-shadow: 0 12px 28px rgba(196,143,138,0.36);
}
body.manage-open .circle-fab.primary {
  background: var(--graphite);
  box-shadow: 0 12px 28px rgba(44,44,44,0.28);
}
.circle-fab.remembered:not(.on)::after {
  content: ""; position: absolute; width: 7px; height: 7px;
  border-radius: 50%; background: var(--blush-deep); top: 9px; right: 9px;
}
#bgm-toggle { position: relative; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1300;
  /* height includes safe pad so icons sit fully above home indicator / gesture bar */
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 8px 28px var(--safe-bottom);
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: center; justify-items: center;
  background: rgba(255,255,255,0.97);
  border-top: 1px solid var(--line);
  /* 实色底已够遮挡；大 blur 在滚动/切模式时吃 GPU */
  box-sizing: border-box;
}
.bnav-item {
  border: none; background: transparent; color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.18em; cursor: pointer; padding: 6px;
  touch-action: manipulation; transition: color 0.2s ease;
  min-height: 44px; justify-content: center;
}
.bnav-item.is-active { color: var(--graphite); }
.bnav-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 0;
}
.bnav-icon svg { display: block; flex-shrink: 0; }
.bnav-record {
  border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 6px; min-height: 44px;
  color: var(--ink-soft);
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.18em; cursor: pointer;
  touch-action: manipulation;
  /* Flush with 回忆/计划 — no raised FAB offset */
  transform: none;
}
.bnav-fab {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blush); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 0; padding: 0; box-sizing: border-box;
  box-shadow: 0 6px 16px rgba(196,143,138,0.32);
  transition: transform 0.25s var(--ease-out), background 0.2s ease, box-shadow 0.25s ease;
}
.bnav-fab svg {
  display: block;
  flex-shrink: 0;
  /* Geometric center — SVG strokes, no font metrics drift */
  transform: translate(0, 0);
}
.bnav-record:active .bnav-fab { transform: scale(0.94); }
body.manage-open .bnav-fab,
body.plan-open .bnav-fab {
  background: var(--graphite);
  box-shadow: 0 6px 16px rgba(44,44,44,0.24);
}

/* ---------- Plans view (map-first chrome, not a full-page list) ---------- */
.plans-view {
  position: fixed;
  left: 0; right: 0;
  top: max(12px, var(--safe-top));
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  z-index: 1100;
  display: none;
  pointer-events: none;
  padding: 8px max(16px, var(--safe-right)) 12px max(16px, var(--safe-left));
  box-sizing: border-box;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
}
body.mode-plans .plans-view {
  display: flex;
}
.plans-view[hidden] { display: none !important; }
body.mode-plans .plans-view[hidden] { display: flex !important; }
body.mode-plans #empty-state { display: none !important; }

.plans-chrome {
  position: relative;
  pointer-events: none;
  align-self: flex-start;
  max-width: 280px;
  padding: 14px 16px 12px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(44,44,44,0.06);
  border-radius: 4px;
  box-shadow: 0 14px 36px rgba(44,44,44,0.09);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.plans-chrome::before {
  content: "";
  position: absolute;
  top: 14px; bottom: 14px; left: 0;
  width: 2px;
  background: var(--future);
}
.plans-kicker {
  font-family: var(--font-sans);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.28em; color: var(--ink-faint);
  margin: 0 0 6px;
}
.plans-chrome h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 7vw, 30px);
  font-weight: 500; color: var(--graphite);
  margin: 0; line-height: 1.15;
}
.plans-lead {
  margin: 8px 0 0;
  font-family: var(--font-sans);
  font-size: 12px; line-height: 1.55;
  color: var(--ink-soft); letter-spacing: 0.02em;
}

.plans-rail {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 4px 2px 8px;
  margin: 0 -4px;
  scrollbar-width: none;
}
.plans-rail::-webkit-scrollbar { display: none; }
.plan-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 148px;
  max-width: 200px;
  text-align: left;
  border: 1.5px dashed rgba(var(--future-rgb), 0.48);
  background: rgba(255,255,255,0.92);
  border-radius: 6px;
  padding: 12px 14px 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  touch-action: manipulation;
  box-shadow: 0 8px 20px rgba(44,44,44,0.06);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.plan-chip:active { transform: scale(0.98); }
.plan-chip.is-done {
  opacity: 0.62;
  border-style: solid;
  border-color: rgba(44,44,44,0.12);
}
.plan-chip.is-active {
  border-color: var(--future);
  border-style: solid;
  box-shadow: 0 10px 24px rgba(var(--future-rgb), 0.2);
}
.plan-chip-title {
  display: block;
  font-family: var(--font-display);
  font-size: 17px; font-weight: 500;
  color: var(--graphite); line-height: 1.25;
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-chip-sub {
  display: block;
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: 11px; letter-spacing: 0.04em;
  color: var(--future-deep);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-chip-tag {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 9px; font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.plans-empty {
  pointer-events: none;
  text-align: center;
  margin: auto 12px;
  padding: 22px 20px;
  font-family: var(--font-sans);
  font-size: 14px; line-height: 1.7;
  color: var(--ink-soft);
  background: rgba(255,255,255,0.86);
  border: 1px dashed rgba(var(--future-rgb), 0.38);
  border-radius: 16px;
  max-width: 320px;
  align-self: center;
}
.plans-empty.hidden { display: none; }
.plans-add-btn {
  pointer-events: auto;
  align-self: center;
  min-height: 48px;
  padding: 0 28px;
  border: none; border-radius: 999px;
  background: var(--future); color: #fff;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.16em;
  cursor: pointer; touch-action: manipulation;
  box-shadow: 0 10px 24px rgba(var(--future-rgb), 0.3);
  flex-shrink: 0;
}

/* Future plan pins — outline / dashed, distinct from photo memories */
.plan-marker { background: none !important; border: none !important; }
.plan-pin-wrap {
  display: flex; flex-direction: column; align-items: center;
  width: 72px; pointer-events: auto;
}
.plan-pin {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px dashed var(--future);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 4px 14px rgba(var(--future-rgb), 0.24);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease;
}
.plan-pin-wrap:hover .plan-pin,
.plan-pin.is-active {
  transform: translateY(-2px) scale(1.06);
  border-style: solid;
  border-color: var(--future-deep);
}
.plan-pin.is-done {
  border-style: solid;
  border-color: rgba(44,44,44,0.28);
  opacity: 0.7;
}
.plan-pin-core {
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--future);
  box-shadow: 0 0 0 3px rgba(var(--future-rgb), 0.2);
}
.plan-pin.is-done .plan-pin-core { background: rgba(44,44,44,0.35); box-shadow: none; }
.plan-pin-ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 52px; height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--future-rgb), 0.38);
  pointer-events: none;
}
.plan-pin-label {
  margin-top: 6px;
  max-width: 78px;
  text-align: center;
  pointer-events: none;
}
.plan-pin-place {
  display: block;
  font-family: var(--font-sans);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--future-deep);
  line-height: 1.25;
  text-shadow: 0 0 4px #f7f6f4, 0 0 2px #f7f6f4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.plan-pin-date {
  display: block;
  margin-top: 2px;
  font-family: var(--font-sans);
  font-size: 9px; letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* Plan detail sheet */
.plan-detail {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px);
  z-index: 1400;
  max-width: 440px;
  margin: 0 auto;
  padding: 18px 18px 16px;
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(var(--future-rgb), 0.26);
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(44,44,44,0.12);
  transform: translateY(0);
  transition: transform 0.35s var(--ease-out), opacity 0.28s ease;
}
.plan-detail.hidden {
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.plan-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.plan-detail h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 500; color: var(--graphite);
  margin: 4px 0 0; line-height: 1.2;
}
.plan-detail-meta {
  margin: 10px 0 0;
  font-family: var(--font-sans);
  font-size: 11px; letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.plan-detail-place {
  margin: 10px 0 0;
  font-family: var(--font-sans);
  font-size: 13px; letter-spacing: 0.04em;
  color: var(--future-deep);
}
.plan-detail-place:empty,
.plan-detail-note:empty { display: none; }
.plan-detail-note {
  margin: 12px 0 0;
  font-family: var(--font-sans);
  font-size: 14px; line-height: 1.65;
  color: var(--ink-soft);
  white-space: pre-wrap;
}
.plan-detail-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 16px;
}
.plan-detail-actions .us-btn {
  min-height: 44px;
  padding: 0 16px;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.danger-text { color: #a45 !important; }

body.plan-picking #map-crosshair,
body.plan-picking #map-pick-bar { /* shared chrome with memory pick */ }
body.plan-peek #plan-panel {
  /* set in mobile block */
}
body.kb-open #plan-detail { bottom: calc(var(--kb, 0px) + 12px); }

/* ---------- Record chooser ---------- */
.record-chooser {
  position: fixed; inset: 0; z-index: 1600;
  display: flex; align-items: flex-end; justify-content: center;
}
.record-chooser.hidden { display: none !important; }
.record-chooser-backdrop {
  position: absolute; inset: 0;
  border: none; padding: 0; margin: 0;
  background: rgba(44,44,44,0.28);
  cursor: pointer;
}
.record-chooser-sheet {
  position: relative; z-index: 1;
  width: min(100%, 440px);
  background: rgba(255,255,255,0.98);
  border-radius: 20px 20px 0 0;
  padding: 22px 22px calc(18px + var(--safe-bottom));
  box-shadow: 0 -18px 50px rgba(44,44,44,0.12);
  animation: chooser-up 0.28s var(--ease-out);
}
@keyframes chooser-up {
  from { transform: translateY(18px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.record-chooser-hint {
  margin: 8px 0 0;
  font-family: var(--font-sans);
  font-size: 13px; line-height: 1.6;
  color: var(--ink-soft);
}
.record-chooser-sheet h2 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 500;
  color: var(--graphite); margin: 4px 0 0;
}
.record-chooser-actions {
  display: grid; gap: 10px; margin-top: 18px;
}
.chooser-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  width: 100%; text-align: left;
  border: 1px solid rgba(44,44,44,0.1);
  background: var(--paper);
  border-radius: 14px;
  padding: 16px 16px;
  cursor: pointer; touch-action: manipulation;
  color: inherit; font: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.chooser-opt:active { background: rgba(196,143,138,0.08); border-color: rgba(196,143,138,0.35); }
.chooser-opt-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500; color: var(--graphite);
}
.chooser-opt-sub {
  font-family: var(--font-sans);
  font-size: 12px; letter-spacing: 0.06em; color: var(--ink-soft);
}
.record-chooser-cancel {
  display: block; width: 100%;
  margin-top: 14px; min-height: 44px;
  border: none; background: transparent;
  color: var(--ink-soft); cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; letter-spacing: 0.12em;
}

/* ---------- Plan panel ---------- */
#plan-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1650;
  width: min(400px, 100vw); display: flex; flex-direction: column;
  background: rgba(255,255,255,0.99);
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 48px rgba(44,44,44,0.1);
  transition: transform 0.4s var(--ease-out);
  padding-bottom: var(--safe-bottom);
  overflow: hidden;
}
#plan-panel.hidden {
  transform: translateX(110%); pointer-events: none; box-shadow: none;
}
body.kb-open #plan-panel { bottom: var(--kb, 0px); }
.plan-form-scroll { padding: 4px 20px 24px; overflow-y: auto; flex: 1; }
#plan-form-msg { min-height: 1.2em; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
#plan-form-msg.ok { color: #3a7; }
#plan-form-msg.err { color: #a45; }

/* ---------- Us sheet ---------- */
.us-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1400;
  background: rgba(255,255,255,0.98);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 50px rgba(44,44,44,0.1);
  transform: translateY(0);
  transition: transform 0.4s var(--ease-out);
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
  max-height: min(72dvh, 560px);
}
.us-sheet.collapsed { transform: translateY(110%); pointer-events: none; }
.us-sheet-inner { padding: 30px 28px 22px; position: relative; }
.sheet-close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 15px;
}
.us-kicker, .empty-kicker, .intro-kicker, .manage-kicker {
  font-family: var(--font-sans); font-size: 10px; font-weight: 500;
  letter-spacing: 0.32em; color: var(--ink-soft);
}
.us-rule, .empty-rule, .intro-rule, .manage-rule {
  width: 28px; height: 1px; background: var(--blush); margin: 12px 0 14px;
}
#us-title {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 500; color: var(--graphite);
}
.us-days {
  margin-top: 14px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  color: var(--blush-deep); letter-spacing: 0.08em;
}
.us-sub {
  margin-top: 8px; color: var(--ink-soft);
  font-family: var(--font-sans); font-size: 13px; line-height: 1.75;
}
.us-actions { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.us-btn {
  min-height: 46px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--graphite); color: #fff;
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.2em; cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.us-btn:active { transform: scale(0.98); }
.us-btn.ghost { background: transparent; color: var(--graphite); }

/* ---------- Empty ---------- */
#empty-state {
  position: fixed; inset: 0; z-index: 850;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; padding: 24px;
}
#empty-state.hidden { display: none; }
.empty-card {
  pointer-events: auto; max-width: 320px; text-align: center;
  padding: 40px 30px; background: rgba(255,255,255,0.94);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); animation: fade-up 0.55s var(--ease-out);
}
.empty-card h2 {
  font-family: var(--font-display); font-size: 26px; font-weight: 500; color: var(--graphite);
}
.empty-card p {
  margin-top: 12px; color: var(--ink-soft);
  font-family: var(--font-sans); font-size: 13px; line-height: 1.85;
}

/* ---------- Intro ---------- */
#intro {
  position: fixed; inset: 0; z-index: 3500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(247,246,244,0.97);
  padding: max(20px, var(--safe-top)) 24px max(20px, var(--safe-bottom));
  animation: soft-in 0.4s ease;
}
#intro.hidden { display: none; }
.intro-card { max-width: 380px; width: 100%; text-align: center; padding: 42px 24px 30px; }
#intro-title {
  font-family: var(--font-display); font-size: 36px; font-weight: 500;
  color: var(--graphite); letter-spacing: 0.06em;
}
#intro-days {
  margin-top: 18px; color: var(--blush-deep);
  font-family: var(--font-sans); font-size: 14px; font-weight: 500; letter-spacing: 0.1em;
}
#intro-sub {
  margin-top: 8px; color: var(--ink-soft);
  font-family: var(--font-sans); font-size: 13px; letter-spacing: 0.08em;
}
.intro-actions {
  margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
#intro-begin {
  min-width: 168px; min-height: 46px; border: none; border-radius: 999px;
  background: var(--graphite); color: #fff;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.22em; cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
#intro-begin:hover { background: #1f1f1f; }
#intro-skip, .ghost-btn, button.textish {
  border: none; background: transparent; color: var(--ink-soft);
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; cursor: pointer; padding: 8px 12px;
  touch-action: manipulation;
}

/* =========================================================
   Story magazine — B-mobile-story layout
   Top editorial (paper) + bottom hero photo with poem
   ========================================================= */
#panel.story-magazine {
  position: fixed; inset: 0; z-index: 2000;
  background: var(--paper);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.42s var(--ease-out), opacity 0.35s ease;
}
#panel.story-magazine.hidden {
  opacity: 0; pointer-events: none;
  transform: translateY(10%);
}
.story-top {
  position: relative; z-index: 5; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, calc(var(--safe-top) + 6px)) max(18px, var(--safe-right)) 4px max(8px, var(--safe-left));
  background: var(--paper);
}
#panel-close {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border: none; background: transparent;
  color: var(--graphite); cursor: pointer; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
#panel-close .panel-back-gif {
  width: 32px; height: 32px; object-fit: contain;
  display: block; pointer-events: none; user-select: none;
  /* Side-view cow-cat already faces down-left; slight nudge reads as “back” */
  transform: translate(-1px, 1px);
}
.story-brand, .story-index {
  font-family: var(--font-sans);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.3em; color: var(--graphite);
}
.story-top-right {
  position: relative;
  display: flex; align-items: center; gap: 2px;
  min-width: 44px; justify-content: flex-end;
}
.story-more-btn {
  width: 44px; height: 44px; border: none; background: transparent;
  color: var(--graphite); cursor: pointer; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.story-more-btn[aria-expanded="true"] {
  background: rgba(44,44,44,0.06);
}
.story-more-menu {
  position: absolute; top: calc(100% - 4px); right: 0;
  min-width: 132px; padding: 6px;
  background: rgba(255,255,255,0.98);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(44,44,44,0.12);
  z-index: 20;
  display: flex; flex-direction: column; gap: 2px;
}
.story-more-menu.hidden { display: none !important; }
.story-more-menu button {
  border: none; background: transparent;
  text-align: left; padding: 12px 14px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.12em; color: var(--graphite);
  border-radius: 6px; cursor: pointer; touch-action: manipulation;
}
.story-more-menu button:active { background: rgba(44,44,44,0.06); }
.story-more-menu button.danger { color: #b4544c; }
.story-editorial {
  flex-shrink: 0;
  padding: 8px max(28px, var(--safe-right)) 18px max(28px, var(--safe-left));
  background: var(--paper);
  animation: fade-up 0.55s var(--ease-out);
  max-height: 48dvh;
  overflow-y: auto;
}
#panel-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 9.5vw, 48px);
  font-weight: 600; line-height: 1.22;
  letter-spacing: 0.08em; color: var(--graphite);
  white-space: pre-line; max-width: 8em;
}
.story-caption {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: 14px; line-height: 1.7;
  color: rgba(44,44,44,0.72); letter-spacing: 0.04em;
  max-width: 18em;
}
.story-rule {
  width: 32px; height: 1px; background: rgba(44,44,44,0.35);
  margin: 18px 0 12px;
}
.story-credits {
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--font-sans);
  font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: rgba(44,44,44,0.55); max-width: 260px;
}
#panel-author { color: var(--blush-deep); letter-spacing: 0.22em; }

/* ---------- Comments (in editorial column) ---------- */
.comments-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  max-width: 100%;
}
.comments-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.comments-kicker {
  font-family: var(--font-sans); font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.28em; color: rgba(44,44,44,0.45);
}
.comments-count {
  font-family: var(--font-display); font-size: 14px; color: var(--blush-deep);
}
.comments-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: min(28vh, 220px); overflow-y: auto;
  padding-right: 4px; margin-bottom: 12px;
}
.comments-empty {
  font-family: var(--font-serif); font-size: 13px;
  color: rgba(44,44,44,0.45); letter-spacing: 0.04em;
}
.comment-item { padding-bottom: 8px; border-bottom: 1px solid rgba(44,44,44,0.06); }
.comment-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-sans); font-size: 10px;
  letter-spacing: 0.12em; color: rgba(44,44,44,0.5);
}
.comment-author { color: var(--graphite); font-weight: 500; }
.comment-time { opacity: 0.75; }
.comment-del {
  border: none; background: none; padding: 0; cursor: pointer;
  color: rgba(168,90,82,0.85); font-size: 10px; letter-spacing: 0.1em;
}
.comment-text {
  margin-top: 4px;
  font-family: var(--font-serif); font-size: 13.5px; line-height: 1.65;
  color: var(--ink); letter-spacing: 0.03em; white-space: pre-wrap;
}
.comment-who {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
  font-family: var(--font-sans); font-size: 11px;
  color: rgba(44,44,44,0.55); letter-spacing: 0.06em;
}
.comment-switch {
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--blush-deep); font-size: 11px; letter-spacing: 0.1em;
  text-decoration: underline; text-underline-offset: 3px;
}
.comment-row { display: flex; gap: 8px; align-items: stretch; }
#comment-input {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 4px;
  background: #fff; color: var(--ink);
  font-family: var(--font-serif); font-size: 16px;
}
#comment-input:focus {
  outline: 2px solid rgba(212,168,164,0.35); border-color: var(--blush);
}
#comment-send {
  flex-shrink: 0; padding: 0 14px; border: none; border-radius: 999px;
  background: var(--graphite); color: #fff;
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.16em;
  cursor: pointer;
}
.comment-msg {
  min-height: 16px; margin-top: 6px;
  font-family: var(--font-sans); font-size: 11px; color: #a85a52;
}

/*
 * 写评论时输入法会盖住编辑栏底部。手机/平板下把故事页压到键盘之上，
 * 让文字栏吃掉整块可视高度、大图暂时收起，评论框就能滚进视野。
 */
@media (max-width: 900px) {
  body.kb-open #panel.story-magazine { bottom: var(--kb, 0px); }
  body.kb-open .story-editorial {
    flex: 1 1 auto; min-height: 0; max-height: none;
    padding-bottom: calc(12px + var(--safe-bottom));
  }
  body.kb-open .story-hero { flex: 0 0 0; min-height: 0; }
}

.story-hero {
  position: relative; flex: 1; min-height: 0;
  background: #2a2927; overflow: hidden;
  animation: soft-in 0.6s ease 0.05s both;
}
#panel-gallery,
#gallery-main {
  position: absolute; inset: 0;
}
#gallery-main img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  cursor: zoom-in; animation: soft-in 0.22s ease-out both;
}
@keyframes kenburns {
  from { transform: scale(1.04); }
  to { transform: scale(1); }
}
#gallery-main .no-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--blush); font-family: var(--font-display); font-size: 48px;
  background: linear-gradient(160deg, #3a3936, #2a2927);
}
#gallery-thumbs {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end;
  max-width: 40%;
}
#gallery-thumbs img {
  width: 36px; height: 36px; object-fit: cover; border-radius: 2px;
  opacity: 0.55; border: 1.5px solid transparent; cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
#gallery-thumbs img.active { opacity: 1; border-color: #fff; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 38px; height: 38px; border: none; border-radius: 50%;
  background: rgba(20,18,16,0.35); color: #fff; font-size: 20px; cursor: pointer;
}
.gallery-nav.hidden { display: none; }
#gallery-prev { left: 12px; }
#gallery-next { right: 12px; }
.story-hero-scrim {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg,
    rgba(20,18,16,0.05) 0%,
    rgba(20,18,16,0.0) 40%,
    rgba(20,18,16,0.45) 100%);
}
.story-poem-wrap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 0 max(28px, var(--safe-right)) max(22px, calc(var(--safe-bottom) + 14px)) max(28px, var(--safe-left));
  pointer-events: none;
}
.story-poem {
  position: relative;
  padding-left: 16px;
  color: rgba(255,255,255,0.96);
  font-family: var(--font-serif);
  font-size: 14.5px; line-height: 2.05; letter-spacing: 0.05em;
  white-space: pre-wrap; max-width: 17em;
  min-height: 4.5em;
  text-shadow: 0 2px 14px rgba(0,0,0,0.3);
  animation: fade-up 0.65s var(--ease-out) 0.12s both;
}
.story-poem::before {
  content: "";
  position: absolute; left: 0; top: 0.2em; bottom: 0.2em;
  width: 1px; background: rgba(255,255,255,0.75);
}
.panel-actions {
  position: absolute; right: max(18px, var(--safe-right));
  bottom: max(18px, calc(var(--safe-bottom) + 12px));
  z-index: 4;
}
.ghost-btn {
  display: inline-flex; align-items: center;
  padding: 8px 14px !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  border-radius: 999px; color: #fff !important;
  background: rgba(20,18,16,0.22) !important;
  font-size: 11px !important; letter-spacing: 0.14em;
  backdrop-filter: blur(6px);
}
.mem-anniv { margin-left: 6px; color: var(--blush-deep); }

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(20,18,16,0.95);
  display: flex; align-items: center; justify-content: center;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  animation: soft-in 0.25s ease;
}
#lightbox.hidden { display: none; }
#lightbox img {
  max-width: 92vw; max-height: 92dvh; border-radius: 2px;
  user-select: none; pointer-events: none;
}
#lightbox button {
  position: absolute; z-index: 10; border: none; cursor: pointer;
  background: rgba(255,255,255,0.12); color: #fff;
  width: 46px; height: 46px; border-radius: 50%; font-size: 22px;
}
#lightbox-close { top: max(20px, calc(var(--safe-top) + 10px)); right: max(20px, calc(var(--safe-right) + 10px)); font-size: 17px; }
#lightbox-prev { left: max(18px, calc(var(--safe-left) + 8px)); top: 50%; transform: translateY(-50%); }
#lightbox-next { right: max(18px, calc(var(--safe-right) + 8px)); top: 50%; transform: translateY(-50%); }

/* ---------- Time scrubber (slim era rail — secondary chrome) ---------- */
.time-scrub {
  position: fixed;
  left: max(16px, var(--safe-left));
  right: max(16px, var(--safe-right));
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 6px);
  width: auto;
  z-index: 1060;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.4s var(--ease-out);
}
.time-scrub.hidden { display: none !important; }
.time-scrub:hover,
.time-scrub:focus-within,
body.scrubbing .time-scrub {
  opacity: 1;
}
.time-scrub-inner {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0 10px;
  padding: 5px 10px 6px 12px;
  background: rgba(247, 246, 244, 0.42);
  border: 1px solid transparent;
  border-radius: 2px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.time-scrub:hover .time-scrub-inner,
.time-scrub:focus-within .time-scrub-inner,
body.scrubbing .time-scrub-inner {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(44, 44, 44, 0.08);
  box-shadow: 0 4px 18px rgba(44, 44, 44, 0.05);
}
.time-scrub-kicker {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.26em;
  color: var(--ink-faint);
  line-height: 1;
  transition: color 0.2s ease;
}
body.scrubbing .time-scrub-kicker { color: var(--blush-deep); }
.time-scrub-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  line-height: 1;
  white-space: nowrap;
  min-width: 4.8em;
  transition: color 0.2s ease;
}
body.scrubbing .time-scrub-label { color: var(--graphite); }
.time-scrub-track {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
#time-scrub-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}
#time-scrub-range:focus { outline: none; }
#time-scrub-range:focus-visible {
  outline: 1.5px solid var(--blush);
  outline-offset: 2px;
  border-radius: 3px;
}
#time-scrub-range::-webkit-slider-runnable-track {
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(212, 168, 164, 0.28), rgba(44, 44, 44, 0.1));
}
#time-scrub-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -5px;
  border-radius: 50%;
  border: 1px solid rgba(44, 44, 44, 0.18);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: none;
  transition: transform 0.18s var(--ease-out), background 0.18s ease, border-color 0.18s ease;
}
#time-scrub-range:active::-webkit-slider-thumb,
body.scrubbing #time-scrub-range::-webkit-slider-thumb {
  transform: scale(1.15);
  background: var(--blush);
  border-color: transparent;
}
#time-scrub-range::-moz-range-track {
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(212, 168, 164, 0.28), rgba(44, 44, 44, 0.1));
}
#time-scrub-range::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(44, 44, 44, 0.18);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: none;
}
.time-scrub-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}
.time-scrub:hover .time-scrub-ends,
.time-scrub:focus-within .time-scrub-ends,
body.scrubbing .time-scrub-ends {
  opacity: 0.85;
  max-height: 14px;
}
.time-scrub-reset {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 4px 2px;
  touch-action: manipulation;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.time-scrub-reset:hover { color: var(--graphite); }
.time-scrub-reset:disabled {
  opacity: 0.28;
  cursor: default;
}
body.scrubbing .photo-pin-wrap,
body.scrubbing .story-card,
body.scrubbing .feature-card {
  transition: opacity 0.06s linear, transform 0.12s var(--ease-out);
  will-change: opacity, transform;
}
/* 拖动时关闭吸附与平滑滚动，让照片条直接跟手对齐当前时间 */
body.scrubbing .story-track {
  scroll-snap-type: none;
  scroll-behavior: auto;
}
body.scrubbing .photo-pin-wrap.is-far,
body.scrubbing .story-card.is-far {
  pointer-events: none;
}
body.manage-open .time-scrub,
body.intro-open .time-scrub {
  opacity: 0 !important;
  pointer-events: none;
  visibility: hidden;
}

/* ---------- Timeline ---------- */
#timeline {
  position: fixed;
  top: max(16px, calc(var(--safe-top) + 8px));
  bottom: max(16px, calc(var(--safe-bottom) + 8px));
  left: max(16px, calc(var(--safe-left) + 8px));
  width: min(300px, calc(100vw - 32px));
  z-index: 1600; display: flex; flex-direction: column;
  background: rgba(255,255,255,0.97);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.4s var(--ease-out), opacity 0.25s ease;
}
#timeline.collapsed {
  transform: translateX(calc(-100% - 24px));
  opacity: 0; pointer-events: none;
}
.timeline-handle {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line);
}
.timeline-grip {
  width: 18px; height: 3px; border-radius: 999px;
  background: rgba(44,44,44,0.14); display: none;
}
.timeline-title {
  flex: 1; font-family: var(--font-display);
  font-size: 17px; letter-spacing: 0.12em; color: var(--graphite);
}
#timeline-close {
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 14px;
}
#timeline-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px; }
.timeline-empty {
  padding: 24px 12px; text-align: center; color: var(--ink-soft);
  font-family: var(--font-sans); font-size: 13px; line-height: 1.7;
}
.timeline-item {
  display: flex; gap: 10px; align-items: center; width: 100%;
  padding: 10px; border: none; border-radius: 8px; background: transparent;
  text-align: left; cursor: pointer; color: inherit; touch-action: manipulation;
  transition: background 0.18s ease;
}
.timeline-item:hover, .timeline-item.active { background: var(--blush-mist); }
.tl-cover img, .tl-ph {
  width: 48px; height: 48px; border-radius: 4px; object-fit: cover;
  flex-shrink: 0; background: #eceae7;
}
.tl-ph {
  display: flex; align-items: center; justify-content: center;
  color: var(--blush); font-size: 18px;
}
.tl-meta { min-width: 0; flex: 1; }
.tl-date {
  font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  color: var(--blush-deep); letter-spacing: 0.1em;
}
.tl-title {
  margin-top: 2px; font-family: var(--font-serif);
  font-size: 13.5px; font-weight: 600; color: var(--graphite);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-place {
  margin-top: 2px; font-family: var(--font-sans);
  font-size: 11.5px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Manage ---------- */
#manage-unlock.hidden, #member-pick.hidden, #cancel-edit-btn.hidden,
#draft-hint.hidden, #search-results.hidden, #plan-search-results.hidden,
#manage-list-section.hidden, #member-switch.hidden,
#manage-logout.hidden, .form-who.hidden,
.manage-step.hidden { display: none !important; }

body.manage-open #mobile-hero,
body.manage-open #story-rail,
body.manage-open #desktop-stage,
body.manage-open #empty-state { opacity: 0.28; pointer-events: none; }
body.manage-open #bottom-nav { opacity: 0.45; }
body.manage-open #manage-toggle { opacity: 1; pointer-events: auto; }
body.manage-open #desktop-fabs { opacity: 0.35; pointer-events: none; }
body.manage-open #manage-toggle-desktop { pointer-events: auto; opacity: 1; }

.pick-marker { background: none; border: none; }
.pick-pin {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.95);
  border: 1.5px solid var(--blush-deep); color: var(--blush-deep);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(44,44,44,0.16); line-height: 1;
}

#map-crosshair {
  position: fixed; left: 50%; top: 34%; z-index: 1640;
  width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none;
}
#map-crosshair.hidden { display: none !important; }
body.manage-peek #map-crosshair { top: 30%; }
.crosshair-ring {
  position: absolute; inset: 0;
  border: 2px solid rgba(196,143,138,0.9); border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.55), 0 6px 18px rgba(44,44,44,0.14);
  background: rgba(255,255,255,0.1);
}
.crosshair-dot {
  position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--blush-deep); box-shadow: 0 0 0 2px rgba(255,255,255,0.9);
}
/* 可选的「在地图上选点」模式：准星 + 确认条 */
#map-pick-bar {
  position: fixed; left: 50%; z-index: 1660; transform: translateX(-50%);
  bottom: calc(48dvh + 12px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: max-content; max-width: min(340px, calc(100vw - 32px));
}
#map-pick-bar.hidden { display: none !important; }
.map-pick-tip {
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.92);
  font-family: var(--font-sans); font-size: 11.5px; line-height: 1.4;
  color: var(--ink); letter-spacing: 0.04em; text-align: center;
  box-shadow: 0 4px 14px rgba(44,44,44,0.12);
}
.map-pick-actions { display: flex; align-items: center; gap: 4px; }
#confirm-pick-btn {
  min-height: 46px; padding: 0 24px; border: none; border-radius: 999px;
  background: var(--graphite); color: #fff;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.18em;
  box-shadow: 0 10px 28px rgba(44,44,44,0.22); cursor: pointer;
  touch-action: manipulation;
}
#cancel-pick-btn {
  min-height: 46px; border-radius: 999px;
  background: rgba(255,255,255,0.9); box-shadow: 0 4px 14px rgba(44,44,44,0.1);
}
body.manage-peek #map-pick-bar { bottom: calc(40dvh + 12px + var(--safe-bottom)); }
/* 输入法弹出时不做地图选点，免得准星和确认条被键盘顶飞 */
body.kb-open #map-pick-bar,
body.kb-open #map-crosshair { display: none !important; }

#manage-unlock, #member-pick {
  position: fixed; inset: 0; z-index: 3600;
  display: flex; align-items: center; justify-content: center;
  background: rgba(40,38,36,0.28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: max(20px, var(--safe-top)) 20px max(20px, var(--safe-bottom));
  animation: soft-in 0.25s ease;
  overflow-y: auto; overscroll-behavior: contain;
}
#manage-unlock.hidden, #member-pick.hidden { display: none !important; }
/* 输入密码时把弹窗压到键盘之上，并允许滚动 */
body.kb-open #manage-unlock,
body.kb-open #member-pick {
  bottom: var(--kb, 0px);
  align-items: flex-start;
  padding-top: 10px; padding-bottom: 10px;
}
body.kb-open .manage-unlock-card { padding: 16px 20px 16px; }
body.kb-open .manage-unlock-card h2 { font-size: 20px; }
body.kb-open .manage-unlock-card .manage-kicker,
body.kb-open .manage-unlock-card .manage-rule,
body.kb-open .member-pick-hint { display: none; }
/* 身份改成一行小胶囊，密码框和登录键才都塞得进键盘上方 */
body.kb-open .member-pick-list {
  margin-top: 4px; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px;
}
body.kb-open .member-choice {
  width: auto; min-width: 92px; min-height: 40px; padding: 0 16px; font-size: 16px;
}
body.kb-open .member-pw-label { margin-top: 10px; }
body.kb-open .manage-unlock-card input { margin-top: 6px; }
body.kb-open .manage-unlock-actions { margin-top: 10px; }
body.kb-open #manage-login-error,
body.kb-open #member-pick-error { margin-top: 6px; min-height: 0; }
.manage-unlock-card {
  width: min(340px, 100%); padding: 38px 30px 30px; text-align: center;
  background: rgba(255,255,255,0.98); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  animation: fade-up 0.4s var(--ease-out);
}
.manage-unlock-card h2 {
  font-family: var(--font-display); font-size: 26px; font-weight: 500;
  letter-spacing: 0.08em; color: var(--graphite);
}
.manage-unlock-card input {
  width: 100%; margin-top: 14px; padding: 13px 14px; font-size: 16px;
  text-align: center; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; color: var(--ink); font-family: var(--font-sans);
}
.manage-unlock-card input:focus {
  outline: 2px solid rgba(212,168,164,0.35); border-color: var(--blush);
}
.member-pick-hint {
  margin-top: 10px;
  font-family: var(--font-serif); font-size: 13px; line-height: 1.55;
  color: rgba(44,44,44,0.55); letter-spacing: 0.04em;
}
.member-pick-list {
  margin-top: 20px; display: flex; flex-direction: column; gap: 8px;
}
.member-choice {
  width: 100%; min-height: 46px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; color: var(--graphite);
  font-family: var(--font-display); font-size: 18px; letter-spacing: 0.12em;
  cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease;
}
.member-choice.is-selected {
  border-color: var(--blush-deep);
  background: rgba(212,168,164,0.14);
  color: var(--graphite);
}
.member-pick-empty {
  font-family: var(--font-sans); font-size: 12px; color: #a85a52; line-height: 1.5;
}
.member-pw-label {
  display: block; margin-top: 18px;
  font-family: var(--font-sans); font-size: 10px; letter-spacing: 0.22em;
  color: rgba(44,44,44,0.45);
}
.manage-unlock-actions {
  margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
#manage-login-btn, #member-pick-confirm {
  min-width: 148px; min-height: 46px; border: none; border-radius: 999px;
  background: var(--graphite); color: #fff;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.2em; cursor: pointer;
}
#manage-login-error, #member-pick-error {
  margin-top: 10px; min-height: 18px; color: #a85a52;
  font-family: var(--font-sans); font-size: 12px;
}
.form-who {
  margin-top: 6px;
  font-family: var(--font-sans); font-size: 11px;
  letter-spacing: 0.08em; color: rgba(44,44,44,0.55);
}

#manage-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1650;
  width: min(400px, 100vw); display: flex; flex-direction: column;
  background: rgba(255,255,255,0.99);
  border-left: 1px solid var(--line);
  box-shadow: -14px 0 48px rgba(44,44,44,0.1);
  transition: transform 0.4s var(--ease-out);
  padding-bottom: var(--safe-bottom);
}
#manage-panel.hidden {
  transform: translateX(110%); pointer-events: none; box-shadow: none;
}
/* 侧栏形态也让出键盘的高度，字段才滚得进可视区 */
body.kb-open #manage-panel { bottom: var(--kb, 0px); }

/*
 * 键盘占掉一半屏幕时，标题/步骤条这些装饰要让位给正在输入的字段。
 * 动作条也先收起 —— 打字时用不到「保存」，收起来能多露两条搜索结果。
 */
@media (max-width: 900px) {
  body.kb-open .manage-head,
  body.short-view .manage-head { padding-top: 6px; padding-bottom: 6px; }
  body.kb-open .manage-head h2,
  body.short-view .manage-head h2 { margin-top: 0; font-size: 17px; }
  body.kb-open .manage-head .manage-kicker,
  body.kb-open .manage-head .form-who,
  body.short-view .manage-head .manage-kicker,
  body.short-view .manage-head .form-who { display: none; }
  body.kb-open .manage-stepper,
  body.short-view .manage-stepper { padding: 4px 16px 5px; }
  body.kb-open .manage-step-tab,
  body.short-view .manage-step-tab { min-height: 32px; padding: 3px 8px; }
  body.kb-open #manage-panel::before,
  body.short-view #manage-panel::before { display: none; }
  body.kb-open .manage-search-block,
  body.short-view .manage-search-block { padding-bottom: 8px; }
  body.kb-open .search-label,
  body.short-view .search-label { margin-bottom: 5px; }
  body.short-view .manage-actions { padding-top: 8px; padding-bottom: calc(8px + var(--safe-bottom)); }
  /* 打字时用不到「保存」，收起来给字段和结果腾地方 */
  body.kb-open .manage-actions { display: none !important; }
}
.manage-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: max(18px, calc(var(--safe-top) + 10px)) max(16px, var(--safe-right)) 14px 22px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.manage-head h2 {
  margin-top: 4px; font-family: var(--font-display);
  font-size: 24px; font-weight: 500; letter-spacing: 0.06em;
  color: var(--graphite); line-height: 1.35;
}
.manage-head-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
#manage-close {
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: transparent; color: var(--ink-soft); font-size: 15px; cursor: pointer;
}

/* 两步录入：先照片，再信息 */
.manage-stepper {
  display: flex; align-items: center; justify-content: center; gap: 0;
  padding: 10px 22px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: linear-gradient(180deg, #fff 0%, #faf9f7 100%);
}
.manage-step-tab {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; background: transparent; cursor: pointer;
  padding: 6px 10px; min-height: 40px;
  font-family: var(--font-sans); color: var(--ink-faint);
  touch-action: manipulation;
  transition: color 0.2s ease;
}
.manage-step-tab .step-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; letter-spacing: 0;
  border: 1px solid rgba(44,44,44,0.14);
  color: var(--ink-soft);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.manage-step-tab .step-label {
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em;
}
.manage-step-tab.is-active { color: var(--graphite); }
.manage-step-tab.is-active .step-num {
  background: var(--graphite); color: #fff; border-color: transparent;
}
.manage-step-tab.is-done .step-num {
  background: var(--blush-mist, #f7ebe8);
  border-color: rgba(212,168,164,0.55);
  color: var(--blush-deep);
}
.step-rule {
  width: 28px; height: 1px; margin: 0 4px;
  background: rgba(44,44,44,0.12); flex-shrink: 0;
}
.manage-step.hidden { display: none !important; }
.step-lead {
  margin: 2px 0 10px;
  font-family: var(--font-sans); font-size: 13px;
  color: var(--ink-soft); line-height: 1.55; letter-spacing: 0.02em;
}
.photo-zone {
  margin: 0 0 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf9f7;
}
.photo-zone.is-empty {
  padding: 0;
  border: none;
  background: transparent;
}
.photo-zone-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}
.photo-zone.is-empty .photo-zone-grid {
  grid-template-columns: 1fr;
}
.manage-form .photo-add-btn {
  display: flex !important; align-items: center; justify-content: center; gap: 8px;
  margin: 0 !important; letter-spacing: 0;
  min-height: 48px; min-width: 44px;
  padding: 10px 14px;
  border: 1.5px dashed rgba(44,44,44,0.18);
  border-radius: 12px;
  background: linear-gradient(165deg, #faf9f7 0%, #f3efec 100%);
  cursor: pointer; text-align: left; font-weight: 500;
  touch-action: manipulation;
}
.photo-zone.is-empty .photo-add-btn {
  width: 100%;
}
.photo-zone.has-photos .photo-add-btn {
  flex-direction: column; gap: 2px;
  aspect-ratio: 1; min-height: 44px; padding: 6px 4px;
  border-radius: 8px; text-align: center;
}
.photo-add-plus {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; font-weight: 400; color: var(--blush-deep);
  background: rgba(212,168,164,0.22);
}
.photo-zone.has-photos .photo-add-plus { width: 24px; height: 24px; font-size: 20px; }
.photo-add-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.photo-add-text {
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  letter-spacing: 0.06em; color: var(--graphite);
}
.photo-zone.has-photos .photo-add-text { font-size: 12px; letter-spacing: 0.08em; }
.photo-add-hint { margin: 0 !important; font-size: 12px; }
#manage-step-1 .photo-add-btn:hover,
#manage-step-1 .photo-add-btn:focus-within {
  border-color: rgba(212,168,164,0.65);
  background: linear-gradient(165deg, #fff 0%, #f7ebe8 100%);
}
.manage-form .photo-add-btn.is-hidden { display: none !important; }
#manage-step-1 #f-photos {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
#manage-step-1 { position: relative; }
.step-actions { margin-top: 12px; }
#manage-step-next {
  min-height: 46px; padding: 10px 28px;
  border: none; border-radius: 999px; cursor: pointer;
  background: var(--graphite); color: #fff;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.14em; touch-action: manipulation;
}
#manage-step-back { min-height: 42px; }

.manage-search-block {
  flex-shrink: 0; padding: 0 0 14px;
  border-bottom: 1px solid var(--line); background: transparent;
  position: relative; z-index: 20;
  margin-bottom: 4px;
}
.manage-search-block .search-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 0 0 8px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  color: var(--ink); letter-spacing: 0.08em;
}
.manage-search-block .search-label .hint,
.manage-form .hint {
  font-weight: 400; color: var(--ink-faint); font-size: 11px;
}
/* 次要入口：地图选点 / 定位 / 沿用上一条 —— 都是小号文字按钮，不抢搜索的位置 */
.place-alt-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px;
  margin-top: 10px;
}
.link-action {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 4px 8px;
  border: none; border-radius: 999px; background: transparent;
  color: var(--ink-soft); cursor: pointer; touch-action: manipulation;
  font-family: var(--font-sans); font-size: 12.5px; letter-spacing: 0.04em;
  transition: color 0.15s ease, background 0.15s ease;
}
.link-action svg { flex-shrink: 0; opacity: 0.75; }
.link-action:hover, .link-action:active {
  color: var(--graphite); background: rgba(44,44,44,0.045);
}
.link-action:disabled { opacity: 0.5; cursor: wait; }
.link-action.is-on {
  color: var(--blush-deep); background: var(--blush-mist);
}
.locate-hint {
  margin: 6px 2px 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft);
}
.locate-hint.warn { color: #8a5a4a; }
.locate-hint.ok { color: var(--graphite); }

/* 选好之后给人看得懂的确认，不摆经纬度 */
.place-picked {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: var(--blush-mist); border: 1px solid rgba(212,168,164,0.4);
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: var(--graphite); letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.place-picked::before {
  content: "✓"; flex-shrink: 0;
  color: var(--blush-deep); font-weight: 700; font-size: 12px;
}

.manage-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; padding: 8px 22px 32px; min-height: 0;
}
.manage-form label {
  display: block; margin: 16px 0 6px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  color: var(--ink); letter-spacing: 0.08em;
}
.hint-line {
  margin-top: 6px; color: var(--ink-faint);
  font-family: var(--font-sans); font-size: 12px; min-height: 16px;
}
#draft-hint { color: var(--blush-deep); }

.manage-form input[type="text"],
.manage-form input[type="search"],
.manage-form input[type="date"],
.manage-form textarea,
#place-search {
  width: 100%; max-width: 100%; padding: 14px 16px; font-size: 17px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink); font-family: var(--font-sans);
}
#place-search,
#plan-place-search { min-height: 52px; box-shadow: var(--shadow-soft); }
#place-search::placeholder,
#plan-place-search::placeholder { color: var(--ink-faint); font-size: 15px; }
.manage-form textarea { resize: vertical; line-height: 1.7; min-height: 96px; }
.manage-form input:focus,
.manage-form textarea:focus,
#place-search:focus,
#plan-place-search:focus {
  outline: 2px solid rgba(212,168,164,0.35); border-color: var(--blush);
}
.manage-form input[type="file"] {
  font-size: 13px; padding: 6px 0; color: var(--ink-soft); font-family: var(--font-sans);
}
.manage-form input[type="date"] {
  min-height: 44px; appearance: none; -webkit-appearance: none;
}

.search-wrap { position: relative; }
/* 结果列表走正常文档流：绝对定位会被 .manage-scroll 的 overflow 裁掉，
   之前「搜索框展示不完整」就是这么来的 */
#search-results,
#plan-search-results {
  margin-top: 8px;
  max-height: min(320px, max(150px, calc(var(--vvh, 100dvh) - 210px)));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-soft);
}
.search-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; border: none; background: #fff; color: var(--ink);
  padding: 14px; font-size: 14px; line-height: 1.4; cursor: pointer;
  border-bottom: 1px solid #f0eeec; font-family: var(--font-sans);
  min-height: 48px; touch-action: manipulation;
}
.search-item-title { font-weight: 600; color: var(--graphite); }
.search-item-sub {
  font-size: 12px; color: var(--ink-soft); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item:active { background: #f7f5f3; }
.search-item.muted { color: var(--ink-faint); cursor: default; display: block; }

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
}
.photo-thumb img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); background: #efecea;
}
.photo-thumb.removing img { opacity: 0.3; filter: grayscale(1); }
.photo-thumb .remove-x {
  position: absolute; top: -4px; right: -4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #a85a52; color: #fff; font-size: 13px; line-height: 28px;
  text-align: center; cursor: pointer; padding: 0; border: none;
  touch-action: manipulation;
}

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
/* 第 2 步的动作条：面板底部固定一行，独立于滚动区 */
.manage-actions {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 12px max(16px, var(--safe-right)) calc(12px + var(--safe-bottom)) 22px;
  border-top: 1px solid var(--line); background: #fff;
}
.manage-actions.hidden { display: none !important; }
#save-btn, .manage-form button.secondary, .memory-item .actions button {
  border: none; border-radius: 999px; cursor: pointer;
  font-family: var(--font-sans); touch-action: manipulation;
}
#save-btn {
  min-height: 46px; padding: 10px 28px; background: var(--graphite); color: #fff;
  font-size: 13px; font-weight: 500; letter-spacing: 0.16em;
}
#save-btn:disabled, .manage-form button:disabled { opacity: 0.55; cursor: not-allowed; }
.manage-form button.secondary, button.secondary {
  background: #efecea; color: var(--ink); padding: 8px 16px; font-size: 12px;
}
.manage-form button.small, button.small { padding: 6px 12px; font-size: 12px; }
button.danger {
  background: #f3e8e6; color: #a85a52; padding: 6px 12px; font-size: 12px;
  border: none; border-radius: 999px; cursor: pointer; font-family: var(--font-sans);
}
#form-msg { margin-top: 12px; font-size: 13px; min-height: 18px; font-family: var(--font-sans); }
#form-msg.ok { color: #3d7a5a; }
#form-msg.err { color: #a85a52; }

.manage-list-section {
  margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line);
}
.manage-list-section h3 {
  font-family: var(--font-display); font-size: 17px; font-weight: 500;
  letter-spacing: 0.12em; color: var(--graphite); margin-bottom: 8px;
}
.manage-list-section h3 span { color: var(--blush-deep); font-size: 13px; letter-spacing: 0; }
.memory-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #f0eeec;
}
.memory-item:last-child { border-bottom: none; }
.memory-item img.cover, .memory-item .cover-placeholder {
  width: 48px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0;
}
.memory-item .cover-placeholder {
  background: #f4f3f1; display: flex; align-items: center; justify-content: center;
  color: var(--blush); font-size: 18px;
}
.memory-item .info { flex: 1; min-width: 0; }
.memory-item .info .t {
  font-family: var(--font-serif); font-size: 13.5px; font-weight: 600; color: var(--graphite);
}
.memory-item .info .s {
  font-family: var(--font-sans); font-size: 11.5px; color: var(--ink-soft); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.memory-item .actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty-tip {
  color: var(--ink-faint); font-family: var(--font-sans);
  font-size: 13px; padding: 12px 0; line-height: 1.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /*
   * Android 手势条 / 部分 WebView 常把 safe-area-inset-bottom 报成 0。
   * 手机端给底栏留至少 28px，避免图标被系统条挡住；真机有 inset 时取更大值。
   */
  :root {
    --safe-bottom: max(28px, constant(safe-area-inset-bottom, 0px));
    --safe-bottom: max(28px, env(safe-area-inset-bottom, 0px));
  }
  .mag-header, .desktop-stage, .desktop-fabs { display: none !important; }
  .mobile-hero, .story-rail { display: block; }
  .bottom-nav { display: grid; }
  /* 手机：ERA 细轨贴在横排小照片正下方，与照片条同组出现 */
  .time-scrub {
    left: max(14px, var(--safe-left));
    right: max(14px, var(--safe-right));
    width: auto;
    bottom: calc(var(--nav-h) + var(--safe-bottom) + 6px);
    opacity: 0.62;
    visibility: visible;
    pointer-events: none;
    z-index: 1060;
  }
  .time-scrub:hover,
  .time-scrub:focus-within,
  body.scrubbing .time-scrub,
  body.mode-map .time-scrub {
    opacity: 1;
  }
  .time-scrub-inner { pointer-events: auto; }
  body.mode-map .time-scrub-inner { pointer-events: auto; }
  .time-scrub-inner {
    grid-template-columns: auto auto 1fr auto;
    gap: 0 8px;
    padding: 3px 8px 4px;
    background: rgba(255, 255, 255, 0.62);
  }
  body.mode-map .time-scrub-inner {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 4px 16px rgba(44,44,44,0.08);
  }
  .time-scrub-label { font-size: 12px; min-width: 4.2em; }
  .time-scrub-ends { display: none; }
  .time-scrub-kicker { letter-spacing: 0.2em; }
  .story-rail {
    bottom: calc(var(--nav-h) + var(--safe-bottom) + 42px);
    height: 118px;
  }
  body.mode-map .story-rail {
    bottom: calc(var(--nav-h) + var(--safe-bottom) + 40px);
    height: 86px;
  }
  body.mode-map .story-card {
    flex: 0 0 min(26vw, 96px);
  }
}

@media (max-width: 640px) {
  #map { opacity: 0.7; }
  body.mode-map #map { opacity: 0.95; }
  .photo-pin-wrap { width: 70px; }
  .photo-pin { width: 40px; }
  .photo-pin-frame { width: 40px; height: 40px; }
  .photo-pin-label { max-width: 74px; }
  .photo-pin-place { font-size: 10.5px; }

  #timeline {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: min(58dvh, 480px);
    border-radius: 18px 18px 0 0;
    border-left: none; border-right: none; border-bottom: none;
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
  }
  #timeline.collapsed { transform: translateY(110%); opacity: 1; }
  .timeline-grip { display: block; }
  .timeline-handle {
    flex-direction: column; align-items: stretch; gap: 6px;
    padding-top: 10px; cursor: pointer;
  }
  .timeline-handle .timeline-grip { margin: 0 auto; }
  #timeline-close { position: absolute; right: 10px; top: 28px; }

  #manage-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    height: min(82dvh, 100%); max-height: min(82dvh, 100%);
    border-left: none; border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 48px rgba(44,44,44,0.14);
    transition: transform 0.4s var(--ease-out), height 0.28s ease, max-height 0.28s ease;
    padding-bottom: calc(var(--nav-h) * 0.3 + var(--safe-bottom));
  }
  #plan-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    height: min(72dvh, 100%); max-height: min(72dvh, 100%);
    border-left: none; border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 48px rgba(44,44,44,0.14);
    transition: transform 0.4s var(--ease-out), height 0.28s ease, max-height 0.28s ease;
    padding-bottom: calc(var(--nav-h) * 0.3 + var(--safe-bottom));
  }
  /* 屏幕本来就矮（横屏等）时几乎占满，否则表单没地方待 */
  body.short-view #manage-panel,
  body.short-view #plan-panel {
    height: min(96dvh, 100%); max-height: min(96dvh, 100%);
  }
  /* 只有主动「在地图上选点」时才收起，让地图露出来 */
  body.manage-peek #manage-panel { height: min(40dvh, 100%); max-height: min(40dvh, 100%); }
  body.plan-peek #plan-panel { height: min(40dvh, 100%); max-height: min(40dvh, 100%); }
  #manage-panel.hidden,
  #plan-panel.hidden { transform: translateY(110%); }
  /*
   * 输入法弹出：fixed 抽屉本来钉在 layout viewport 底部，会整块沉到键盘下面。
   * 抬到键盘之上，并按 visualViewport 的高度重新收缩。
   */
  body.kb-open #manage-panel,
  body.kb-open #plan-panel {
    bottom: var(--kb, 0px);
    height: calc(var(--vvh, 100dvh) - 6px);
    max-height: calc(var(--vvh, 100dvh) - 6px);
    padding-bottom: 0;
    transition: none;
  }
  .manage-actions { padding: 10px 16px calc(10px + var(--safe-bottom)); }
  #manage-panel::before,
  #plan-panel::before {
    content: ""; display: block; width: 40px; height: 4px;
    margin: 10px auto 0; border-radius: 999px;
    background: rgba(44,44,44,0.14); flex-shrink: 0;
  }
  .manage-head { padding: 8px 16px 10px; }
  .manage-head h2 { font-size: 20px; }
  .manage-stepper { padding: 8px 16px 10px; }
  .manage-search-block { padding: 0 0 12px; }
  .manage-scroll { padding: 4px 16px calc(32px + var(--safe-bottom)); }
  #place-search { min-height: 52px; }
  #search-results,
  #plan-search-results { max-height: min(300px, max(132px, calc(var(--vvh, 100dvh) - 250px))); }
  #map-crosshair { top: 22%; }
  body.manage-peek #map-crosshair { top: 24%; }
  body.plan-picking #map-crosshair { top: 24%; }
  #map-pick-bar { bottom: calc(40dvh + 10px + var(--safe-bottom)); }
  .memory-item { flex-wrap: wrap; }
  .memory-item .actions { width: 100%; justify-content: flex-end; }
  .memory-item .actions button { min-height: 40px; padding: 8px 14px; }

  #lightbox-prev, #lightbox-next {
    top: auto; bottom: max(28px, calc(var(--safe-bottom) + 16px)); transform: none;
  }

  /* desktop story on tablet-ish phones still use magazine split */
  .story-editorial { padding-bottom: 14px; }
  #panel-title { font-size: clamp(32px, 9vw, 44px); }
}

@media (min-width: 901px) {
  .mobile-hero, .story-rail, .bottom-nav { display: none !important; }
  .mag-header { display: flex; }
  .desktop-stage { display: block; }
  .desktop-fabs { display: flex; }
  body.mode-plans .desktop-stage { display: none; }
  .plans-view {
    top: max(100px, calc(var(--safe-top) + 88px));
    bottom: max(28px, var(--safe-bottom));
    left: clamp(40px, 5vw, 72px);
    right: clamp(40px, 5vw, 72px);
    padding: 0;
  }
  .plans-chrome { max-width: 300px; }
  .plans-rail { max-width: 560px; }
  .plan-detail {
    left: clamp(40px, 5vw, 72px);
    right: auto;
    bottom: max(28px, var(--safe-bottom));
    width: min(400px, 36vw);
  }
  .plan-pin-wrap { width: 80px; }
  .plan-pin { width: 48px; height: 48px; }
  .plan-pin-label { max-width: 88px; }
  .plan-pin-place { font-size: 12px; }

  /* B-desktop：地图更清晰，精选卡浮于其上（仅用 opacity，避免整图 filter） */
  #map { opacity: 0.9; }
  body.mode-map #map,
  body.mode-plans #map { opacity: 0.98; }
  #map-veil {
    background:
      radial-gradient(ellipse at 40% 35%, rgba(247, 246, 244, 0.08) 0%, transparent 50%),
      linear-gradient(180deg,
        rgba(247, 246, 244, 0.18) 0%,
        rgba(247, 246, 244, 0.04) 40%,
        rgba(247, 246, 244, 0.35) 78%,
        var(--paper) 96%);
  }
  body.mode-map #map-veil { opacity: 0.1; }

  /* 桌面：无照片条，ERA 仍为刊头下独立细轨（不破坏精选卡） */
  .time-scrub {
    top: max(96px, calc(var(--safe-top) + 86px));
    right: clamp(40px, 5vw, 72px);
    left: auto;
    bottom: auto;
    width: min(300px, 26vw);
    opacity: 0.38;
    z-index: 1180;
  }
  body.mode-map .time-scrub {
    top: max(96px, calc(var(--safe-top) + 86px));
    right: clamp(40px, 5vw, 72px);
    left: auto;
    transform: none;
    width: min(340px, 30vw);
    opacity: 0.5;
  }
  .time-scrub-inner {
    padding: 4px 10px 5px 12px;
    border-radius: 2px;
  }
  .time-scrub-label { font-size: 13px; }

  .photo-pin-wrap { width: 80px; }
  .photo-pin { width: 50px; }
  .photo-pin-frame { width: 50px; height: 50px; }
  .photo-pin-label { max-width: 88px; }
  .photo-pin-place { font-size: 12px; }

  body.manage-open #map-crosshair { left: calc(50% - min(200px, 50vw)); }
  body.manage-open #map-pick-bar {
    left: calc(50% - min(200px, 50vw)); bottom: 28px;
  }
  #manage-panel {
    width: min(420px, 36vw);
  }
  .us-sheet {
    left: auto; right: max(28px, var(--safe-right));
    bottom: max(100px, calc(var(--safe-bottom) + 80px));
    width: min(360px, 32vw); border-radius: var(--radius);
    padding-bottom: 0; max-height: min(70vh, 520px);
  }
  .us-sheet.collapsed { transform: translateY(12px); opacity: 0; }

  /* story panel desktop: elegant two-column magazine */
  #panel.story-magazine {
    flex-direction: row; background: var(--paper);
  }
  .story-top {
    position: absolute; top: 0; left: 0; right: 0;
    background: transparent; mix-blend-mode: normal;
  }
  .story-editorial {
    width: min(440px, 36vw); flex-shrink: 0;
    display: flex; flex-direction: column; justify-content: center;
    padding: 100px 44px 48px;
    border-right: 1px solid var(--line);
    overflow-y: auto;
    max-height: none;
  }
  .story-hero { flex: 1; }
  #panel-title { font-size: 46px; }
  .comments-section { max-width: 100%; }
  .comments-list { max-height: min(32vh, 260px); }
}

@media (min-width: 1280px) {
  .feature-card {
    width: min(620px, 48vw);
  }
  .feature-body { padding: 26px 28px 10px; min-height: 260px; }
  .feature-media { min-height: 260px; }
  #feature-title { font-size: 30px; }
}

@media (max-height: 480px) {
  .mobile-sub, .mobile-stats { display: none; }
  #mobile-brand { font-size: 30px; }
  .story-rail { height: 100px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 38px); }
  .story-card { height: 86px; flex-basis: min(28vw, 100px); width: min(28vw, 100px); }
  .story-editorial { padding-top: 4px; padding-bottom: 8px; }
  #panel-title { font-size: 28px; }
}

/* ---------- 2026 refinement: clarity, touch comfort and calm motion ---------- */
@media (max-width: 640px) {
  .story-track {
    gap: 8px;
    padding-left: max(18px, var(--safe-left));
    padding-right: max(18px, var(--safe-right));
  }
  .story-card {
    flex-basis: min(31vw, 112px);
    width: min(31vw, 112px);
    border-radius: 8px;
  }
  body.mode-map .story-card {
    flex-basis: min(28vw, 100px);
  }
  .photo-pin-wrap { width: 62px; }
  .photo-pin-label { max-width: 62px; }
  .photo-pin-place {
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .photo-pin-date { display: none; }
  .plans-chrome { max-width: min(82vw, 300px); }
  .plan-pin-label { max-width: 70px; }
  .plan-pin-place {
    max-width: 70px;
    -webkit-line-clamp: 1;
  }
  .plan-pin-date { display: none; }
  .plan-detail-actions .us-btn { flex: 1 1 110px; }
}

/* Mobile WebViews have a much smaller compositing budget than desktop Chrome. */
@media (max-width: 900px) {
  #map,
  #map-veil { transition: none; }
  .plans-chrome,
  .time-scrub-inner,
  .ghost-btn,
  #manage-unlock,
  #member-pick {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .plans-chrome,
  .time-scrub-inner { background: rgba(255, 255, 255, 0.94); }
  .photo-pin,
  .story-card,
  .plan-pin { contain: layout paint style; }
}

body.module-loading::before {
  content: "";
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 42%;
  height: 2px;
  background: var(--blush-deep);
  box-shadow: 0 0 10px rgba(196, 143, 138, 0.35);
  animation: module-progress 0.8s var(--ease-out) infinite alternate;
}

@keyframes module-progress {
  from { transform: translateX(-20%); opacity: 0.55; }
  to { transform: translateX(160%); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .photo-pin.is-featured::before { display: none; }
}
