/* =========================================================================
   长沙 BD 网格 · 样式
   移动端（微信 H5）为主，PC 管理端为次。所有尺寸以 rem/px 混排，
   根字号固定 16px，避免微信字体缩放导致布局崩坏（见 html 的 -webkit-text-size-adjust）。
   ========================================================================= */

:root {
  --ink: #0d1520;
  --ink-2: #41505f;
  --muted: #7c8a99;
  --line: #e4eaf0;
  --line-2: #f0f4f8;
  --surface: #ffffff;
  --bg: #eef2f6;
  --accent: #1256db;
  --accent-ink: #0b3fa8;
  --accent-soft: #eaf1fe;
  --ok: #0f9d58;
  --ok-soft: #e7f6ee;
  --warn: #d98c00;
  --warn-soft: #fdf3e0;
  --danger: #e04347;
  --danger-soft: #fdeceb;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-s: 0 1px 2px rgba(13, 21, 32, 0.06), 0 2px 8px rgba(13, 21, 32, 0.04);
  --shadow-m: 0 4px 16px rgba(13, 21, 32, 0.09), 0 1px 3px rgba(13, 21, 32, 0.06);
  --shadow-l: 0 18px 48px rgba(13, 21, 32, 0.18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --sheet-h: 88vh;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 16px; /* 小于 16px iOS 会自动放大页面 */
  color: var(--ink);
}

img {
  display: block;
  max-width: 100%;
}

.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ------------------------------------------------------------------ 通用组件 */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  background: var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip--ok { background: var(--ok-soft); color: #0a7a44; }
.chip--warn { background: var(--warn-soft); color: #9a6300; }
.chip--danger { background: var(--danger-soft); color: #b32b2f; }
.chip--accent { background: var(--accent-soft); color: var(--accent); }
.chip--ghost { background: transparent; border: 1px solid var(--line); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  background: var(--line-2);
  color: var(--ink);
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s;
  user-select: none;
}
.btn:active { transform: scale(0.975); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(18, 86, 219, 0.28); }
.btn--dark { background: var(--ink); color: #fff; box-shadow: 0 6px 16px rgba(13, 21, 32, 0.22); }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--line { background: var(--surface); border: 1px solid var(--line); }
.btn--danger { background: var(--danger); color: #fff; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn--sm { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13px; }
.btn--block { width: 100%; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex: none;
  letter-spacing: 0.5px;
}
.avatar--sm { width: 22px; height: 22px; font-size: 11px; }
.avatar--lg { width: 56px; height: 56px; font-size: 20px; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.field-label .req { color: var(--danger); }
.field-hint { font-size: 12px; color: var(--muted); }

.input,
.textarea,
.select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 86, 219, 0.12);
}
.input::placeholder,
.textarea::placeholder { color: #a9b4c0; }
.textarea { height: auto; min-height: 88px; padding: 12px 14px; resize: none; line-height: 1.55; }
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5L6 6.5l5-5' stroke='%237c8a99' stroke-width='1.8' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.input--err { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(224, 67, 71, 0.1); }

/* ------------------------------------------------------------------ 地图容器 */

.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #e9eff5;
  touch-action: none;
}
.map-stage canvas { display: block; width: 100%; height: 100%; }

.map-ctrl {
  position: absolute;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
}
.map-ctrl button {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-s);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.map-ctrl button:active { background: #fff; transform: scale(0.95); }

.map-scale {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-size: 10.5px;
  font-weight: 600;
  color: #46515f;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.92);
  pointer-events: none;
  z-index: 2;
}
.map-attribution {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 10px;
  color: #6b7280;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95);
  pointer-events: none;
  z-index: 2;
}

.map-scale-num {
  margin-bottom: 2px;
  letter-spacing: 0.2px;
}
.map-scale-bar {
  width: 100%;
  height: 4px;
  border: 1.5px solid #46515f;
  border-top: 0;
}

/* 选点十字准星 */
.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}
.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: var(--ink);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}
.crosshair::before { left: 50%; top: 0; width: 1.5px; height: 100%; margin-left: -0.75px; }
.crosshair::after { top: 50%; left: 0; height: 1.5px; width: 100%; margin-top: -0.75px; }
.crosshair-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------------ BD 首页 */

.m-home {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.m-topbar {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(var(--safe-t) + 10px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: var(--shadow-m);
}
.m-topbar-main { flex: 1; min-width: 0; }
.m-topbar-eyebrow {
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
}
.m-topbar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-s);
}
.m-stat { text-align: center; }
.m-stat-num { font-size: 20px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.15; }
.m-stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.m-stat--accent .m-stat-num { color: var(--accent); }

/* 底部抽屉 */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sheet-h);
  z-index: 6;
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  box-shadow: 0 -8px 32px rgba(13, 21, 32, 0.14);
  will-change: transform;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.sheet.dragging { transition: none; }

.sheet-hd {
  flex: none;
  padding: 8px 16px 10px;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  cursor: grab;
  touch-action: none;
}
.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: #c6d0da;
  margin: 0 auto 10px;
}
.sheet-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.sheet-title { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.sheet-sub { font-size: 12px; color: var(--muted); }

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px calc(96px + var(--safe-b));
}

.terr-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 4px 12px;
  scrollbar-width: none;
}
.terr-chips::-webkit-scrollbar { display: none; }
.terr-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all 0.16s;
}
.terr-chip .cnt { font-size: 11px; color: var(--muted); }
.terr-chip.active {
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(13, 21, 32, 0.1);
}
.terr-chip.active .cnt { color: var(--ink-2); }

.shop-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-s);
  margin-bottom: 10px;
  transition: transform 0.12s;
}
.shop-card:active { transform: scale(0.988); }
.shop-card-thumb {
  width: 76px;
  height: 76px;
  border-radius: 11px;
  object-fit: cover;
  flex: none;
  background: var(--line-2);
}
.shop-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shop-card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.15px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.shop-card-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-card-meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.shop-card-addr {
  font-size: 12.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 11.5px;
  color: var(--muted);
}

.fab-add {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + var(--safe-b));
  z-index: 8;
  height: 50px;
  padding: 0 22px 0 18px;
  border-radius: 25px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 28px rgba(13, 21, 32, 0.32);
  transition: transform 0.14s;
}
.fab-add:active { transform: translateX(-50%) scale(0.96); }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty svg { margin: 0 auto 10px; opacity: 0.5; }

/* ------------------------------------------------------------------ 页面框架 */

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 12px;
  padding-top: var(--safe-t);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.navbar-title { font-size: 16.5px; font-weight: 650; letter-spacing: -0.2px; flex: 1; text-align: center; }
.navbar-side { width: 40px; display: flex; justify-content: flex-start; }
.navbar-side--right { justify-content: flex-end; }
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.icon-btn:active { background: var(--line-2); }

.page-body {
  flex: 1;
  padding: 14px 12px calc(110px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  padding: 14px;
}
.card-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  letter-spacing: 0.2px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 10px 12px calc(10px + var(--safe-b));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
}

/* ------------------------------------------------------------------ 录店表单 */

.picker {
  position: relative;
  height: 30vh;
  min-height: 190px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-s);
  background: #e9eff5;
}
.picker-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 10px;
  z-index: 5;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(13, 21, 32, 0.78);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
.picker-locate.is-busy {
  opacity: 0.6;
  pointer-events: none;
}
.picker-locate {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 6;
  height: 34px;
  padding: 0 12px 0 10px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-m);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.form-section { display: flex; flex-direction: column; gap: 14px; }

.photogrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-cell {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--line-2);
  border: 1px dashed #cfd9e3;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell--filled { border: 0; background: #000; }
.photo-cell-del {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(13, 21, 32, 0.66);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
}
.photo-cell-cover {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(13, 21, 32, 0.66);
  color: #fff;
  font-size: 10px;
}
.photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.photo-busy { opacity: 0.5; pointer-events: none; }

.seg {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -2px;
  padding: 2px;
}
.seg::-webkit-scrollbar { display: none; }
.seg-item {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.seg-item.active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

/* ------------------------------------------------------------------ 门店详情 */

.hero {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0d1520;
  overflow: hidden;
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
}
.hero-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}
.hero-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.hero-dots i.on { background: #fff; width: 14px; border-radius: 3px; }

.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-k { width: 64px; flex: none; color: var(--muted); font-size: 13px; }
.kv-v { flex: 1; min-width: 0; color: var(--ink); word-break: break-all; }
.kv-v--action { color: var(--accent); font-weight: 600; }

.timeline { display: flex; flex-direction: column; gap: 14px; }
.tl-item { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted); }
.tl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c3ceda;
  margin-top: 6px;
  flex: none;
}
.tl-item--on .tl-dot { background: var(--accent); }

/* ------------------------------------------------------------------ 我的 */

.me-hero {
  padding: 22px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #16232f 0%, #0d1520 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.me-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 86, 219, 0.55), transparent 65%);
}
.me-name { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; margin-top: 12px; }
.me-role { font-size: 12.5px; opacity: 0.62; margin-top: 2px; }
.me-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}
.me-stat-num { font-size: 19px; font-weight: 700; letter-spacing: -0.5px; }
.me-stat-label { font-size: 11px; opacity: 0.6; margin-top: 1px; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface);
  font-size: 14px;
  border-bottom: 1px solid var(--line-2);
}
.list-row:last-child { border-bottom: 0; }
.list-row-l { flex: 1; min-width: 0; }
.list-row-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-s); }

.progress {
  height: 6px;
  border-radius: 6px;
  background: var(--line-2);
  overflow: hidden;
}
.progress > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width 0.4s ease; }

/* ------------------------------------------------------------------ 弹层 */

.mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 21, 32, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade 0.16s ease;
}
@keyframes fade { from { opacity: 0; } }

.dialog {
  width: 100%;
  max-width: 320px;
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-l);
  animation: pop 0.2s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
.dialog-body { padding: 22px 20px 18px; text-align: center; }
.dialog-title { font-size: 16.5px; font-weight: 650; letter-spacing: -0.2px; }
.dialog-text { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.55; }
.dialog-actions { display: flex; border-top: 1px solid var(--line); }
.dialog-actions button {
  flex: 1;
  height: 50px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.dialog-actions button + button { border-left: 1px solid var(--line); }
.dialog-actions .ok { color: var(--accent); }
.dialog-actions .danger { color: var(--danger); }

.toasts {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 84px);
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(13, 21, 32, 0.92);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-l);
  animation: toastIn 0.24s cubic-bezier(0.2, 1.2, 0.4, 1);
  max-width: 80vw;
  text-align: center;
}
.toast--ok { background: rgba(10, 122, 68, 0.96); }
.toast--err { background: rgba(190, 40, 44, 0.96); }
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0; } }

/* ------------------------------------------------------------------ PC 管理端 */

.admin {
  display: grid;
  grid-template-columns: 268px 1fr 316px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}
.admin.is-review { grid-template-columns: 268px 1fr; }

.adm-side {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  min-height: 0;
}
.adm-brand {
  padding: 20px 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.5px;
}
.adm-brand-name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.2px; }
.adm-brand-sub { font-size: 11px; color: var(--muted); }

.adm-tabs { display: flex; gap: 4px; padding: 0 12px 12px; }
.adm-tab {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.adm-tab.active { background: var(--line-2); color: var(--ink); }

.adm-list { flex: 1; overflow-y: auto; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.adm-terr {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all 0.14s;
  cursor: pointer;
}
.adm-terr:hover { border-color: #c9d4e0; }
.adm-terr.active { border-color: var(--ink); box-shadow: 0 3px 14px rgba(13, 21, 32, 0.1); }
.adm-terr-top { display: flex; align-items: center; gap: 8px; }
.adm-terr-name { font-size: 14px; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-terr-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }

.adm-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.adm-topbar {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.adm-title { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.adm-stats { display: flex; gap: 18px; margin-left: auto; }
.adm-stat-num { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.adm-stat-label { font-size: 10.5px; color: var(--muted); }
.adm-map { flex: 1; min-height: 0; position: relative; }
.adm-hint {
  position: absolute;
  left: 16px;
  bottom: 58px;
  z-index: 3;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-s);
  font-size: 11.5px;
  color: var(--ink-2);
}

.adm-inspector {
  border-left: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.adm-ins-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line-2); }
.adm-ins-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.adm-ins-foot { padding: 14px 18px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 2px solid transparent;
  transition: all 0.14s;
}
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

.checklist { display: flex; flex-direction: column; gap: 2px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.12s;
}
.check-row:hover { background: var(--line-2); }
.check-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid #c3ceda;
  display: grid;
  place-items: center;
  flex: none;
}
.check-row.on .check-box { background: var(--accent); border-color: var(--accent); color: #fff; }

.adm-table-wrap { flex: 1; overflow-y: auto; padding: 16px 18px; }
.adm-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.adm-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 12px 4px;
  letter-spacing: 0.3px;
}
.adm-table td {
  background: var(--surface);
  padding: 12px;
  font-size: 13.5px;
  vertical-align: middle;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.adm-table td:first-child { border-left: 1px solid var(--line-2); border-radius: 12px 0 0 12px; }
.adm-table td:last-child { border-right: 1px solid var(--line-2); border-radius: 0 12px 12px 0; }
.adm-table tbody tr { transition: transform 0.12s; }
.adm-thumb { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--line-2); }

.log-row {
  display: grid;
  grid-template-columns: 132px 90px 1fr;
  gap: 12px;
  padding: 9px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line-2);
}
.log-row:last-child { border-bottom: 0; }
.log-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.log-act { font-weight: 600; color: var(--ink-2); }
.log-detail { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 侧栏底部身份切换 */
.adm-user {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.adm-user:hover { background: var(--line-2); }
.adm-user-name { font-size: 13px; font-weight: 600; }
.adm-user-role { font-size: 11px; color: var(--muted); }

/* 移动端提示：管理端需要宽屏 */
.wide-only {
  display: none;
}

@media (max-width: 1080px) {
  .admin { grid-template-columns: 1fr; }
  .adm-side, .adm-inspector { display: none; }
}

@media (min-width: 900px) {
  .wide-only { display: block; }
}

/* ------------------------------------------------------------------ 桌面端浏览移动页时的手机视框 */

@media (min-width: 900px) {
  body:has(.page),
  body:has(.m-home) {
    background:
      radial-gradient(circle at 20% 0%, #dfe7f1 0%, #e8edf3 40%, #e2e8ef 100%);
  }
  .page {
    max-width: 460px;
    margin: 0 auto;
    min-height: 100dvh;
    background: var(--bg);
    box-shadow: 0 0 0 1px rgba(13, 21, 32, 0.06), 0 24px 60px rgba(13, 21, 32, 0.1);
  }
  .navbar {
    max-width: 460px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
  }
  .footer-bar {
    max-width: 460px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
  }
  .m-home {
    width: 100%;
    max-width: 460px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    box-shadow: 0 0 0 1px rgba(13, 21, 32, 0.06), 0 24px 60px rgba(13, 21, 32, 0.12);
  }
}

/* 管理端在窄屏：地图全屏 + 检查器底部抽屉 */
@media (max-width: 1080px) {
  .admin {
    position: relative;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  .adm-side {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 30;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .adm-brand,
  .adm-user { display: none; }
  .adm-tabs { padding: 8px 12px; }
  .adm-list {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 8px;
  }
  .adm-terr { min-width: 190px; }
  .adm-list > .btn { display: none; }
  .admin { padding-top: 104px; }
  .adm-inspector {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    max-height: 54vh;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(13, 21, 32, 0.16);
  }
  .adm-ins-body { padding-bottom: 28px; }
  .adm-topbar { position: sticky; top: 104px; z-index: 20; }
  .adm-stats { gap: 12px; }
  .adm-hint { display: none; }
}
