/* ==========================================================================
   天气 · 设计系统
   结构：整页天空（.sky）+ 单列内容（820px）+ 玻璃卡片 + 底部抽屉详情
   主题：html[data-time]（day/night）× html[data-cond]（天气类型）
   ========================================================================== */

:root {
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --w: 820px;
  --r: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- 白字玻璃：昼夜只差天空与蒙版，卡片一律 14% 白 ---------- */
html[data-time="day"] {
  --page: #4fa0e8;
  --glass: rgba(255, 255, 255, .14);
  --glass-brd: rgba(255, 255, 255, .22);
  --card: var(--glass);
  --card-2: rgba(255, 255, 255, .10);
  --sheet-bg: rgba(20, 32, 48, .88);
  --text: #fff;
  --muted: rgba(255, 255, 255, .82);
  --faint: rgba(255, 255, 255, .66);
  --line: rgba(255, 255, 255, .22);
  --line-2: rgba(255, 255, 255, .30);
  --accent: #cfe6ff;
  --chip: rgba(255, 255, 255, .16);
  --tile: rgba(255, 255, 255, .11);
  --tile-brd: rgba(255, 255, 255, .15);
  --shadow: 0 10px 34px rgba(0, 0, 0, .14);
  --card-blur: blur(34px) saturate(170%) brightness(.84);
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .11) 100%);
  --sky-veil: rgba(0, 0, 0, 0);
  --sky-glow: .18;
}

/* ---------- 夜间 ---------- */
html[data-time="night"] {
  --page: #0c1725;
  --glass: rgba(255, 255, 255, .13);
  --glass-brd: rgba(255, 255, 255, .18);
  --card: var(--glass);
  --card-2: rgba(255, 255, 255, .08);
  --sheet-bg: rgba(14, 24, 37, .93);
  --text: #fff;
  --muted: rgba(255, 255, 255, .76);
  --faint: rgba(255, 255, 255, .58);
  --line: rgba(255, 255, 255, .14);
  --line-2: rgba(255, 255, 255, .24);
  --accent: #a8d0ff;
  --chip: rgba(255, 255, 255, .09);
  --tile: rgba(255, 255, 255, .10);
  --tile-brd: rgba(255, 255, 255, .13);
  --shadow: 0 10px 34px rgba(0, 0, 0, .34);
  --card-blur: blur(34px) saturate(160%) brightness(1.14);
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .09) 100%);
  --sky-veil: rgba(0, 0, 0, .18);
  --sky-glow: .10;
}

/* ---------- 天空配色（按天气 × 昼夜） ---------- */
html[data-cond="clear"][data-time="day"]   { --s1: #1565c9; --s2: #3f97e0; --s3: #62b0e8; }
html[data-cond="partly"][data-time="day"]  { --s1: #2a6ec4; --s2: #4f93d4; --s3: #79b6e2; }
html[data-cond="overcast"][data-time="day"]{ --s1: #46536a; --s2: #6b7c92; --s3: #93a4b6; }
html[data-cond="rain"][data-time="day"]    { --s1: #273648; --s2: #435a72; --s3: #6c8299; }
html[data-cond="thunder"][data-time="day"] { --s1: #1b2740; --s2: #35476a; --s3: #5c6f97; }
html[data-cond="snow"][data-time="day"]    { --s1: #476482; --s2: #7fa2c0; --s3: #b9d4e8; }
html[data-cond="fog"][data-time="day"]     { --s1: #59626e; --s2: #7f8a98; --s3: #a5b0bd; }
html[data-cond="dust"][data-time="day"]    { --s1: #59626e; --s2: #7f8a98; --s3: #a5b0bd; }

html[data-cond="clear"][data-time="night"]   { --s1: #040a18; --s2: #0e1e3e; --s3: #1e3660; }
html[data-cond="partly"][data-time="night"]  { --s1: #081228; --s2: #14284e; --s3: #244470; }
html[data-cond="overcast"][data-time="night"]{ --s1: #0c1018; --s2: #1c2432; --s3: #303a4a; }
html[data-cond="rain"][data-time="night"]    { --s1: #080e18; --s2: #141e2e; --s3: #26364a; }
html[data-cond="thunder"][data-time="night"] { --s1: #060a14; --s2: #10182a; --s3: #1e2a44; }
html[data-cond="snow"][data-time="night"]    { --s1: #101828; --s2: #22304a; --s3: #3a4e66; }
html[data-cond="fog"][data-time="night"]     { --s1: #101620; --s2: #222a36; --s3: #36404e; }
html[data-cond="dust"][data-time="night"]    { --s1: #101620; --s2: #222a36; --s3: #36404e; }

/* 橙色 / 红色预警：整片天空转为暖红（与参考站一致，雷雨雪除外） */
html[data-alert="critical"][data-time="day"] {
  --s1: #5b1e1e; --s2: #8b3a3a; --s3: #c06060; --page: #c06060;
  --sky-glow: .12;
}
html[data-alert="critical"][data-time="night"] {
  --s1: #1a0808; --s2: #3a1515; --s3: #5b2020; --page: #5b2020;
  --sky-glow: .07;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: color .5s var(--ease), background .5s var(--ease);
}

/* 弹层打开时 body 会被锁成 overflow:hidden，窗口滚动条一消失内容宽度就多 15px，
   整列卡片会横跳 7.5px（弹层按视口居中，于是看起来就是"没对齐"）。
   html 显式接管两轴滚动后，body 的 overflow 不再向上传播，滚动条不会消失；
   scrollbar-gutter 再兜住使用覆盖式滚动条的浏览器。 */
html {
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

h1, h2, h3, h4, p, ul, li, figure { margin: 0; padding: 0; }
li { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }
svg text { font-family: var(--font); }

/* 线性图标统一描边，避免默认黑色填充 */
svg.h-ico,
.search-ico,
.tb-btn svg,
.city-btn svg,
.c-more svg,
.sheet-close svg,
.hero-loc svg,
.gl-k svg,
.city-search svg,
.city-clear svg,
.city-item svg,
.m-k svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(26, 114, 216, .22); }

/* ---------- 整页天空 ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--page);
}
.sky-grad {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, var(--sky-veil) 100%),
    linear-gradient(180deg, var(--s1) 0%, var(--s2) 50%, var(--s3) 100%);
  transition: background 1.1s var(--ease);
}
/* 左上 / 右下两团白光，给纯渐变加一点体积感（参考站同款） */
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 15% 0%, rgba(255, 255, 255, var(--sky-glow, .16)), transparent 62%),
    radial-gradient(90% 60% at 90% 100%, rgba(255, 255, 255, calc(var(--sky-glow, .16) * .7)), transparent 60%);
}
.sky-scene {
  position: absolute;
  top: -14px;
  right: 0;
  width: min(680px, 56vw);
  aspect-ratio: 900 / 460;
  height: auto;
  opacity: .96;
}
.sky-scene svg { width: 100%; height: 100%; }
.sky-glow {
  position: absolute;
  left: 50%;
  top: -170px;
  width: 900px;
  height: 640px;
  margin-left: -450px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, calc(var(--sky-glow, .16) + .04)), transparent 72%);
}
html[data-time="night"] .sky-glow { background: radial-gradient(closest-side, rgba(120, 175, 255, .13), transparent 72%); }
html[data-time="night"] .sky-scene { opacity: .82; }

/* ---------- 顶栏 ---------- */
/* 顶栏状态探针：1×1px，放在 24px 处，滚过即离开视口 */
.top-sentinel {
  position: absolute;
  top: 24px;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  opacity: 0;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 8px 0;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.is-top { color: #fff; }
.topbar.is-stuck {
  color: #fff;
  background: rgba(12, 22, 36, .44);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: rgba(255, 255, 255, .12);
}
.tb {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 16px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand-mark { width: 26px; height: 26px; filter: drop-shadow(0 4px 8px rgba(242, 84, 91, .3)); }
.brand-name { font-size: 14.5px; font-weight: 650; letter-spacing: .03em; }

.city-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 32px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .16);
  color: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.city-btn:hover { background: rgba(255, 255, 255, .26); }

.city-btn svg { width: 13px; height: 13px; opacity: .9; flex: none; }
.city-btn .chev { width: 12px; height: 12px; opacity: .55; }
.city-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw; }

.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tb-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .16);
  color: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background .2s var(--ease), transform .16s var(--ease), border-color .2s var(--ease);
}

.tb-btn svg { width: 16px; height: 16px; }
.tb-btn:hover { background: rgba(255, 255, 255, .3); }

.tb-btn:active { transform: scale(.94); }
.tb-btn.unit { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.tb-btn.is-busy svg { animation: spin 1s linear infinite; }
.tb-btn.is-busy { pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 布局 ---------- */
.app {
  max-width: var(--w);
  margin: 0 auto;
  padding: 74px 0 0;
}

/* ---------- 主视觉 ---------- */
.hero {
  position: relative;
  padding: 24px 16px 30px;
  text-align: center;
  color: #fff;
}
.hero-loc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .2s var(--ease);
}
.hero-loc:hover { background: rgba(255, 255, 255, .22); }
.hero-loc svg { width: 13px; height: 13px; opacity: .92; flex: none; }
.hero-city { font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.hero-region { font-size: 11.5px; opacity: .74; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hero-temp {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 10px 0 0;
  line-height: .84;
}
.hero-num {
  font-size: clamp(76px, 19vw, 118px);
  font-weight: 200;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 12px 44px rgba(0, 26, 54, .26);
}
.hero-deg {
  font-size: clamp(30px, 7.4vw, 46px);
  font-weight: 200;
  margin-top: 12px;
  margin-left: 2px;
  opacity: .92;
}
.hero-cond {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .16em;
  text-indent: .16em;
  text-shadow: 0 2px 12px rgba(0, 20, 40, .2);
}
.hero-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255, 255, 255, .88);
}
.hero-meta b { font-weight: 600; }
.hero-meta .sep { opacity: .5; }
.hero-foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .68);
}
.hero-foot .sep { opacity: .45; }
.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 0 3px rgba(255, 209, 102, .24);
}
.hero-dot.is-night { background: #a8c8f0; box-shadow: 0 0 0 3px rgba(168, 200, 240, .22); }

/* ---------- 卡片通用 ---------- */
.deck {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 0 16px;
}
.deck > div:empty { display: none; }

.card {
  position: relative;
  padding: 18px;
  border-radius: var(--r);
  /* 不用 backdrop-filter：Chromium 会把元素自身的半透明背景一起过滤镜，
     白色玻璃层会被 brightness() 吃掉，卡片就和背景糊成一片。
     天空本来就是平滑渐变，blur 也看不出效果，直接上渐变底色更稳、更省性能。 */
  background-image: var(--glass-sheen);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .26);
  text-shadow: 0 1px 2px rgba(4, 18, 36, .32);
  animation: rise .45s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.c-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 18px;
  margin-bottom: 12px;
}
.c-ico { width: 15px; height: 15px; display: grid; place-items: center; color: var(--text); opacity: .82; flex: none; }
.c-ico svg { width: 14px; height: 14px; }
.c-head h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  opacity: .8;
}
.c-hint { margin-left: auto; font-size: 11px; color: var(--faint); white-space: nowrap; }
.c-more {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 6px 2px 6px 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.c-more:hover { color: var(--accent); }
.c-more svg { width: 12px; height: 12px; opacity: .7; }

/* ---------- 概览：空气质量 / 生活指数 ---------- */
.glance { padding: 18px; }
.gl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 0;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.gl-row + .gl-row { border-top: 1px solid var(--line); }
.gl-row:hover .gl-track { filter: brightness(1.04); }
.gl-k {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 82px;
  flex: none;
  font-size: 12px;
  color: rgba(255, 255, 255, .9);
}
.gl-k svg { width: 13px; height: 13px; color: var(--faint); flex: none; }
.gl-track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--chip);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: filter .2s var(--ease);
}
.gl-zones {
  background: linear-gradient(90deg,
    #35b06a 0 16.6%, #e6be2c 16.6% 33.2%, #ef9529 33.2% 49.8%,
    #e75f3a 49.8% 66.4%, #c8383f 66.4% 83%, #8d3a9c 83% 100%);
  opacity: .88;
}
.gl-dot {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--lv, #fff);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .34);
  transform: translate(-50%, -50%);
}
.gl-v {
  width: 92px;
  flex: none;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 5px;
  font-size: 12px;
}
.gl-v b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gl-v b { text-shadow: 0 1px 3px rgba(4, 18, 36, .4); }
.gl-v em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.gl-v em.strong { color: var(--text); font-weight: 600; }
.gl-row > svg.h-ico { width: 13px; height: 13px; color: var(--faint); flex: none; }
.gl-row.is-empty { cursor: default; }
.gl-dash { display: block; width: 100%; height: 100%; border-radius: 999px; background: var(--chip); }

/* 生活指数：五格等级刻度，比无意义的渐变条更诚实 */
.gl-steps {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  height: auto;
  background: none;
  box-shadow: none;
  padding-left: 2px;
}
.gl-steps i {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: background .25s var(--ease);
}
.gl-steps i.on {
  background: #ffd166;
  box-shadow: 0 0 0 1px rgba(255, 209, 102, .35), 0 0 8px rgba(255, 209, 102, .35);
}
.gl-row.is-empty .gl-v { color: var(--faint); }

/* ---------- 预警 ---------- */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 14px 18px 15px 18px;
  border-radius: var(--r);
  border: 1px solid var(--glass-brd);
  background-color: transparent;   /* button 默认有 ButtonFace 底色，必须清掉 */
  background-image: var(--glass-sheen);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .26);
  text-align: left;
  text-shadow: 0 1px 2px rgba(4, 18, 36, .30);
  cursor: pointer;
  overflow: hidden;
  animation: rise .45s var(--ease) both;
  transition: background-color .2s var(--ease);
}
.alert:hover { background-image: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .16)); }
/* 左缘色条：颜色只出现在这一条和徽标里，卡片本体保持和其它卡片同一块玻璃 */
.alert::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--lv);
  box-shadow: 0 0 12px color-mix(in srgb, var(--lv) 60%, transparent);
}
.al-top { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.al-sign { width: 15px; height: 15px; color: var(--lv); display: grid; place-items: center; flex: none; }
.al-sign svg { width: 14px; height: 14px; }
.al-type { font-weight: 600; color: var(--text); }
.al-lv {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--lv);
  color: var(--lv-ink, #fff);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: none;
}
.al-time { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }
.al-title { font-size: 14px; font-weight: 600; line-height: 1.5; letter-spacing: -.01em; }
.al-text {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 逐小时 ---------- */
/* 小时条贴到卡片左右边缘：被裁掉的那半列落在圆角里，看起来才像「还能滑」 */
.hr-scroll {
  display: flex;
  gap: 1px;
  margin: 0 -18px;
  padding: 0 18px 2px;
  overflow-x: auto;
  --edge: 44px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - var(--edge)), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - var(--edge)), transparent 100%);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.hr-scroll::-webkit-scrollbar { display: none; }
.hr {
  flex: 0 0 auto;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 0 8px;
  border: 0;
  background: none;
  border-radius: 13px;
  color: inherit;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background .18s var(--ease);
}
.hr:hover { background: var(--chip); }
.hr.is-now { background: color-mix(in srgb, var(--accent) 11%, transparent); }
.hr.is-next { box-shadow: inset 1px 0 0 var(--line); }
.hr-t {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-height: 14px;
}
.hr.is-now .hr-t { color: var(--accent); font-weight: 600; }
.hr-t em { font-style: normal; font-size: 8px; color: var(--faint); font-weight: 400; }
.hr-i { width: 33px; height: 33px; }
.hr-i svg { width: 100%; height: 100%; }
.hr-temp { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hr-pop { font-size: 10px; color: #3d94dd; font-variant-numeric: tabular-nums; }
.hr-pop.is-zero { opacity: 0; }

/* ---------- 实时降雨 · 雷达拼图 ---------- */
.rd-nmc {
  position: relative;
  display: block;
  /* 全国拼图接近正方形（1349×1208，图注在最下面 120px）。卡片里不裁地图，
     只把报纸式的图注裁掉，高度跟着宽度走 —— 之前固定 238px 只能看到
     华北那一条，用户会以为"没地方在下雨"。
     宽度再收一点，免得一张图把整列的比例压垮。 */
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  aspect-ratio: 1349 / 1088;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #e6ebef;
  cursor: zoom-in;
  isolation: isolate;
}
html[data-time="night"] .rd-nmc { background: #1b2430; }
.rd-img {
  display: block;
  width: 100%;
  height: auto;
}
/* 中央气象台的图是纸质风格的白底，夜里压一点亮度，别整页最亮的是它 */
html[data-time="night"] .rd-img { filter: brightness(.88) contrast(1.02); }
.rd-nmc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  pointer-events: none;
}
.rd-tag {
  position: absolute;
  left: 9px;
  top: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: rgba(8, 18, 30, .58);
  color: #fff;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.rd-tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .22);
  animation: rdPulse 2.4s ease-in-out infinite;
}
@keyframes rdPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(74, 222, 128, .26); }
  50% { box-shadow: 0 0 0 5px rgba(74, 222, 128, .08); }
}
.rd-tip {
  position: absolute;
  right: 9px;
  bottom: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(8, 18, 30, .52);
  color: rgba(255, 255, 255, .88);
  font-size: 10px;
}
.rd-none {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 12px;
  color: rgba(255, 255, 255, .8);
  background: var(--tile);
}
html[data-time="day"] .rd-none { color: var(--muted); }

/* 详情里的看图器 */
.nmc-host { border-radius: 14px; overflow: hidden; background: #dfe5ea; }
html[data-time="night"] .nmc-host { background: #1b2430; }
.nmc { position: relative; }
.nmc-stage {
  position: relative;
  height: min(58vh, 540px);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: #eef1f4;
}
.nmc.is-zoomed .nmc-stage { cursor: move; }
.nmc-stage:active { cursor: grabbing; }
.nmc-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity .2s linear;
}
.nmc.is-loading .nmc-img { opacity: .55; }
.nmc.is-failed .nmc-img { visibility: hidden; }
.nmc-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
}
.nmc-tools button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text);
  cursor: pointer;
  transition: background .18s var(--ease);
}
.nmc-tools button:hover { background: var(--chip); }
.nmc-tools svg { width: 13px; height: 13px; }
.nmc-level {
  min-width: 38px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.nmc-reset { width: auto !important; padding: 0 11px; font-size: 11.5px; margin-left: auto; }

/* 时间轴 */
.rd-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.rd-strip::-webkit-scrollbar { display: none; }
.rd-chip {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.rd-chip:hover { background: var(--chip); }
.rd-chip.is-on {
  background: #2f7fd4;
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.rd-play {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text);
  font-size: 11.5px;
  cursor: pointer;
}
.rd-play svg { width: 11px; height: 11px; }
.rd-play.is-on { background: var(--accent); border-color: transparent; color: #fff; }
.rd-hint { margin-top: 8px; font-size: 10.5px; color: var(--faint); }

/* 台风/雷达共用的地图框 */
.rd-map { height: 198px; border-radius: 14px; background: #c3cbd4; }
html[data-time="night"] .rd-map { background: #232b34; }
.rd-map-lg { height: 320px; border-radius: 14px; }

/* ---------- 分钟降水 ---------- */
.nc { margin-top: 12px; }
.nc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.nc-head svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.nc-head strong { font-weight: 600; }
.nc-head span { font-size: 11.5px; color: var(--muted); }
.nc-chart {
  position: relative;
  height: 60px;
  margin-top: 9px;
  padding-top: 4px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  border-bottom: 1px solid var(--line);
}
.nc-bar { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.nc-bar i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #6cc0f7, #2f86d8);
  transition: height .5s var(--ease);
}
.nc-bar.is-zero i { background: var(--line-2); opacity: .45; }
.nc-axis { position: relative; height: 14px; margin-top: 6px; font-size: 10px; color: var(--faint); }
.nc-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.nc-axis span:first-child { transform: none; color: var(--accent); }
.nc-none { font-size: 12px; color: var(--muted); padding: 3px 0; line-height: 1.6; }

/* ---------- 7 天 ---------- */
.fc-list { display: flex; flex-direction: column; }
.fc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 4px;
  border: 0;
  background: none;
  border-radius: 10px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.fc-row + .fc-row { border-top: 1px solid var(--line); }
.fc-row:hover { background: var(--chip); }
.fc-row.is-today { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.fc-day { width: 50px; flex: none; display: flex; flex-direction: column; line-height: 1.3; }
.fc-day b { font-size: 12.5px; font-weight: 600; }
.fc-day em { font-style: normal; font-size: 9.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.fc-ico { width: 25px; height: 25px; flex: none; }
.fc-ico svg { width: 100%; height: 100%; }
.fc-cond {
  width: 58px;
  flex: none;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.28;
  white-space: nowrap;
  overflow: hidden;
}
.fc-cond em {
  display: block;
  font-style: normal;
  font-size: 9.5px;
  color: #55a8e8;
  font-variant-numeric: tabular-nums;
}
.fc-low, .fc-high { width: 34px; flex: none; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.fc-low { color: rgba(255, 255, 255, .84); }
.fc-high { font-weight: 600; }
.fc-bar { position: relative; flex: 1; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.fc-bar i {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #66d4ff 0%, #8fe0a8 45%, #ffd54a 100%);
  box-shadow: 0 0 8px rgba(255, 255, 255, .22);
}

/* ---------- 当前实况 ---------- */
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.metric {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--tile);
  border: 1px solid var(--tile-brd);
  transition: background .2s var(--ease);
}
.metric:hover { background: rgba(255, 255, 255, .16); }
.m-k { display: flex; align-items: center; gap: 4px; font-size: 11px; color: rgba(255, 255, 255, .7); }
.m-k svg { width: 12px; height: 12px; flex: none; }
.m-v { display: block; margin-top: 4px; font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 生活指数 ---------- */
.idx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.idx {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid var(--tile-brd);
  background: var(--tile);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.idx:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .24); transform: translateY(-1px); }
.idx-ico {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .10);
  font-size: 12.5px;
  line-height: 1;
  margin-bottom: 3px;
  /* emoji 原色太跳，压一点饱和度让它落进整体色调里 */
  filter: saturate(.72) brightness(1.04);
}
.idx-name {
  font-size: 11px;
  color: rgba(255, 255, 255, .72);
  letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.idx-lv { font-size: 13px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- 天文 ---------- */
.sun-arc { width: min(100%, 400px); margin: 0 auto; }
.astro-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 6px; }
.astro-grid div { padding: 9px 10px; border-radius: 12px; background: var(--tile); border: 1px solid var(--tile-brd); }
.astro-grid span { display: block; font-size: 9.5px; color: var(--faint); margin-bottom: 3px; }
.astro-grid strong { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.moon-row { display: flex; align-items: center; gap: 11px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.moon-row svg { flex: none; }
.m-info strong { display: block; font-size: 12.5px; font-weight: 600; }
.m-info span { font-size: 11px; color: var(--muted); }

/* ---------- 时光机 ---------- */
.hist-compare { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hc { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 12px; background: var(--chip); }
.hc span { display: block; font-size: 10px; color: var(--faint); margin-bottom: 3px; }
.hc strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hc em { display: block; margin-top: 3px; font-style: normal; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.hc-arrow { color: var(--faint); font-size: 12px; flex: none; }
.hist-chart { width: 100%; }
.hist-note { margin-top: 8px; font-size: 10.5px; line-height: 1.6; color: var(--faint); }

/* ---------- 台风 ---------- */
.ty-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ty-name { display: flex; align-items: baseline; gap: 6px; font-size: 15.5px; font-weight: 600; }
.ty-name em { font-style: normal; font-size: 10.5px; color: var(--faint); letter-spacing: .06em; }
.ty-chips { display: flex; gap: 5px; flex: none; }
.ty-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 10px;
  white-space: nowrap;
}
.ty-map { height: 236px; }
.ty-meta { margin-top: 9px; font-size: 11px; line-height: 1.65; color: var(--muted); }
.ty-meta b { color: var(--text); font-weight: 600; }
.ty-mapwrap { position: relative; }
.ty-tools {
  position: absolute;
  right: 9px;
  top: 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ty-tools button {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(10, 20, 34, .6);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.ty-tools button:hover { background: rgba(10, 20, 34, .78); }
.ty-tools svg { width: 12px; height: 12px; }
.ty-fit { font-size: 10px; }
.ty-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--muted);
}
.ty-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ty-legend i { width: 14px; height: 0; flex: none; }
.lg-past { border-top: 2.5px solid var(--text); }
.lg-fc { border-top: 2px dashed #ffd166; }
.lg-r7 { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 209, 102, .22); border: 1px solid rgba(255, 209, 102, .6); }
.lg-r10 { width: 12px; height: 12px; border-radius: 50%; background: rgba(239, 68, 68, .2); border: 1px solid rgba(239, 68, 68, .6); }
.ty-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.ty-tab {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.ty-tab.is-on { background: #2f7fd4; border-color: transparent; color: #fff; }
.ty-points { display: flex; flex-direction: column; margin-top: 4px; }
.ty-points li {
  display: grid;
  grid-template-columns: 78px 1fr 42px auto;
  gap: 8px;
  align-items: center;
  padding: 7px 2px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.tp-time { color: var(--faint); font-variant-numeric: tabular-nums; }
.tp-strong { color: var(--text); }
.tp-power { color: var(--text); font-weight: 600; }
.tp-pos { color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- 迷你地图 ---------- */
.mm { position: relative; overflow: hidden; border-radius: 16px; background: #cfd6db; }
html[data-time="night"] .mm { background: #232b34; }
/* 细描边：让被裁切的瓦片边缘（跨界的文字标签）看起来像有意的画框 */
.mm::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(12, 26, 44, .09);
  pointer-events: none;
}
html[data-time="night"] .mm::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.mm-layer { position: absolute; inset: 0; }
.mm-t { position: absolute; left: 0; top: 0; width: 256px; height: 256px; user-select: none; }
/* 高德 style=7 的底图偏米黄，压一点饱和、叠一层浅浅的蓝，跟卡片落到同一色系 */
.mm::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  background: rgba(24, 78, 138, .12);
  mix-blend-mode: multiply;
}
html[data-time="night"] .mm::before { background: rgba(8, 20, 36, .16); }
/* 夜里不做反相：反相会把黄色主干道变成暗红、文字变成白底黑字，路线看不清。
   只降亮度加一点蓝，省界和地名仍然读得出来。 */
html[data-time="day"] .mm-l-base { filter: saturate(.8) contrast(.98) brightness(.96); }
html[data-time="night"] .mm-l-base { filter: saturate(.88) brightness(.8) contrast(.96); }
.mm-l-radar { opacity: 0; transition: opacity .3s linear; }
.mm-marker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.mm-marker i {
  position: absolute;
  left: -6px;
  top: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a72d8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 6px rgba(26, 114, 216, .18);
}
.mm-marker::after {
  content: "";
  position: absolute;
  left: -14px;
  top: -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(26, 114, 216, .55);
  animation: mmPulse 2.6s ease-out infinite;
}
@keyframes mmPulse {
  0% { transform: scale(.5); opacity: .9; }
  100% { transform: scale(1.7); opacity: 0; }
}
.mm-attrib {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 9px;
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.mm-track { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tr-past-halo { fill: none; stroke: rgba(10, 30, 55, .45); stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }
.tr-past { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tr-future { fill: none; stroke: #ffd166; stroke-width: 2.1; stroke-dasharray: 5 4; stroke-linecap: round; }
.tr-dot { stroke-width: 1.6; }
.tr-dot.is-now { stroke-width: 2.2; }
.tr-fc-dot { fill: rgba(255, 209, 102, .9); stroke: rgba(10, 30, 55, .5); stroke-width: 1; }
.tr-fc-txt { font-size: 8.5px; fill: rgba(255, 255, 255, .9); paint-order: stroke; stroke: rgba(10, 30, 55, .5); stroke-width: 2.2; }
.tr-ring { stroke-width: 1.2; }
.tr-ring-7 { fill: rgba(255, 209, 102, .1); stroke: rgba(255, 209, 102, .62); }
.tr-ring-10 { fill: rgba(239, 68, 68, .12); stroke: rgba(239, 68, 68, .68); }
.tr-home-dot { fill: #1a72d8; stroke: #fff; stroke-width: 1.6; }
.tr-home-halo { fill: rgba(26, 114, 216, .18); }
.tr-home-txt {
  font-size: 9px;
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(10, 30, 55, .55);
  stroke-width: 2.4;
}

/* ---------- 弹层 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(4, 10, 18, .56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .28s ease;
}
.sheet-mask.show { opacity: 1; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 191;
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  background: var(--sheet-bg);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -22px 60px rgba(0, 0, 0, .32);
  backdrop-filter: blur(50px) saturate(180%);
  -webkit-backdrop-filter: blur(50px) saturate(180%);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .34s var(--ease);
  will-change: transform;
}
.sheet.show { transform: translateY(0); }
.sheet.dragging { transition: none; }

.sheet-handle {
  flex: none;
  display: flex;
  justify-content: center;
  padding: 9px 0 3px;
  touch-action: none;
  cursor: grab;
}
.sheet-handle span { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); }

.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 22px 16px;
  border-bottom: 1px solid var(--line);
}
.sheet-ico {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--accent);
}
.sheet-ico svg { width: 19px; height: 19px; }
.sheet-titles { flex: 1; min-width: 0; }
.sheet-titles h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.sheet-titles p { margin-top: 2px; font-size: 11px; line-height: 1.45; color: var(--muted); }
.sheet-close {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--chip);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.sheet-close svg { width: 13px; height: 13px; }
.sheet-body {
  padding: 16px 22px 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (min-width: 720px) {
  .sheet {
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(560px, calc(100vw - 40px));
    max-height: 80vh;
    border-radius: 24px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
    transform: translate(-50%, -46%) scale(.96);
    opacity: 0;
    transition: transform .3s var(--ease), opacity .24s ease;
  }
  .sheet.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet.is-wide { width: min(760px, calc(100vw - 40px)); }
  .sheet-handle { display: none; }
  .sheet-head { padding-top: 18px; }
  .sheet-body { padding-bottom: 18px; }
}

body.is-locked { overflow: hidden; }

/* ---------- 弹层内容 ---------- */
.sh-h4 { margin: 16px 0 7px; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.sh-text { font-size: 13px; line-height: 1.8; color: var(--text); }
.sh-note { margin-top: 14px; font-size: 10.5px; line-height: 1.65; color: var(--faint); }
.city-note {
  margin-top: 20px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.sh-lead { display: flex; align-items: center; gap: 14px; padding: 4px 0 14px; }
.sh-lead-ico { width: 54px; height: 54px; flex: none; }
.sh-lead-ico svg { width: 100%; height: 100%; }
.sh-lead-num strong { display: block; font-size: 34px; font-weight: 300; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sh-lead-num em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.sh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 7px; }
.sh-grid > div { padding: 9px 11px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .10); }
/* 奇数个格子时，最后一行不留半行：让它自己占满整行 */
.sh-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sh-grid span { display: block; font-size: 10px; color: var(--faint); margin-bottom: 3px; }
.sh-grid b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sh-range { position: relative; height: 8px; margin: 18px 0 6px; border-radius: 4px; background: var(--chip); }
.sh-range i {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #66d4ff 0%, #8fe0a8 45%, #ffd54a 100%);
}
.sh-range span {
  position: absolute;
  top: -15px;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.sh-range span:first-child { left: 0; }
.sh-range span:last-child { right: 0; }

.sh-aqi { display: flex; align-items: center; gap: 14px; }
.sh-aqi .aqi-gauge { width: 150px; flex: none; }
.sh-aqi-side { min-width: 0; }
.sh-aqi-side strong { font-size: 20px; font-weight: 650; }
.sh-aqi-side p { margin-top: 5px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.sh-aqi-side p b { color: var(--text); }
.sh-advice { padding: 8px 10px; border-radius: 10px; background: var(--chip); margin-top: 8px !important; }
.aqi-bars { display: flex; flex-direction: column; gap: 8px; }
.aqi-bars li { display: grid; grid-template-columns: 50px 1fr 74px; align-items: center; gap: 9px; font-size: 11.5px; }
.aqi-bars .p-name { color: var(--muted); }
.aqi-bars .p-track { height: 5px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.aqi-bars .p-track i { display: block; height: 100%; border-radius: 3px; }
.aqi-bars .p-val { text-align: right; font-variant-numeric: tabular-nums; }
.aqi-bars .p-val em { font-style: normal; font-size: 10px; color: var(--faint); margin-left: 2px; }
.aqi-trend { width: 100%; }

.sh-idx { display: flex; align-items: center; gap: 14px; }
.sh-idx-ico {
  width: 50px;
  height: 50px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--chip);
  font-size: 24px;
}
.sh-idx-lv { min-width: 0; }
.lv-bar { display: flex; gap: 3px; margin-bottom: 7px; }
.lv-bar i { width: 26px; height: 4px; border-radius: 2px; background: var(--line-2); }
.lv-bar i.on { background: var(--lvc, #37b26c); }
.sh-idx-lv strong { font-size: 18px; font-weight: 650; }

.sh-alert {
  position: relative;
  padding: 14px 14px 14px 16px;
  border-radius: 14px;
  border-left: 3px solid var(--lv);
  background: color-mix(in srgb, var(--lv) 11%, var(--chip));
}
.sh-alert-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lv) 26%, transparent);
  font-size: 10.5px;
  color: var(--text);
}

/* ---------- 城市切换 ---------- */
.city-results:empty { display: none; }
.city-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: 13px;
  background: var(--chip);
  border: 1px solid transparent;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.city-search:focus-within { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--card-2); }
.city-search svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.city-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
}
.city-search input::placeholder { color: var(--faint); }
.city-search input::-webkit-search-cancel-button { display: none; }
.city-clear {
  width: 22px;
  height: 22px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--line-2);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.city-clear svg { width: 11px; height: 11px; }

.city-results { margin-top: 6px; }
.city-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.city-item:hover, .city-item.is-active { background: var(--chip); }
.city-item svg { width: 14px; height: 14px; color: var(--faint); flex: none; }
.ci-name { font-size: 13.5px; font-weight: 600; }
.ci-sub { margin-left: auto; font-size: 11px; color: var(--muted); text-align: right; }
.city-hint { padding: 14px 6px; font-size: 12.5px; color: var(--muted); }
.city-sec { margin-top: 20px; }
.city-sec h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--faint);
  margin-bottom: 10px;
}
.city-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.city-chip {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .15s var(--ease);
}
.city-chip:hover { background: rgba(255, 255, 255, .16); border-color: transparent; }
.city-chip:active { transform: scale(.96); }

/* ---------- 页脚 ---------- */
.foot {
  max-width: var(--w);
  margin: 0 auto;
  padding: 22px 16px 34px;
  color: var(--muted);
}
.foot-main, .foot-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.foot-main { margin-bottom: 5px; }
.foot-brand { font-weight: 600; color: var(--text); }
.foot a { border-bottom: 1px dotted var(--line-2); }
.foot a:hover { color: var(--accent); border-color: transparent; }
.foot .sep { opacity: .5; }
.foot-note { margin-top: 7px; font-size: 10px; color: var(--faint); line-height: 1.6; }

/* ---------- 骨架屏 ---------- */
.sk-hero { padding: 26px 18px 30px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sk-hero .sk-line { height: 14px; border-radius: 7px; }
.sk-hero .sk-line.huge { height: 96px; width: 180px; border-radius: 18px; }
.sk-hero .sk-line.w30 { width: 30%; }
.sk-hero .sk-line.w40 { width: 40%; }
.sk-line, .sk-rows, .sk-bars, .sk-map {
  background: linear-gradient(90deg, var(--chip) 25%, color-mix(in srgb, var(--chip) 50%, transparent) 37%, var(--chip) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 8px;
}
.sk-line { height: 12px; margin-bottom: 10px; }
.sk-line.w30 { width: 30%; }
.sk-rows { height: 62px; }
.sk-bars { height: 74px; margin-top: 12px; }
.sk-map { height: 180px; }
.sk .card { background: var(--card); }
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* ---------- 错误 / 提示 ---------- */
.error {
  margin: 12px 16px 0;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
}
.error .err-emoji { font-size: 40px; }
.error h3 { font-size: 15px; font-weight: 600; }
.error p { font-size: 12.5px; line-height: 1.7; color: var(--muted); max-width: 420px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  margin-top: 6px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.btn.primary { background: #2f7fd4; border-color: transparent; color: #fff; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 300;
  max-width: min(86vw, 460px);
  padding: 9px 17px;
  border-radius: 999px;
  background: rgba(10, 20, 34, .92);
  color: #fff;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 16px 36px -18px rgba(0, 0, 0, .7);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: .28s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (min-width: 600px) {
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ty-map { height: 250px; }
  .rd-map-lg { height: 360px; }
}

@media (max-width: 520px) {
  .sky-scene { top: 8px; right: -8%; width: 68vw; aspect-ratio: 900 / 460; height: auto; opacity: .72; }
  .hero { padding: 20px 16px 26px; }
  .hero-num { font-size: 96px; }
  .hero-deg { font-size: 38px; margin-top: 11px; }
  .hero-cond { font-size: 16.5px; }
  .brand-name { display: none; }
  .city-btn span { max-width: 30vw; }
  .deck { padding: 0 16px; gap: 11px; }
  .card { padding: 14px 14px 13px; border-radius: 18px; }
  .fc-cond { width: 46px; font-size: 11px; }
  .fc-day { width: 46px; }
  .gl-k { width: 74px; }
  .gl-v { width: 80px; }
  .idx-grid { gap: 6px; }
  .idx { padding: 7px 8px; }
  .idx-lv { font-size: 11.5px; }
  .astro-grid { gap: 6px; }
  .astro-grid div { padding: 7px 8px; }
  .foot { padding: 18px 16px 30px; }
  .rd-map { height: 178px; }
  .rd-map-lg { height: 42vh; min-height: 220px; max-height: 340px; }
  .ty-map { height: 168px; }
  .sh-aqi { gap: 10px; }
  .sh-aqi .aqi-gauge { width: 120px; }
}

@media (max-width: 380px) {
  .hero-num { font-size: 84px; }
  .idx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 宽弹层（台风 / 雷达）桌面端：760px 宽的画面配 360px 太扁，路径会压成一条 */
@media (min-width: 720px) {
  .sheet.is-wide .rd-map-lg { height: min(46vh, 400px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
