/* ============ 魔都·Explore · 主题系统 ============
   默认浅色 + 雾灰 / 东京夜 / 墨蓝 / 微醺 共五套皮肤（html[data-theme] 切换），
   另有「跟随系统」在浅色/东京夜之间自动切换。
   每个主题绑定对应的高德官方底图风格（见 app.js THEMES 的 mapStyle）。 */

:root {
  --paper: #f5f6f8;
  --card: #ffffff;
  --panel: rgba(255, 255, 255, 0.88);
  --ink: #232936;
  --ink-soft: #626b7a;
  --line: #e3e6eb;
  --metro: #d6336c;
  --metro-soft: rgba(214, 51, 108, 0.08);
  --brick: #c2504a;
  --toast-bg: #2a2230;
  --toast-ink: #fdf3f8;

  /* 浅色下的品牌渐变：玫红→青，与品牌标识一致 */
  --neon-a: #e0447c;
  --neon-b: #14b8c9;
  --neon-grad: linear-gradient(135deg, var(--neon-a), var(--neon-b));
  --glow-pink: 0 6px 18px rgba(224, 68, 124, 0.16);
  --glow-cyan: 0 4px 14px rgba(20, 184, 201, 0.12);

  /* 派生色 */
  --ink-faint: color-mix(in srgb, var(--ink-soft) 62%, var(--paper));
  --panel-border: color-mix(in srgb, var(--ink) 10%, transparent);
  --brick-deep: color-mix(in srgb, var(--brick) 82%, black);
  --metro-soft-2: color-mix(in srgb, var(--metro) 8%, var(--card));
  --shadow-card: 0 10px 34px rgba(30, 35, 50, 0.14);
  --shadow-float: 0 6px 20px rgba(30, 35, 50, 0.16);

  --font-display: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
}

html[data-theme="tokyo"] {
  --paper: #0a0f1e;
  --card: #10182b;
  --panel: rgba(13, 20, 38, 0.82);
  --ink: #e8ecf8;
  --ink-soft: #9aa7c7;
  --line: #263352;
  --metro: #22d3ee;
  --metro-soft: rgba(34, 211, 238, 0.12);
  --brick: #ff5d7a;
  --toast-bg: #e8ecf8;
  --toast-ink: #0a0f1e;

  /* 霓虹品牌渐变与光效 */
  --neon-a: #ff3d81;
  --neon-b: #22d3ee;
  --neon-grad: linear-gradient(135deg, var(--neon-a), var(--neon-b));
  --glow-pink: 0 0 18px rgba(255, 61, 129, 0.35);
  --glow-cyan: 0 0 16px rgba(34, 211, 238, 0.3);

  --panel-border: color-mix(in srgb, var(--neon-b) 22%, transparent);
  --shadow-card: 0 12px 36px rgba(2, 6, 16, 0.55);
  --shadow-float: 0 6px 22px rgba(2, 6, 16, 0.6);
}

/* 🌫️ 雾灰：中性浅灰 + slate 强调，底图 grey */
html[data-theme="grey"] {
  --paper: #f2f3f5;
  --card: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --ink: #24292f;
  --ink-soft: #61696f;
  --line: #e1e4e8;
  --metro: #46586c;
  --metro-soft: rgba(70, 88, 108, 0.08);
  --brick: #c2504a;
  --toast-bg: #24292f;
  --toast-ink: #f5f6f8;

  --neon-a: #57606a;
  --neon-b: #2f8f83;
  --neon-grad: linear-gradient(135deg, var(--neon-a), var(--neon-b));
  --glow-pink: 0 6px 18px rgba(87, 96, 106, 0.16);
  --glow-cyan: 0 4px 14px rgba(47, 143, 131, 0.12);
}

/* 🌌 墨蓝：深海军蓝 + 靛蓝荧光，底图 darkblue */
html[data-theme="midnight"] {
  --paper: #0b1226;
  --card: #101a33;
  --panel: rgba(10, 17, 36, 0.84);
  --ink: #dce4ff;
  --ink-soft: #8ea0d0;
  --line: #24325c;
  --metro: #6ea8ff;
  --metro-soft: rgba(110, 168, 255, 0.13);
  --brick: #ff8f6b;
  --toast-bg: #dce4ff;
  --toast-ink: #0b1226;

  --neon-a: #6d5dff;
  --neon-b: #2fd4ff;
  --neon-grad: linear-gradient(135deg, var(--neon-a), var(--neon-b));
  --glow-pink: 0 0 18px rgba(109, 93, 255, 0.32);
  --glow-cyan: 0 0 16px rgba(47, 212, 255, 0.28);

  --panel-border: color-mix(in srgb, var(--neon-b) 20%, transparent);
  --shadow-card: 0 12px 36px rgba(1, 4, 12, 0.6);
  --shadow-float: 0 6px 22px rgba(1, 4, 12, 0.65);
}

/* 🍷 微醺：暗酒红 + 玫瑰金强调，底图 wine */
html[data-theme="wine"] {
  --paper: #180a10;
  --card: #221019;
  --panel: rgba(28, 12, 20, 0.85);
  --ink: #f6e3ec;
  --ink-soft: #c79ab1;
  --line: #462233;
  --metro: #ff7fae;
  --metro-soft: rgba(255, 127, 174, 0.12);
  --brick: #ff9a5c;
  --toast-bg: #f6e3ec;
  --toast-ink: #180a10;

  --neon-a: #ff3d81;
  --neon-b: #ff9a5c;
  --neon-grad: linear-gradient(135deg, var(--neon-a), var(--neon-b));
  --glow-pink: 0 0 18px rgba(255, 61, 129, 0.3);
  --glow-cyan: 0 0 16px rgba(255, 154, 92, 0.25);

  --panel-border: color-mix(in srgb, var(--brick) 25%, transparent);
  --shadow-card: 0 12px 36px rgba(8, 2, 5, 0.6);
  --shadow-float: 0 6px 22px rgba(8, 2, 5, 0.65);
}

/* 分类数据色（深色底加亮，标记与筛选用；与 app.js CATEGORIES 一致） */
:root {
  --cat-scenic: #34d399;
  --cat-food: #fb923c;
  --cat-museum: #60a5fa;
  --cat-shopping: #f472b6;
  --cat-fun: #a78bfa;
  --cat-other: #94a3b8;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
}

button { font: inherit; }

:focus-visible { outline: none; }

/* ---------- 地图舞台与浮层 ---------- */

.map-stage {
  position: fixed;
  inset: 0;
  background: var(--paper);
}

.map { position: absolute; inset: 0; }

/* ---------- 顶栏（浮于地图之上） ---------- */

.top-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 10px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: var(--shadow-card), var(--glow-cyan);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex: none;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--neon-grad);
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: var(--glow-pink);
  flex: none;
}

.brand-badge svg {
  width: 19px;
  height: 19px;
  fill: #070b16;
  transform: translateY(-1px);
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.5px;
  line-height: 1.15;
  white-space: nowrap;
  background: var(--neon-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 10.5px;
  letter-spacing: 3px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.search-wrap { position: relative; flex: 1 1 auto; max-width: 430px; min-width: 140px; }

.search-wrap input {
  width: 100%;
  height: 100%;
  min-height: 54px;
  padding: 0 18px 0 44px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  font-size: 14.5px;
  color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237f8db0' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 17px center;
}

.search-wrap input::placeholder { color: var(--ink-faint); }

.search-wrap input:focus-visible {
  box-shadow: var(--shadow-card), 0 0 0 2px var(--metro);
}

.search-wrap input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  z-index: 30;
}

.search-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink);
}

.search-suggest button:hover,
.search-suggest button:focus-visible,
.search-suggest button.is-active { background: var(--metro-soft); }

.suggest-name { font-weight: 600; font-size: 14px; }
.suggest-addr {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-empty {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- 按钮 ---------- */

.btn {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.btn:hover { background: var(--metro-soft); border-color: color-mix(in srgb, var(--metro) 40%, transparent); }
.btn:focus-visible { outline: 2px solid var(--metro); outline-offset: 2px; }

.btn-primary {
  background: var(--neon-grad);
  border: none;
  color: #070b16;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-float), var(--glow-pink);
}

.btn-primary:hover { filter: brightness(1.12); }

.btn-danger {
  background: var(--brick);
  border: none;
  color: #2a0a12;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(255, 93, 122, 0.3);
}

.btn-danger:hover { background: var(--brick); filter: brightness(1.1); }

.btn:disabled { opacity: 0.55; cursor: wait; filter: none; }

.btn-small { padding: 5px 13px; font-size: 12.5px; }

.btn-link {
  border: none;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 12.5px;
}

.btn-link:focus-visible { outline: 2px solid var(--metro); }

/* ---------- 侧栏浮层 ---------- */

.side-panel {
  position: absolute;
  top: 82px;
  left: 14px;
  bottom: 14px;
  width: 338px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  z-index: 15;
}

.filters {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.category-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color, var(--ink-faint));
  box-shadow: 0 0 6px var(--chip-color, transparent);
}

.chip[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--chip-color);
  background: color-mix(in srgb, var(--chip-color) 16%, var(--card));
}

.chip:hover { border-color: var(--chip-color); }
.chip:focus-visible { outline: 2px solid var(--metro); outline-offset: 1px; }

.unvisited-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}

.unvisited-toggle input { accent-color: var(--metro); }

/* ---------- 列表头（计数 + 排序） ---------- */

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 4px;
  flex: none;
}

.list-count {
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--ink-faint);
}

.sort-select {
  font: inherit;
  font-size: 11.5px;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  cursor: pointer;
}

.sort-select:focus-visible { outline: 2px solid var(--metro); }

/* ---------- 骨架屏 ---------- */

.skeleton-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  list-style: none;
}

.sk {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #17223e 25%, #22304f 45%, #17223e 65%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.sk-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; }

.sk-lines { flex: 1; }

.sk-line { height: 11px; margin: 7px 0; }
.sk-line.w60 { width: 60%; }
.sk-line.w85 { width: 85%; }

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------- 地点列表 ---------- */

.place-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 8px 10px;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink-soft) 45%, transparent) transparent;
}

.place-list::-webkit-scrollbar { width: 6px; }
.place-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-soft) 45%, transparent);
  border-radius: 3px;
}

.place-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  column-gap: 10px;
  row-gap: 3px;
  padding: 10px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.place-item:hover { background: var(--metro-soft); }
.place-item:focus-visible { outline: 2px solid var(--metro); }

.place-emoji {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: color-mix(in srgb, var(--emoji-color) 16%, var(--card));
  border: 1px solid color-mix(in srgb, var(--emoji-color) 45%, var(--card));
  box-shadow: 0 0 10px color-mix(in srgb, var(--emoji-color) 25%, transparent);
}

.place-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.place-name {
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-item.is-visited .place-name { color: var(--ink-soft); }

.place-actions { display: none; gap: 2px; }

.place-item:hover .place-actions,
.place-item:focus-within .place-actions { display: flex; }

.place-actions button {
  border: none;
  background: none;
  font-size: 13.5px;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 7px;
  line-height: 1;
}

.place-actions button:hover { background: var(--metro-soft); }

.place-meta {
  grid-column: 2 / 4;
  min-width: 0; /* 长地址 nowrap 会把网格撑破，把操作按钮顶出屏幕 */
  font-size: 11.5px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-desc {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 去过标记：霓虹发光圆环 */

.stamp {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2.5px solid var(--brick);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 93, 122, 0.55);
  opacity: 0.95;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 26px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
}

.empty-icon { font-size: 34px; margin: 0 0 6px; }

#btn-empty-new { margin-top: 14px; }

.empty-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: 1px;
}

/* ---------- 地图切换器 ---------- */

.map-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 0;
  flex: none;
}

.map-switcher-label { font-size: 15px; }

#btn-map-settings {
  flex: none;
  padding: 6px 9px;
  font-size: 13px;
  line-height: 1;
}

/* ---------- 地图设置弹窗 ---------- */

.settings-divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0 6px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.settings-text { min-width: 0; }

.settings-text b { font-size: 13.5px; }

.settings-hint {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  line-height: 1.55;
}

.settings-row .btn { flex: none; }

/* 侧栏功能入口（回忆 / 海报） */

.side-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px 4px;
  flex: none;
}

.side-actions .btn { flex: 1; }
.side-actions .side-icon-btn { flex: 0 0 38px; padding-inline: 0; font-size: 15px; }

.discover-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px 14px 8px;
  flex: none;
}

.btn-draw {
  border-color: color-mix(in srgb, var(--brick) 55%, var(--line));
  color: var(--ink);
}

.user-location {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, #1677ff 18%, transparent);
  animation: location-pulse 1.8s ease-out infinite;
}

.user-location span {
  width: 13px;
  height: 13px;
  box-sizing: border-box;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1677ff;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.55);
}

@keyframes location-pulse {
  0%, 45% { box-shadow: 0 0 0 0 rgba(22, 119, 255, 0.35); }
  100% { box-shadow: 0 0 0 14px rgba(22, 119, 255, 0); }
}

.discover-body { padding: 22px 24px; }
.nearby-list { display: grid; gap: 6px; margin-top: 14px; }

.nearby-item {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nearby-item:hover { background: var(--metro-soft); }
.nearby-emoji { font-size: 22px; text-align: center; }
.nearby-main { min-width: 0; display: grid; gap: 3px; }
.nearby-main strong, .nearby-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nearby-main small { color: var(--ink-faint); font-size: 11.5px; }
.nearby-item > b { color: var(--metro); font-size: 12px; white-space: nowrap; }

.dialog-random { width: 380px; }
.random-body { position: relative; text-align: center; }
.random-close { position: absolute; right: 14px; top: 12px; }
.random-kicker { margin: 4px 0 14px; color: var(--ink-soft); font-size: 13px; }
.random-card {
  min-height: 176px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--brick) 48%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 88%, var(--brick));
  box-shadow: var(--shadow-card);
}
.random-card.is-drawing { animation: card-draw 0.14s ease-in-out infinite alternate; }
.random-emoji { font-size: 44px; }
.random-card strong { max-width: 100%; font-size: 23px; overflow-wrap: anywhere; }
.random-card > span:last-child { color: var(--ink-soft); font-size: 12px; }
@keyframes card-draw { to { transform: translateY(-3px) scale(1.01); } }

/* 「我也想去」心形投票 */

.wish-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.wish-chip:hover { border-color: var(--brick); color: var(--ink); }

.wish-chip.is-wished {
  color: var(--brick);
  border-color: color-mix(in srgb, var(--brick) 55%, transparent);
  background: color-mix(in srgb, var(--brick) 12%, transparent);
  text-shadow: 0 0 8px rgba(255, 93, 122, 0.5);
}

#map-select {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  cursor: pointer;
}

#map-select:focus-visible { outline: 2px solid var(--metro); }

#map-select option { background: var(--card); color: var(--ink); font-weight: 400; }
#map-select .map-new-option { color: var(--metro); font-weight: 600; }

/* ---------- 新建/加入地图弹层 ---------- */

.dialog-map-entry { width: 400px; }

.map-entry-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  color: var(--ink-faint);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  z-index: 1;
}

.map-entry-close:hover { color: var(--ink); }
.map-entry-close:focus-visible { outline: 2px solid var(--metro); }

.dialog-map-entry .map-entry-body {
  padding: 28px 28px 24px;
  text-align: center;
}

.welcome-badge {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--neon-grad);
  display: grid;
  place-items: center;
  box-shadow: var(--glow-pink);
}

.welcome-badge svg {
  width: 26px;
  height: 26px;
  fill: #070b16;
  transform: translateY(-1px);
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 3px;
  margin: 0 0 6px;
  background: var(--neon-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.welcome-form { text-align: left; display: flex; flex-direction: column; gap: 12px; }

.welcome-form .field input { font-size: 14.5px; }

.welcome-btn { width: 100%; padding: 10px; font-size: 14px; }

.welcome-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--ink-faint);
  font-size: 12px;
}

.welcome-divider::before,
.welcome-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* 邀请码大字展示 */

.invite-code {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--metro);
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.45);
  text-align: center;
  background: var(--metro-soft);
  border: 1px solid color-mix(in srgb, var(--metro) 30%, transparent);
  border-radius: 12px;
  padding: 14px 0 14px 8px;
  user-select: all;
}

/* ---------- 选点提示 / 地图占位 ---------- */

.pick-hint {
  position: absolute;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 12, 24, 0.92);
  border: 1px solid var(--panel-border);
  color: var(--ink);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-float), var(--glow-cyan);
  z-index: 25;
  white-space: nowrap;
}

.pick-hint button {
  border: none;
  background: none;
  color: var(--metro);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13px;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, var(--paper) 0 24px,
      color-mix(in srgb, var(--ink) 5%, var(--paper)) 24px 48px);
  z-index: 10;
}

.map-fallback-card {
  max-width: 420px;
  margin: 20px;
  background: var(--card);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 24px 26px;
  text-align: center;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-soft);
  box-shadow: var(--shadow-card);
}

.fallback-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: 1px;
}

/* ---------- 地图标记（map.js 注入） ---------- */

.marker-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f4f7ff;
  border: 2.5px solid var(--chip-color, var(--cat-scenic));
  box-shadow: 0 3px 10px rgba(2, 6, 16, 0.55),
    0 0 14px color-mix(in srgb, var(--chip-color, var(--cat-scenic)) 55%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
  transform: translateY(-8px);
  transition: transform 0.15s ease;
}

.marker-chip:hover { transform: translateY(-10px) scale(1.06); }

/* 列表悬停联动时的高亮态 */
.marker-chip.is-hot {
  transform: translateY(-12px) scale(1.18);
  box-shadow: 0 6px 16px rgba(2, 6, 16, 0.6),
    0 0 24px color-mix(in srgb, var(--chip-color, var(--cat-scenic)) 85%, transparent);
}

.marker-chip.is-visited { opacity: 0.65; }

.marker-chip.is-visited::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--brick);
  background: #f4f7ff;
  box-shadow: 0 0 8px rgba(255, 93, 122, 0.6);
}

/* ---------- 信息窗（自定义皮肤，map.js 注入） ---------- */

.info-window {
  position: relative;
  font-family: var(--font-body);
  max-width: 244px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 14px 16px 12px;
  box-shadow: var(--shadow-card);
}

.info-window::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--card);
  border-right: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}

.info-window .iw-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.info-window .iw-desc {
  margin: 0 0 7px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.info-window .iw-meta {
  margin: 0 0 6px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.info-window .iw-links {
  margin: 0;
  font-size: 12px;
  flex-wrap: wrap;
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.info-window .iw-sep { color: var(--ink-faint); }

.info-window .iw-edit,
.info-window .iw-detail {
  color: var(--metro);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.info-window .iw-detail { color: #ff7fae; }

.info-window .iw-close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  color: var(--ink-faint);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.info-window .iw-close:hover { color: var(--ink); }

/* ---------- 吸附选点 ---------- */

.pick-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brick) 20%, transparent);
  border: 3px solid var(--brick);
  box-shadow: 0 2px 10px rgba(2, 6, 16, 0.6), 0 0 12px rgba(255, 93, 122, 0.5);
  animation: pick-pulse 1.2s ease-out infinite;
}

@keyframes pick-pulse {
  0% { transform: scale(0.85); opacity: 0.95; }
  70% { transform: scale(1.5); opacity: 0.35; }
  100% { transform: scale(0.85); opacity: 0.95; }
}

.dialog-pick .pick-body { padding: 22px 24px; width: 360px; max-width: 92vw; }

.pick-candidates {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
  margin: 4px 0 6px;
}

.pick-candidate {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 10px;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  color: var(--ink);
}

.pick-candidate:hover,
.pick-candidate:focus-visible {
  background: var(--metro-soft);
  border-color: color-mix(in srgb, var(--metro) 25%, transparent);
}

.pick-candidate:first-child {
  border-color: var(--metro);
  background: var(--metro-soft);
}

.candidate-name { font-weight: 600; font-size: 14px; }
.candidate-addr {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.candidate-distance {
  font-size: 12px;
  color: var(--metro);
  font-weight: 600;
  white-space: nowrap;
}

.pick-loading {
  padding: 14px 4px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- 对话框 ---------- */

.dialog {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 0;
  max-width: 92vw;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
}

.dialog::backdrop {
  background: rgba(4, 7, 15, 0.6);
  backdrop-filter: blur(3px);
  animation: fade-in 0.2s ease;
}

/* 对话框入场动效（灯箱不缩放，只淡入） */
.dialog[open] { animation: dialog-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.lightbox[open] { animation: fade-in 0.18s ease; }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dialog form { padding: 22px 24px; }

.dialog h2 {
  font-family: var(--font-display);
  margin: 0 0 16px;
  font-size: 19px;
  letter-spacing: 2px;
}

.dialog-narrow { width: 330px; }

.dialog-hint {
  margin: -8px 0 14px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.65;
}

#place-dialog form { width: 430px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 13px 14px;
}

.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }

.field > span { color: var(--ink-soft); }

.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 55%, var(--card));
  color: var(--ink);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--metro);
  outline-offset: 1px;
}

.field select option { background: var(--card); color: var(--ink); }

.field-name { grid-column: 1; }
.field-category { grid-column: 2; grid-row: 1; }
.field-desc { grid-column: 1 / -1; }
.field-address { grid-column: 1; }
.field-nickname { grid-column: 2; grid-row: 4; }
.field-coords { grid-column: 1 / -1; }
.field-coords output {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 6px 0;
}

.field-visited {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.field-visited input { accent-color: var(--brick); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- 地点详情（照片与留言） ---------- */

.dialog-detail .detail-body {
  width: 480px;
  max-width: 92vw;
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 20px 22px 22px;
  scrollbar-width: thin;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-title-group { min-width: 0; }

.detail-title-group h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 1px;
}

.detail-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.6;
}

.detail-close {
  border: none;
  background: none;
  color: var(--ink-faint);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}

.detail-close:hover { color: var(--ink); }

.detail-desc {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap; /* 放不下的按钮整颗换到下一行 */
  gap: 7px;
  margin-top: 14px;
}

/* 单颗按钮内禁止折行（否则「打卡」变「打/卡」竖排） */
.detail-actions .btn {
  white-space: nowrap;
}

#btn-detail-wish.is-wished {
  color: var(--brick);
  border-color: color-mix(in srgb, var(--brick) 55%, transparent);
  background: color-mix(in srgb, var(--brick) 12%, transparent);
}

.detail-wishes {
  margin-top: 10px;
  font-size: 12px;
  color: var(--brick);
  line-height: 1.6;
}

#btn-detail-public.is-public {
  color: var(--metro);
  border-color: color-mix(in srgb, var(--metro) 55%, transparent);
  background: var(--metro-soft);
}

.detail-readonly {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--metro-soft);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.detail-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 13.5px;
  letter-spacing: 1.5px;
  color: var(--ink);
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-section-head h3 { margin: 0; }

.detail-count { color: var(--ink-faint); font-weight: 400; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo-cell {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--card);
}

.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(7, 11, 22, 0.78);
  border: 1px solid color-mix(in srgb, var(--brick) 55%, transparent);
  color: #ffd9e2;
  font-size: 11px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.photo-cell:hover .photo-del,
.photo-cell:focus-within .photo-del { opacity: 1; }

.detail-empty {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 2px 0 8px;
}

.comment-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 45%, var(--card));
}

.comment-main { flex: 1; min-width: 0; }

.comment-head {
  display: flex;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-bottom: 3px;
}

.comment-author { color: var(--metro); font-weight: 600; }

.comment-body {
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-del {
  border: none;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.comment-item:hover .comment-del,
.comment-item:focus-within .comment-del { opacity: 1; }

.comment-del:hover { color: var(--brick); background: none; }

.comment-form { display: flex; gap: 8px; }

.comment-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13.5px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 55%, var(--card));
  color: var(--ink);
}

.comment-form input::placeholder { color: var(--ink-faint); }

.comment-form input:focus-visible {
  outline: 2px solid var(--metro);
  outline-offset: 1px;
}

/* ---------- 确认 / 昵称弹窗 ---------- */

.dialog-confirm .confirm-body,
.confirm-body {
  padding: 22px 24px;
  width: 340px;
  max-width: 92vw;
}

.confirm-body .dialog-hint { margin: -6px 0 4px; }

.nickname-input {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 55%, var(--card));
  color: var(--ink);
  margin-top: 12px;
}

.nickname-input:focus-visible { outline: 2px solid var(--metro); outline-offset: 1px; }

/* ---------- 高德链接导入 ---------- */

.import-input {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 55%, var(--card));
  color: var(--ink);
  resize: vertical;
  min-height: 84px;
  margin-top: 4px;
}

.import-input:focus-visible { outline: 2px solid var(--metro); outline-offset: 1px; }

.import-preview {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--metro-soft);
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

/* 锚点形态的高德跳转按钮 */
#btn-detail-amap {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* ---------- 移动端抽屉把手（桌面隐藏） ---------- */

.panel-handle { display: none; }

/* ---------- 灯箱 ---------- */

.lightbox {
  border: none;
  background: rgba(4, 7, 15, 0.9);
  padding: 0;
  cursor: zoom-out;
}

/* 只有 open 状态才改布局，避免覆盖掉关闭态 dialog 的 display:none */
.lightbox[open] {
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  max-height: none;
}

.lightbox::backdrop { background: rgba(4, 7, 15, 0.6); }

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 92vw;
}

.lightbox-figure img {
  max-width: 92vw;
  max-height: 80vh;
  max-height: 80dvh;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
}

.lightbox-caption {
  max-width: 92vw;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(10, 15, 30, 0.75);
  border: 1px solid var(--panel-border);
  color: var(--ink-soft);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 回忆时间线 ---------- */

.dialog-memories { width: 460px; }

.memories-body {
  max-height: 80vh;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 20px 22px 22px;
  scrollbar-width: thin;
}

.memories-list { display: flex; flex-direction: column; gap: 12px; }

.memory-month {
  margin: 10px 0 0;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--metro);
}

.memory-month:first-child { margin-top: 0; }

.memory-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 45%, var(--card));
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.memory-card:hover {
  border-color: color-mix(in srgb, var(--metro) 45%, transparent);
  background: var(--metro-soft);
}

.memory-photos {
  flex-wrap: wrap;
  display: flex;
  gap: 8px;
}

.memory-photos img {
  width: 118px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.memory-no-photo {
  width: 118px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px dashed var(--line);
  font-size: 24px;
}

.memory-info { display: flex; flex-direction: column; gap: 3px; }

.memory-name { font-weight: 600; font-size: 14.5px; }

.memory-sub { font-size: 11.5px; color: var(--ink-faint); }

.memories-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
}

/* ---------- 分享海报 ---------- */

.dialog-poster { width: 420px; }

.poster-body { padding: 20px 22px 22px; }

.poster-canvas-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}

#poster-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.poster-body .form-actions { margin-top: 14px; }

/* ---------- Toast ---------- */

.toasts {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  padding: 10px 20px 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-float);
  animation: toast-in 0.18s ease-out;
  max-width: min(86vw, 420px);
}

.toast-icon {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: var(--neon-grad);
  color: #070b16;
}

.toast-error .toast-icon { background: var(--brick); color: #fff; }

.toast-error { filter: saturate(1.3); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 移动端 ---------- */

@media (max-width: 720px) {
  .top-bar {
    flex-wrap: wrap;
    gap: 8px;
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .brand { order: 1; padding: 6px 14px 6px 8px; }
  .brand-text h1 { font-size: 16px; }
  .brand-text p { display: none; }
  .brand-badge { width: 32px; height: 32px; font-size: 16px; }

  .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .search-wrap input { min-height: 46px; }

  #btn-import { order: 2; }
  #btn-pick { order: 2; margin-left: auto; }

  .side-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 46vh;
    height: 46dvh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--panel) 100%, var(--card));
    transition: transform 0.28s cubic-bezier(0.3, 0.9, 0.3, 1);
  }

  .side-panel.is-collapsed { transform: translateY(calc(100% - 118px - env(safe-area-inset-bottom))); }

  .panel-handle {
    display: grid;
    place-items: center;
    width: 100%;
    padding: 8px 0 2px;
    background: none;
    border: none;
    cursor: pointer;
    flex: none;
  }

  .handle-bar {
    width: 46px;
    height: 5px;
    border-radius: 3px;
    background: var(--line);
  }

  .place-actions { display: flex; }
  .place-actions button { padding: 8px 9px; min-width: 40px; min-height: 40px; }

  /* iOS：聚焦字号 <16px 的输入框会强制放大页面，全部抬到 16px */
  .search-wrap input,
  #place-form input,
  #place-form select,
  #place-form textarea,
  .comment-form input,
  #nickname-form input,
  #import-form input,
  #map-entry-form input { font-size: 16px; }

  .pick-hint {
    top: 128px;
    max-width: calc(100vw - 24px);
    white-space: normal;
    text-align: center;
  }

  #place-dialog form { width: 92vw; }

  .dialog-map-entry { width: 92vw; }
  .dialog-memories { width: 92vw; }
  .dialog-poster { width: 92vw; }

  .form-grid { grid-template-columns: 1fr; }
  .field-category,
  .field-nickname { grid-column: 1; grid-row: auto; }

  .dialog-detail .detail-body {
    width: 92vw;
    max-height: 86vh;
  max-height: 86dvh;
  }

  /* 小屏超高弹层必须可滚动，否则底部按钮够不到 */
  .map-entry-body,
  .poster-body,
  .memories-body { max-height: calc(88vh - 48px); max-height: calc(88dvh - 48px); overflow-y: auto; }

  .toasts { bottom: calc(22px + env(safe-area-inset-bottom)); }

  .btn-small { min-height: 40px; padding: 8px 12px; }
  .iw-close { width: 36px; height: 36px; }
  .photo-del { width: 30px; height: 30px; font-size: 15px; }

  .place-list { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

  .photo-del { opacity: 1; }
  .comment-del { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 行程单 ---------- */

.dialog-itinerary { width: 460px; }

.itinerary-body {
  max-height: 80vh;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 20px 22px 22px;
  scrollbar-width: thin;
}

.itinerary-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }

.itinerary-stop {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.itinerary-no {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--metro);
}

.itinerary-stop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.itinerary-stop-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.itinerary-stop-name.is-visited { color: var(--ink-soft); }

.itinerary-leg { font-size: 12px; color: var(--ink-soft); }

.itinerary-ops { flex: none; display: flex; gap: 6px; }
.itinerary-ops .btn { min-width: 34px; padding: 5px 8px; }

.itinerary-empty { text-align: center; color: var(--ink-soft); padding: 18px 0 6px; }
.itinerary-empty .empty-icon { font-size: 26px; margin: 0 0 6px; }

.itinerary-add { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.itinerary-add-title { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.itinerary-add-list { display: flex; flex-wrap: wrap; gap: 6px; }
.itinerary-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
  .dialog-itinerary { width: 92vw; }
  .itinerary-body { max-height: calc(88vh - 48px); max-height: calc(88dvh - 48px); }
  .itinerary-ops .btn { min-height: 40px; }
}

/* ---------- 地点信息徽章（人均/营业时间/标签） ---------- */

.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }

.detail-badge {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- 回收站 ---------- */

.trash-body {
  max-height: 72vh;
  max-height: 72dvh;
  overflow-y: auto;
  padding: 20px 22px 22px;
  scrollbar-width: thin;
}

.trash-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }

.trash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.trash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trash-name { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.trash-meta { font-size: 12px; color: var(--ink-soft); }

/* ---------- 推送开关 ---------- */

#btn-push.is-on {
  border-color: var(--metro);
  color: var(--metro);
  background: var(--metro-soft);
}
