/* 安寻机主站样式 — 无外部 CSS 依赖，适合国内首屏
   主题：跟随系统自动切换（data-theme 由 head 内联脚本 + JS 监听同步） */
:root {
  --radius: 16px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  /* 默认深色变量（无匹配时的兜底） */
  --bg: #0c0f14;
  --surface: #12171f;
  --surface-solid: #141a24;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);
  --text: #e8ecf1;
  --text-strong: #ffffff;
  --muted: #7c8a9e;
  --muted-2: #5a6a80;
  --accent: #0ea5e9;
  --accent-soft: #38bdf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --nav-bg: rgba(12, 15, 20, 0.82);
  --bottom-bg: rgba(12, 15, 20, 0.92);
  --map-bg: #0a1018;
  --toast-bg: rgba(15, 23, 42, 0.94);
  --toast-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 40px -16px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* 系统浅色：高对比文字（深字 + 浅底） */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef2f6;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --border: rgba(15, 23, 42, 0.12);
    --border-hover: rgba(15, 23, 42, 0.2);
    --text: #1e293b;
    --text-strong: #0f172a;
    --muted: #334155;
    --muted-2: #475569;
    --accent: #0369a1;
    --accent-soft: #0284c7;
    --ok: #047857;
    --warn: #b45309;
    --danger: #b91c1c;
    --nav-bg: rgba(255, 255, 255, 0.94);
    --bottom-bg: rgba(255, 255, 255, 0.97);
    --map-bg: #dbe3ec;
    --toast-bg: rgba(255, 255, 255, 0.98);
    --toast-border: rgba(15, 23, 42, 0.14);
    --card-shadow: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 8px 28px -10px rgba(15, 23, 42, 0.14);
    color-scheme: light;
  }
}

/* JS 同步后的显式主题（保证与系统一致、并驱动部分组件） */
html[data-theme="dark"] {
  --bg: #0c0f14;
  --surface: #12171f;
  --surface-solid: #141a24;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);
  --text: #e8ecf1;
  --text-strong: #ffffff;
  --muted: #7c8a9e;
  --muted-2: #5a6a80;
  --accent: #0ea5e9;
  --accent-soft: #38bdf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --nav-bg: rgba(12, 15, 20, 0.82);
  --bottom-bg: rgba(12, 15, 20, 0.92);
  --map-bg: #0a1018;
  --toast-bg: rgba(15, 23, 42, 0.94);
  --toast-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 40px -16px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.12);
  --border-hover: rgba(15, 23, 42, 0.2);
  --text: #1e293b;
  --text-strong: #0f172a;
  --muted: #334155;
  --muted-2: #475569;
  --accent: #0369a1;
  --accent-soft: #0284c7;
  --ok: #047857;
  --warn: #b45309;
  --danger: #b91c1c;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --bottom-bg: rgba(255, 255, 255, 0.97);
  --map-bg: #dbe3ec;
  --toast-bg: rgba(255, 255, 255, 0.98);
  --toast-border: rgba(15, 23, 42, 0.14);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 1) inset, 0 8px 28px -10px rgba(15, 23, 42, 0.14);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

.bg-mesh {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(14, 165, 233, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(99, 102, 241, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(14, 165, 233, 0.05), transparent 55%),
    var(--bg);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .bg-mesh {
    background:
      radial-gradient(ellipse 80% 50% at 10% -10%, rgba(14, 165, 233, 0.08), transparent 55%),
      radial-gradient(ellipse 60% 40% at 90% 10%, rgba(99, 102, 241, 0.05), transparent 50%),
      var(--bg);
  }
}
html[data-theme="light"] .bg-mesh {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(14, 165, 233, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(99, 102, 241, 0.05), transparent 50%),
    var(--bg);
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.35;
  background-image:
    linear-gradient(rgba(128, 128, 128, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 128, 128, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

.shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* Layout */
.container { width: 100%; max-width: 80rem; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px) { .container { padding-left: 1.5rem; padding-right: 1.5rem; } }

.page-main { flex: 1; padding-top: 1.25rem; padding-bottom: 1.25rem; }
@media (min-width: 640px) { .page-main { padding-top: 1.75rem; padding-bottom: 1.75rem; } }
/* 手机底部导航 + 完整设备卡可滚动到底 */
@media (max-width: 1023px) {
  .page-main {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
  .panel-left {
    min-height: 0;
    overflow: visible;
  }
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 640px) { .layout { gap: 1.25rem; } }
@media (min-width: 1024px) {
  .layout {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 1.5rem;
    align-items: start;
  }
}

/* 移动端：结果优先、地图在后 */
.panel-left { display: flex; flex-direction: column; gap: 1rem; order: 1; }
.panel-map { min-width: 0; order: 2; }
@media (min-width: 1024px) {
  .panel-left, .panel-map { order: unset; }
}

/* Surfaces */
.surface {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius);
}
.surface-flat {
  background: rgba(128, 128, 128, 0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.device-card {
  padding: 1.25rem;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
/* 手机：卡片随内容撑开，完整展示全部字段，不内部裁切 */
@media (max-width: 1023px) {
  .device-card {
    min-height: 0;
    height: auto;
    overflow: visible;
  }
}
@media (min-width: 640px) { .device-card { padding: 1.5rem; } }
/* 桌面与地图等高时再给最小高度 */
@media (min-width: 1024px) {
  .device-card {
    min-height: 560px;
  }
}

.search-card { padding: 1.25rem; }
@media (min-width: 640px) { .search-card { padding: 1.5rem; } }

/* 地图高度：空状态/加载正常；有结果且无坐标时压矮，把空间让给设备信息 */
.map-shell {
  padding: 0.5rem;
  height: 200px;
  position: relative;
  transition: height 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.map-shell.is-expanded { height: min(70vh, 520px) !important; }

/* 查询结果后、无坐标伪地图：尽量矮 */
.map-shell.is-fake.is-compact {
  height: 118px;
}
.map-shell.is-fake.is-compact .map-empty-desc {
  display: none; /* 矮高度下只保留标题 */
}
.map-shell.is-fake.is-compact .map-empty-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  margin-bottom: 0;
}
.map-shell.is-fake.is-compact .map-empty-title {
  font-size: 12px;
}
.map-shell.is-fake.is-compact .map-empty {
  padding: 8px 12px 28px;
  gap: 4px;
}
.map-shell.is-fake.is-compact .map-baidu-logo {
  height: 18px;
  bottom: 6px;
  left: 8px;
}
.map-shell.is-fake.is-compact .map-fake-status {
  transform: scale(0.92);
  transform-origin: top left;
}

@media (min-width: 640px) {
  .map-shell { padding: 0.625rem; height: 260px; }
  .map-shell.is-expanded { height: min(70vh, 560px) !important; }
  .map-shell.is-fake.is-compact { height: 132px; }
}
@media (min-width: 1024px) {
  /* 桌面有坐标：大地图；无坐标紧凑伪地图 */
  .map-shell.is-live,
  .map-shell.is-live.is-expanded { height: 640px; }
  .map-shell.is-fake { height: 220px; }
  .map-shell.is-fake.is-compact { height: 148px; }
  .map-shell.is-fake.is-expanded { height: min(70vh, 480px) !important; }
}

/* 手机有结果时：设备卡完整展开，不设限高 */
@media (max-width: 1023px) {
  .layout:has(.map-shell.is-compact) .device-card,
  .layout:has(.map-shell.is-live) .device-card {
    min-height: 0;
    height: auto;
  }
}

.map-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
}
#map {
  width: 100%; height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--map-bg);
}
.map-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  background: var(--map-bg);
  color: var(--muted);
  font-size: 13px;
  z-index: 1;
}
.map-placeholder.done { display: none; }

/* 伪地图：无坐标不请求百度 API —— 地块/路网/噪点更像未定位底图 */
.map-fake {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--map-bg);
  overflow: hidden;
}
.map-fake.hidden { display: none !important; }

.map-fake-base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 30% 40%, rgba(56, 120, 160, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 60% at 75% 65%, rgba(40, 90, 70, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 20%, rgba(80, 100, 140, 0.08), transparent 60%),
    var(--map-bg);
  pointer-events: none;
}
html[data-theme="light"] .map-fake-base {
  background:
    radial-gradient(ellipse 90% 70% at 30% 40%, rgba(100, 160, 200, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 60% at 75% 65%, rgba(120, 170, 130, 0.16), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 20%, rgba(160, 180, 210, 0.14), transparent 60%),
    var(--map-bg);
}

/* 柔和地块色块 */
.map-fake-land {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(ellipse 42% 28% at 28% 38%, rgba(90, 120, 100, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 36% 32% at 72% 58%, rgba(70, 100, 130, 0.2) 0%, transparent 72%),
    radial-gradient(ellipse 30% 24% at 55% 78%, rgba(100, 110, 90, 0.14) 0%, transparent 70%),
    radial-gradient(ellipse 24% 20% at 18% 72%, rgba(80, 110, 140, 0.12) 0%, transparent 70%);
}
html[data-theme="light"] .map-fake-land {
  opacity: 0.7;
  background:
    radial-gradient(ellipse 42% 28% at 28% 38%, rgba(140, 175, 150, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 36% 32% at 72% 58%, rgba(130, 160, 190, 0.3) 0%, transparent 72%),
    radial-gradient(ellipse 30% 24% at 55% 78%, rgba(180, 185, 150, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 24% 20% at 18% 72%, rgba(150, 175, 200, 0.2) 0%, transparent 70%);
}

/* SVG 路网 + 街区轮廓 */
.map-fake-roads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}
.map-fake-roads .road {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-fake-roads .road.major {
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 2.2;
}
.map-fake-roads .road.minor {
  stroke: rgba(148, 163, 184, 0.16);
  stroke-width: 1.1;
}
.map-fake-roads .road.water {
  stroke: rgba(56, 189, 248, 0.18);
  stroke-width: 3;
  stroke-linecap: round;
}
.map-fake-roads .block {
  fill: rgba(148, 163, 184, 0.06);
  stroke: rgba(148, 163, 184, 0.2);
  stroke-width: 1;
}
.map-fake-roads .block.soft {
  fill: rgba(148, 163, 184, 0.04);
  stroke: rgba(148, 163, 184, 0.12);
}
.map-fake-roads .poi-ring {
  fill: none;
  stroke: rgba(14, 165, 233, 0.22);
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
}
.map-fake-roads .poi-ring.soft {
  stroke: rgba(14, 165, 233, 0.1);
  stroke-dasharray: 3 6;
}
html[data-theme="light"] .map-fake-roads .road.major {
  stroke: rgba(71, 85, 105, 0.28);
}
html[data-theme="light"] .map-fake-roads .road.minor {
  stroke: rgba(71, 85, 105, 0.14);
}
html[data-theme="light"] .map-fake-roads .block {
  fill: rgba(71, 85, 105, 0.05);
  stroke: rgba(71, 85, 105, 0.18);
}
html[data-theme="light"] .map-fake-roads .road.water {
  stroke: rgba(2, 132, 199, 0.22);
}

.map-fake-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(128, 128, 128, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 128, 128, 0.1) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black, transparent 88%);
  pointer-events: none;
}

/* 轻微胶片噪点 */
.map-fake-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
html[data-theme="light"] .map-fake-noise {
  opacity: 0.05;
  mix-blend-mode: multiply;
}
html.lite .map-fake-noise,
html.lite .map-fake-land {
  display: none;
}
html.lite .map-fake-roads {
  opacity: 0.55;
}

/* 百度地图 logo：左下角伪访问标识 */
.map-baidu-logo {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  height: 22px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
  opacity: 0.92;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}


.map-live {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.map-live.hidden { display: none !important; }
.map-live #map {
  position: absolute;
  inset: 0;
}

/* 无坐标空状态 */
.map-empty {
  position: absolute; inset: 0;
  z-index: 3;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 20px 20px 40px;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}
.map-empty--fake {
  background: transparent;
}
.map-empty.hidden { display: none !important; }

/* 伪地图状态芯片（加载时与文案同步） */
.map-fake-status {
  z-index: 6;
  pointer-events: none;
}
.map-fake-status .map-status-dot {
  background: var(--accent-soft);
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4);
  animation: pulse-dot 1.6s ease-out infinite;
}
.map-fake.is-loading .map-fake-status .map-status-dot {
  background: var(--accent-soft);
}
.map-fake.is-loading .poi-ring {
  stroke: rgba(14, 165, 233, 0.45);
  animation: ring-pulse 2.2s ease-out infinite;
}
.map-fake.is-loading .poi-ring.soft {
  stroke: rgba(14, 165, 233, 0.2);
  animation: ring-pulse 2.2s ease-out 0.4s infinite;
}
@keyframes ring-pulse {
  0% { opacity: 0.35; }
  50% { opacity: 1; }
  100% { opacity: 0.35; }
}

/* 地图区加载层：与左侧步骤文案对应 */
.map-load-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 20px 48px;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(8, 12, 18, 0.28) 0%,
    rgba(8, 12, 18, 0.45) 100%
  );
  backdrop-filter: blur(2px);
  pointer-events: none;
}
html[data-theme="light"] .map-load-overlay {
  background: linear-gradient(
    180deg,
    rgba(240, 243, 247, 0.45) 0%,
    rgba(240, 243, 247, 0.62) 100%
  );
}
.map-load-overlay.hidden { display: none !important; }
.map-load-ring {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.22);
  display: grid;
  place-items: center;
  color: var(--accent-soft);
  margin-bottom: 4px;
}
.map-load-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  max-width: 260px;
  line-height: 1.45;
}
.map-load-hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted-2);
  max-width: 240px;
}
.map-load-track {
  width: min(200px, 55%);
  height: 3px;
  border-radius: 99px;
  background: rgba(128, 128, 128, 0.18);
  overflow: hidden;
  margin-top: 2px;
}
.map-load-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
html.lite .map-load-overlay {
  backdrop-filter: none;
}
html.lite .map-fake.is-loading .poi-ring {
  animation: none;
}
.map-empty-ico {
  width: 56px; height: 56px; border-radius: 16px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.15);
  display: grid; place-items: center;
  color: var(--accent-soft);
  margin-bottom: 4px;
}
.map-empty-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}
.map-empty-desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted-2);
  max-width: 240px;
  line-height: 1.5;
}

/* 真实地图模式下隐藏伪地图相关控件高度补偿 */
.map-shell.is-live .map-fake { display: none !important; }
.map-shell.is-fake .map-live { display: none !important; }

.map-expand-btn {
  display: flex;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--nav-bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
@media (min-width: 1024px) {
  .map-expand-btn { display: none !important; }
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
@media (min-width: 640px) { .nav-inner { height: 4rem; } }

.logo-wrap { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(145deg, #38bdf8 0%, #0ea5e9 45%, #0284c7 100%);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px -4px rgba(14, 165, 233, 0.55);
  color: #fff;
}
.logo-title { font-size: 15px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.02em; line-height: 1.1; }
@media (min-width: 640px) { .logo-title { font-size: 16px; } }
.logo-sub { font-size: 11px; color: var(--muted-2); font-weight: 600; margin-top: 3px; letter-spacing: 0.02em; }
@media (min-width: 640px) { .logo-sub { font-size: 11px; } }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
@media (min-width: 640px) { .nav-actions { gap: 0.75rem; } }

.status-pill {
  display: none;
  align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.28);
}
@media (min-width: 640px) { .status-pill { display: inline-flex; } }
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #34d399;
  animation: pulse-dot 2s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-weight: 600; font-size: 14px;
  border-radius: 11px; font-family: inherit;
  transition: transform 0.12s, opacity 0.15s, filter 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
/* 禁用态保留点击：用于弱提醒（勿用 pointer-events:none） */
.btn:disabled,
.btn.is-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.15);
}
.btn.is-disabled:active,
.btn[aria-disabled="true"]:active,
.btn:disabled:active {
  transform: none;
}
.btn-primary {
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
  color: #041018;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px -6px rgba(14, 165, 233, 0.55);
  padding: 0.625rem 1.25rem;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-block { width: 100%; padding: 0.8rem 1rem; border-radius: 12px; }
.btn-icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(128, 128, 128, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0;
}
.btn-icon:hover { background: rgba(128, 128, 128, 0.12); color: var(--text-strong); }
.btn-icon.sm { width: 32px; height: 32px; }
.btn-icon.map-zoom {
  width: 36px; height: 36px;
  background: rgba(12, 15, 20, 0.82);
  backdrop-filter: blur(8px);
}

/* Search */
.search-field {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 6px 6px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-field:focus-within {
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.search-field input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--text-strong); font-size: 15px; min-width: 0; padding: 10px 0;
  font-family: inherit;
  font-weight: 500;
}
.search-field input::placeholder { color: var(--muted-2); opacity: 1; }

.lang-sel {
  appearance: none; -webkit-appearance: none;
  background: rgba(128, 128, 128, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 28px 8px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer; outline: none;
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.lang-sel:focus { border-color: rgba(14, 165, 233, 0.4); }
.lang-sel option { background: var(--surface-solid); color: var(--text-strong); }

/* Icons (inline SVG) */
.icon {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}
.icon svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.icon-stroke svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 0.85em; height: 0.85em; }
.icon-md { width: 1.1em; height: 1.1em; }
.icon-lg { width: 1.35em; height: 1.35em; }
.icon-xl { width: 1.75em; height: 1.75em; }
.icon-2xl { width: 2rem; height: 2rem; }

/* Map chips */
.map-chip {
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.map-overlay-tl { position: absolute; top: 12px; left: 12px; z-index: 2; pointer-events: none; }
.map-overlay-tr { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; flex-direction: column; gap: 6px; }
.map-overlay-bl {
  position: absolute; bottom: 12px; left: 12px; right: 12px; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  pointer-events: none;
}
.dot-ok { width: 6px; height: 6px; border-radius: 50%; background: #34d399; flex-shrink: 0; }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: inline-flex; } }

/* Trust strip */
.trust {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  max-height: 240px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s ease,
              margin 0.28s ease,
              transform 0.28s ease;
  transform: translateY(0);
}
@media (min-width: 640px) {
  .trust { margin-top: 1.5rem; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
}
/* 有查询结果后收起，把纵向空间留给设备信息 */
.trust.is-collapsed {
  max-height: 0 !important;
  opacity: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  transform: translateY(-6px);
  pointer-events: none;
}
.trust-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
}
.trust-ico {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 12px;
}
.trust-ico.sky { background: rgba(14, 165, 233, 0.1); color: #38bdf8; }
.trust-ico.ok { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.trust-ico.violet { background: rgba(139, 92, 246, 0.1); color: #a78bfa; }
.trust-ico.amber { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.trust-title { font-size: 12px; font-weight: 600; color: var(--text-strong); }
.trust-desc { font-size: 10px; color: var(--muted-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.lite .trust {
  transition: none;
}

/* Footer */
.footer {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: auto;
}
@media (min-width: 768px) { .footer { display: block; } }
.footer-inner {
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between; gap: 0.75rem;
  font-size: 11px; color: var(--muted-2);
}
@media (min-width: 640px) {
  .footer-inner { flex-direction: row; }
}
.footer-links { display: flex; align-items: center; gap: 1rem; }

/* Bottom nav */
.bottom-nav {
  display: block;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--bottom-bg);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (min-width: 768px) { .bottom-nav { display: none; } }
.bottom-nav-inner {
  display: flex; align-items: center; justify-content: space-around;
  padding: 0.6rem 0.5rem;
}
.bnav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 72px; padding: 4px 0;
  background: none; border: 0; color: var(--muted);
  font-family: inherit; font-size: 10px; font-weight: 500; cursor: pointer;
}
.bnav-btn:hover, .bnav-btn.active { color: var(--accent); font-weight: 700; }
.bnav-btn .icon { width: 1.25rem; height: 1.25rem; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 768px) {
  .modal-backdrop { align-items: center; padding: 24px; }
}
.modal-panel {
  width: 100%; max-width: 400px;
  animation: fade-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.25rem;
}
@media (max-width: 767px) {
  .modal-panel { max-width: none; border-radius: 20px 20px 0 0 !important; }
}
.modal-panel.pad-lg { padding: 1.5rem; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.modal-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-strong); }

.menu-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 12px; border-radius: 14px; cursor: pointer;
  transition: background 0.15s; border: 1px solid transparent;
}
.menu-row:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border);
}
.menu-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.menu-ico.sky { background: rgba(14, 165, 233, 0.1); color: #38bdf8; }
.menu-ico.violet { background: rgba(139, 92, 246, 0.1); color: #a78bfa; }
.menu-ico.ok { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.menu-text { min-width: 0; flex: 1; }
.menu-text strong { display: block; font-size: 14px; font-weight: 600; color: var(--text-strong); }
.menu-text span { display: block; font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.menu-chev { color: var(--muted-2); font-size: 10px; }

/* Empty / states */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 2.5rem 1rem;
}
.empty-ring {
  width: 72px; height: 72px; border-radius: 20px;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.12), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(14, 165, 233, 0.15);
  display: grid; place-items: center;
  margin-bottom: 1.25rem;
  color: #38bdf8;
}
.empty-title { margin: 0 0 0.5rem; font-size: 17px; font-weight: 700; color: var(--text-strong); }
.empty-desc { margin: 0; font-size: 13px; color: var(--muted); max-width: 260px; line-height: 1.55; font-weight: 500; }
.tag-row { margin-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted-2);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 999px; padding: 6px 12px;
}
.state-ico {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; margin-bottom: 1rem;
}
.state-ico.err { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.15); color: #f87171; }
.state-ico.warn { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.15); color: #fbbf24; }
.state-ico.mute { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); color: var(--muted); }

/* Device view */
.device-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
}
.device-head { display: flex; align-items: flex-start; gap: 12px; }
.device-avatar {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.2), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(14, 165, 233, 0.15);
  display: grid; place-items: center; color: var(--accent-soft); font-size: 20px;
}
.device-meta { min-width: 0; flex: 1; }
.device-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-strong);
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  line-height: 1.35;
}
.device-model {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  line-height: 1.35;
}
@media (min-width: 1024px) {
  .device-view { height: 100%; }
  .device-name, .device-model {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.device-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-on { background: rgba(16, 185, 129, 0.12); color: var(--ok); border: 1px solid rgba(16, 185, 129, 0.28); }
.badge-off { background: rgba(245, 158, 11, 0.12); color: var(--warn); border: 1px solid rgba(245, 158, 11, 0.28); }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; }
.badge-on .bdot { background: var(--ok); }
.badge-off .bdot { background: var(--warn); }
.bat { font-size: 12px; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.bat.ok { color: var(--ok); }
.bat.low { color: var(--danger); }

.loc-card {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(99, 102, 241, 0.06) 100%);
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: 14px; padding: 14px 16px;
}
.loc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.loc-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.loc-flag { font-size: 10px; color: var(--muted-2); font-weight: 600; }
.loc-addr { font-size: 15px; font-weight: 700; color: var(--text-strong); line-height: 1.4; margin-bottom: 12px; }
.loc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.loc-grid .k { font-size: 10px; color: var(--muted-2); font-weight: 600; margin-bottom: 4px; }
.loc-grid .v {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: normal;
  word-break: break-word;
  overflow: visible;
}
.loc-addr {
  white-space: normal;
  word-break: break-word;
  overflow: visible;
}

.contact-strip {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
}
.contact-ico {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(128, 128, 128, 0.08);
  display: grid; place-items: center; color: var(--muted); flex-shrink: 0;
}
.contact-k { font-size: 10px; color: var(--muted-2); font-weight: 600; margin-bottom: 2px; }
.contact-v {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: normal;
  word-break: break-word;
  overflow: visible;
}

/* 手机：规格区完整展开，不内部滚动裁切 */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 0 0 auto;
  align-content: start;
  overflow: visible;
  max-height: none;
}
@media (min-width: 1024px) {
  .spec-grid {
    flex: 1 1 auto;
    /* 桌面与高地图并排时，规格区可在卡片内滚动 */
    overflow-y: auto;
    max-height: none;
  }
}
.spec-item {
  background: rgba(128, 128, 128, 0.06);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 13px; min-width: 0;
}
.spec-item .label {
  font-size: 11px; color: var(--muted-2); font-weight: 600; margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.spec-item .value {
  font-size: 13px; color: var(--text-strong); font-weight: 600;
  word-break: break-all; line-height: 1.35;
}
.muted-dash { color: var(--muted-2); }

/* Loading */
.loading-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 2rem 0.5rem;
}
.loading-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.15);
  display: grid; place-items: center; color: #38bdf8;
  margin-bottom: 1.75rem; font-size: 1.5rem;
}
.loading-steps {
  width: 100%; max-width: 240px; text-align: left;
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 1.75rem;
}
.step-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--muted); font-weight: 500; opacity: 0.4;
}
.step-row.on { opacity: 1; color: var(--text-strong); font-weight: 600; }
.step-row.done { opacity: 1; color: var(--text); font-weight: 600; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 11px; color: var(--muted-2); flex-shrink: 0; font-weight: 700;
}
.progress-track {
  width: 12rem; height: 3px;
  background: rgba(128, 128, 128, 0.18);
  border-radius: 99px; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  border-radius: 99px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.loading-text { font-size: 12px; color: var(--muted); margin-top: 12px; font-weight: 600; }
.loading-text.ok { color: var(--ok); font-weight: 700; }

/* Wechat modal extras */
.wx-icon {
  width: 48px; height: 48px; border-radius: 16px; margin: 0 auto 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.15);
  display: grid; place-items: center; color: #34d399; font-size: 1.5rem;
}
.wx-title { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--text-strong); text-align: center; }
.wx-desc { margin: 0 0 1.25rem; font-size: 13px; color: var(--muted); line-height: 1.6; text-align: center; font-weight: 500; }
.wx-qr-wrap {
  background: #fff; border-radius: 16px; padding: 14px;
  display: inline-block; margin: 0 auto 1.25rem; position: relative;
  box-shadow: 0 2px 16px -4px rgba(0, 0, 0, 0.4);
}
.wx-qr-wrap img { width: 176px; height: 176px; display: block; border-radius: 8px; }
.wx-loading {
  position: absolute; inset: 14px; background: #fff; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px; color: #64748b; font-size: 12px;
}
.wx-center { text-align: center; }

/* Utils */
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1; }
.ml-auto { margin-left: auto; }
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mt-4 { margin-top: 1rem; }
.hint {
  font-size: 11px; color: var(--muted-2);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 1rem;
}
.hint-ok { color: #34d399; }
.spin { animation: spin 0.85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.anim-up { animation: fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.anim-in { animation: fade-in 0.25s ease both; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.25); border-radius: 4px; }

/* Toast */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 360px);
}
@media (min-width: 768px) {
  .toast-host { bottom: 28px; }
}
.toast {
  pointer-events: none;
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.toast.out { animation: toast-out 0.22s ease both; }
.toast.ok { border-color: rgba(16, 185, 129, 0.35); }
.toast.err { border-color: rgba(239, 68, 68, 0.35); color: var(--danger); }
/* 弱提醒：中性、轻量、不抢注意力 */
.toast.weak {
  font-size: 12.5px;
  font-weight: 500;
  padding: 9px 14px;
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 8px 22px -14px rgba(0, 0, 0, 0.28);
  opacity: 0.96;
}
html.ui-busy .btn.is-disabled,
html.ui-busy .btn[aria-disabled="true"],
html.ui-busy .lang-sel.is-disabled,
html.ui-busy input.is-disabled {
  cursor: not-allowed;
}
.lang-sel.is-disabled,
.lang-sel[aria-disabled="true"],
input.is-disabled,
input[aria-disabled="true"],
input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.bnav-btn.is-disabled,
.bnav-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}

/* 服务剩余天数 */
.service-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.16);
}
.service-bar.warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.22);
}
.service-bar-meta { flex: 1; min-width: 0; }
.service-bar-label {
  font-size: 11px;
  color: var(--muted-2);
  font-weight: 700;
  margin-bottom: 3px;
}
.service-bar-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-strong);
}
.service-bar-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(128, 128, 128, 0.15);
  overflow: hidden;
  margin-top: 8px;
}
.service-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  max-width: 100%;
}

/* 可复制字段 */
.spec-val-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.spec-val-row .value { flex: 1; min-width: 0; }
.copy-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(128, 128, 128, 0.08);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
}
.copy-btn:hover {
  color: var(--accent);
  background: rgba(14, 165, 233, 0.1);
}
.copy-btn:active { transform: scale(0.96); }

.empty-title, .device-name, .modal-title, .loc-addr {
  color: var(--text-strong);
}

/* —— 浅色模式专修：补强对比度与次要信息 —— */
html[data-theme="light"] .surface-flat {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
}
html[data-theme="light"] .spec-item {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}
html[data-theme="light"] .loc-card {
  background: linear-gradient(135deg, rgba(3, 105, 161, 0.08) 0%, rgba(79, 70, 229, 0.06) 100%);
  border-color: rgba(3, 105, 161, 0.22);
}
html[data-theme="light"] .service-bar {
  background: rgba(3, 105, 161, 0.08);
  border-color: rgba(3, 105, 161, 0.2);
}
html[data-theme="light"] .service-bar.warn {
  background: rgba(180, 83, 9, 0.1);
  border-color: rgba(180, 83, 9, 0.25);
}
html[data-theme="light"] .badge-on {
  background: rgba(4, 120, 87, 0.12);
  color: #047857;
  border-color: rgba(4, 120, 87, 0.3);
}
html[data-theme="light"] .badge-off {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.3);
}
html[data-theme="light"] .tag {
  color: var(--muted);
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
  font-weight: 600;
}
html[data-theme="light"] .map-empty-title,
html[data-theme="light"] .map-load-title {
  color: #0f172a;
}
html[data-theme="light"] .map-empty-desc,
html[data-theme="light"] .map-load-hint {
  color: #475569;
  font-weight: 500;
}
html[data-theme="light"] .hint {
  color: #475569;
  font-weight: 600;
}
html[data-theme="light"] .footer-inner,
html[data-theme="light"] .footer-links {
  color: #475569;
}
html[data-theme="light"] .bnav-btn {
  color: #334155;
  font-weight: 600;
}
html[data-theme="light"] .bnav-btn.active {
  color: #0369a1;
}
html[data-theme="light"] .copy-btn {
  color: #334155;
  background: #e2e8f0;
  border-color: rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .search-field {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .btn-icon {
  color: #334155;
  background: #f1f5f9;
}
html[data-theme="light"] .state-ico.mute {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
  color: #475569;
}
html[data-theme="light"] .loading-icon {
  color: #0369a1;
}
html[data-theme="light"] .step-row {
  color: #64748b;
}
html[data-theme="light"] .step-row.on,
html[data-theme="light"] .step-row.done {
  color: #0f172a;
}
html[data-theme="light"] .toast {
  color: #0f172a;
  box-shadow: 0 10px 28px -10px rgba(15, 23, 42, 0.2);
}

/* 系统浅色且未写 data-theme 时同样生效 */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .surface-flat {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.1);
  }
  :root:not([data-theme="dark"]) .spec-item {
    background: #f8fafc;
  }
  :root:not([data-theme="dark"]) .loc-addr,
  :root:not([data-theme="dark"]) .device-name,
  :root:not([data-theme="dark"]) .empty-title,
  :root:not([data-theme="dark"]) .contact-v,
  :root:not([data-theme="dark"]) .spec-item .value,
  :root:not([data-theme="dark"]) .loc-grid .v {
    color: #0f172a;
  }
  :root:not([data-theme="dark"]) .device-model,
  :root:not([data-theme="dark"]) .empty-desc,
  :root:not([data-theme="dark"]) .loc-grid .k,
  :root:not([data-theme="dark"]) .spec-item .label {
    color: #475569;
  }
}

/* 低端机 / 减弱动画：降特效保流畅 */
html.lite .bg-grid { display: none !important; }
html.lite .bg-mesh {
  background: var(--bg) !important;
}
html.lite .nav,
html.lite .bottom-nav,
html.lite .modal-backdrop,
html.lite .map-chip,
html.lite .map-expand-btn {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.lite .surface {
  box-shadow: none;
}
html.lite .anim-up,
html.lite .anim-in,
html.lite .modal-panel {
  animation: none !important;
}
html.lite .pulse-dot,
html.lite .status-pill .dot {
  animation: none !important;
}
html.lite .spin {
  animation-duration: 1.4s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .spin { animation: none !important; }
}

.empty-title { color: var(--text-strong); }

/* 拼多多核销码闸门 */
.verify-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px calc(28px + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 8, 12, 0.78);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
html[data-theme="light"] .verify-gate {
  background: rgba(238, 242, 246, 0.88);
}
.verify-card {
  width: 100%;
  max-width: 440px;
  margin: 12px auto 24px;
  padding: 20px 18px 22px;
  border-radius: 20px;
}
.verify-head { text-align: center; margin-bottom: 14px; }
.verify-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.28);
  margin-bottom: 10px;
}
html[data-theme="light"] .verify-badge {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
}
.verify-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 750;
  color: var(--text-strong);
}
.verify-lead {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.verify-script {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.verify-script b { color: var(--text-strong); }
.verify-steps {
  margin: 0 0 14px;
  padding: 0 0 0 1.2rem;
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.verify-example {
  margin: 0 0 16px;
  text-align: center;
}
.verify-example summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  padding: 8px 0;
}
.verify-example summary::-webkit-details-marker { display: none; }
.verify-example img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.55);
  background: #111;
}
.verify-example p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.verify-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.verify-form input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(128, 128, 128, 0.08);
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  outline: none;
}
.verify-form input[type="text"]:focus {
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.verify-or {
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
  margin: 12px 0 8px;
}
.verify-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 12px;
  border: 1px dashed var(--border-hover);
  background: rgba(128, 128, 128, 0.05);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.verify-upload-primary {
  min-height: 56px;
  margin-bottom: 8px;
  border-style: solid;
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.1);
  font-size: 14px;
}
.verify-preview {
  margin-top: 10px;
  text-align: center;
}
.verify-preview img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.verify-hint {
  min-height: 1.4em;
  margin: 10px 0 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}
.verify-hint.err { color: var(--danger); }
.verify-hint.ok { color: var(--ok); }
body:has(#verifyGate:not(.hidden)) .bottom-nav { display: none; }
