/* ---------- 去过的地方 · styles ---------- */

:root {
  --paper: #f7f4ee;
  --card: #fffdf8;
  --ink: #26211d;
  --ink-2: #5a5049;
  --muted: #7a6f65;
  --line: #e4dcd1;
  --line-soft: #efe8de;
  --accent: #b4562f;
  --accent-ink: #8a3d1e;
  --accent-soft: #f4e7df;
  --shadow-sm: 0 1px 2px rgba(38, 33, 29, 0.06);
  --shadow-md: 0 2px 6px rgba(38, 33, 29, 0.06), 0 14px 32px -18px rgba(38, 33, 29, 0.28);
  --shadow-lg: 0 -8px 40px -12px rgba(38, 33, 29, 0.25);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body.locked { overflow: hidden; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

img { display: block; max-width: 100%; }

/* ---------- 骨架 ---------- */

#app {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  min-height: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-t) + 14px) 18px 12px;
  background: linear-gradient(to bottom, var(--paper) 72%, rgba(247, 244, 238, 0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.brand {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 400;
  margin-top: 1px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: background 0.18s;
}
.icon-btn:hover { background: rgba(38, 33, 29, 0.06); }
.icon-btn svg { width: 20px; height: 20px; }

main { position: relative; }

.view { display: none; }
.view.active { display: block; }

/* ---------- 时间线（编年） ---------- */

#view-timeline {
  padding: 4px 16px calc(120px + var(--safe-b));
}

.chron { position: relative; }

/* 时间线的背景：一张照片压成底纹 */
.tl-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.tl-bg.on { opacity: 1; }
.tl-tiles {
  position: absolute;
  inset: -2px;
  display: grid;
  gap: 2px;
  opacity: 0.55;
  filter: blur(1.6px) saturate(0.85);
}
.tl-tiles i {
  display: block;
  background: center / cover no-repeat;
}
.tl-bg-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 62% at 50% 34%, rgba(247, 244, 238, 0.84), rgba(247, 244, 238, 0.58) 100%);
}

/* 贯穿的那根线 */
.spine {
  position: absolute;
  left: 50px;
  top: 6px;
  bottom: 8px;
  width: 1px;
  background: #ded5c8;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  pointer-events: none;
}

.entry {
  display: flex;
  padding: 15px 0 17px;
  position: relative;
  cursor: pointer;
  transition: opacity 0.15s;
}
.entry + .entry { border-top: 1px solid var(--line-soft); }
.entry.same { border-top: 0; padding-top: 2px; }
.entry:active { opacity: 0.65; }

/* 左列：年 / 月.日 */
.entry .d {
  width: 50px;
  flex: none;
  text-align: right;
  padding-right: 10px;
  padding-top: 1px;
}
.entry .d .y {
  display: block;
  font-size: 9.5px;
  color: #a99d90;
  letter-spacing: 0.08em;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.entry .d .md {
  display: block;
  font-family: var(--serif);
  font-size: 14.5px;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.entry.same .d { visibility: hidden; }

/* 线上的节点 */
.entry .node {
  position: absolute;
  left: 46.5px;
  top: 21px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid #c9bdb0;
  z-index: 2;
}
.entry .node.solid {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 86, 47, 0.12);
}

.entry .c {
  flex: 1;
  min-width: 0;
  padding-left: 13px;
}

.entry .tt {
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.34;
  font-weight: 600;
  margin: 0 0 3px;
  letter-spacing: 0.01em;
  word-break: break-word;
}
.entry .mt {
  font-size: 10.5px;
  color: #8a7f74;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.entry .note {
  margin: 0 0 9px;
  font-size: 12.5px;
  line-height: 1.72;
  color: #5a5049;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.entry .strip {
  display: flex;
  gap: 5px;
  align-items: center;
}
.entry .strip i {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: block;
  background: var(--accent-soft) center/cover no-repeat;
  flex: none;
}
.entry .strip .more {
  height: 44px;
  min-width: 44px;
  border-radius: 6px;
  background: var(--line-soft);
  color: #8a7f74;
  font-size: 10.5px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  flex: none;
}

/* ---------- 空状态 ---------- */

.empty {
  padding: 68px 28px;
  text-align: center;
}
.empty .glyph {
  font-family: var(--serif);
  font-size: 44px;
  color: var(--line);
  line-height: 1;
  margin-bottom: 18px;
}
.empty h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.empty p {
  margin: 0 auto;
  max-width: 300px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- 地图 ---------- */

#view-map { padding: 0; }

#map {
  height: calc(100vh - 145px - var(--safe-t) - var(--safe-b));
  height: calc(100dvh - 145px - var(--safe-t) - var(--safe-b));
  min-height: 300px;
  width: 100%;
  background: var(--line-soft);
  z-index: 1;
}

.map-note {
  position: absolute;
  left: 50%;
  bottom: calc(100px + var(--safe-b));
  transform: translateX(-50%);
  background: rgba(38, 33, 29, 0.82);
  color: #f7f4ee;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  white-space: nowrap;
}
.map-note.show { opacity: 1; }

.pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #fffdf8;
  box-shadow: 0 1px 6px rgba(38, 33, 29, 0.4);
}

/* 地图上的照片图钉 */
.photo-pin {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fffdf8;
  box-shadow: 0 2px 10px rgba(38, 33, 29, 0.45);
  background-size: cover;
  background-position: center;
  transition: transform 0.15s ease;
}
.photo-pin:active { transform: scale(0.92); }

.leaflet-popup-content-wrapper {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.leaflet-popup-content { margin: 10px 12px; font-family: var(--sans); }
.leaflet-popup-tip { background: var(--card); }
.pop-title { font-family: var(--serif); font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.pop-meta { font-size: 11.5px; color: var(--muted); letter-spacing: 0.03em; }
.pop-img { width: 150px; height: 92px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }

/* ---------- 照片墙（一张可以四处拖的纸） ---------- */

#view-grid { padding: 0; position: relative; }

#canvas-stage {
  position: relative;
  height: calc(100vh - 145px - var(--safe-t) - var(--safe-b));
  height: calc(100dvh - 145px - var(--safe-t) - var(--safe-b));
  min-height: 320px;
  overflow: hidden;
  touch-action: none;
  background: #e2d8c7;
  cursor: grab;
}
#canvas-stage.dragging { cursor: grabbing; }

#canvas-board {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  background: var(--paper);
  background-image: radial-gradient(rgba(90, 80, 73, 0.085) 1px, transparent 1.3px);
  background-size: 26px 26px;
  box-shadow: 0 18px 46px -22px rgba(38, 33, 29, 0.42), 0 0 0 1px rgba(38, 33, 29, 0.07);
}

.zone {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(90, 80, 73, 0.2);
}
.zone span {
  position: absolute;
  left: 22px;
  top: -28px;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0.1em;
  color: rgba(90, 80, 73, 0.42);
}

.cshot {
  position: absolute;
  padding: 6px 6px 0;
  border: 0;
  border-radius: 3px;
  background: var(--card);
  text-align: left;
  box-shadow: 0 1px 2px rgba(38, 33, 29, 0.12), 0 14px 30px -22px rgba(38, 33, 29, 0.6);
  overflow: hidden;
}
.cshot .ph {
  overflow: hidden;
  background: var(--accent-soft) center/cover no-repeat;
}
.cshot .cap {
  padding: 7px 3px 9px;
  overflow: hidden;
}
.cshot .cap b {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cshot .cap i {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 1px;
}

.canvas-tools {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  display: flex;
  gap: 6px;
}
.chip {
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: rgba(255, 253, 248, 0.9);
  padding: 7px 13px;
  border-radius: 999px;
  box-shadow: 0 6px 18px -12px rgba(38, 33, 29, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.14s ease;
}
.chip:active { transform: scale(0.95); }

.canvas-mini {
  position: absolute;
  left: 12px;
  bottom: 14px;
  z-index: 5;
  width: 54px;
  height: 62px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 10px 24px -14px rgba(38, 33, 29, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.canvas-mini .mini-map {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: #f2ece2;
  overflow: hidden;
}
.canvas-mini .d {
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  border-radius: 1px;
  background: rgba(90, 80, 73, 0.35);
}
.canvas-mini .frame {
  position: absolute;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
}

.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #fffaf2;
  background: rgba(38, 33, 29, 0.78);
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.35s;
}
.canvas-hint.gone { opacity: 0; }

.canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 28px;
}
.canvas-empty .glyph {
  font-family: var(--serif);
  font-size: 44px;
  color: rgba(90, 80, 73, 0.28);
  line-height: 1;
  margin-bottom: 16px;
}
.canvas-empty h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.canvas-empty p {
  margin: 0;
  max-width: 300px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  z-index: 40;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(760px, 100%);
  display: flex;
  padding: 8px 14px calc(8px + var(--safe-b));
  gap: 6px;
  background: var(--paper);
  border-top: 1px solid var(--line-soft);
  box-shadow: 0 -6px 18px -14px rgba(38, 33, 29, 0.5);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0 4px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  transition: color 0.18s;
}
.tab svg { width: 21px; height: 21px; }
.tab.on { color: var(--accent); }

.fab {
  position: fixed;
  z-index: 41;
  right: max(18px, calc(50% - 362px));
  bottom: calc(84px + var(--safe-b));
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff8f2;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px -6px rgba(180, 86, 47, 0.72);
  transition: transform 0.16s ease, box-shadow 0.16s;
}
.fab:active { transform: scale(0.93); }
.fab svg { width: 24px; height: 24px; }
#view-map.active ~ .fab,
body[data-view="map"] .fab { bottom: calc(84px + var(--safe-b)); }

/* ---------- 通用按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 14px;
  letter-spacing: 0.03em;
  background: var(--line-soft);
  color: var(--ink-2);
  transition: opacity 0.16s, background 0.16s;
}
.btn:active { opacity: 0.75; }
.btn.primary { background: var(--accent); color: #fff8f2; font-weight: 500; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { color: #a4372a; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

/* ---------- 底部面板 ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(38, 33, 29, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  z-index: 51;
  left: 50%;
  bottom: 0;
  width: min(560px, 100%);
  max-height: calc(94vh - var(--safe-t));
  transform: translate(-50%, 102%);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet.open { transform: translate(-50%, 0); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.sheet-head h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.03em;
}
.sheet-head .close {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 4px;
}

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px calc(24px + var(--safe-b));
  flex: 1;
}

.sheet-foot {
  padding: 12px 18px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 10px;
  flex: none;
  background: var(--paper);
}
.sheet-foot .btn { flex: 1; }

/* ---------- 表单 ---------- */

.field { margin-bottom: 20px; }
.field.two { display: flex; gap: 10px; }
.field.two > div { flex: 1; min-width: 0; }
.field > label {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 7px;
}

.input, .textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 13px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 86, 47, 0.12);
}
.input::placeholder, .textarea::placeholder { color: #b3a89d; }
.input[type="date"] { min-height: 46px; }

.textarea {
  min-height: 108px;
  line-height: 1.75;
  resize: vertical;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 7px;
}

/* 照片选择 */
.photo-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.photo-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.photo-actions .btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 13.5px;
}
.photo-row:empty { display: none; }
.photo-row:empty + .photo-actions { margin-top: 0; }

.photo-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--accent-soft) center/cover no-repeat;
  position: relative;
  overflow: hidden;
}
.photo-cell .rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: rgba(38, 33, 29, 0.68);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
  backdrop-filter: blur(2px);
}
.photo-cell .stars {
  position: absolute;
  bottom: 3px;
  left: 3px;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(38, 33, 29, 0.55);
  border-radius: 4px;
  padding: 1px 4px;
}

/* 封面星标 */
.photo-cell .star {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(38, 33, 29, 0.52);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.16s, color 0.16s, transform 0.16s;
}
.photo-cell.cover .star {
  background: var(--accent);
  color: #fff8f2;
}
.photo-cell.cover { outline: 2px solid var(--accent); outline-offset: -2px; }

/* 地图选点 */
.picker-map {
  height: 190px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line-soft);
  z-index: 0;
}
.addr-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.addr-line .coord { font-variant-numeric: tabular-nums; }

/* ---------- 详情页（一篇） ---------- */

.detail {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--paper);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}
.detail.open { transform: translateY(0); }

.detail-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-t) + 10px) 14px 12px;
  background: linear-gradient(to bottom, rgba(247, 244, 238, 0.96) 55%, rgba(247, 244, 238, 0));
}
.detail-bar .btn { padding: 8px 14px; font-size: 13px; }

/* 背景：拿一张照片模糊铺满 */
.pg-fixed {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.pg-bg {
  position: absolute;
  inset: -44px;
  background: center / cover no-repeat;
  filter: blur(26px) saturate(1.05);
  transform: scale(1.12);
}
.pg-wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(247, 244, 238, 0.7),
    rgba(247, 244, 238, 0.87) 38%,
    rgba(247, 244, 238, 0.965)
  );
}

.pg-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 2px 18px calc(64px + var(--safe-b));
}

.pg-title {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: 0.01em;
  word-break: break-word;
}
.pg-meta {
  font-size: 11.5px;
  color: #6b6058;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.pg-note {
  font-size: 14.5px;
  line-height: 1.9;
  color: #4a423c;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 18px;
}

/* 照片：拼贴 */
.pg-wall {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 46px;
  gap: 3px;
  grid-auto-flow: dense;
}
.pg-wall button {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  background: var(--accent-soft) center / cover no-repeat;
  padding: 0;
}
.pg-wall button:active { opacity: 0.82; }
.pg-wall button.bg-on::after {
  content: "背景";
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 8px;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(38, 33, 29, 0.55);
  border-radius: 4px;
  padding: 1px 4px;
}

/* ---------- 灯箱 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #16120f;
  display: none;
  flex-direction: column;
}
.lightbox.open { display: flex; }
.lb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--safe-t) + 10px) 16px 8px;
  color: #d8cfc5;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  flex: none;
}
.lb-top button { color: #d8cfc5; font-size: 22px; line-height: 1; padding: 4px 8px; }
.lb-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 0;
}
.lb-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 22px 26px 26px;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 60px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  user-select: none;
}
.lb-nav.prev { left: 0; }
.lb-nav.next { right: 0; }

/* ---------- 设置项 ---------- */

.set-list { display: flex; flex-direction: column; }
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  width: 100%;
}
.set-row:last-child { border-bottom: 0; }
.set-row .t { font-size: 14.5px; }
.set-row .d { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.set-row .chev { color: var(--line); font-size: 16px; flex: none; }
.set-row.danger .t { color: #a4372a; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 13px 10px;
  text-align: center;
}
.stat .v {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.15;
  color: var(--ink);
}
.stat .k { font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); margin-top: 3px; }

/* ---------- 批量导入 ---------- */

.imp-veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(38, 33, 29, 0.44);
  display: grid;
  place-items: center;
  padding: 22px;
}

.imp-card {
  width: min(400px, 100%);
  background: var(--paper);
  border-radius: 18px;
  padding: 20px 20px 16px;
  box-shadow: 0 24px 60px -24px rgba(38, 33, 29, 0.5);
}
.imp-card h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 0.03em;
}
.imp-card p {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.imp-card p b { color: var(--accent-ink); font-weight: 600; }

.imp-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--line-soft);
  overflow: hidden;
  margin: 4px 0 10px;
}
.imp-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}

.imp-note {
  font-size: 12px;
  color: var(--muted);
  min-height: 17px;
  margin: 0 0 6px !important;
}

.imp-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.imp-actions .btn { padding: 10px 16px; font-size: 13.5px; }

/* ---------- 提示条 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(104px + var(--safe-b));
  transform: translate(-50%, 12px);
  z-index: 90;
  background: rgba(38, 33, 29, 0.92);
  color: #f7f4ee;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
  max-width: 84vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 桌面 ---------- */

@media (min-width: 720px) {
  body { font-size: 15px; }
  #view-timeline { padding-left: 24px; padding-right: 24px; }
  .detail-title { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- 同步 ---------- */

.sync-box {
  border: 1px solid var(--line-soft);
  background: var(--card);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 18px;
}
.sync-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  margin-bottom: 11px;
}
.sync-badge {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--line-soft);
  padding: 3px 9px;
  border-radius: 999px;
  flex: none;
}
.sync-badge.on { color: var(--accent-ink); background: var(--accent-soft); }
#sync-setup .input { margin-bottom: 8px; font-size: 13.5px; }
#sync-setup .btn { width: 100%; padding: 10px; font-size: 13.5px; }
.sync-btns { display: flex; gap: 8px; }
.sync-btns .btn { flex: 1; padding: 10px; font-size: 13.5px; }
#sync-state { margin: 0 0 10px; }

/* ---------- 备份提醒 ---------- */

.backup-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 2px 0 12px;
  background: var(--accent-soft);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--accent-ink);
  line-height: 1.5;
}
.backup-tip span { flex: 1; min-width: 0; }
.backup-tip button {
  flex: none;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff8f2;
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ---------- 桌面：左右分栏 ---------- */

.tl-split { display: block; }

.pane { display: none; }

@media (min-width: 900px) {
  #app { max-width: 1200px; }
  .entry .strip i {
    width: 58px;
    height: 58px;
  }
  .tabbar { width: min(1200px, 100%); }
  .fab { right: max(20px, calc(50% - 580px)); }
  .tl-bg {
    left: 50%;
    right: auto;
    width: min(1200px, 100%);
    transform: translateX(-50%);
  }
  #view-timeline {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4px 28px 40px;
  }
  .tl-split {
    display: grid;
    grid-template-columns: 384px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  .pane {
    display: block;
    position: sticky;
    top: 78px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-md);
    min-height: 420px;
  }
  .pane-bg {
    position: absolute;
    inset: -40px;
    background: center / cover no-repeat;
    filter: blur(26px) saturate(1.05);
    transform: scale(1.1);
  }
  .pane-wash {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(247, 244, 238, 0.68),
      rgba(247, 244, 238, 0.88) 38%,
      rgba(247, 244, 238, 0.955)
    );
  }
  .pane-scroll {
    position: relative;
    z-index: 1;
    max-height: calc(100vh - 132px);
    overflow-y: auto;
    padding: 20px 22px 28px;
  }
  .pane-empty {
    position: relative;
    z-index: 1;
    padding: 120px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.9;
  }
  .pane-empty .g { font-family: var(--serif); font-size: 34px; color: var(--line); display: block; margin-bottom: 10px; }
  .pane-edit {
    float: right;
    font-size: 12px;
    color: var(--accent);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 11px;
    margin-top: 2px;
  }
  .entry.sel { background: rgba(180, 86, 47, 0.055); }
  .entry.sel .tt { color: var(--accent-ink); }


}

/* 背景浓淡 */
.tune-box {
  margin: 0 0 18px;
  padding: 13px 15px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--card);
}
.tune-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  letter-spacing: 0.03em;
  margin-bottom: 11px;
}
.tune-val {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tune-range {
  width: 100%;
  height: 22px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  display: block;
}
.tune-range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}
.tune-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9.5px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper);
  box-shadow: 0 2px 8px -2px rgba(60, 40, 20, 0.45);
}
.tune-range::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}
.tune-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper);
}
.tune-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 5px;
}

/* 背景照片太暗时，字自动翻白 */
body[data-view="timeline"].bg-dark .topbar {
  background: linear-gradient(to bottom, rgba(22, 18, 15, 0.93) 62%, rgba(22, 18, 15, 0));
}
body[data-view="timeline"].bg-dark .brand { color: #f7f2ec; }
body[data-view="timeline"].bg-dark .brand small { color: rgba(246, 241, 234, 0.7); }
body[data-view="timeline"].bg-dark .icon-btn { color: rgba(246, 241, 234, 0.82); }
body[data-view="timeline"].bg-dark #search { color: #f7f2ec; }
body[data-view="timeline"].bg-dark #search::placeholder { color: rgba(246, 241, 234, 0.5); }
body[data-view="timeline"].bg-dark .entry .tt { color: #f7f2ec; }
body[data-view="timeline"].bg-dark .entry .mt { color: rgba(246, 241, 234, 0.66); }
body[data-view="timeline"].bg-dark .entry .note { color: rgba(246, 241, 234, 0.84); }
body[data-view="timeline"].bg-dark .entry .d .y { color: rgba(246, 241, 234, 0.5); }
body[data-view="timeline"].bg-dark .entry .d .md { color: #f0a87e; }
body[data-view="timeline"].bg-dark .entry .node {
  background: #2a2521;
  border-color: rgba(246, 241, 234, 0.5);
}
body[data-view="timeline"].bg-dark .entry .node.solid {
  background: #f0a87e;
  border-color: #f0a87e;
  box-shadow: 0 0 0 3px rgba(240, 168, 126, 0.2);
}
body[data-view="timeline"].bg-dark .spine { background: rgba(246, 241, 234, 0.34); }
body[data-view="timeline"].bg-dark .entry + .entry { border-color: rgba(246, 241, 234, 0.15); }
body[data-view="timeline"].bg-dark .entry .strip .more {
  background: rgba(246, 241, 234, 0.16);
  color: rgba(246, 241, 234, 0.82);
}
body[data-view="timeline"].bg-dark .entry.sel { background: rgba(246, 241, 234, 0.1); }
body[data-view="timeline"].bg-dark .backup-tip {
  background: rgba(246, 241, 234, 0.12);
  color: rgba(246, 241, 234, 0.9);
}
body[data-view="timeline"].bg-dark .tabbar {
  background: rgba(24, 20, 17, 0.93);
  border-top-color: rgba(246, 241, 234, 0.12);
}
body[data-view="timeline"].bg-dark .tab { color: rgba(246, 241, 234, 0.55); }
body[data-view="timeline"].bg-dark .tab.on { color: #f0a87e; }

/* ---------- 照片墙（可拖动的拼贴） ---------- */

.legacy-canvas { display: none !important; }

#view-grid {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: none;
}
#view-grid.active { display: block; }

.wall-head {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--topbar-h, 77px);
  z-index: 6;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px 10px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.05em;
  background: linear-gradient(to bottom, rgba(247, 244, 238, 0.97) 60%, rgba(247, 244, 238, 0));
  pointer-events: none;
}
.wall-head small {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.wall-pan {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--topbar-h, 77px) + 46px);
  bottom: 74px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.wall-pan.dragging { cursor: grabbing; }

.wall-grid {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 6), var(--tile, 96px));
  grid-auto-rows: var(--tile, 96px);
  gap: 3px;
  grid-auto-flow: dense;
  will-change: transform;
}

.wt {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
  background: var(--accent-soft) center / cover no-repeat;
  transition: opacity 0.15s;
}
.wt:active { opacity: 0.8; }
.wt.big::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.46), transparent 42%);
}
.wt b {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  z-index: 2;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.wall-empty {
  padding: 90px 24px;
  text-align: center;
  color: var(--muted);
}
.wall-empty .glyph { font-size: 30px; color: var(--line); margin-bottom: 12px; }
.wall-empty h2 { font-family: var(--serif); font-size: 19px; color: var(--ink); margin: 0 0 8px; font-weight: 600; }
.wall-empty p { font-size: 13px; line-height: 1.9; margin: 0; }

/* ---------- 零碎 ---------- */

[hidden] { display: none !important; }

.search-wrap { margin-bottom: 2px; }
.search-wrap .input {
  background: transparent;
  border-color: transparent;
  padding: 9px 12px;
  font-size: 14px;
}
.search-wrap .input:focus {
  background: var(--card);
  border-color: var(--line);
}
.search-wrap .input::-webkit-search-cancel-button { -webkit-appearance: none; }

.set-row .t, .set-row .d { display: block; }
.set-row > span:first-child { min-width: 0; }

.sheet-foot .btn.danger {
  flex: 0 0 auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* ================= 桌面端专项（放最后，覆盖前面） ================= */

@media (min-width: 900px) {
  /* 导航：底部 tabbar 改成顶上一条胶囊 */
  .tabbar {
    left: 50%;
    right: auto;
    top: 13px;
    bottom: auto;
    transform: translateX(-50%);
    width: auto;
    padding: 4px;
    gap: 2px;
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    box-shadow: 0 8px 22px -14px rgba(38, 33, 29, 0.55);
  }
  .tab {
    flex: none;
    flex-direction: row;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  .tab svg { width: 15px; height: 15px; }
  .tab.on { background: var(--accent-soft); }

  /* 新建按钮：不再压着底栏 */
  .fab { bottom: 30px; }

  /* 弹窗：底部抽屉 → 居中卡片 */
  .sheet {
    top: 50%;
    bottom: auto;
    width: min(640px, calc(100% - 80px));
    max-height: min(780px, calc(100vh - 90px));
    border-radius: 20px;
    transform: translate(-50%, -46%);
    opacity: 0;
    transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
  }
  .sheet.open {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  .sheet-head { border-radius: 20px 20px 0 0; }
  .sheet-body { padding-bottom: 26px; }
}
/* 灯箱顶部动作 */
.lb-acts { display: flex; align-items: center; gap: 12px; }
#lb-del {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(255, 253, 248, 0.3);
  border-radius: 8px;
  padding: 5px 12px;
}
#lb-del:active { background: rgba(255, 253, 248, 0.14); }
@media (hover: hover) {
  #lb-del:hover { color: #fffdf8; border-color: rgba(255, 253, 248, 0.55); }
}
/* ================= 照片墙 · 挂在绳子上 ================= */

#wall-grid {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
}
#wall-grid svg.wall-ropes {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  overflow: visible;
}

#wall-grid .wt {
  position: absolute;
  display: block;
  background: #fffdf8;
  border-radius: 1px;
  padding: 5px;
  transform-origin: 50% 0;
  box-shadow: 0 4px 10px -4px rgba(60, 45, 30, 0.45), 0 1px 2px rgba(60, 45, 30, 0.18);
  cursor: pointer;
  transition: opacity 0.15s;
}
#wall-grid .wt .win {
  display: block;
  background: #eee center / 100% 100% no-repeat;
}
#wall-grid .wt .lip { display: block; height: 14px; }
#wall-grid .wt:active { opacity: 0.82; }

#wall-grid .wall-clip {
  position: absolute;
  width: 14px;
  height: 32px;
  border-radius: 3px;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(100deg, #e0c197 0%, #cfa877 42%, #a97a4d 58%, #d3ab7b 100%);
  box-shadow: 0 3px 6px -2px rgba(55, 38, 20, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
#wall-grid .wall-clip::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: 13px;
  height: 5px;
  background: linear-gradient(180deg, #c3bcb1, #8b8478 70%, #a8a196);
  box-shadow: 0 1px 1px rgba(60, 45, 30, 0.3);
}
#wall-grid .wall-clip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  bottom: 2px;
  width: 1px;
  margin-left: -0.5px;
  background: rgba(90, 62, 35, 0.55);
}

#wall-grid .wall-pin {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #f3ead9, #c0ab8c 55%, #8d785c);
  box-shadow: 0 2px 4px rgba(55, 38, 20, 0.5), inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}
/* ================= 地图上的城市卡 ================= */

.city-marker { background: none; border: none; }

.city-card {
  background: #fffdf8;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 8px 20px -10px rgba(50, 35, 20, 0.65), 0 2px 6px rgba(50, 35, 20, 0.18);
  border: 1px solid #e8e0d4;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.city-card:hover { transform: translateY(-2px); }
.city-card .cc-img {
  border-radius: 6px;
  background: #eee center / cover no-repeat;
}
.city-card .cc-name {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-top: 5px;
  letter-spacing: 0.04em;
}
.city-card .cc-n {
  font-size: 9.5px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

/* 墙标题栏里的返回 */
.wall-head .wh-right {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.cb-back {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 10px;
  background: rgba(255, 253, 248, 0.85);
}
/* ================= 时间线 · 背景更明显之后的字色 ================= */

#view-timeline .entry .tt {
  color: #191410;
  text-shadow: 0 1px 0 rgba(255, 253, 248, 0.55);
}
#view-timeline .entry .note { color: #463d36; }
#view-timeline .entry .mt { color: #6f6459; }
#view-timeline .entry .d .y { color: #94887a; }
#view-timeline .entry .d .md { color: #a4481f; }
#view-timeline .entry .node { border-color: #b9ac9c; }
#view-timeline .spine { background: #d3c8b8; }
#view-timeline .entry + .entry { border-color: #e0d7c9; }
#view-timeline .search-wrap .input { color: #2a231d; }
#view-timeline .search-wrap .input::placeholder { color: #9d9184; }
/* ================= 时间线 · 批量设置 ================= */

.pickbar {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: calc(84px + var(--safe-b));
  transform: translateX(-50%);
  width: min(680px, calc(100% - 28px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(38, 33, 29, 0.94);
  border-radius: 14px;
  box-shadow: 0 10px 30px -12px rgba(38, 33, 29, 0.6);
}
.pickbar .pk-n {
  flex: 1;
  font-size: 13px;
  color: #f7f2ec;
  letter-spacing: 0.04em;
}
.pickbar .pk-btn {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff8f2;
}
.pickbar .pk-btn.ghost {
  background: transparent;
  border: 1px solid rgba(247, 242, 236, 0.35);
  color: rgba(247, 242, 236, 0.9);
}

/* 选择态 */
body.picking .entry { cursor: pointer; }
body.picking .entry .c { padding-left: 30px; }
body.picking .entry::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 20px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #c9bdb0;
  background: var(--paper);
}
body.picking .entry.picked::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 86, 47, 0.15);
}
body.picking .entry.picked { background: rgba(180, 86, 47, 0.07); }
#btn-pick-mode.on { color: var(--accent); border-color: var(--accent); }

/* 弹层 */
.pickmodal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(30, 24, 20, 0.45);
  padding: 20px;
}
.pm-card {
  width: min(360px, 100%);
  background: var(--paper);
  border-radius: 16px;
  padding: 20px 20px 16px;
  box-shadow: 0 24px 60px -24px rgba(30, 24, 20, 0.7);
}
.pm-card h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 0 0 4px;
  font-weight: 600;
}
.pm-sub { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.pm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}
.pm-row span { width: 36px; color: var(--muted); flex: none; }
.pm-row input {
  flex: 1;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
}
.pm-tip { font-size: 11px; color: var(--muted); margin: 2px 0 14px; }
.pm-btns { display: flex; gap: 10px; justify-content: flex-end; }
.search-wrap { display: flex; align-items: center; gap: 8px; }
.search-wrap .input { flex: 1; min-width: 0; }
.pick-toggle {
  flex: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(255, 253, 248, 0.7);
}

/* 照片墙缩放 */
.wall-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}
.wall-zoom button {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1;
  height: 28px;
  min-width: 30px;
  padding: 0 8px;
  border-radius: 8px;
  color: #6b5f52;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(190, 178, 164, 0.55);
}
.wall-zoom button:active {
  background: #efe7db;
}
#wall-zval {
  min-width: 54px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* 空状态里的"输入密钥"入口 */
.empty-join {
  margin-top: 16px;
  font-size: 13px;
  color: #8a7a68;
  border-color: rgba(190, 178, 164, 0.6);
  background: rgba(255, 253, 248, 0.7);
}

/* 灯箱里的"设为封面" */
#lb-cover {
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #d8cfc5;
  border: 1px solid rgba(216, 207, 197, 0.35);
  background: rgba(255, 255, 255, 0.04);
}
#lb-cover.on {
  color: #e9c9a8;
  border-color: rgba(233, 201, 168, 0.5);
  opacity: 0.75;
}

/* 封面角标 */
.pg-wall button.is-cover {
  outline: 2px solid rgba(180, 86, 47, 0.55);
  outline-offset: -2px;
}
.cv-tag {
  position: absolute;
  left: 6px;
  top: 6px;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  color: #fff;
  background: rgba(180, 86, 47, 0.85);
  pointer-events: none;
}