/* ============================================================
   安康 ANHONG · 供给侧安全与福祉工具 · 设计令牌与组件库
   ------------------------------------------------------------
   色板来源: dataviz 参考色板 (validated)
   - 表面/墨色: chrome 表 (light #fcfcfb / dark #1a1a19)
   - 状态色: 固定角色色 good/warning/serious/critical
     (亮面上 warning/serious <3:1 是规范设计——永远配图标+文字)
   - 热力序列: 单一蓝色阶。choropleth 连续量级编码, 近零端允许向
     表面退隐 (ordinal 2:1 地板不适用); 暗色模式方向反转。
   图标: 一律内置 stroke SVG (app.js icon()), 零 emoji 依赖。
   设计原则映射: 《产品设计输入》2.4
   ============================================================ */

:root {
  color-scheme: light;
  /* -- surfaces & ink (dataviz chrome) -- */
  --page:            #f5f5f3;
  --surface-1:       #fcfcfb;   /* 卡片面 */
  --text-primary:    #0b0b0b;
  --text-secondary:  #52514e;
  --text-muted:      #898781;
  --gridline:        #e3e2db;
  --hairline:        #c3c2b7;
  --ring:            rgba(11, 11, 11, 0.08);
  /* -- accent (categorical slot 1) -- */
  --accent:          #2a78d6;
  --accent-deep:     #1c5cad;
  --accent-wash:     rgba(42, 120, 214, 0.10);
  /* -- status (固定角色色, 永远 icon+label 出场) -- */
  --st-good:         #0ca30c;
  --st-good-wash:    rgba(12, 163, 12, 0.10);
  --st-good-text:    #006300;
  --st-warning:      #d99b00;
  --st-warning-wash: rgba(217, 155, 0, 0.12);
  --st-serious:      #ec835a;
  --st-critical:     #d03b3b;
  --st-critical-wash: rgba(208, 59, 59, 0.10);
  /* -- 热力序列 (light: 低=浅, 高=深; near-zero 贴近表面) -- */
  --heat-0:          #f0f4fb;
  --heat-1:          #cde2fb;
  --heat-2:          #86b6ef;
  --heat-3:          #3987e5;
  --heat-4:          #256abf;
  --heat-5:          #0d366b;
  /* -- 层级阴影 -- */
  --shadow-s:  0 1px 2px rgba(16, 16, 14, .04), 0 2px 8px rgba(16, 16, 14, .05);
  --shadow-m:  0 2px 6px rgba(16, 16, 14, .06), 0 8px 24px rgba(16, 16, 14, .08);
  --shadow-l:  0 8px 20px rgba(16, 16, 14, .10), 0 20px 48px rgba(16, 16, 14, .14);
  /* -- 尺寸 -- */
  --tap: 48px;                 /* 最小触达目标 (低识字用户·大按钮) */
  --radius: 16px;
  --radius-s: 12px;
  --topbar-h: 60px;
  --nav-h: 62px;
}

@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) {
  color-scheme: dark;
  --page:            #0d0d0d;
  --surface-1:       #1a1a19;
  --text-primary:    #ffffff;
  --text-secondary:  #c3c2b7;
  --text-muted:      #898781;
  --gridline:        #2c2c2a;
  --hairline:        #383835;
  --ring:            rgba(255, 255, 255, 0.10);
  --accent:          #3987e5;
  --accent-deep:     #256abf;
  --accent-wash:     rgba(57, 135, 229, 0.16);
  --st-good-wash:    rgba(12, 163, 12, 0.16);
  --st-good-text:    #0ca30c;
  --st-warning:      #fab219;
  --st-warning-wash: rgba(250, 178, 25, 0.14);
  --st-critical-wash: rgba(208, 59, 59, 0.18);
  --shadow-s:  0 1px 2px rgba(0, 0, 0, .25), 0 2px 8px rgba(0, 0, 0, .20);
  --shadow-m:  0 2px 6px rgba(0, 0, 0, .30), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-l:  0 8px 20px rgba(0, 0, 0, .38), 0 20px 48px rgba(0, 0, 0, .42);
  /* 暗色热力: 方向反转 (低值贴近暗表面, 高值最亮) */
  --heat-0:          #1c2634;
  --heat-1:          #0d366b;
  --heat-2:          #184f95;
  --heat-3:          #256abf;
  --heat-4:          #3987e5;
  --heat-5:          #86b6ef;
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:            #0d0d0d;
  --surface-1:       #1a1a19;
  --text-primary:    #ffffff;
  --text-secondary:  #c3c2b7;
  --text-muted:      #898781;
  --gridline:        #2c2c2a;
  --hairline:        #383835;
  --ring:            rgba(255, 255, 255, 0.10);
  --accent:          #3987e5;
  --accent-deep:     #256abf;
  --accent-wash:     rgba(57, 135, 229, 0.16);
  --st-good-wash:    rgba(12, 163, 12, 0.16);
  --st-good-text:    #0ca30c;
  --st-warning:      #fab219;
  --st-warning-wash: rgba(250, 178, 25, 0.14);
  --st-critical-wash: rgba(208, 59, 59, 0.18);
  --shadow-s:  0 1px 2px rgba(0, 0, 0, .25), 0 2px 8px rgba(0, 0, 0, .20);
  --shadow-m:  0 2px 6px rgba(0, 0, 0, .30), 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-l:  0 8px 20px rgba(0, 0, 0, .38), 0 20px 48px rgba(0, 0, 0, .42);
  --heat-0:          #1c2634;
  --heat-1:          #0d366b;
  --heat-2:          #184f95;
  --heat-3:          #256abf;
  --heat-4:          #3987e5;
  --heat-5:          #86b6ef;
}

/* ============ base ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 16.5px;
  line-height: 1.55;
  background: var(--page);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text-primary); }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { line-height: 1.28; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 23px; font-weight: 750; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16.5px; font-weight: 700; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ============ app shell ============ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--gridline);
}
.topbar .brand { display: flex; align-items: center; gap: 9px; }
.topbar .brand .logo {
  width: 34px; height: 34px; border-radius: 10px; border: none;
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}
.brand-t { display: flex; flex-direction: column; line-height: 1.15; }
.brand-n { font-weight: 800; font-size: 16px; letter-spacing: 0.01em; }
.brand-s { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.topbar .spacer { flex: 1; }
.citybtn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 40px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--gridline);
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 13.5px; font-weight: 650;
  box-shadow: var(--shadow-s);
}
.citybtn:active { background: var(--accent-wash); }
.iconbtn {
  min-width: 42px; min-height: 42px;
  display: grid; place-items: center;
  border: none; background: none; border-radius: 999px;
  color: var(--text-secondary); font-size: 13px; font-weight: 700;
}
.iconbtn:active { background: var(--accent-wash); }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + env(safe-area-inset-bottom, 0) + 28px);
}
.page--nogap { padding-bottom: var(--nav-h); }
.pagehead { margin: 4px 2px 18px; }
.pagehead h1 { margin-bottom: 6px; }
.pagehead .sub { color: var(--text-secondary); font-size: 14px; margin: 0; }

/* 入场动效: 内容块依次上浮 (reduced-motion 下关闭) */
.page > * { animation: rise .32s ease-out both; }
.page > *:nth-child(2) { animation-delay: .04s; }
.page > *:nth-child(3) { animation-delay: .08s; }
.page > *:nth-child(4) { animation-delay: .12s; }
.page > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ bottom nav ============ */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface-1) 93%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--gridline);
}
.bottomnav a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-muted); text-decoration: none;
  font-size: 10.5px; font-weight: 600; min-height: var(--nav-h);
}
.bottomnav a .ico { display: grid; place-items: center; }
.bottomnav a.active { color: var(--accent); }
.bottomnav a.active::before {
  content: ""; position: absolute; top: 0;
  width: 22px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--accent);
}
.navfab {
  align-self: center;
  width: 56px; height: 56px; margin-top: -26px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  color: #fff;
  border: 4px solid var(--page);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, rgba(0,0,0,.18));
}
.navfab:active { transform: scale(0.93); }

/* ============ cards ============ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-s);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card .h-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-wash); color: var(--accent); flex: none; }
.card .sub { color: var(--text-secondary); font-size: 14px; margin: 0 0 12px; }
.section-title {
  font-size: 12.5px; font-weight: 750; letter-spacing: 0.08em;
  color: var(--text-muted); text-transform: uppercase;
  margin: 22px 2px 10px;
}
.fineprint { font-size: 12px; color: var(--text-muted); margin: 10px 2px 0; }

/* ============ stat tile (dataviz 契约: label + value) ============ */
.tilegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile {
  background: var(--page);
  border: 1px solid var(--ring);
  border-radius: var(--radius-s);
  padding: 12px 14px;
}
.tile .t-label { font-size: 12.5px; color: var(--text-secondary); font-weight: 600; }
.tile .t-value { font-size: 28px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .t-note  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* hero figure: 每屏至多一个 */
.hero-value { font-size: 46px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-label { font-size: 14px; color: var(--text-secondary); font-weight: 600; }
.home-hero { display: flex; align-items: flex-end; gap: 18px; margin: 6px 0 12px; }
.hero-side { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }
.kv-mini { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot--good { background: var(--st-good); }
.dot--warn { background: var(--st-warning); }

/* 堆叠构成条: 佐证/未佐证 (颜色永远配旁边的文字图例, 条只示比例) */
.stackbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--gridline); }
.stackbar .sb-good { background: var(--st-good); }
.stackbar .sb-warn { background: var(--st-warning); }

/* ============ 状态徽章: 永远 图标 + 文字 (色不单独传义) ============ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 650;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--ring);
  color: var(--text-primary);
  background: var(--surface-1);
}
.badge .dot { width: 8px; height: 8px; }
.badge--good .dot     { background: var(--st-good); }
.badge--warning .dot  { background: var(--st-warning); }
.badge--serious .dot  { background: var(--st-serious); }
.badge--critical .dot { background: var(--st-critical); }
.badge--corroborated { border-color: transparent; background: var(--st-good-wash); color: var(--st-good-text); }
.badge--corroborated .dot { background: var(--st-good); }
.badge--unverified { border-color: transparent; background: var(--st-warning-wash); color: var(--text-primary); }
.badge--unverified .dot { background: var(--st-warning); }
.badge--area { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-wash); color: var(--accent); }

/* 锁形小注 (隐私承诺的图标化) */
.lockchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); font-weight: 600; }

/* ============ 佐证度 meter (fill = accent, 轨道 = 同 ramp 浅步) ============ */
.meter { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, var(--surface-1)); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 20px;
  border-radius: 13px; border: 1px solid var(--ring);
  background: var(--surface-1); color: var(--text-primary);
  font-size: 16px; font-weight: 650;
  width: 100%;
  transition: transform .08s ease-out;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 32%, transparent);
}
.btn--ghost { background: none; }
.btn--danger { background: var(--st-critical-wash); border-color: transparent; color: var(--st-critical); }
.btn--ic svg { flex: none; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btnrow { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.btnrow .btn--wide { grid-column: 1 / -1; }

/* ============ 快捷入口 grid (跨语言: 图标优先) ============ */
.quickgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px; min-height: 96px; justify-content: center;
  border-radius: var(--radius-s);
  background: var(--surface-1); border: 1px solid var(--ring);
  box-shadow: var(--shadow-s);
  color: var(--text-primary); text-decoration: none; text-align: center;
  font-size: 13px; font-weight: 600;
  transition: transform .08s ease-out;
}
.quick:active { background: var(--accent-wash); transform: scale(0.97); }
.quick .qico {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent-wash); color: var(--accent);
  display: grid; place-items: center;
}
.quick small { color: var(--text-muted); font-weight: 400; font-size: 11px; }

/* ============ 表单 ============ */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 7px; color: var(--text-secondary); }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap);
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--gridline);
  background: var(--page);
  font-size: 17px;
  transition: border-color .12s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
textarea.input { min-height: 96px; resize: vertical; }

/* 查询行 (checker): 图标输入 + 内嵌按钮 */
.searchrow { display: flex; align-items: center; gap: 8px; position: relative; }
.searchrow .s-ic { position: absolute; left: 13px; color: var(--text-muted); display: grid; place-items: center; pointer-events: none; }
.searchrow .input { padding-left: 40px; flex: 1; min-width: 0; }
.searchrow .s-go { width: auto; padding: 10px 22px; flex: none; }

/* chips (可多选特征标签) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.district-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 15px; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--gridline);
  background: var(--surface-1); font-size: 15px; font-weight: 550;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: var(--shadow-s);
  transition: transform .08s ease-out;
}
.chip:active { transform: scale(0.96); }
.chip svg { color: var(--text-muted); }
.chip[aria-pressed="true"] {
  background: var(--accent-wash); border-color: var(--accent);
  color: var(--accent); font-weight: 700;
}
.chip[aria-pressed="true"] svg { color: var(--accent); }

/* toggle (同意式分级分发等) */
.togglerow {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--gridline);
  min-height: var(--tap);
}
.togglerow:first-of-type { border-top: none; }
.togglerow .t-main { flex: 1; }
.togglerow .t-main b { display: block; font-size: 16px; }
.togglerow .t-main span { font-size: 12.5px; color: var(--text-muted); }
.switch {
  width: 52px; height: 32px; border-radius: 999px; flex: none;
  background: var(--gridline); border: none; position: relative;
  transition: background 0.16s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.28);
  transition: left 0.16s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 23px; }

/* ============ 列表行 ============ */
.rowlist { background: var(--surface-1); border: 1px solid var(--ring); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-s); }
.row {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 13px 15px;
  border-top: 1px solid var(--gridline); background: none; width: 100%;
  text-align: left; text-decoration: none; color: var(--text-primary);
}
.row:first-child { border-top: none; }
.row .r-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--page); border: 1px solid var(--ring); display: grid; place-items: center; color: var(--text-secondary); }
.row .r-main { flex: 1; }
.row .r-main b { display: block; font-size: 15.5px; font-weight: 650; }
.row .r-main span { font-size: 12.5px; color: var(--text-muted); }
.row .r-end { color: var(--text-muted); font-size: 13px; text-align: right; }
.row:active { background: var(--accent-wash); }

/* ============ 地图 ============ */
.map-box {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--ring);
  background: var(--surface-1);
  box-shadow: var(--shadow-s);
}
.map-box .leaflet-container { width: 100%; background: #e8eaea; }   /* 高度由 --hero/--full/--mini 承担, 不得覆盖为 100% (父级无高会塌) */
.map--hero { height: 340px; min-height: 340px; }
.map--full { height: calc(100vh - var(--topbar-h) - 132px); min-height: 380px; }
.map--mini { height: 230px; min-height: 230px; }
.map-note {
  font-size: 12px; color: var(--text-muted);
  padding: 9px 13px; border-top: 1px solid var(--gridline);
  display: flex; gap: 7px; align-items: flex-start;
  background: var(--surface-1);
}
.map-note svg { flex: none; margin-top: 2px; }
.map-cta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px; font-size: 14.5px; font-weight: 700;
  text-decoration: none; color: var(--text-primary);
  border-top: 1px solid var(--gridline);
  background: var(--surface-1);
}
.map-cta .chev { color: var(--text-muted); font-size: 17px; }
.map-cta:active { background: var(--accent-wash); }

/* 热力图例 (横向色带 + 计数, 文字用 text token) */
.legend {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 12.5px; color: var(--text-secondary);
  background: var(--surface-1); border-top: 1px solid var(--gridline);
}
.legend .ramp { display: flex; flex: 1; height: 9px; border-radius: 999px; overflow: hidden; }
.legend .ramp i { flex: 1; }
.legend .l-end { flex: none; font-variant-numeric: tabular-nums; }

/* ============ 底部抽屉 (bottom sheet) ============ */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8, 8, 8, 0.46);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91;
  max-width: 560px; margin: 0 auto;
  background: var(--surface-1);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-l);
  padding: 8px 20px calc(env(safe-area-inset-bottom, 0) + 22px);
  transform: translateY(105%); transition: transform 0.26s cubic-bezier(.2, .8, .25, 1);
  max-height: 80vh; overflow-y: auto;
}
.sheet.open, .sheet-backdrop.open { opacity: 1; transform: none; pointer-events: auto; }
.sheet .grab { width: 42px; height: 4.5px; border-radius: 999px; background: var(--gridline); margin: 7px auto 16px; }

/* 大型确认图标 (sheet 顶部, 替代 emoji 大图) */
.big-ic {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; margin: 6px auto 12px;
}
.big-ic--ok { background: var(--st-good-wash); color: var(--st-good); }
.big-ic--warn { background: var(--st-warning-wash); color: var(--st-warning); }
.bookcode { font-size: 34px; font-weight: 750; letter-spacing: 5px; font-variant-numeric: tabular-nums; }

/* ============ toast ============ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0) + 16px);
  left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--text-primary); color: var(--page);
  padding: 11px 19px; border-radius: 999px;
  font-size: 14px; font-weight: 650; z-index: 99;
  box-shadow: var(--shadow-l);
  opacity: 0; pointer-events: none; transition: all 0.2s;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 快速伪装 (panic → 计算器) ============ */
.calc {
  position: fixed; inset: 0; z-index: 200;
  background: var(--page);
  display: none; flex-direction: column;
  padding: max(14px, env(safe-area-inset-top, 0)) 14px 18px;
}
.calc.on { display: flex; }
.calc .c-disp {
  flex: 1; display: flex; align-items: flex-end; justify-content: flex-end;
  font-size: 58px; font-weight: 280; padding: 10px;
  font-variant-numeric: tabular-nums;
  overflow: hidden; white-space: nowrap;
  color: var(--text-primary);
}
.calc .c-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.calc .c-grid button {
  min-height: 62px; border-radius: 50%;
  border: none; font-size: 23px; font-weight: 500;
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--ring);
  box-shadow: var(--shadow-s);
}
.calc .c-grid button.op { background: var(--accent-wash); color: var(--accent); border-color: transparent; }
.calc .c-grid button.eq { background: linear-gradient(140deg, var(--accent), var(--accent-deep)); color: #fff; border-color: transparent; }

/* ============ 杂项 ============ */
.kv { display: flex; gap: 10px; font-size: 14.5px; padding: 5px 0; }
.kv .k { color: var(--text-muted); flex: none; width: 92px; }
.kv .v { color: var(--text-primary); }
.hint { font-size: 12px; color: var(--text-muted); }
.note {
  font-size: 13px; color: var(--text-secondary);
  background: var(--accent-wash); border-radius: var(--radius-s);
  padding: 12px 14px; margin: 14px 0;
  border-left: 3px solid var(--accent);
}
.note b { color: var(--accent); }
.demo-tag {
  display: inline-block; font-size: 10.5px; font-weight: 750; letter-spacing: 0.04em;
  background: var(--st-warning-wash); color: var(--st-warning);
  padding: 2px 8px; border-radius: 999px; vertical-align: 2px; margin-left: 6px;
}
.center { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.blurbox {
  border: 1px dashed var(--hairline); border-radius: 13px;
  padding: 15px; min-height: 76px;
  font-size: 15.5px; color: var(--text-secondary);
  background: var(--page);
}
.step-list { margin: 0; padding-left: 0; list-style: none; counter-reset: s; }
.step-list li {
  counter-increment: s; position: relative;
  padding: 11px 0 11px 46px; font-size: 15.5px;
  border-top: 1px solid var(--gridline);
}
.step-list li:first-child { border-top: none; }
.step-list li::before {
  content: counter(s); position: absolute; left: 0; top: 12px;
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--accent-wash); color: var(--accent);
  font-weight: 750; font-size: 15px;
  display: grid; place-items: center;
}

/* ============ leaflet 适配 ============ */
.leaflet-control-attribution { font-size: 9.5px !important; opacity: .85; }
.leaflet-bar { border: none !important; box-shadow: var(--shadow-m) !important; }
.leaflet-bar a {
  width: 34px !important; height: 34px !important; line-height: 32px !important;
  background: var(--surface-1) !important; color: var(--text-primary) !important;
  border-bottom: 1px solid var(--gridline) !important;
  font-weight: 500;
}
.osm-dark .leaflet-tile { filter: brightness(0.62) saturate(0.75) contrast(1.05); }
.leaflet-tooltip.dist-tip {
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--ring); box-shadow: var(--shadow-m);
  border-radius: 9px; padding: 4px 10px;
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
/* POI 地标标签: 次级信息, 更小更淡, 不与警情标签同级 */
.leaflet-tooltip.poi-tip {
  background: none; border: none; box-shadow: none;
  color: var(--text-secondary);
  font-size: 11px; font-weight: 650;
  text-shadow: 0 1px 2px var(--page), 0 0 4px var(--page), 0 -1px 2px var(--page);
}
.leaflet-tooltip-top:before { border-top-color: transparent; }
.leaflet-tooltip.dist-tip.leaflet-tooltip-top:before { border-top-color: var(--ring); }
.dist-ring { transition: none; }

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

/* ---- F-series: 趋势徽章 / 未读胶囊 / 内信行 ---- */
.trend { display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 700; padding: 2.5px 8px; border-radius: 999px;
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend svg { display: block; }
.trend--up   { color: #fff; background: var(--st-warning); }   /* 警报上升 = 需留意; label 同时带文字, 颜色不单传义 */
.trend--down { color: #fff; background: var(--st-good); }
.trend--flat { color: var(--text-muted); background: var(--hairline); }
.pill-unread { display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  vertical-align: middle; }
.msg { padding: 10px 2px; border-top: 1px solid var(--hairline); display: flex; gap: 10px; }
.msg:first-of-type { border-top: none; }
.msg .m-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-wash, rgba(47,111,237,.10)); color: var(--accent); }
.msg .m-body { flex: 1; font-size: 13px; line-height: 1.55; color: var(--text-primary); }
.msg .m-time { display: block; margin-top: 3px; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.msg--unread .m-body { font-weight: 600; }
.home-inbox-hint { display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px; border-radius: var(--r-m, 12px); border: 1px solid var(--hairline);
  background: var(--surface-1); color: var(--accent); font-size: 13px; font-weight: 650;
  cursor: pointer; }
.home-inbox-hint .spacer { flex: 1; }

/* ---- F8: 首页引导卡 ---- */
.intro-uses { margin: 4px 0 6px; }
.intro-use { display: flex; align-items: center; gap: 10px; padding: 7px 0;
  font-size: 13.5px; line-height: 1.5; color: var(--text-primary); }
.intro-use .u-ic { flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.intro-card .fineprint { margin-top: 6px; }
