/* ───────── 设计变量 ─────────
   字号只有 7 级：大字 / 34 / 22 / 17 / 15 / 13 / 11
   材质只有 3 层：天空（无容器）→ 胶囊 → 面板 */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  /* 等级色：紫外线、空气质量、预警共用同一组 */
  --lv1: #62d493; --lv2: #f4d04a; --lv3: #ff9f45; --lv4: #ff6b6b; --lv5: #c78bfa; --lv6: #b0527a;
  --rain: #8ccbff;
  --ink: #fff;
  --r-sheet: 24px;
  --r-cell: 14px;
}
/* ───────── 天空配色：天气 × 白天/夜间 ─────────
   每套给 天顶 / 中段 / 地平线 三个颜色和一团光晕；
   --sky-* 注册成颜色类型，切换天气或外观时渐变色也能平滑过渡 */
@property --sky-top { syntax: "<color>"; inherits: true; initial-value: #124dbd; }
@property --sky-mid { syntax: "<color>"; inherits: true; initial-value: #1d67d5; }
@property --sky-end { syntax: "<color>"; inherits: true; initial-value: #2a78dc; }
html {
  --sky-top: var(--p-top); --sky-mid: var(--p-mid); --sky-end: var(--p-end);
  transition: --sky-top .6s ease, --sky-mid .6s ease, --sky-end .6s ease;
}
/* 白天 */
html[data-theme="day"]                     { --p-top: #124dbd; --p-mid: #1d67d5; --p-end: #2a78dc; --p-glow: rgba(150, 208, 255, .5); }
html[data-theme="day"][data-wx="cloudy"]   { --p-top: #1f4f93; --p-mid: #3266aa; --p-end: #477bb8; --p-glow: rgba(214, 230, 255, .34); }
html[data-theme="day"][data-wx="overcast"] { --p-top: #4a6382; --p-mid: #5f7896; --p-end: #7890a9; --p-glow: rgba(255, 255, 255, .12); }
html[data-theme="day"][data-wx="rain"]     { --p-top: #344b66; --p-mid: #46607d; --p-end: #5b7592; --p-glow: rgba(160, 200, 255, .14); }
html[data-theme="day"][data-wx="thunder"]  { --p-top: #252640; --p-mid: #343553; --p-end: #444364; --p-glow: rgba(255, 220, 140, .12); }
html[data-theme="day"][data-wx="snow"]     { --p-top: #4a6a8f; --p-mid: #5a789a; --p-end: #7590b0; --p-glow: rgba(255, 255, 255, .26); }
html[data-theme="day"][data-wx="fog"]      { --p-top: #526273; --p-mid: #66778a; --p-end: #7d8c9d; --p-glow: rgba(255, 255, 255, .2); }
html[data-theme="day"][data-wx="haze"]     { --p-top: #514434; --p-mid: #665641; --p-end: #7a684f; --p-glow: rgba(255, 210, 140, .22); }
/* 夜间 */
html[data-theme="night"]                     { --p-top: #060a1e; --p-mid: #0e1439; --p-end: #1a2259; --p-glow: rgba(120, 136, 255, .22); }
html[data-theme="night"][data-wx="cloudy"]   { --p-top: #090d20; --p-mid: #141a38; --p-end: #232b50; --p-glow: rgba(140, 150, 220, .14); }
html[data-theme="night"][data-wx="overcast"] { --p-top: #0d1017; --p-mid: #171b25; --p-end: #252b38; --p-glow: transparent; }
html[data-theme="night"][data-wx="rain"]     { --p-top: #080d16; --p-mid: #111a27; --p-end: #1c2838; --p-glow: rgba(120, 160, 220, .08); }
html[data-theme="night"][data-wx="thunder"]  { --p-top: #0a0914; --p-mid: #15132a; --p-end: #232039; --p-glow: rgba(255, 220, 140, .07); }
html[data-theme="night"][data-wx="snow"]     { --p-top: #0f1522; --p-mid: #1a2334; --p-end: #29344a; --p-glow: rgba(255, 255, 255, .1); }
html[data-theme="night"][data-wx="fog"]      { --p-top: #101216; --p-mid: #1a1d23; --p-end: #282c33; --p-glow: rgba(255, 255, 255, .06); }
html[data-theme="night"][data-wx="haze"]     { --p-top: #15110c; --p-mid: #221c15; --p-end: #322a20; --p-glow: rgba(255, 200, 130, .08); }

html[data-theme="night"] {
  --ink-2: rgba(232, 238, 255, .74);
  --ink-3: rgba(232, 238, 255, .52);
  --sheet: rgba(255, 255, 255, .07);
  --sheet-deep: rgba(10, 14, 40, .55);
  --raise: rgba(255, 255, 255, .09);
  --hair: rgba(255, 255, 255, .1);
  --edge: rgba(255, 255, 255, .1);
  --glass: color-mix(in srgb, color-mix(in srgb, var(--sky-end) 88%, #fff) 84%, transparent);
  --glow: rgba(196, 208, 255, .2);
  --panel: color-mix(in srgb, var(--sky-mid) 88%, #fff);
  --temp-w: 200;
}
html[data-theme="day"] {
  --ink-2: rgba(255, 255, 255, .9);
  --ink-3: rgba(255, 255, 255, .76);
  /* 面板、悬浮栏、抽屉都取天顶色压暗，任何天气下都和天空同一色系 */
  --sheet: color-mix(in srgb, color-mix(in srgb, var(--sky-top) 62%, #000) 45%, transparent);
  --sheet-deep: color-mix(in srgb, color-mix(in srgb, var(--sky-top) 70%, #000) 62%, transparent);
  --raise: rgba(255, 255, 255, .15);
  --hair: rgba(255, 255, 255, .18);
  --edge: rgba(255, 255, 255, .17);
  --glass: color-mix(in srgb, color-mix(in srgb, var(--sky-top) 85%, #000) 82%, transparent);
  --glow: rgba(255, 249, 228, .36);
  --panel: color-mix(in srgb, var(--sky-top) 92%, #fff);
  --temp-w: 300;
}
/* 阴雨雾霾的白天：太阳光晕收弱 */
html[data-theme="day"]:is([data-wx="overcast"], [data-wx="rain"], [data-wx="thunder"], [data-wx="fog"], [data-wx="haze"]) { --glow: rgba(255, 255, 255, .14); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--sky-end); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* 线性图标统一 1.7 线宽；天气图标统一带渐变的实心风格 */
svg.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.wi { width: 26px; height: 26px; flex: none; }
.dot { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; }

/* ───────── 天空：固定在最底层，滚动时不重绘 ───────── */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70vmax 60vmax at 96% -6%, var(--p-glow, transparent), transparent 64%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 46%, var(--sky-end) 100%);
}

/* ───────── 版面 ───────── */
.app { position: relative; max-width: 480px; margin: 0 auto; padding: 0 16px calc(92px + var(--sab)); overflow-x: clip; }
/* 夜间晴天/多云的星星：只点在页面顶部和大字区的空白处，跟着内容一起滚走 */
.app::before, .hero::before { content: ""; position: absolute; z-index: -1; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
html[data-theme="night"][data-wx="clear"] .app::before, html[data-theme="night"][data-wx="clear"] .hero::before { opacity: 1; }
html[data-theme="night"][data-wx="cloudy"] .app::before, html[data-theme="night"][data-wx="cloudy"] .hero::before { opacity: .4; }
.app::before {
  top: 0; left: 0; right: 0; height: calc(var(--sat) + 48px);
  background:
    radial-gradient(1.4px 1.4px at 9% 30%, rgba(255, 255, 255, .85) 50%, transparent 52%),
    radial-gradient(1px 1px at 30% 58%, rgba(255, 255, 255, .5) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 58% 84%, rgba(255, 255, 255, .7) 50%, transparent 52%),
    radial-gradient(1px 1px at 74% 22%, rgba(255, 255, 255, .55) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 93% 48%, rgba(255, 255, 255, .6) 50%, transparent 52%);
}
.hero::before {
  inset: 0;
  background:
    radial-gradient(1.2px 1.2px at 47% 9%, rgba(255, 255, 255, .7) 50%, transparent 52%),
    radial-gradient(1px 1px at 60% 30%, rgba(255, 255, 255, .5) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 57% 40%, rgba(255, 255, 255, .8) 50%, transparent 52%),
    radial-gradient(1px 1px at 97% 3%, rgba(255, 255, 255, .6) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 99% 41%, rgba(255, 255, 255, .5) 50%, transparent 52%),
    radial-gradient(1px 1px at 90% 50%, rgba(255, 255, 255, .55) 50%, transparent 52%);
}

/* 顶部栏：地名（滚动后追加 气温 + 天气）+ 外观开关 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  margin: 0 -16px; padding: calc(var(--sat) + 6px) 16px 8px 24px;
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .25s;
  background: linear-gradient(var(--sky-top) var(--sat), color-mix(in srgb, var(--sky-top) 92%, transparent));
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: 0 .5px 0 var(--hair);
}
.topbar.is-stuck::before { opacity: 1; }
.loc { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 36px; }
.loc h1 { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 22px; font-weight: 600; letter-spacing: .01em; }
.loc h1 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc h1 svg { width: 13px; height: 13px; flex: none; color: var(--ink-2); }
.loc-now { display: flex; align-items: center; gap: 4px; flex: none; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.topbar.show-now .loc-now { opacity: 1; transform: none; }
.loc-now .wi { width: 22px; height: 22px; }
.loc-now b { font-size: 17px; font-weight: 600; }
.loc-now span { font-size: 15px; color: var(--ink-2); }

/* 外观：自动 / 白天 / 夜间 三段，白色滑块停在所选的一段上。
   看上去 34px 高，每段的点按区域上下各外扩 5px，达到 44px */
.tsw { position: relative; display: flex; flex: none; height: 34px; padding: 0 3px; border-radius: 17px; background: var(--raise); box-shadow: inset 0 0 0 .5px var(--edge); }
.tsw::before { content: ""; position: absolute; top: 3px; left: 3px; width: 36px; height: 28px; border-radius: 14px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .28s cubic-bezier(.3, .7, .3, 1); }
.tsw[data-mode="day"]::before { transform: translateX(36px); }
.tsw[data-mode="night"]::before { transform: translateX(72px); }
.tsw button { position: relative; display: grid; place-items: center; width: 36px; height: 44px; margin: -5px 0; border-radius: 14px; color: var(--ink-2); transition: color .2s, transform .12s; }
.tsw button[aria-checked="true"] { color: #17306b; }
.tsw button:active { transform: scale(.9); }
.tsw svg.ico { width: 16px; height: 16px; }

/* 预警：深色胶囊 + 预警色描边与图标（不再用左侧色条） */
.alerts { display: grid; gap: 8px; margin-top: 2px; }
.alerts:empty { display: none; }
.alert { border-radius: 20px; background: var(--sheet-deep); box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--ac) 55%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.alert summary { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px 0 12px; }
.alert .a-ico { width: 20px; height: 20px; flex: none; color: var(--ac); }
.alert .a-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert[open] .a-title { white-space: normal; padding: 9px 0; }
.alert .chev { width: 16px; height: 16px; color: var(--ink-3); transition: transform .2s; }
.alert[open] .chev { transform: rotate(90deg); }
.alert .a-body { padding: 0 14px 14px 40px; font-size: 13px; line-height: 1.6; color: var(--ink-2); white-space: pre-line; }
.alert .a-body small { display: block; margin-bottom: 6px; font-size: 11px; color: var(--ink-3); }
.alert .a-body p + p { margin-top: 8px; }

/* ───────── 首屏大字区：直接写在天空上，不套容器 ───────── */
.hero { position: relative; padding: 8px 8px 0; }
.hero-main { display: flex; align-items: center; justify-content: space-between; }
.temp { display: flex; align-items: flex-start; font-size: clamp(100px, 27vw, 118px); font-weight: var(--temp-w); line-height: .86; letter-spacing: -.045em; }
.temp sup { margin: .06em 0 0 .06em; font-size: .4em; font-weight: 300; line-height: 1; letter-spacing: 0; }
.hero-icon { position: relative; width: 112px; height: 112px; flex: none; margin-right: 4px; }
.hero-icon::before { content: ""; position: absolute; inset: -78px; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), color-mix(in srgb, var(--glow) 42%, transparent) 34%, color-mix(in srgb, var(--glow) 12%, transparent) 64%, transparent); pointer-events: none; }
.hero-icon svg { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .16)); }
.cond { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.cond b { font-size: 22px; font-weight: 600; line-height: 1.25; }
.cond span { font-size: 15px; color: var(--ink-2); }
.wearline { display: flex; align-items: center; gap: 2px; width: 100%; margin-top: 4px; font-size: 15px; color: var(--ink-2); text-align: left; }
.wearline b { color: var(--ink); font-weight: 600; }
.wearline svg.ico { width: 14px; height: 14px; color: var(--ink-3); }
/* 四项指标：小标签在上、数值在下，列与列之间只用一根细线 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; }
.stat { min-width: 0; padding-left: 14px; border-left: .5px solid var(--hair); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-2); white-space: nowrap; }
.stat b { display: block; margin-top: 1px; font-size: 17px; font-weight: 600; white-space: nowrap; }
.stat b i { margin-left: 3px; font-style: normal; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 34px; padding: 0 14px 0 12px; border-radius: 17px; background: var(--raise); box-shadow: inset 0 0 0 .5px var(--edge); font-size: 15px; white-space: nowrap; }
.chip em { font-style: normal; color: var(--ink-2); }
.chip svg.ico { width: 15px; height: 15px; color: var(--rain); }
.mini-rain { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: 12px; }
.mini-rain i { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--rain); }
.mini-rain-x { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--ink-3); }

/* 更高的屏幕（如 17 Pro Max 全屏）：多出来的高度留给大字区透气 */
@media (min-height: 920px) {
  .hero { padding-top: 22px; }
  .cond { margin-top: 14px; }
  .stats { margin-top: 22px; }
  .chips { margin-top: 18px; }
  main { margin-top: 20px; }
}

/* ───────── 面板：无描边，靠一层浅填充 + 0.5px 内高光成形 ───────── */
main { display: grid; gap: 12px; margin-top: 14px; }
.sheet {
  min-width: 0; padding: 14px 16px 16px; border-radius: var(--r-sheet);
  background: var(--sheet);
  box-shadow: inset 0 0 0 .5px var(--edge);
  -webkit-backdrop-filter: blur(24px) saturate(1.15); backdrop-filter: blur(24px) saturate(1.15);
  scroll-margin-top: calc(var(--sat) + 58px);
}
/* 面板标题：统一的小标签样式，右侧可带一段辅助信息 */
.sh { display: flex; align-items: center; gap: 6px; min-height: 20px; margin-bottom: 12px; font-size: 13px; font-weight: 600; letter-spacing: .03em; color: var(--ink-3); }
.sh svg.ico { width: 15px; height: 15px; }
.sh .acc { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-weight: 400; letter-spacing: 0; }
.sh .acc svg.ico ~ svg.ico { margin-left: 8px; }
.rule { height: .5px; margin: 12px 0; background: var(--hair); }
.lead { font-size: 15px; color: var(--ink-2); }
.lead b { color: var(--ink); font-weight: 600; }

#forecast { padding: 12px 16px 10px; }
#forecast .sh { margin-bottom: 6px; }
/* 昨天 / 今天 / 明天：不画竖线，“今天”用一块浅底托起来 */
.d3note { margin: 0 4px 8px; font-size: 13px; color: var(--ink-2); }
.d3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0 -6px; }
.d3c { min-width: 0; padding: 7px 10px 8px; border-radius: 16px; }
.d3c.today { background: var(--raise); }
.d3c.past { opacity: .72; }
.d3c-head { display: flex; align-items: baseline; justify-content: space-between; }
.d3c-head b { font-size: 15px; font-weight: 600; }
.d3c-head small { font-size: 11px; color: var(--ink-3); }
.d3c-wx { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.d3c-wx .wi { width: 22px; height: 22px; }
.d3c-wx span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d3c-t { margin-top: 3px; font-size: 22px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.d3c-t small { font-size: 15px; font-weight: 400; color: var(--ink-2); }

/* 24 小时：每小时一列，气温数字沿曲线起伏 */
.scroller { margin: 0 -16px; padding: 0 9px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroller::-webkit-scrollbar { display: none; }
.hours { position: relative; display: flex; }
.hours-line { position: absolute; left: 0; bottom: 4px; pointer-events: none; }
.hour { display: flex; flex-direction: column; align-items: center; flex: none; width: 58px; padding: 6px 0 4px; border-radius: 16px; transition: background-color .15s; }
.hour.is-active { background: var(--raise); }
.h-time { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.hour.is-now .h-time { color: var(--ink); font-weight: 600; }
.hour.is-past > * { opacity: .5; }
.hour.is-past.is-active > * { opacity: .75; }
.hour .wi { margin-top: 4px; }
.h-pop { display: flex; align-items: center; height: 14px; font-size: 11px; font-weight: 600; color: var(--rain); }
.hours.no-pop .h-pop { display: none; }
.h-chart { position: relative; width: 100%; height: 50px; }
.h-temp { position: absolute; left: 0; right: 0; text-align: center; font-size: 15px; font-weight: 600; }
.hour-detail { margin-top: 10px; padding: 9px 12px; border-radius: var(--r-cell); background: var(--raise); font-size: 13px; color: var(--ink-2); }
.hour-detail b { color: var(--ink); font-weight: 600; }

/* ───────── 紫外线 ───────── */
.uv-days { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); margin: 0 -6px; }
.uvd { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.uvd small { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.uvd span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 17px; transition: transform .12s, background-color .15s; }
.uvd.past span { color: var(--ink-3); }
.uvd.is-today span { box-shadow: inset 0 0 0 1px var(--ink-3); }
.uvd[aria-pressed="true"] span { background: #fff; color: #142a63; font-weight: 600; box-shadow: none; }
.uvd:active span { transform: scale(.9); }
.uv-read { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.uv-read .big { font-size: 34px; font-weight: 300; line-height: 1.1; }
.uv-read .lv { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; }
.uv-read .when { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.uv-chart { margin-top: 6px; }
.uv-svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.uv-svg text { font-size: 11px; fill: var(--ink-3); }
.uv-svg .grid line { stroke: var(--hair); stroke-width: 1; shape-rendering: crispEdges; }
.uv-svg .grid line.v { stroke-dasharray: 2 4; }
.uv-svg .now { stroke: var(--ink-2); stroke-width: 1; }
.uv-svg .cursor { stroke: #fff; stroke-width: 1; }
.uv-svg .knob { fill: #fff; stroke: rgba(8, 16, 48, .55); stroke-width: 2; }
.cmp-title { margin: 14px 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .03em; color: var(--ink-3); }
.cmp { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) 1.6em; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.cmp-bar { height: 8px; border-radius: 4px; background: var(--hair); }
.cmp-bar i { display: block; height: 100%; min-width: 8px; border-radius: 4px; background: var(--ink-3); }
.cmp.is-main { color: var(--ink); }
.cmp.is-main .cmp-bar i { background: #fff; }
.cmp b { text-align: right; font-size: 15px; font-weight: 600; color: var(--ink); }

/* ───────── 15 天 ───────── */
.day + .day { border-top: .5px solid var(--hair); }
.day summary { display: grid; grid-template-columns: 44px 26px minmax(0, 1fr) 28px 72px 30px; align-items: center; gap: 8px; min-height: 48px; padding: 6px 0; }
.d-date b { display: block; font-size: 15px; font-weight: 600; line-height: 19px; }
.d-date small { display: block; font-size: 11px; line-height: 13px; color: var(--ink-3); }
.d-text { font-size: 13px; line-height: 1.25; color: var(--ink-2); }
.d-text em { display: block; font-style: normal; font-size: 11px; font-weight: 600; color: var(--rain); }
.d-min, .d-max { font-size: 15px; text-align: right; }
.d-min { color: var(--ink-2); }
.d-max { font-weight: 600; }
.d-bar { position: relative; height: 4px; border-radius: 2px; background: var(--hair); }
.d-bar i { position: absolute; top: 0; bottom: 0; min-width: 4px; border-radius: 2px; }
.d-bar b { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2.5px rgba(8, 16, 48, .5); }
.day.is-past summary { opacity: .55; }
.d-note { grid-column: 1 / -1; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }
.d-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; margin: 2px 0 12px; padding: 10px 12px; border-radius: var(--r-cell); background: var(--raise); }
.kv small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }
.kv b { font-size: 15px; font-weight: 600; white-space: nowrap; }
.kv b i { margin-left: 2px; font-style: normal; font-size: 11px; font-weight: 400; color: var(--ink-3); }

/* ───────── 穿衣提示 ───────── */
.wear-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wear-head b { font-size: 22px; font-weight: 600; line-height: 1.25; }
.wear-head span { font-size: 13px; color: var(--ink-3); }
.wear-text { margin-top: 4px; }
.tips { display: grid; gap: 8px; }
.tips li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--ink-2); }
.tips em { flex: none; margin-top: 2px; padding: 1px 8px; border-radius: 9px; background: var(--raise); font-style: normal; font-size: 11px; font-weight: 600; line-height: 18px; color: var(--ink); }

/* ───────── 实况详情（3×3） ───────── */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { min-width: 0; padding: 12px 8px 12px 0; border-top: .5px solid var(--hair); }
.tile:nth-child(-n+3) { padding-top: 0; border-top: 0; }
.tile:nth-last-child(-n+3) { padding-bottom: 0; }
.tile dt { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }
.tile dt svg.ico { width: 14px; height: 14px; }
.tile dd { margin-top: 3px; font-size: 22px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.tile dd small { margin-left: 2px; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.tile dd .dot { margin-right: 6px; vertical-align: 3px; }
.tile p { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───────── 空气质量 ───────── */
.aqi { display: flex; align-items: baseline; gap: 10px; }
.aqi .big { font-size: 34px; font-weight: 300; line-height: 1.1; }
.aqi .lv { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 600; }
.aqi .when { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.aqi-scale { position: relative; display: flex; gap: 3px; margin: 12px 0; }
.aqi-scale span { flex: 1; height: 6px; border-radius: 3px; opacity: .9; }
.aqi-scale i { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(8, 16, 48, .5); }
.poll { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.footer { margin-top: 20px; text-align: center; font-size: 11px; line-height: 1.7; color: var(--ink-3); }

/* ───────── 底部悬浮栏：刷新 / 定位箭头 + 城市圆点 / 城市列表 ───────── */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; max-width: 480px; margin: 0 auto; padding: 0 20px calc(10px + var(--sab)); pointer-events: none; }
/* 用天空本身的颜色向下渐隐，内容滑到悬浮栏下面时不会和按钮糊在一起 */
.dock::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; height: calc(108px + var(--sab)); background: linear-gradient(to top, var(--sky-end) 40%, transparent); pointer-events: none; }
.dock > * { pointer-events: auto; }
.dock-btn, .pager { background: var(--glass); box-shadow: inset 0 0 0 .5px var(--edge), inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 28px rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
.dock-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; transition: transform .12s; }
.dock-btn svg.ico { width: 21px; height: 21px; }
.dock-btn:active { transform: scale(.92); }
.dock-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 圆点栏：第一个是定位箭头，后面每个常用城市一个点；城市多了可以横向滚动 */
.pager { display: flex; align-items: center; min-width: 0; max-width: calc(100% - 120px); height: 44px; padding: 0 10px; border-radius: 22px; overflow-x: auto; scrollbar-width: none; }
.pager::-webkit-scrollbar { display: none; }
.pg { display: grid; place-items: center; flex: none; width: 22px; height: 44px; color: rgba(255, 255, 255, .4); transition: color .15s, transform .12s; }
.pg i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pg svg { width: 14px; height: 14px; }
.pg[aria-current="true"] { color: #fff; }
.pg:active { transform: scale(.85); }

/* ───────── 提示条、加载与出错 ───────── */
.notice { display: flex; align-items: flex-start; gap: 8px; margin-top: 2px; margin-bottom: 8px; padding: 10px 6px 10px 14px; border-radius: 18px; background: var(--sheet-deep); box-shadow: inset 0 0 0 .5px var(--edge); font-size: 13px; color: var(--ink-2); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.notice span { flex: 1; min-width: 0; padding-top: 1px; }
.notice button { display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin: -6px 0; border-radius: 50%; color: var(--ink-3); }
.notice button svg.ico { width: 15px; height: 15px; }
.state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22vh 16px 12vh; text-align: center; font-size: 15px; color: var(--ink-2); }
.spinner { width: 28px; height: 28px; border: 2.5px solid rgba(255, 255, 255, .22); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.state.is-error .spinner { display: none; }
.btn { height: 44px; padding: 0 26px; border-radius: 22px; background: #fff; color: #17306b; font-weight: 600; transition: transform .12s; }
.btn:active { transform: scale(.96); }

/* 切换城市时的滑入动画 */
#content.swap-l { animation: swap-l .28s ease-out; }
#content.swap-r { animation: swap-r .28s ease-out; }
@keyframes swap-l { from { opacity: .3; transform: translateX(28px); } }
@keyframes swap-r { from { opacity: .3; transform: translateX(-28px); } }

.footer a { color: inherit; }
.footer p + p { margin-top: 2px; }

/* ───────── 城市列表（底部抽屉） ───────── */
.cities { width: min(480px, 100vw); max-width: 100vw; max-height: min(86dvh, 720px); margin: auto auto 0; padding: 8px 20px calc(20px + var(--sab)); border: 0; border-radius: 28px 28px 0 0; background: var(--panel); color: var(--ink); box-shadow: inset 0 .5px 0 var(--edge); overflow-y: auto; overscroll-behavior: contain; }
.cities::backdrop { background: rgba(4, 8, 24, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.grab { width: 36px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--hair); }
.cd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cd-head h2 { font-size: 22px; font-weight: 600; outline: 0; }
.cd-head button { display: grid; place-items: center; width: 44px; height: 44px; margin: -6px -6px -6px 0; border-radius: 50%; }
.cd-head button svg.ico { box-sizing: content-box; padding: 7px; border-radius: 50%; background: var(--raise); }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: var(--r-cell); background: var(--raise); color: var(--ink-3); }
.search:focus-within { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
/* 字号不小于 16px，iOS 聚焦时才不会自动放大页面 */
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 17px; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: grayscale(1) brightness(2); opacity: .7; }
.list-title { margin: 18px 0 2px; font-size: 13px; font-weight: 600; letter-spacing: .03em; color: var(--ink-3); }
.list { margin-top: 6px; }
.list .empty { padding: 12px 0; font-size: 15px; color: var(--ink-3); }
.row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 6px 0; text-align: left; }
.row + .row, .row-wrap + .row-wrap { border-top: .5px solid var(--hair); }
.r-name { flex: 1; min-width: 0; }
.r-name b { display: block; font-size: 17px; font-weight: 600; }
.r-name small { display: block; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-tag { flex: none; padding: 3px 10px; border-radius: 12px; background: var(--raise); font-size: 13px; font-weight: 600; }
.r-tag.is-saved { background: none; color: var(--ink-3); font-weight: 400; }
.row-wrap { display: flex; align-items: center; gap: 4px; }
.row-wrap .row { flex: 1; min-width: 0; }
.del { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; color: var(--ink-3); transition: transform .12s; }
.del:active { transform: scale(.9); color: #ff8a8a; }

/* ───────── 触控反馈与悬停 ───────── */
a { -webkit-tap-highlight-color: transparent; }
.hour:active, .day summary:active, .row:active { opacity: .7; }
.chip, .wearline { transition: transform .12s; }
.wearline:active { transform: scale(.98); }
/* 只有接了鼠标的设备才有悬停效果 */
@media (hover: hover) {
  .tsw button:hover:not([aria-checked="true"]) { color: var(--ink); }
  .dock-btn:hover, .pg:hover { filter: brightness(1.15); }
  .hour:hover:not(.is-active) { background: rgba(255, 255, 255, .06); }
  .day summary:hover { background: rgba(255, 255, 255, .05); border-radius: 10px; }
  .uvd:hover:not([aria-pressed="true"]) span { background: var(--raise); }
  .row:hover { background: rgba(255, 255, 255, .05); border-radius: 10px; }
  .del:hover { color: #ff8a8a; }
  .wearline:hover b, .notice button:hover { color: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  html { transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
