:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --line: #e6eaf0;
  --line-strong: #d8dee8;
  --text: #111827;
  --muted: #6b7280;
  --dim: #9aa3b2;
  --amber: #ff8a1e;
  --red: #ef4444;
  --blue: #2563eb;
  --ok: #16a34a;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font-family: inherit; }

.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ---------- 开机动画 ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #f4f6f9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.55s ease;
}
.splash.done { opacity: 0; pointer-events: none; }

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: splashIn 0.5s ease;
}
@keyframes splashIn {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.splash-mark {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 22px;
  background: linear-gradient(140deg, #ffb020, #ff7a00);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 32px rgba(255, 122, 0, 0.38);
  padding: 8px;
}
.splash-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.splash-radar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}
.splash-radar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, rgba(255,255,255,0.92), transparent 28%);
  animation: radar 1.8s linear infinite;
}
.splash-dot {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.9);
}

.splash-inner h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #111827;
}
.splash-inner p {
  margin: 0;
  font-size: 13px;
  color: #9aa3b2;
  letter-spacing: 1px;
}
.splash-bar {
  width: 80px;
  height: 3px;
  background: #e6eaf0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.splash-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffb020, #ff7a00);
  border-radius: 999px;
  animation: splashLoad 1.6s ease-out forwards;
}
@keyframes splashLoad { from { width: 0; } to { width: 100%; } }

/* ---------- 顶部悬浮栏 ---------- */
.bar {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.2s;
}

body.panel-open .bar { opacity: 0; pointer-events: none; }
body.panel-open .bar > * { pointer-events: none; }

.bar-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: auto;
  max-width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 13px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(140deg, #ffb020, #ff7a00);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.32);
  padding: 4px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }

.brand-radar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.brand-radar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, rgba(255, 255, 255, 0.9), transparent 30%);
  animation: radar 2.4s linear infinite;
}

@keyframes radar { to { transform: rotate(360deg); } }

.brand-dot {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.brand-text b { font-size: 15px; letter-spacing: 0.3px; }
.brand-text small { font-size: 10.5px; color: var(--dim); white-space: nowrap; }

/* 分隔线 */
.bar-card .bar-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  flex: none;
}

.city-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}
.city-pill:hover { background: rgba(255, 122, 0, 0.08); }
.city-pill:active { transform: scale(0.96); }
.city-pill svg { color: #ff7a00; }

.bar-live {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  transition: background 0.3s;
  flex: none;
}

.bar-live.is-live { color: var(--ok); }
.bar-live.is-live .live-dot {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.bar-stats {
  display: flex;
  gap: 14px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  align-items: center;
}

.bar-login {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(140deg, #ffb020, #ff7a00);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
}
.bar-login:active { transform: scale(0.97); }

.bar-settings {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.bar-settings:hover { background: rgba(0, 0, 0, 0.05); }
.bar-settings:active { transform: scale(0.92); }

.stat { display: flex; align-items: baseline; gap: 3px; line-height: 1; }
.stat b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 10px; color: var(--dim); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn:hover { background: #f8fafc; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #ffb020, #ff7a00);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 122, 0, 0.28);
}

.btn-primary:hover { background: linear-gradient(135deg, #ffbb3d, #ff8a1e); }
.btn-primary.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-primary.is-loading::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost { background: #f3f5f8; border-color: #e6eaf0; }
.btn-ghost:hover { background: #e9edf3; }

.btn-still {
  background: #e8f9ef;
  border-color: #bbf0cf;
  color: #15803d;
}

.btn-still:hover { background: #d9f5e5; }

/* ---------- 地图铺满 ---------- */
.stage { position: fixed; inset: 0; }

.map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #e9edf2;
}

/* 标记内容（由高德自定义 Marker 承载） */
.amk {
  position: relative;
  width: 0;
  height: 0;
  pointer-events: auto;
  cursor: pointer;
}

.amk.is-faded { opacity: 0.6; }

.mk-tail {
  position: absolute;
  left: -5px;
  top: -9px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px 2px 5px rgba(15, 23, 42, 0.12);
  z-index: 0;
}

.mk-bubble {
  position: absolute;
  bottom: 8px;
  left: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid color-mix(in srgb, var(--c, var(--amber)) 65%, #fff);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
  color: #111827;
  white-space: nowrap;
  transition: transform 0.18s, box-shadow 0.2s;
  z-index: 1;
}

.mk-bubble b { font-size: 14px; line-height: 1; }
.mk-bubble i {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: color-mix(in srgb, var(--c, var(--amber)) 72%, #111827);
}

.mk-meta {
  position: absolute;
  top: 5px;
  left: 0;
  transform: translateX(-50%);
  font-size: 10px;
  color: #4b5563;
  background: rgba(255, 255, 255, 0.92);
  padding: 1px 6px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.amk.is-fresh .mk-meta { opacity: 1; }

.amk.is-fresh .mk-bubble::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--c, var(--amber)) 50%, transparent);
  animation: mkPulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes mkPulse {
  0% { transform: scale(0.92); opacity: 0.85; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

.amk:hover .mk-bubble { transform: translateX(-50%) scale(1.06); }

.amk.is-selected { z-index: 80; }
.amk.is-selected .mk-bubble {
  transform: translateX(-50%) scale(1.12);
  border-color: var(--c, var(--amber));
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.24), 0 0 0 3px color-mix(in srgb, var(--c, var(--amber)) 18%, transparent);
}
.amk.is-selected .mk-meta { opacity: 1; }

.me-amk { position: relative; width: 0; height: 0; }

.me-amk span {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2563eb;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.18), 0 2px 8px rgba(15, 23, 42, 0.3);
}

/* ---------- 地图悬浮控件 ---------- */
.map-tools {
  position: absolute;
  right: 14px;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
}

.map-tool {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  background: #fff;
  color: #374151;
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, transform 0.15s;
}

.map-tool:hover { background: #f8fafc; }
.map-tool:active { transform: scale(0.94); }

.map-tool.is-busy { color: var(--amber); cursor: progress; box-shadow: 0 0 0 2px rgba(255, 138, 30, 0.3), var(--shadow); }
.map-tool.is-busy svg { animation: toolSpin 0.9s linear infinite; }

.map-tool.is-following {
  color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3), var(--shadow);
}

@keyframes toolSpin { to { transform: rotate(360deg); } }

.map-legend {
  position: absolute;
  left: 14px;
  top: 84px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  max-width: 42%;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-size: 10.5px;
  color: #4b5563;
  z-index: 20;
}

.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.legend-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c, var(--amber));
}

/* 添加上报 FAB */
.fab {
  position: absolute;
  right: 16px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #ffb020, #ff7a00);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 10px 26px rgba(255, 122, 0, 0.4);
  transition: transform 0.16s, box-shadow 0.2s;
}

.fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(255, 122, 0, 0.46); }
.fab:active { transform: scale(0.95); }

/* 查看列表 */
.panel-open {
  position: absolute;
  left: 16px;
  bottom: 26px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.04);
  background: #fff;
  color: #1f2937;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.panel-open:hover { background: #f8fafc; }
.panel-open b { color: var(--amber); font-variant-numeric: tabular-nums; }

.map-hint {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  font-size: 11.5px;
  color: var(--muted);
  z-index: 20;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.4s;
}

.map-offline {
  position: absolute;
  left: 50%;
  bottom: 132px;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #b45309;
  font-size: 11px;
  z-index: 21;
}

.attrib {
  position: absolute;
  right: 6px;
  bottom: 2px;
  font-size: 9px;
  color: rgba(17, 24, 39, 0.35);
  text-decoration: none;
  z-index: 10;
}

.attrib:hover { color: rgba(17, 24, 39, 0.6); }

/* ---------- 列表抽屉 ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(15, 23, 42, 0.26);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.24s;
}

body.panel-open .drawer-backdrop { opacity: 1; }

.panel {
  position: fixed;
  z-index: 260;
  top: 0;
  bottom: 0;
  left: 0;
  width: 384px;
  max-width: 88vw;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border-radius: 0 22px 22px 0;
  box-shadow: 18px 0 46px rgba(15, 23, 42, 0.16);
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.panel-open .panel { transform: none; }

.panel-head {
  padding: 18px 18px 12px;
  border-bottom: 1px solid #f0f3f7;
}

.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-title h2 { margin: 0; font-size: 16px; letter-spacing: 0.2px; }

/* 实时同步小组件 */
.sync-widget {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 999px;
  background: #f4f7fb; border: 1px solid #e8edf4;
  font-size: 11px; color: var(--dim);
  white-space: nowrap; flex-shrink: 0;
}
.sync-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #c8d0dc; flex-shrink: 0;
  transition: background 0.3s;
}
.sync-dot.is-live {
  background: #22c55e;
  animation: syncPulse 1.8s ease-in-out infinite;
}
@keyframes syncPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.sync-count { font-weight: 600; color: #475569; }
.sync-btn {
  border: 0; background: none; cursor: pointer; padding: 2px;
  color: #64748b; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s, transform 0.6s;
}
.sync-btn:hover { color: #2563eb; background: #e8eefc; }
.sync-btn:active { transform: scale(0.9); }
.sync-btn svg.is-spinning { animation: syncSpin 0.7s ease-in-out; }
@keyframes syncSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.sync-time { color: #9aa6b8; font-size: 10px; }

.panel-tools { display: flex; align-items: center; gap: 10px; }

.link-btn {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}

.link-btn:hover, .link-btn.is-on { color: var(--amber); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-bottom: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #e6eaf0;
  background: #fff;
  color: #4b5563;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.18s;
}

.chip b { font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; }

.chip.is-on {
  background: color-mix(in srgb, var(--c, var(--amber)) 12%, #fff);
  border-color: color-mix(in srgb, var(--c, var(--amber)) 40%, #fff);
  color: color-mix(in srgb, var(--c, var(--amber)) 78%, #111827);
}

.chip.is-on b { color: inherit; opacity: 0.7; }

.panel-note {
  margin: 10px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--dim);
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: #dfe5ee transparent;
}

/* ---------- 列表卡片 ---------- */
.rcard {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid #edf0f5;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.18s, box-shadow 0.2s;
  animation: cardIn 0.3s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.rcard:hover {
  border-color: #dfe5ee;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.rcard.is-active {
  border-color: rgba(255, 138, 30, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 138, 30, 0.14), 0 8px 20px rgba(15, 23, 42, 0.08);
}

.rcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: color-mix(in srgb, var(--c, var(--amber)) 78%, #111827);
  background: color-mix(in srgb, var(--c, var(--amber)) 11%, #fff);
  border: 1px solid color-mix(in srgb, var(--c, var(--amber)) 26%, #fff);
  white-space: nowrap;
}

.tag b { font-size: 13px; }

.tag-lg { font-size: 12.5px; padding: 6px 13px; }
.tag-lg b { font-size: 16px; }

.rcard-age { font-size: 10.5px; color: var(--dim); white-space: nowrap; }

.rcard-title {
  margin: 9px 0 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
  color: #111827;
}

.rcard-desc {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rcard-place {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--dim);
}

.rcard-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--dim);
}

.rcard-foot .who { color: var(--muted); }
.rcard-foot .trust { color: #15803d; }
.rcard-foot .dist {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 6px;
  background: #eef4ff;
  color: #2563eb;
}

/* ---------- 空状态 ---------- */
.empty {
  margin: auto;
  padding: 40px 20px;
  text-align: center;
}

.empty-emoji { font-size: 34px; opacity: 0.75; }
.empty-title { margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.empty-sub { margin: 0; font-size: 11.5px; color: var(--dim); line-height: 1.6; }

/* ---------- 弹层 ---------- */
.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 24px;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s;
}

.sheet-layer.is-open .sheet-backdrop { opacity: 1; }

.sheet {
  position: relative;
  width: min(448px, calc(100vw - 32px));
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 20px 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.3);
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  transition: opacity 0.24s, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet-layer.is-open .sheet { opacity: 1; transform: none; }

.sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  margin: -6px auto 14px;
}

.sheet h3 { margin: 0 0 5px; font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }

.sheet-sub {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sheet-sub::before {
  content: "📍";
  font-size: 12px;
  flex: none;
}

.field { margin-bottom: 14px; }

.field > label {
  display: block;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #4b5563;
  letter-spacing: 0.2px;
}

.field .opt {
  font-weight: 400;
  color: var(--dim);
  margin-left: 4px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid #e6eaf0;
  background: #f7f9fc;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  resize: none;
}

.field input::placeholder,
.field textarea::placeholder { color: #a9b1bf; }

.field input:focus,
.field textarea:focus {
  border-color: rgba(255, 138, 30, 0.6);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 138, 30, 0.1);
}

/* 分类分组 */
.kind-groups { display: flex; flex-direction: column; gap: 10px; }

.kind-group-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10.5px;
  color: var(--dim);
}

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

.kind {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 42px;
  padding: 0 6px;
  border-radius: 12px;
  border: 1px solid #e6eaf0;
  background: #f7f9fc;
  color: #4b5563;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s;
}

.kind b { font-size: 16px; }

.kind:hover { background: #eff3f8; transform: translateY(-1px); }

.kind.is-on {
  background: color-mix(in srgb, var(--c, var(--amber)) 14%, #fff);
  border-color: color-mix(in srgb, var(--c, var(--amber)) 60%, #fff);
  color: color-mix(in srgb, var(--c, var(--amber)) 85%, #111827);
  font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--c, var(--amber)) 20%, transparent);
}

.sheet-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.sheet-actions .btn { flex: 1; height: 44px; font-size: 14px; }

/* 详情 */
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid #e6eaf0;
  background: #f7f9fc;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
}

.icon-btn:hover { color: var(--text); background: #eef2f7; }

.detail-title { margin: 14px 0 0; font-size: 18px; line-height: 1.4; }

.detail-place { margin: 8px 0 0; font-size: 12px; color: var(--dim); }

.detail-desc {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
}

.detail-note {
  margin: 12px 0 0;
  padding: 11px 13px;
  border-radius: 11px;
  background: #f7f9fc;
  border-left: 2px solid rgba(255, 138, 30, 0.65);
  font-size: 12.5px;
  line-height: 1.6;
  color: #4b5563;
}

.detail-note.is-muted { color: var(--dim); border-left-color: #e6eaf0; }

.trust-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--dim);
}

.trust-bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: #eef1f6;
  overflow: hidden;
}

.trust-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c, var(--amber)) 55%, #fff), var(--c, var(--amber)));
  transition: width 0.4s;
}

.trust-row b { color: #111827; font-variant-numeric: tabular-nums; }

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--dim);
}

.detail-counts {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.detail-counts > div {
  flex: 1;
  padding: 9px;
  border-radius: 11px;
  background: #f7f9fc;
  text-align: center;
}

.detail-counts b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.detail-counts span { font-size: 10px; color: var(--dim); }

.delete-btn {
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid #fecdd3;
  background: #fff5f6;
  color: #dc2626;
  font-size: 12px;
  cursor: pointer;
}

.delete-btn:hover { background: #ffe4e6; }

.detail-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--dim);
}

/* ---------- toast ---------- */
.toasts {
  position: fixed;
  right: 18px;
  top: 76px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(340px, 78vw);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px 11px 13px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.94);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(10px);
  font-size: 12.5px;
  line-height: 1.5;
  color: #f9fafb;
  animation: toastIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
  background: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
}
.toast--ok { background: rgba(22, 101, 52, 0.94); }
.toast--ok::before { background: #86efac; box-shadow: 0 0 0 3px rgba(134,239,172,0.18); }
.toast--err { background: rgba(185, 28, 28, 0.94); }
.toast--err::before { background: #fca5a5; box-shadow: 0 0 0 3px rgba(252,165,165,0.18); }

.toast.is-out { opacity: 0; transform: translateX(16px); transition: 0.22s; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- 邀请码门禁 ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(110% 70% at 50% -10%, rgba(255, 176, 32, 0.18), transparent 62%),
    radial-gradient(90% 55% at 50% 108%, rgba(37, 99, 235, 0.10), transparent 66%),
    #f4f6f9;
}

.gate-card {
  position: relative;
  width: min(420px, 100%);
  margin: auto;
  padding: 24px 22px 20px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(230, 234, 240, 0.9);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.13), 0 2px 6px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
/* 顶部品牌渐变条 */
.gate-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ffb020, #ff7a00);
}

.gate-close {
  position: absolute;
  top: 14px;
  right: 14px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.gate-close:hover { background: #f3f5f8; color: var(--text); }

.gate-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.gate-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.gate-brand .brand-text b { font-size: 15px; }
.gate-brand .brand-text small { font-size: 10px; }

.gate h1 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.gate-sub {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.gate-sub b { color: #d97706; }

/* 表单字段 */
.gf { margin-bottom: 12px; }

.gf > label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.gf input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #e3e8ef;
  background: #f8fafc;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.gf input::placeholder {
  font-size: 13px;
  color: #a9b1bf;
}

.gf input:focus {
  border-color: rgba(255, 138, 30, 0.65);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 138, 30, 0.12);
}

#bind-invite {
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* 人机验证 */
.captcha-row {
  display: flex;
  gap: 9px;
  align-items: stretch;
}
.captcha-q {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 138, 30, 0.4);
  background: #fff8f0;
  color: #d97706;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, opacity 0.18s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.captcha-q:hover:not(:disabled) { border-color: var(--amber); background: #fff1e0; }
.captcha-q:disabled { opacity: 0.5; cursor: not-allowed; color: var(--dim); border-color: var(--line-strong); background: #f5f7fa; }
.captcha-row input {
  width: 108px;
  flex: none;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #e3e8ef;
  background: #f8fafc;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}
.captcha-row input:focus {
  border-color: rgba(255, 138, 30, 0.65);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 138, 30, 0.12);
}

.gate-error {
  min-height: 16px;
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #dc2626;
  opacity: 0;
  transition: opacity 0.2s;
}

.gate-error.is-on { opacity: 1; }

.gate-btn {
  width: 100%;
  height: 50px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.gate-btn.btn-primary { box-shadow: 0 10px 24px rgba(255, 122, 0, 0.3); transition: transform .12s, box-shadow .2s, opacity .2s; }
.gate-btn.btn-primary:active { transform: scale(0.98); }
.gate-btn.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
/* 提交按钮加载态 */
.gate-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.gate-btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gate-btn.btn-ghost { background: #f5f7fa; border-color: #e6eaf0; font-weight: 600; }

.gate-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  font-size: 11px;
  color: var(--dim);
}

.gate-divider::before,
.gate-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #eef1f6;
}

.gate-tip {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--dim);
  text-align: center;
}

.whoami {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 10.5px;
  color: #15803d;
}

.whoami:empty { display: none; }

.whoami.is-clickable { cursor: pointer; }
.whoami.is-clickable:hover { text-decoration: underline; }

.whoami-avatar {
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  border-radius: 6px;
  background: #f1f5f9;
}
.whoami b { color: #15803d; font-weight: 700; }
.whoami-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color .15s;
}
.whoami-id:hover { color: var(--amber); }

.whoami-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 780px) {
  .bar { top: 8px; left: 8px; right: 8px; }
  .bar-card { padding: 4px; gap: 2px; border-radius: 16px; }

  .brand { padding: 4px 8px 4px 4px; border-radius: 12px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 9px; padding: 3px; }
  .brand-text small { display: none; }
  .brand-text b { font-size: 14px; }

  .city-pill { height: 32px; padding: 0 8px; font-size: 13px; }
  .bar-live { height: 32px; padding: 0 8px; font-size: 11.5px; }
  .bar-stats { height: 32px; padding: 0 8px; gap: 10px; }
  .stat b { font-size: 13px; }
  .stat span { font-size: 9px; }
  .bar-settings { width: 32px; height: 32px; }
  .bar-settings svg { width: 16px; height: 16px; }
  .bar-login { height: 32px; padding: 0 12px; font-size: 11.5px; }

  .map-tools { top: 70px; right: 10px; gap: 7px; }
  .map-tool { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; }

  .map-legend { top: 70px; left: 10px; max-width: 48%; padding: 7px 9px; gap: 4px 9px; font-size: 10px; }

  .fab { right: 14px; bottom: calc(20px + env(safe-area-inset-bottom)); width: 54px; height: 54px; }
  .panel-open { left: 12px; bottom: calc(24px + env(safe-area-inset-bottom)); height: 40px; }
  .map-hint { bottom: calc(86px + env(safe-area-inset-bottom)); font-size: 11px; }
  .map-offline { bottom: calc(122px + env(safe-area-inset-bottom)); max-width: 92vw; text-align: center; }
  .attrib { bottom: 1px; }

  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 64vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(102%);
    box-shadow: 0 -18px 44px rgba(15, 23, 42, 0.2);
  }

  body.panel-open .panel { transform: none; }
  .panel-head { padding: 14px 14px 10px; }
  .panel-title h2 { font-size: 15px; }
  .sync-widget { gap: 5px; padding: 3px 8px; font-size: 10px; }
  .sync-time { display: none; }
  .panel-body { padding: 10px; }

  .sheet-layer { padding: 0; }
  .sheet {
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  }

  .toasts { right: 12px; left: 12px; top: auto; bottom: calc(88px + env(safe-area-inset-bottom)); max-width: none; }

  .gate-card { padding: 22px 18px 18px; border-radius: 18px; }
}

@media (max-width: 420px) {
  .kind-grid { grid-template-columns: repeat(2, 1fr); }
  .map-legend { display: none; }
}

/* ============ 键盘弹起时抽屉/表单跟随 ============ */
:root {
  --kb-inset: 0px;
  --vv-bottom: 0px;
}

.composer { padding-bottom: calc(20px + var(--kb-inset)); }
/* 键盘弹起时 padding-bottom 必须即时响应，不能有过渡，否则会与高频 visualViewport 事件打架产生抖动 */
.sheet { transition: transform 0.25s cubic-bezier(.2,.8,.2,1), opacity 0.24s; }
.sheet.composer, .sheet.settings { transition: none; }

/* ============ place-row：📍自动填充路段 ============ */
.place-row {
  display: flex;
  gap: 8px;
}
.place-row input { flex: 1; min-width: 0; }
.place-sense {
  flex: none;
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  border-color: rgba(255, 138, 30, 0.4);
  background: #fff8f0;
  color: #d97706;
}
.place-sense:hover:not(:disabled) { background: #fff1e0; border-color: var(--amber); }
.place-sense:disabled { opacity: 0.6; cursor: progress; }

/* ============ Gate Tab 切换 ============ */
.gate-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 16px;
  padding: 4px;
  background: #f2f5f9;
  border-radius: 13px;
}
.gate-tab {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.gate-tab.is-active {
  background: #fff;
  color: #d97706;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.gate-tab-pane { display: none; }
.gate-tab-pane.is-active { display: block; animation: gateIn 0.25s; }
@keyframes gateIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============ 封禁覆盖层 ============ */
.ban-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.2s;
}
.ban-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  border-top: 4px solid var(--red);
}
.ban-ico { font-size: 40px; margin-bottom: 8px; }
.ban-card h3 { margin: 8px 0 10px; font-size: 18px; }
.ban-card p { color: var(--muted); margin: 4px 0; font-size: 13.5px; line-height: 1.6; }
.ban-card .btn { margin-top: 18px; }
.hidden { display: none !important; }

/* ---------- 门禁小屏适配 ---------- */
@media (max-width: 420px) {
  .gate { padding: 16px 14px; }
  .gate-card { padding: 20px 18px 16px; border-radius: 20px; }
  .gate h1 { font-size: 19px; }
  .gate-sub { font-size: 12px; margin-bottom: 14px; }
  .gf { margin-bottom: 10px; }
  .gf input { height: 46px; font-size: 14.5px; }
  .gate-btn { height: 48px; font-size: 14.5px; }
  .gate-close { top: 12px; right: 12px; }
}

/* ============ 设置 / 个人主页 ============ */
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.settings-head h3 { margin: 0; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(255, 176, 32, 0.1), rgba(37, 99, 235, 0.05));
}
.profile-avatar {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}
.profile-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-meta b {
  font-size: 16px;
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-id { font-size: 11.5px; color: var(--muted); }
.profile-id code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: opacity .15s;
}
.profile-id code:hover { opacity: .7; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.avatar-opt {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: #f6f8fb;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.16s, background 0.16s;
}
.avatar-opt:hover { background: #fff; transform: translateY(-1px); }
.avatar-opt.is-on {
  border-color: rgba(255, 138, 30, 0.75);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 138, 30, 0.14);
}

.settings-rows {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  text-align: left;
  cursor: default;
}
.settings-row > span { color: var(--muted); }
.settings-row > b {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--dim);
}
.settings-row > .link-btn { margin-left: 8px; }
.settings-row--danger {
  justify-content: center;
  color: var(--red);
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.16s;
}
.settings-row--danger:hover { background: rgba(239, 68, 68, 0.07); }

@media (max-width: 420px) {
  .avatar-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .avatar-opt { font-size: 19px; border-radius: 10px; }
  .profile-avatar { width: 50px; height: 50px; font-size: 26px; }
}

/* ========== 通用确认弹层（替代 confirm） ========== */
.confirm-modal {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.confirm-modal[hidden] { display: none !important; }
.confirm-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}
.confirm-card {
  position: relative; z-index: 1;
  width: min(360px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.3);
  animation: confirmIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes confirmIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.confirm-msg {
  margin: 0 0 18px;
  font-size: 15px; line-height: 1.6;
  text-align: center; color: var(--text);
}
.confirm-actions {
  display: flex; gap: 10px;
}
.confirm-actions .btn { flex: 1; height: 44px; }

/* ========== 城市选择 ========== */
.city-sheet { max-height: 78vh; overflow-y: auto; }
.city-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.city-head h3 { margin: 0; }
.city-auto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  margin-bottom: 16px;
  border: 1px dashed rgba(255, 122, 0, 0.5);
  border-radius: 12px;
  background: rgba(255, 122, 0, 0.06);
  color: #d97706;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}
.city-auto:hover { background: rgba(255, 122, 0, 0.12); }
.city-auto:active { transform: scale(0.99); }

.city-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.city-opt {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.city-opt:hover { border-color: rgba(255, 138, 30, 0.5); background: #fff7ed; }
.city-opt:active { transform: scale(0.97); }
.city-opt.is-on {
  border-color: #ff7a00;
  background: linear-gradient(140deg, #ffb020, #ff7a00);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
}
.city-opt-name { display: block; }
.city-opt-prov { display: block; font-size: 11px; color: #999; font-weight: 400; }
.city-opt.is-on .city-opt-prov { color: rgba(255,255,255,0.85); }

/* 搜索结果：单列列表，带城市名 + 省份 + 命中高亮 */
.city-grid:has(.city-opt-search) {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.city-opt-search {
  height: auto;
  min-height: 52px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
}
.city-opt-search .city-opt-name {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.city-opt-search .city-opt-prov {
  margin-top: 2px;
  font-size: 11px;
}
.city-opt-search mark {
  background: transparent;
  color: #ff7a00;
  font-weight: 700;
  padding: 0;
}
.city-opt-search.is-on mark { color: #fff3e0; }
.city-py-tag {
  font-size: 11px;
  font-weight: 500;
  color: #ff7a00;
  background: #fff3e0;
  padding: 1px 6px;
  border-radius: 6px;
}
.city-opt-search.is-on .city-py-tag {
  color: #fff;
  background: rgba(255,255,255,0.25);
}

/* 搜索框 */
.city-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 12px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f7f8;
  color: #999;
  transition: border-color 0.15s, background 0.15s;
}
.city-search:focus-within { border-color: #ff7a00; background: #fff; }
.city-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}
.city-search input::placeholder { color: #bbb; }
.city-search button {
  border: 0;
  background: transparent;
  color: #bbb;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

/* 按省分组 */
.city-prov-group { margin-bottom: 14px; }
.city-prov-title {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin: 0 0 8px 2px;
  letter-spacing: 0.5px;
}
.city-prov-cities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.city-empty {
  text-align: center;
  color: #bbb;
  font-size: 14px;
  padding: 32px 0;
}

@media (max-width: 380px) {
  .city-prov-cities { grid-template-columns: repeat(2, 1fr); }
  .city-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 600px) {
  .city-prov-cities { grid-template-columns: repeat(4, 1fr); }
}

/* ===== 获取邀请码入口 ===== */
.invite-help {
  margin-top: -4px;
  margin-bottom: 12px;
}
.invite-get {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent, #ff7a00);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 0;
}
.invite-get:hover { opacity: 0.8; }

/* ===== 通用 Modal ===== */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-layer[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}
.modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: rgba(0, 0, 0, 0.12); }

/* ===== 微信公众号指引 Modal ===== */
.wechat-head {
  text-align: center;
  margin-bottom: 22px;
}
.wechat-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(7, 193, 96, 0.35);
}
.wechat-head h3 {
  font-size: 19px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.wechat-sub {
  font-size: 13px;
  color: #888;
}
.wechat-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #f7f8fa;
  border-radius: 14px;
  margin-bottom: 18px;
}
.wechat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffb020, #ff7a00);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.wechat-info {
  flex: 1;
  min-width: 0;
}
.wechat-info b {
  display: block;
  font-size: 16px;
  color: #1a1a1a;
}
.wechat-info small {
  font-size: 12px;
  color: #888;
}
.wechat-info code {
  background: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #ff7a00;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  min-height: 32px;
}
.wechat-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.wechat-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #444;
}
.wechat-step .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb020, #ff7a00);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wechat-step b { color: #1a1a1a; }
.wechat-qr {
  text-align: center;
  margin-bottom: 18px;
  padding: 16px;
  background: #f7f8fa;
  border-radius: 14px;
}
.wechat-qr img {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}
.wechat-qr p {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

/* ===== 登录页视觉增强（参考 Folia 风格） ===== */
.gate {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 176, 32, 0.08), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(255, 122, 0, 0.06), transparent 50%),
    linear-gradient(180deg, #fafafa 0%, #f0f0f5 100%);
}
.gate-card {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.gate-brand .brand-mark {
  box-shadow: 0 10px 30px rgba(255, 122, 0, 0.3);
}
.gate-tabs {
  background: #f2f2f7;
  padding: 4px;
  border-radius: 12px;
}
.gate-tab {
  border-radius: 9px;
  transition: all 0.2s;
}
.gate-tab.is-active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (max-width: 380px) {
  .modal { padding: 22px 18px 20px; }
  .wechat-qr img { width: 120px; height: 120px; }
}
