/* =========================================================
 * 天气 App 样式（移动优先，max-width 480px 居中）
 * 明暗两套配色由 body.night 切换；全部动画尊重
 * prefers-reduced-motion。
 * ========================================================= */

/* ---------- CSS 变量：白天 ---------- */
:root {
  --bg: #cfe4f7;
  --text: #2c3a47;
  --text-sub: #5a6b7d;
  --card: rgba(255, 255, 255, 0.75);
  --card-border: rgba(255, 255, 255, 0.6);
  --accent: #3d82c6;
  --pill-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 8px 24px rgba(44, 58, 71, 0.12);
  --radius: 18px;
  --hairline: rgba(86, 116, 148, 0.14); /* 大卡内部的分隔线 */
  --press: rgba(86, 116, 148, 0.07);    /* 大卡内可点分区的按下反馈 */
}

/* ---------- CSS 变量：夜间 ---------- */
body.night {
  --bg: #2b3a4e;
  --text: #e8eef5;
  --text-sub: #a8b8c8;
  --card: rgba(20, 35, 55, 0.6);
  --card-border: rgba(255, 255, 255, 0.12);
  --accent: #7fb5e8;
  --pill-bg: rgba(45, 62, 84, 0.85);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --hairline: rgba(255, 255, 255, 0.12);
  --press: rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- 圆体字体：资源圆体（OFL 开源，本地 woff2 子集，GB2312 全汉字） ---------- */
@font-face {
  font-family: "Resource Han Rounded";
  src: url("../assets/fonts/RHR-CN-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Resource Han Rounded";
  src: url("../assets/fonts/RHR-CN-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Resource Han Rounded";
  src: url("../assets/fonts/RHR-CN-Bold.woff2") format("woff2");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

/* overscroll-behavior-y:contain 挡掉 Chrome / 新版 Safari 自带的「下拉整页刷新」，
   否则两者会同时触发：浏览器重载页面 + 我们自己的刷新，看起来像闪了一下白屏。
   iOS 的回弹仍由 touchmove 里的 preventDefault 兜住 */
html, body { min-height: 100%; overscroll-behavior-y: contain; }

body {
  font-family: "Resource Han Rounded", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  transition: background 0.6s ease;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

/* ---------- 场景背景容器 ---------- */
#scene-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ---------- 应用主容器 ---------- */
.app {
  --app-gap: 12px;      /* 顶栏 / 主内容 / 页脚之间的列间距；页脚要抵消它才能贴住卡片 */
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  /* 底部补 safe-area，让贴底的那一行不被 iPhone home indicator 压住 */
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--app-gap);
  min-height: 100vh;
  /* dvh 才是 iOS Safari 的「可见视口」：vh 含工具栏高度，贴底内容会被工具栏遮住。
     先写 vh 给老浏览器兜底，支持的浏览器用 dvh 覆盖 */
  min-height: 100dvh;
}

/* ---------- 主内容区：卡片之间留出间距 ---------- */
.main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 主页卡片整体贴底对齐：内容不足一屏时把整摞卡片推到页脚上方，
   余白留在顶栏与首卡之间（iPhone 竖屏 19.5:9 的常态）。
   margin-top:auto 在内容超高时自然退化为 0，不挤压也不遮挡滚动。
   只在真正的天气卡片存在时下沉：配置引导 / 加载失败是单张提示卡，
   跟着贴底会飘到屏幕下方，故用 :has 把它排除在外 */
.main:has(> .hero-card) {
  margin-top: auto;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
}
.topbar .icon-btn { flex-shrink: 0; }   /* 设置按钮不参与收缩，左侧长名字先截断 */

.city-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;              /* 超长城市名时让胶囊先收缩，而不是把刷新时间挤出屏幕 */
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  box-shadow: var(--shadow);
}

.city-entry__name {
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.city-entry__chevron { color: var(--text-sub); flex-shrink: 0; }

/* 顶栏左侧：城市胶囊 + 刷新时间并排，右侧留给设置按钮 */
.topbar__lead {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* 刷新时间：紧贴城市胶囊右侧的次要小字，等宽数字避免刷新时左右跳动 */
.topbar__stamp {
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 1px;          /* 与 17px 的城市名在中线上对齐，不被小字基线带偏 */
}
.topbar__stamp:empty { display: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ---------- 下拉刷新指示器 ----------
 * 固定悬浮在页面顶部中央：城市名在左、设置按钮在右，中间这块平时是空的，
 * 刷新时浮在上面不会盖住任何信息。
 * 静止位置整体藏在视口上方（-44px 再叠安全区），--ptr-shift 从 0 涨到 102px 时
 * 正好停在顶栏下方 —— 再往下就是压住「更新于 HH:MM」那行小字了。
 * 跟手阶段由 JS 逐帧写 --ptr-shift，只有 .is-animating 才带缓动 ——
 * 拖动时加过渡，指示器就会慢半拍，手感立刻变成「粘手」。
 */
.ptr {
  position: fixed;
  left: 50%;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--text-sub);
  /* 描边不是为了好看：夜间 pill-bg 是深色，没有边就糊在深色天幕里看不出是颗胶囊 */
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 16px rgba(44, 58, 71, 0.16);
  transform: translate3d(-50%, calc(env(safe-area-inset-top) - 44px + var(--ptr-shift, 0px)), 0);
  opacity: var(--ptr-opacity, 0);
  pointer-events: none;   /* 纯指示，绝不挡住下面卡片的点击 */
  will-change: transform, opacity;
}
.ptr.is-animating {
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}
/* 夜间投影要更重：深色胶囊压在深色天幕上，只靠 12% 白描边几乎看不出边界 */
body.night .ptr { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }

.ptr__ring {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transform: rotate(-90deg);   /* 让进度从 12 点方向开始顺时针长出来 */
}
.ptr__track,
.ptr__bar {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.ptr__track { stroke: var(--hairline); }
/* 周长 = 2π×8 ≈ 50.27：dasharray 定成整圈，JS 只改 dashoffset 就能表示 0→1 的进度 */
.ptr__bar {
  stroke: var(--accent);
  stroke-dasharray: 50.27;
  stroke-dashoffset: 50.27;
}
/* 刷新中：弧长固定成一截，靠整圈旋转表达「还在转」 */
.ptr.is-refreshing .ptr__bar {
  stroke-dasharray: 17 50.27;
  stroke-dashoffset: 0;
}
.ptr.is-refreshing .ptr__ring {
  animation: ptrSpin 0.9s linear infinite;
}
@keyframes ptrSpin {
  from { transform: rotate(-90deg); }
  to { transform: rotate(270deg); }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

/* ---------- 顶部大卡：天气 / 日出日落 / 温度对比 ---------- */
/* 三块收进同一张 .hero-card：外层一张卡承担底色、描边与阴影，内部分区只用发丝线切分，
   不再出现「卡片套卡片」的层叠阴影，纵向也比三张独立卡省一截 */
.hero-card {
  display: flex;
  flex-direction: column;
  padding: 0;       /* 内边距下沉到各分区，分隔线才能顶到卡片左右边缘 */
  overflow: hidden; /* 圆角裁掉分区的直角背景，避免边缘露出硬直边 */
}
/* 上排两格等分整行、等高对齐（右格矮时也拉满，让竖向分隔线贯穿） */
.current-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.current-row > * {
  flex: 1 1 0;
  min-width: 0;
}
/* 两格保留原卡片的内边距（左右 16px 与下方对比条对齐）。
   纵向从 14px 收到 12px：上排是整张大卡里最占高度的一段，收 2px 就能整卡矮一截 */
.hero-card .current-card,
.hero-card .astro-card {
  padding: 12px 16px;
  min-width: 0;
}
/* 左上天气卡是 <button>（可点进「今日」）：把按钮的原生外观全部抹平，
   让它看起来仍是这张卡的左半格，而不是一个灰底方钮。
   font/text-align 不重置的话，按钮会退回系统的 13px 居中字，温度与状况会整体错位 */
.hero-card .current-card {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  background: none;
  border: 0;
  border-radius: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* 按下反馈只做轻微压暗：整格缩放会把大卡底色露出来，像错位 */
.hero-card .current-card:active { opacity: .85; }
/* 竖向发丝线用 border 画：自动跟着两格中更高的那格拉满，不必用伪元素算高度 */
.hero-card .astro-card { border-left: 1px solid var(--hairline); }

/* 天气卡内容：天气图标在左，气温与天气状况纵排在右（整体垂直居中） */
.current-card__hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  /* 地板值取图标同高（84）：温度那列内容比图标矮时，别让格子被 min-height 再撑出一截；
     右侧日出日落在窄屏会矮下去，这块下限同时也给竖发丝线一个稳定的高度 */
  min-height: 84px;
}
.current-card__meta {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
}

/* 天气状况文字：气温下方右对齐；字号收至 14px 让五字描述单行放下，
   必须换行时用 balance 均衡两行，避免出现 4+1 的孤字 */
.current-card__desc {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.35;
  letter-spacing: 0.2px;
  text-align: right;
  text-wrap: balance;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 温度对比条 + 体感方块：横向排布，左右等高（stretch），左侧对比条占满剩余宽度。
   现已被拆为独立卡片，卡片自身承担内边距，故不再额外留出顶部 margin */
.range-compare-wrap {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-top: 0;
  padding: 0; /* 与上排两格的左右内边距对齐，不要额外内缩 */
}

/* 温度对比：两条共用横轴（左=两天最低，右=两天最高），条内色条为当天温度范围；
   与右侧体感方块等高后，内容在纵向居中。
   宽度按容器 60% 收缩（不再吃满整行）：轨道过长时两端温差被拉平，短一些更好读；
   剩余空隙由右侧体感胶囊的 margin-left:auto 吸收，胶囊始终贴右边缘 */
.range-compare {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  flex: 0 1 60%;
  min-width: 0;
  min-height: 38px;
}
/* 行可能因数据缺失被隐藏：.range-row 的 display:flex 会盖掉 [hidden] 的 UA 规则，需显式复位 */
.range-row[hidden] { display: none; }
.range-row { display: flex; align-items: center; gap: 5px; }
.range-row__label {
  font-size: 11px;
  color: var(--text-sub);
  min-width: 22px;
  flex-shrink: 0;
}
.range-bar__min, .range-bar__max {
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
  min-width: 24px;
}
.range-bar__min { text-align: right; }
/* 最高温标签右侧留一点余量：dot 走到轴端点时会伸出轨道半个直径，避免压到数字 */
.range-bar__max { margin-left: 3px; }
.range-bar__track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  /* 淡色轨道：代表两天共用的温度轴 */
  background: rgba(120, 140, 160, 0.18);
}
body.night .range-bar__track { background: rgba(255, 255, 255, 0.14); }
/* 当天温度范围色条：位置与宽度按公共轴换算 */
.range-bar__seg {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  /* 左蓝（冷）→ 右橘黄（暖）渐变过渡 */
  background: linear-gradient(to right, var(--accent), #f5a34c);
}
/* 对比行色条淡化变体：用于「昨天」（已过去的参照日），今天/明天保持实色 */
.range-bar__seg--dim { opacity: 0.55; }
.range-bar__dot {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(44, 58, 71, 0.3);
  transition: left 0.4s ease;
}
body.night .range-bar__dot { border-color: rgba(45, 62, 84, 0.9); }

/* 大温度：随视口流体缩放（半宽卡片内仍保证两位温度单行显示） */
.current-card__temp {
  display: inline-flex;
  align-items: flex-start;
  font-size: clamp(36px, 11vw, 46px);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -1px;
}

/* 度数符号：用 flex 顶部对齐 + 轻微下移定位，避免各机型 vertical-align 基线差异 */
.current-card__unit {
  font-size: 0.45em;
  line-height: 1;
  margin-top: 0.16em;
  margin-left: 0.05em;
  font-weight: 300;
}

.w-icon { display: inline-flex; align-items: center; justify-content: center; }
.w-icon svg { width: 100%; height: 100%; display: block; }
.w-icon--lg { width: 84px; height: 84px; flex-shrink: 0; }
.w-icon--sm { width: 26px; height: 26px; }
.w-icon--md { width: 34px; height: 34px; }

/* 体感温度胶囊（突出显示） */
.pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--card-border);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

/* 体感文字：位于温度对比右侧并贴右边缘，与左侧对比条垂直居中。
   只留文字本身，不再挂胶囊底色与描边——它已经在顶部大卡内部，
   再套一层浅色块等于「卡里画卡」，看着脏。
   字号与下方 AQI / 风力等指标卡的数值保持同级（18px / 600），整页文字层级一致。
   注意：必须定义在 .pill 基础样式之后，否则 padding/字号/圆角会被基础样式覆盖 */
.pill--feels {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  flex-shrink: 0;
  margin-left: auto;
}

.precip-tip {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-sub);
}

/* 温度对比 + 体感：大卡内的第三块，可点击进入「未来」详情页（7 天预报）。
   自身不再有底色与圆角，只用一条顶部发丝线与上排分开；
   按下反馈从缩放改成淡底色——整行缩放会把大卡底色露出来，看着像错位 */
.feels-compare-card {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  color: inherit;
  text-align: left;
  transition: background-color 0.15s ease;
}
.feels-compare-card:active { background: var(--press); }

/* 风 / AQI 各自独立卡片（位于 24 小时预报上方）：卡片本身承载底色，内部按钮去掉外框。
   内边距下沉到按钮内部（卡片 padding:0），让整张卡片都是点击热区——
   否则卡片上下各 11px 的留白点不动，真机上像「点了没反应」 */
.metric-strip-card { padding: 0; }

/* 四张独立小卡片：底色 + 描边 + 圆角（可点击，进入对应详情页） */
.metric {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: center;
  background: var(--pill-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 4px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.metric:active { transform: scale(0.94); }
.metric__label { display: block; font-size: 11px; color: var(--text-sub); }
.metric__value { display: block; font-size: 13px; font-weight: 600; margin-top: 4px; white-space: nowrap; }
/* AQI 小卡专属：衬在数值+等级底下的等级色卡（颜色由 JS 按 HJ 633 官方色写入）；长度为卡片宽 2/3 */
.metric__chip {
  display: block;
  width: 67%;
  height: 5px;
  border-radius: 3px;
  margin: 5px auto 0;
  background: var(--card-border);
  transition: background 0.3s ease;
}

/* 指标卡基础纵向布局（日出日落卡：弧在上、时间行在下，卡内垂直居中） */
.metric { display: flex; flex-direction: column; justify-content: center; }

/* 独立卡内两栏网格：左列「标签 / 变化提示」两行，右列数值（AQI 为等级色块）跨两行；
   右列上下边分别与左列两行文字的外沿齐平，形成左右两个等高的内容块。
   仅作用于独立卡内，日出日落卡（在头部）仍保持纵向居中布局 */
.metric-strip-card .metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: stretch;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  /* 原卡片内边距下沉到这里：整卡可点，视觉尺寸不变 */
  padding: 11px 15px;
}
.metric-strip-card .metric:active { transform: none; opacity: 0.7; }
/* 左侧标签：升为卡内标题层级（字号加大、用主文字色），贴第一行底部 */
.metric-strip-card .metric__label {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  min-width: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 1.4;
  color: var(--text);
}
/* 标签前的线性图标：inline 排版，用 vertical-align 微调使图标中心贴合文字，不改变标签基线 */
.metric__ico {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
  color: var(--accent);
  flex-shrink: 0;
}
/* 右列：风=AQI 的数值，AQI=数值+等级色块的外层；跨两行拉伸，内容垂直居中 */
.metric-strip-card .metric__value,
.metric-strip-card .metric__right {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: stretch;
}
.metric-strip-card .metric__value {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.25;
  color: var(--text);
  margin-top: 0;
  padding: 0;
}
/* 紫外线等「数值 + 等级徽标」并排的右列：同样跨两行，整体垂直居中并靠右 */
.metric-strip-card .metric__pair {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
/* 长条内非交互卡片（紫外线 / 气压 / 能见度）：不显示手型与按压缩放 */
.metric-strip-card div.metric { cursor: default; }
.metric-strip-card div.metric:active { opacity: 1; }
/* 左列第二行：变化时点提示，前置小圆点做层级标记 */
.metric-strip-card .metric__hint {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  position: relative;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-sub);
  text-align: left;
  padding-left: 9px;
  text-wrap: pretty;        /* 必须换行时避免末行孤字 */
}
/* 气压卡第二行是 7 张里最长的（「20时降至低压，明日6时升至高压」16 字），
   右列又要让出「1012 hPa」的宽度，窄屏下只能折行；用 balance 让两行长度接近，
   否则末行只剩「高压」两个字，比整齐的一行还难看。 */
.metric-strip-card [data-metric="pressure"] .metric__hint { text-wrap: balance; }
.metric-strip-card .metric__hint::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6.5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
/* AQI 右侧组：数值+等级文字衬在等级色卡上（色卡由 JS 按 HJ 633 官方色写入背景） */
.metric__right { position: relative; display: flex; }
.metric-strip-card .metric__right { min-width: 56px; justify-content: center; align-items: center; }
.metric__right .metric__value {
  position: relative;
  z-index: 1;               /* 文字浮于色卡之上 */
  padding: 3px 12px;
  border-radius: 10px;
}
.metric__right .metric__chip {
  position: absolute;
  inset: 0;                 /* 色卡铺满数值+等级区域作衬底 */
  width: auto;
  height: auto;
  margin: 0;
  border-radius: 8px;
}

/* 风力卡右列：风向箭头 + 风级。箭头默认朝上（北），整枚按方位角旋转，
   箭头尖指向「风来向」——与风力详情页风向风纹同一套角度约定，两处读数不会互相矛盾 */
.metric-strip-card .metric__value--wind { gap: 6px; }
.wind-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 20px（原 18px）：尖角改圆角后，图形在同一 viewBox 里内缩了一圈，
     放大 2px 让它在「2 级」这行 18px 字旁边保持原来的视觉分量 */
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
  transform: rotate(var(--deg, 0deg));
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0.3, 1);
}
.wind-arrow svg { width: 100%; height: 100%; display: block; }
/* 风向不定（数据源给「-」）：不画箭头，免得被读成北风 */
.wind-arrow.is-unknown { display: none; }
/* 风级数字用等宽位，1 级与 10 级切换时右列不左右跳 */
.wind-arrow__lv { font-variant-numeric: tabular-nums; }

/* ---------- 主页：云量/能见度/紫外线/湿度/气压 一行五等分 ---------- */
/* 五个指标原先各占一张整行长条，五行加起来吃掉近半屏。合成一张卡、五等分排布，
   高度从 ~300px 压到 ~70px，仍然每个格子可点进对应详情页。
   列宽下限靠 minmax(0,1fr) 保证等分——默认的 min-content 会被「1011 hPa」撑破。 */
.metric-row-card { padding: 0; }
.metric-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  /* 左右各留 6px：首末列的值（「55%」「1011 hPa」）才不会贴住卡片圆角边缘 */
  padding: 3px 6px;
}
.metric-tile {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 9px 2px 8px;
  font: inherit;
  color: inherit;
  text-align: center;
  background: none;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.metric-tile:active { opacity: 0.6; }
/* 等分之间的细竖线：只占 62% 高度，读作分隔而不是边框 */
.metric-tile + .metric-tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 62%;
  background: var(--hairline);
}
.metric-tile__ico {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.metric-tile__label {
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.2px;
  color: var(--text-sub);
  white-space: nowrap;
}
/* 值一律不换行：气压「1011 hPa」是最长的一项，320 宽下每列仅 ~49px，
   11px + tabular-nums 是能完整放下的上限，再大就会被省略号截断 */
.metric-tile__value {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.1px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-tile__pair {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
/* UV 等级胶囊在窄格里压一档，否则「2 弱」会顶到格边 */
.metric-tile .aqi-level {
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 600;
}
/* 趋势小字在这个密度下放不下：元素留着（JS 直接写它），只做视觉隐藏，文本改挂 title */
.metric-tile__hint {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 天气概况卡（位于 AQI 卡上方）：一句话文字描述 ---------- */
/* 只在 6–12 点说今天、18–24 点说明天，其余时段整卡隐藏；卡片高度随文案自然伸缩，不写死 */
.brief-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.brief-card[hidden] { display: none; }   /* flex 会盖掉 [hidden] 的默认 display */
.brief-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.brief-card__tag {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text);
}
.brief-card__date {
  font-size: 11.5px;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 主文案 + 副行（气温/降水/风力）纵向排列；副行比主文案低一档，只做补充不做主角 */
.brief-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brief-card__meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}
.brief-card__text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  text-wrap: pretty;
}
/* 空气行夹在天气与副行之间：标签压到次级色、等级用主色，视觉上仍排在天气之下 */
.brief-card__air {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.5;
}
.brief-card__air[hidden] { display: none; }   /* flex 同样会盖掉 [hidden] 的默认 display */
.brief-card__air-label { flex: none; color: var(--text-sub); }
.brief-card__air-text { min-width: 0; color: var(--text); text-wrap: pretty; }
/* 分段不可断：窄屏折行只发生在段间的逗号处，避免把「降水概率 97%」拆成两半 */
.brief-card__seg { white-space: nowrap; }

/* ---------- 日出日落卡（顶部右半卡）：向上扁弧 + 当前太阳位置；可点击进入天文详情页 ---------- */
/* 外层 .astro-card 承担卡片底色与描边，内部按钮仅保留内容布局 */
.astro-card {
  display: flex;
  align-items: center;
  justify-content: center;
}
.metric--astro {
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  gap: 4px;
}
.metric--astro:active { transform: scale(0.98); }
.astro-arc {
  display: block;
  width: 100%;
  max-width: 190px;
  margin: 0 auto;
}
/* 轨道弧：淡色半圆；填充弧：琥珀黄，按日间进度用 dashoffset 截取 */
.astro-arc__track {
  fill: none;
  stroke: rgba(127, 145, 165, 0.35);
  stroke-width: 3;
  stroke-linecap: round;
}
body.night .astro-arc__track { stroke: rgba(255, 255, 255, 0.18); }
.astro-arc__fill {
  fill: none;
  stroke: #f0b429;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  transition: stroke-dashoffset 0.5s ease;
}
/* 太阳轨迹点：亮黄圆环，中心镂空透明（弧线从环中穿过）；辉光由 SVG 滤镜 astro-glow 实现 */
.astro-arc__sun {
  fill: none;
  stroke: #ffd60a;
  stroke-width: 2.6;
  transition: cx 0.5s ease, cy 0.5s ease;
}
/* 日出日落时间行：日出居左、日落居右，与弧两端对齐 */
.astro-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-sub);
}
.astro-times b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* 弧顶正午标记：太阳中天（每日最高点）实心小点 + 白描边提亮，弧内居中时间。
   viewBox 120x40 显示宽约 190px，8px 字号实际约 12.6px */
.astro-noon__dot {
  fill: #f0b429;
  stroke: #fff;
  stroke-width: 0.7;
}
.astro-noon__time {
  font-size: 8px;
  font-weight: 600;
  fill: var(--text-sub);
  font-variant-numeric: tabular-nums;
}

/* ---------- 天文详情页：太阳板块（大号弧 + 升落时间行）+ 月亮板块（信息行） ---------- */
.astro-arc--lg { max-width: 320px; }
/* 详情页弧上图标（g 元素，transform 定位）。
   不用硬白描边：1.5 单位的白环在 8px 宽的弧上会切出一圈「戒指」，像贴上去的贴纸；
   改成柔光晕（径向渐变淡出）把图标从弧线上托起来，边缘自身保持干净。 */
.astro-arc__sun-ico,
.astro-arc__moon-ico { transition: transform 0.5s ease; }
/* 太阳：光晕缓慢呼吸（只动 opacity，不动 transform，避免与定位 transform 打架） */
.astro-arc__sun-glow { animation: astroSunPulse 4.6s ease-in-out infinite; }
@keyframes astroSunPulse {
  0%, 100% { opacity: 0.74; }
  50% { opacity: 1; }
}
.astro-arc__sun-rays path { fill: none; stroke: #f6bb42; stroke-width: 1.15; stroke-linecap: round; }
/* 极细同色系描边：把月牙轮廓从浅色卡面上「勾」出来，避免白月牙在 #f5f8fc 上糊掉 */
.astro-arc__moon-body { stroke: rgba(120, 142, 178, 0.42); stroke-width: 0.18; }
/* 夜间底色已足够深，描边再深会显灰，换成淡白 */
body.night .astro-arc__moon-body { stroke: rgba(198, 216, 242, 0.30); }
.astro-arc__moon-glow { animation: astroMoonPulse 6.4s ease-in-out infinite; }
@keyframes astroMoonPulse {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .astro-arc__sun-glow,
  .astro-arc__moon-glow { animation: none; opacity: 1; }
}
/* 详情页太阳弧：黎明暖黄 → 正午淡蓝 → 黄昏暖黄（渐变定义在 SVG defs 的 astroSunGrad）。
   渐变跟随弧的几何位置，进度只决定「已走过」那段的实色长度；未走过的同色淡显，
   这样即使刚日出，整条弧「一天」的配色也读得出来（淡显太浅会让黄昏那端黄到看不见） */
.astro-arc--lg .astro-arc__track {
  stroke: url(#astroSunGrad);
  /* 淡显档位：0.58 时未走过段的淡蓝/淡黄都发米白、看不出渐变；0.82 时与实色段拉不开差距。
     0.70 是实测折中 —— 三档对比见交付说明 */
  opacity: 0.7;
}
.astro-arc--lg .astro-arc__fill { stroke: url(#astroSunGrad); }
/* 夜间不沿用「同色淡显」：深色底上低透明度会把黄混成土褐、蓝混成灰，
   未走完的一段回到中性轨道色（body.night .astro-arc__track 的白 18%），
   已走完的实色段仍是完整渐变 —— 入夜后进度本来就接近满弧，配色照样读得出来 */
body.night .astro-arc--lg .astro-arc__track { opacity: 1; }
.astro-detail { display: flex; flex-direction: column; gap: 10px; }

/* 太阳块（合并大卡首块）：左列=黎明(上)+日出(下)，右列=日落(上)+黄昏(下)；
   左列网格两列（文字 | 时间）保证黎明/日出上下对齐，
   右列网格三列（时间 | 文字 | 图标），图标统一在文字右边，
   黎明/黄昏为副行（民用晨昏蒙影界 ±6°，月亮图标银蓝） */
.sun-duo { display: flex; justify-content: space-between; padding: 2px 6px; }
.sun-duo__cell--left {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
}
.sun-duo__cell--right {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: end;
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
}
.sun-duo__cell--left .astro-detail__label,
.sun-duo__txt { font-size: 13px; color: var(--text-sub); }
.sun-duo__cell b { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.sun-duo__cell .astro-detail__ico { width: 12px; height: 12px; }

/* 季节节点进度条（天文详情页卡四）：一年时间轴，二分二至四点定位，
   今天的位置用实心圆点压在填充层之上。宽度一律百分比，任意视口自适应 */
.season-track { padding: 2px 6px 2px; }
.season-track__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-sub);
}
.season-track__today { font-variant-numeric: tabular-nums; }
.season-track__next { font-variant-numeric: tabular-nums; }
.season-track__next b {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding: 0 1px;
}
/* 轨道：左右留 6px，首末节点圆点不会被裁掉；下方 44px 是标签区 */
.season-track__rail {
  position: relative;
  height: 6px;
  margin: 18px 6px 44px;
  border-radius: 3px;
  background: rgba(86, 116, 148, 0.16);
}
.season-track__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(61, 130, 198, 0.42), var(--accent));
}
.season-track__node { position: absolute; top: 50%; z-index: 2; }
.season-track__dot {
  position: absolute;
  top: -4.5px;
  left: -4.5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  /* 未到的节点只有描边（不填色）：夜间填深色会在浅色轨道上变成"黑洞" */
  background: transparent;
  border: 1.5px solid rgba(86, 116, 148, 0.5);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.season-track__node.is-past .season-track__dot {
  background: #fff;
  border-color: var(--accent);
}
/* 标签一律以节点为中心；不贴边对齐 —— 贴边会让末项向左长，在 320 窄屏与「秋分」压字 */
.season-track__tag {
  position: absolute;
  top: 12px;
  left: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  white-space: nowrap;
}
.season-track__tag b {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}
.season-track__node.is-past .season-track__tag b { color: var(--text); font-weight: 600; }
.season-track__tag i {
  font-style: normal;
  font-size: 10px;
  color: var(--text-sub);
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}
/* 今天：白环 + 主题色实心，压在最上层 */
.season-track__pip {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.94), 0 1px 4px rgba(44, 58, 71, 0.26);
}
body.night .season-track__rail { background: rgba(168, 184, 200, 0.20); }
body.night .season-track__dot {
  border-color: rgba(168, 184, 200, 0.6);
}
body.night .season-track__node.is-past .season-track__dot {
  background: #eef4fa;
  border-color: var(--accent);
}
body.night .season-track__pip {
  box-shadow: 0 0 0 2.5px rgba(30, 46, 66, 0.94), 0 1px 5px rgba(0, 0, 0, 0.45);
}

/* 昼夜时长卡（天文详情页首卡）：白昼/夜晚时长左右分布，行首太阳/月亮图标 */
.dn-duo { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px; }
.dn-duo__cell { display: flex; align-items: center; gap: 7px; }
.dn-duo__cell .astro-detail__ico { width: 14px; height: 14px; }
.dn-duo__name { font-size: 13px; color: var(--text-sub); }
.dn-duo__cell b { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* 天气预警卡（主页最顶部，和风实时天气预警 v1）：每条预警块左侧级别色竖条 +
   三角警告图标 + 标题 + 等级徽标 + 正文；竖条与徽标共用 --warn-color（官方级别色，
   由 JS 按蓝/黄/橙/红写入），保证左侧突出色与徽标色完全一致 */
.warn-card { padding: 12px 14px; }
/* 左侧级别色竖条：用伪元素代替 border-left，上下端做全圆角（宽度 4px、圆角 2px 即半圆端头） */
.warn-card__item { position: relative; padding-left: 14px; }
.warn-card__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  border-radius: 2px;
  background: var(--warn-color, #dfa61a);
}
.warn-card__item + .warn-card__item { margin-top: 10px; }
.warn-card__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.warn-card__ico { width: 16px; height: 16px; flex: none; }
.warn-card__tri { fill: var(--warn-color, #dfa61a); opacity: 0.9; }
.warn-card__mark { stroke: #fff; stroke-width: 1.6; stroke-linecap: round; fill: none; }
.warn-card__ico circle.warn-card__mark { fill: #fff; stroke: none; }
.warn-card__title {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.warn-card__chip {
  flex: none; font-size: 11px; font-weight: 600; color: #fff;
  background: var(--warn-color, #dfa61a); border-radius: 999px; padding: 1px 8px;
}
.warn-card__text {
  margin-top: 5px; font-size: 12px; color: var(--text-sub); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.warn-card__foot {
  margin-top: 6px; font-size: 11px; color: var(--text-sub);
  opacity: 0.75; display: flex; align-items: center; gap: 6px;
}
/* ---------- 主页：分钟级降水卡（和风 minutely/5m，未来 2 小时 × 每 5 分钟一根柱） ----------
   只在有降水时出现（renderMinutely 判定，无降水整卡 hidden）。柱子不换色相，用 --accent
   的四级透明度表达强度，深浅主题共用一套色；干点留 2px 基线，让 2 小时时间轴连成一条。 */
.minutely-card { padding: 12px 16px 10px; }
.minutely-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.minutely-card__title { font-size: 13px; font-weight: 600; color: var(--text); }
.minutely-card__tag {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(61, 130, 198, 0.12);
  border-radius: 999px;
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}
body.night .minutely-card__tag { background: rgba(127, 181, 232, 0.16); }
.minutely-card__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 44px;
  margin-top: 9px;
}
.minutely-bar {
  flex: 1 1 0;
  min-width: 0;
  height: var(--h, 100%);
  border-radius: 3px 3px 1px 1px;
  background: var(--accent);
  opacity: 0.85;
}
/* 强度四档：微量 / 小雨 / 中雨 / 大雨以上（见 app.js minutelyLevel） */
.minutely-bar[data-level="1"] { opacity: 0.4; }
.minutely-bar[data-level="2"] { opacity: 0.6; }
.minutely-bar[data-level="3"] { opacity: 0.8; }
.minutely-bar[data-level="4"] { opacity: 1; }
.minutely-bar.is-dry {
  height: 2px;
  border-radius: 1px;
  background: var(--hairline);
  opacity: 1;
}
/* 三格栅格而不是 space-between：「1 小时」居中恰在 50%，「2 小时」右对齐贴满，
   首格左对齐到 0 —— 三处刻度与柱子比例严格对应 */
.minutely-card__axis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}
.minutely-card__axis span:nth-child(2) { text-align: center; }
.minutely-card__axis span:nth-child(3) { text-align: right; }
.minutely-card__note {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-sub);
  text-wrap: pretty;
}
.minutely-card__note:empty { display: none; }

.astro-detail__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-sub);
  background: var(--pill-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 9px 12px;
}
.astro-detail__row b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
/* 数据行文字前的小图标：与标签同基线居中，太阳琥珀黄 / 月亮银蓝，线条继承文字色 */
.astro-detail__label { display: inline-flex; align-items: center; gap: 6px; }
.astro-detail__ico { width: 14px; height: 14px; flex: none; }
.astro-detail__ico .ad-sun { fill: #f0b429; }
.astro-detail__ico .ad-moon { fill: #b3c2da; }
.astro-detail__ico .ad-line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* 月相与照射范围合并行：右侧值区 = 月球演示图 + 文本 */
.astro-detail__val { display: inline-flex; align-items: center; gap: 8px; }

/* 月亮卡扁平合并块（无内嵌小卡片）：左侧三行文字靠左（字号对齐黄金蓝调建议行 13px），
   右侧留白给放大月球图；月球图绝对定位：上缘=标题上缘、下缘=末行下缘，尺寸由 JS 实测设定 */
.moon-flat { display: flex; align-items: center; font-size: 13px; }
.moon-flat__text { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.moon-flat__line { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.moon-flat__line b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.card--moon { position: relative; }
.card--moon .astro-moon-art { position: absolute; top: 12px; right: 12px; } /* 与下边距同值：三边等距 */

/* 黄金蓝调卡紧凑分组：右侧纵向堆叠（主时间 / 分段小字 / 建议行），右对齐与主行基线一致 */
.astro-detail__stack { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.astro-detail__stack b { font-size: 15px; }
.astro-detail__sub { font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.astro-detail__sub--ok { color: #3a9e5f; font-weight: 600; }
.astro-detail__sub--mid { color: #b98a2f; font-weight: 600; }
.astro-detail__sub--bad { color: #d0654a; font-weight: 600; }

/* 黄金蓝调卡扁平左右布局（同太阳卡）：晨间组靠左、傍晚组靠右，无内嵌小卡片 */
.gb-duo { display: flex; justify-content: space-between; gap: 16px; padding: 2px 6px; }
.gb-duo__cell { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; min-width: 0; }
.gb-duo__cell--right { align-items: flex-end; text-align: right; }
.gb-duo__cell b { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gb-duo__cell .astro-detail__sub { max-width: 46vw; }

/* 天文页无标题合并大卡：太阳 / 弧线 / 黄金蓝调时间三块堆叠，间距对齐卡间距 */
.astro-merge { display: flex; flex-direction: column; gap: 18px; }

/* 黄金蓝调建议独立卡：判定色文字（绿/琥珀/橙红），行样式复用 astro-detail__row */
.astro-detail__advice { font-size: 13px; font-variant-numeric: tabular-nums; }
.astro-detail__advice--ok { color: #3a9e5f; }
.astro-detail__advice--mid { color: #b98a2f; }
.astro-detail__advice--bad { color: #d0654a; }
.gb-duo__cell .astro-detail__sub--ok,
.gb-duo__cell .astro-detail__sub--mid,
.gb-duo__cell .astro-detail__sub--bad { text-wrap: balance; }
/* 月球相位演示图：可见形状 = 照射范围，未照到的部分直接遮掉，不做暗面叠加 */
/* 月球实物模拟图：撑满月相行上下高度，靠右（行 flex-end 自动贴右） */
.astro-moon-art { width: 36px; height: 36px; flex: none; }
/* 亮面兜底底色（照片未加载时形状仍在），夜间提亮以在深色卡上可辨 */
.astro-moon-art .am-base { fill: #d7dfec; }
body.night .astro-moon-art .am-base { fill: rgba(236, 243, 255, 0.55); }
/* 亮面临边一圈微暗描边，只画在亮面内，增强球体转折 */
.astro-moon-art .am-rim { fill: none; stroke: rgba(58, 68, 88, 0.22); stroke-width: 1.2; }
body.night .astro-moon-art .am-rim { stroke: rgba(255, 255, 255, 0.16); }
/* 新月：没有亮面，只留一圈极淡月盘轮廓占位 */
.astro-moon-art .am-new { fill: none; stroke: rgba(96, 112, 138, 0.34); stroke-width: 1.1; }
body.night .astro-moon-art .am-new { stroke: rgba(255, 255, 255, 0.28); }

/* 天文详情页三张卡的纵向间距（对齐主页 .main 的 14px）；
   :not([hidden]) 避免显式 display 覆盖 hidden 属性 */
#detail-astro-card:not([hidden]) { display: flex; flex-direction: column; gap: 14px; }
/* 今日详情页：24 小时预报卡（页面只有这一张，仍按 flex 列排布，与未来页同构，
   以后追加「今日概况」类卡片不必再改布局） */
#detail-today:not([hidden]) { display: flex; flex-direction: column; gap: 14px; }
/* 未来详情页：未来 7 天预报卡（24 小时已移到今日页） */
#detail-forecast:not([hidden]) { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 指标详情页：全屏视图，从右侧滑入 ---------- */
body.detail-open { overflow: hidden; }

.detail-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
  /* 底部留出浮动导航的高度（胶囊约 69px + 浮起 8px ≈ 77px，再留 35px 呼吸位），
     最后一张卡片不会被遮住 */
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}
.detail-page.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.3s ease;
}

/* ---------- 详情页底部浮动导航（Apple 液态玻璃质感） ----------
 * 必须是 .detail-page 的兄弟节点：详情页自身带 transform + overflow-y，
 * 放进里面 position:fixed 会退化成「相对滚动容器绝对定位」，跟着内容一起滚走。
 * 质感全部由 CSS 叠出来，不用图片：
 *   ① 半透明渐变底 + backdrop-filter 模糊/提饱和/微提亮 → 背后内容透出并被「折射」
 *   ② inset 上沿高光 + 下沿弱边 → 玻璃厚度
 *   ③ ::before 左上弧光 + 顶带渐白 → 顶面受光的镜面高光
 *   ④ ::after 左右边缘亮边 → 侧棱的折射边
 * 横向排布：11 项等宽，每项固定 52px（宽屏有余量时各项等分，仍然等宽）。
 * 等宽是为了整齐 —— 按标签自然宽度排时「空气质量」会比「风力」宽 10px，一眼看得出参差。
 * 52px 同时把触摸目标钉在 iOS HIG 要求的 44px 之上。
 * 11 项 × 52px = 572px，远超任何手机屏宽，因此窄屏一律横向滚动（这是既定设计，
 * 不是兜底）：滚动条隐藏，JS 会把选中项自动滚进可视区。
 * 注意：不要为了「都塞进一屏」去压低每项宽度，那会立刻跌回误触高发区。 */
.detail-nav {
  position: fixed;
  left: 50%;
  /* 浮起 8px：胶囊上下都不贴边，才看得出是"悬"在内容上的玻璃片 */
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 55;
  width: calc(100% - 16px);
  /* 与 .detail-page 的 480px 同宽：11 项 × 52px 放不下，超出部分横向滚动 */
  max-width: 480px;
  padding: 5px;
  /* 左端固定区 + 右侧横滑区并排；不设 gap —— 两者之间的间距由 __dock 的分隔线占位，
     这样分隔线始终停在固定区右缘，不会跟着横滑区一起飘走 */
  display: flex;
  align-items: stretch;
  border-radius: 28px;
  /* 底色带一点冷调、透明度压得较低：压在白色卡片上能看出是"一层玻璃"而不是又一块白卡；
     压在浅蓝背景上又会几乎融进去（玻璃吃背景色） */
  background: linear-gradient(180deg,
    rgba(240, 247, 255, 0.34) 0%,
    rgba(214, 233, 250, 0.26) 52%,
    rgba(226, 240, 253, 0.30) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 0.5px rgba(86, 116, 148, 0.13), /* 亮底上的玻璃外缘：一道极淡的暗边，边缘才立得住 */
    0 14px 34px rgba(24, 45, 70, 0.20),
    0 2px 6px rgba(24, 45, 70, 0.08),
    inset 0 1.5px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    inset 0 -8px 14px -8px rgba(255, 255, 255, 0.85),
    inset 0 0 18px rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(30px) saturate(220%) brightness(1.06);
  backdrop-filter: blur(30px) saturate(220%) brightness(1.06);
  /* 收起时多移 16px：仅移 100% 时胶囊顶部还会露出 10px（bottom 的余量） */
  transform: translate(-50%, calc(100% + 16px)) scale(0.97);
  visibility: hidden;
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.34s;
  will-change: transform;
}
body.detail-open .detail-nav {
  transform: translate(-50%, 0) scale(1);
  visibility: visible;
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

/* ③ 顶面镜面高光：贴顶 14px 的一道强高光（厚玻璃的受光棱）+ 左上角弧光 */
.detail-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.80) 0, rgba(255, 255, 255, 0) 11px),
    radial-gradient(80% 60% at 8% -26%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 68%);
  pointer-events: none;
}
/* ④ 侧棱折射：左右两端的亮边 + 一圈极淡内描边 */
.detail-nav::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0) 9%,
    rgba(255, 255, 255, 0) 91%, rgba(255, 255, 255, 0.38));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.20);
  pointer-events: none;
}

/* 固定区：只装「主页」。宽 52px + 左侧 6px 内边距，与横滑区内的项等宽、与胶囊左圆角留出同样的余量。
 * 不参与 overflow 滚动，所以不管横滑区滚到哪儿，它都咬在左端。
 * 「主页」与右侧模块之间一道竖线分组（见下），语义上「退回」与「平级切换」本来就不同。 */
.detail-nav__dock {
  position: relative;
  z-index: 1; /* 与 __list 同层，抬到玻璃的两层高光之上 */
  flex: none;
  display: flex;
  align-items: stretch;
  padding-left: 6px;
}
/* 固定区里的项不参与 flex 均分：横滑区的项是 flex: 1 0 52px（有富余就会变宽），
   主页必须钉死 52px，否则两者会不等宽、分隔线也跟着宽度左右挪动 */
.detail-nav__dock .detail-nav__item { flex: none; width: 52px; }

/* 「主页」右缘一道竖分隔（画在分隔位的中点，不占布局宽度）：
 * 上下用渐变淡出，避免一根硬邦邦的实线切在玻璃上 */
.detail-nav__dock::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  width: 1px;
  height: 36px;
  margin-top: -18px;
  border-radius: 1px;
  background: linear-gradient(180deg,
    rgba(86, 116, 148, 0) 0%,
    rgba(86, 116, 148, 0.30) 24%,
    rgba(86, 116, 148, 0.30) 76%,
    rgba(86, 116, 148, 0) 100%);
  pointer-events: none;
}
body.night .detail-nav__dock::after {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.34) 24%,
    rgba(255, 255, 255, 0.34) 76%,
    rgba(255, 255, 255, 0) 100%);
}

.detail-nav__list {
  position: relative;
  z-index: 1; /* 抬到两层高光之上，图标与文字不被高光糊住 */
  flex: 1 1 auto;
  min-width: 0; /* 没有它，flex 子项会按内容撑开、把胶囊顶出屏宽 */
  display: flex;
  align-items: stretch;
  /* 项间隙 3px：既把相邻按钮的命中区隔开，又不会让整条显得散 */
  gap: 3px;
  /* 右侧留 6px：横滑时最后一项能停在玻璃端头之内，不会被胶囊圆角直角切断；
     左侧 3px：与固定区的分隔线保持与项间隙同等呼吸 */
  padding: 0 6px 0 3px;
  border-radius: 23px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.detail-nav__list::-webkit-scrollbar { display: none; }
/* 只有放不下、真的能横滑时才在右端做淡出，否则尾项会平白变淡。
 * 左端只在已经向右滚过时才淡出：停在最左端时首项（今日）是完整可见的，
 * 这时候加左淡出会让人以为它被切掉了一半，像没渲染好。 */
.detail-nav__list.is-scroll {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 12px), rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 12px), rgba(0, 0, 0, 0) 100%);
}
.detail-nav__list.is-scroll.is-scrolled-left {
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0, #000 12px, #000 calc(100% - 12px), rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0, #000 12px, #000 calc(100% - 12px), rgba(0, 0, 0, 0) 100%);
}

.detail-nav__item {
  /* 等宽：11 项共用同一个基准宽 52px。宽屏时各项均分到相同的余量，仍然等宽；
     窄屏时一律溢出横向滚动。用 shrink=0 而不是压缩——一旦允许压缩，
     4 字的「空气质量」「能见度」会把标签挤到变形或换行。 */
  flex: 1 0 52px;
  /* 触摸目标硬指标：宽 ≥ 52px、高 ≥ 58px（10+9 padding + 22 图标 + 4 gap + 13.2 文字）
     —— 与项数无关，逐项固定
     padding 左右 3px：52 − 6 = 46px 内容宽，容得下 11px × 4 字 = 44px 的标签 */
  min-width: 52px;
  position: relative; /* 自身定位基准（选中底片、按下反馈都在项内绘制） */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 3px 9px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--text-sub);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* 移动端：去掉 300ms 点击延迟与双击缩放，按下即响应 */
  touch-action: manipulation;
  /* 长按时不选中文字，避免 iOS 出现"像是在拖拽"的蓝框 */
  -webkit-user-select: none;
  user-select: none;
  /* 注意：不参与 transform 过渡 —— 按下时不缩放，按钮边界就不会在手指下移动 */
  transition: color 0.18s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.detail-nav__item svg { width: 22px; height: 22px; display: block; }
.detail-nav__label { display: block; line-height: 1.2; }

/* 「主页」与模块之间的竖分隔已经移到固定区（.detail-nav__dock::after）：
 * 分隔线要求不随横滑移动，画在「今日」身上会跟着一起滚走。 */
/* 选中项做成一小片凸起的玻璃：透白 + 上沿高光 + 浅投影 */
.detail-nav__item.is-active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.46));
  box-shadow:
    0 1px 4px rgba(24, 45, 70, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.detail-nav__item.is-active .detail-nav__label { font-weight: 600; }
/* 按下反馈：只变背景/文字色，不做缩放。
   缩放会让按钮边界在手指下方收缩，视觉上像"按到旁边那一项"，是误触错觉的来源之一；
   命中区本身也不该有任何位移。 */
.detail-nav__item:active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.60);
  box-shadow: inset 0 1px 3px rgba(24, 45, 70, 0.10);
}

/* 夜间：深色玻璃，压低高光避免发灰发糊 */
body.night .detail-nav {
  background: linear-gradient(180deg, rgba(58, 76, 100, 0.62), rgba(30, 42, 60, 0.52));
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.42),
    0 2px 6px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}
body.night .detail-nav::before {
  background:
    radial-gradient(140% 90% at 16% -30%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 46%);
}
body.night .detail-nav::after {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 9%,
    rgba(255, 255, 255, 0) 91%, rgba(255, 255, 255, 0.14));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body.night .detail-nav__item.is-active {
  background: linear-gradient(180deg, rgba(127, 181, 232, 0.26), rgba(127, 181, 232, 0.14));
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
body.night .detail-nav__item:active { background: rgba(255, 255, 255, 0.10); }

/* 不支持 backdrop-filter（老浏览器 / 关闭了图形加速）时退回近乎不透明的底，保证可读 */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .detail-nav { background: var(--pill-bg); }
  body.night .detail-nav { background: rgba(34, 46, 64, 0.94); }
}

/* 标题栏只留标题（返回按钮已移除，退回主页由底部导航的「主页」承担）。
   min-height 与原来 38px 返回键同高，保持标题与下方内容的纵向位置不变 */
.detail-topbar {
  display: flex;
  align-items: center;
  min-height: 38px;
}

.detail-title { font-size: 17px; font-weight: 600; }

.detail-current-wrap { padding: 8px 4px 0; }

/* AQI 徽章版式：徽章组居左，更新时间居右且与徽章底部平齐；窄屏允许换行，禁止挤压徽章
   :not([hidden]) 是必须的 —— 显式 display 会盖掉 [hidden]，从 AQI 页切到天文页时
   上一页的徽章会顶在页面最上方（云量/湿度的 grid 版式同理，见下方规则） */
.detail-current-wrap.is-air-badge:not([hidden]) {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.detail-current-wrap.is-air-badge .detail-current {
  display: flex;
  align-items: stretch; /* 两徽章等高：最高者定高，背景完整覆盖不露字 */
  flex-wrap: wrap;
  row-gap: 8px;
  gap: 10px;
}
.detail-current-wrap.is-air-badge .detail-current-sub {
  margin-top: 0;
  margin-left: auto;
  padding-bottom: 3px; /* 与徽章底边平齐 */
  font-size: 11px;
  white-space: nowrap;
}

.detail-current {
  font-size: 44px;
  font-weight: 600;
  line-height: 1.1;
}

/* 顶部双徽章：国标 + 美标估算；徽章内数值下为等级文字，徽章下为标准注脚。
   等级文字最长 7 字（对敏感人群不健康），11px 下单行 77px < 徽章内宽 92px 不换行 */
.detail-current__group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: none;            /* 禁止压缩徽章：压缩会让等级文字截断挤出背景 */
}
.detail-current__badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 104px;          /* 固定宽度：国标/美标两徽章严格同宽 */
  padding: 8px 6px;
  border-radius: 14px;
  color: #fff;
  gap: 2px;
  flex: 1;               /* 同排徽章等高：拉伸至最高徽章的高度 */
}
.detail-current__val { font-size: 28px; font-weight: 700; line-height: 1.05; }
.detail-current__lv {
  font-size: 11px; font-weight: 600; line-height: 1.3;
  text-align: center; padding: 0 2px; text-wrap: balance;
}
.detail-current__std { font-size: 11px; color: var(--text-sub); white-space: nowrap; }

/* 详情页最底部：数据来源与站点信息（多行左对齐） */
.detail-footer {
  font-size: 11px;
  color: var(--text-sub);
  margin: 16px 4px 0;
  padding-bottom: 4px;
  text-align: left;
  line-height: 1.7;
}

.detail-current-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-sub);
}

/* ---------- 云量示意图（云量详情页：顶部百分比右侧） ---------- */
/* 版式：数值与副标题在左列、示意图在右列并垂直居中；用 grid 两行一列，
   示意图跨两行，这样副标题换行也不会把图往下顶。
   （仅在 .is-cloud 时生效，其它指标页仍是普通的块级排布）
   :not([hidden]) 必须带上：否则从云量页切到天文页时，这里的 display:grid 会盖掉
   wrap 的 [hidden]，把上一页的「55% / 当前云量」留在天文页顶部 */
.detail-current-wrap.is-cloud:not([hidden]),
.detail-current-wrap.is-humid:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "val vis" "sub vis";
  align-items: center;
  column-gap: 12px;
}
.detail-current-wrap.is-cloud .detail-current { grid-area: val; }
.detail-current-wrap.is-cloud .detail-current-sub { grid-area: sub; margin-top: 4px; }
.detail-current-wrap.is-cloud .cloud-vis { grid-area: vis; }

.cloud-vis {
  flex: none;
  width: 112px;   /* 与 viewBox 112x64 同比例，缩放时不会出现 letterbox 留白 */
  height: 64px;
  border-radius: 15px;
  overflow: hidden; /* clipPath 之外的双保险：个别 iOS 版本 SVG 裁剪会漏边 */
}
.cloud-vis[hidden] { display: none; }
.cloud-vis__svg { display: block; width: 100%; height: 100%; }

/* 天空底色：昼=浅蓝渐变，夜=深蓝渐变；用 stop-color 而不是换 SVG，避免两套图形重复 */
.cloud-vis__sky { fill: url(#cloud-vis-sky); }
.cloud-vis__sky-a { stop-color: #8ebfe7; }
.cloud-vis__sky-b { stop-color: #c9e2f8; }
body.night .cloud-vis__sky-a { stop-color: #1b2c42; }
body.night .cloud-vis__sky-b { stop-color: #2b4159; }

/* 太阳：日间暖黄，夜间换成中性的浅色圆盘（同一形状读作月亮，不再画光芒） */
.cloud-vis__sun { fill: #ffcb45; }
.cloud-vis__sun-glow { fill: url(#cloud-vis-sun-glow); }
.cloud-vis__glow-a { stop-color: #ffc745; stop-opacity: 0.55; }
.cloud-vis__glow-b { stop-color: #ffc745; stop-opacity: 0; }
body.night .cloud-vis__sun { fill: #e6eefb; }
body.night .cloud-vis__glow-a { stop-color: #dce9f9; stop-opacity: 0.38; }
body.night .cloud-vis__glow-b { stop-color: #dce9f9; stop-opacity: 0; }

/* 云朵：远层最淡、近层最实，配合不同漂移速度形成视差；整体浓度由 JS 按云量写 opacity */
.cloud-vis__cloud--far { fill: rgba(255, 255, 255, 0.72); }
.cloud-vis__cloud--mid { fill: rgba(255, 255, 255, 0.88); }
.cloud-vis__cloud--near { fill: #ffffff; }
.cloud-vis__cloud {
  animation: cloudVisDrift var(--dur, 28s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
  /* 极轻的落影：两朵同色白云相遇时靠它分出前后，否则会糊成一整块白 */
  filter: drop-shadow(0 1.5px 1.5px rgba(46, 86, 126, 0.22));
}
/* 从左侧画外飘到右侧画外：起点终点都在可视区之外，回环时看不到跳帧 */
@keyframes cloudVisDrift {
  from { transform: translateX(-50px); }
  to   { transform: translateX(112px); }
}

/* 阴天雾罩：盖在云之上，云量过 50% 后线性变浓，把整片天空压成灰白 —— 只有 4 朵云时，
   高云量时段会出现大块晴空，靠这层雾才能读出「密云/阴天」；透明度由 JS 按云量写入 */
.cloud-vis__veil { fill: #eaf2fa; opacity: 0; }
body.night .cloud-vis__veil { fill: #45607a; }

/* 外框：极细浅色描边，让「天空窗口」在页面底色上立得住 */
.cloud-vis__frame {
  fill: none;
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 1;
}
body.night .cloud-vis__frame { stroke: rgba(255, 255, 255, 0.14); }

/* 减弱动效：云停在各自的基准位置（--base），仍是一张「云量示意」，只是不动 */
@media (prefers-reduced-motion: reduce) {
  .cloud-vis__cloud {
    animation: none;
    transform: translateX(var(--base, 0px));
  }
}

/* ---------- 湿度示意图（湿度详情页：顶部百分比右侧的大水滴） ---------- */
/* 版式与云量页同构：数值/副标题在左列，水滴跨两行靠右；只在 .is-humid 时改排布
   （:not([hidden]) 的理由同云量页：显式 display 会盖掉 wrap 的 hidden） */
.detail-current-wrap.is-humid:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "val vis" "sub vis";
  align-items: center;
  column-gap: 12px;
}
.detail-current-wrap.is-humid .detail-current { grid-area: val; }
.detail-current-wrap.is-humid .detail-current-sub { grid-area: sub; margin-top: 4px; }
.detail-current-wrap.is-humid .drop-vis { grid-area: vis; }

.drop-vis {
  flex: none;
  justify-self: end;
  width: 70px;   /* 与 viewBox 56x76 同比例（70:95），缩放时不会出现 letterbox 留白 */
  height: 95px;
}
.drop-vis[hidden] { display: none; }
.drop-vis__svg { display: block; width: 100%; height: 100%; }

/* 空腔：水滴内部提亮成半透明白玻璃感，水面以上的这部分才是「还有多少空间」的参照；
   若只留轮廓，空的半截会与浅蓝页底融在一起，看着像水滴被削掉了上半 */
.drop-vis__inner { fill: rgba(255, 255, 255, 0.16); }
body.night .drop-vis__inner { fill: rgba(255, 255, 255, 0.12); }

/* 水体：整组按 --dy 平移到当前水位（0% 在底、100% 满到尖），过渡让数值刷新时水位平滑跟进 */
.drop-vis__water {
  transform: translateY(var(--dy, 71px));
  transition: transform 520ms cubic-bezier(0.32, 0.72, 0.24, 1);
}
.drop-vis__water-fill { fill: url(#drop-vis-water); }
.drop-vis__water-a { stop-color: #63b4ee; }
.drop-vis__water-b { stop-color: #2b7fc4; }
body.night .drop-vis__water-a { stop-color: #4a7fb8; }
body.night .drop-vis__water-b { stop-color: #1f4d78; }

/* 水面：略亮的波浪带，跟着水体一起升降 */
.drop-vis__water-top { fill: rgba(178, 219, 250, 0.9); }
body.night .drop-vis__water-top { fill: rgba(150, 195, 238, 0.5); }
/* 极轻的上下浮动：完全静止的水面看着像一块塑料，动上 1px 就活了 */
.drop-vis__water-shift { animation: dropVisBob 3.6s ease-in-out infinite alternate; }
@keyframes dropVisBob {
  from { transform: translateY(-1.1px); }
  to   { transform: translateY(1.1px); }
}

/* 轮廓：比水体深一档的蓝，让水滴在浅色底纹上立得住 */
.drop-vis__outline {
  fill: none;
  stroke: rgba(58, 118, 168, 0.62);
  stroke-width: 1.6;
  stroke-linejoin: round;
}
body.night .drop-vis__outline { stroke: rgba(150, 195, 238, 0.52); }

/* 玻璃反光：画在最上层，水位高低都不影响容器外壁的这道高光 */
.drop-vis__glint {
  fill: none;
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 2.4;
  stroke-linecap: round;
}

@media (prefers-reduced-motion: reduce) {
  .drop-vis__water { transition: none; }
  .drop-vis__water-shift { animation: none; }
}

.detail-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-sub);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

/* ---------- 风力详情顶部三联卡：左三行数值 / 中风向箭头 / 右风向袋（三卡等宽） ---------- */
#detail-wind-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#detail-wind-card[hidden] { display: none; }

.wind-panel { padding: 10px; }

/* 左卡：三行「名称 ←→ 数值」，行间等距撑满卡片高度 */
.wind-panel--rows {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
}
.wind-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}
.wind-kv__k { font-size: 10.5px; color: var(--text-sub); flex: none; letter-spacing: 0.2px; }
.wind-kv__v {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* 单位降一级：等宽后数据卡变窄，把 km/h 缩到次级字号才能容下「108–198 km/h」这类区间 */
.wind-kv__unit { font-size: 9px; font-weight: 500; color: var(--text-sub); margin-left: 2px; }
/* 范围行自适应：三位数风速区间（108–198 km/h）在等宽窄卡里会顶到标签，
   先降一档字号，仍溢出则省去单位（该行 aria-label 已含完整单位） */
.wind-kv--range.is-tight .wind-kv__v { font-size: 11.5px; letter-spacing: -0.2px; }
.wind-kv--range.is-tight .wind-kv__unit { font-size: 8px; margin-left: 1px; }
.wind-kv--range.is-tighter .wind-kv__unit { display: none; }

/* 左右两张图形卡：只有图形、无图注，图形在卡内垂直水平居中（语义由 aria-label 承载） */
.wind-panel--figure {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wind-figure { width: 74px; height: 74px; display: block; }

/* 风向风纹：三股曲线（由实到虚）+ 末端实心三角，整组按方位角旋转；圆头收笔，无任何圆盘底 */
.wind-spark__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.1;
  stroke-linecap: round;
}
.wind-spark__head { fill: var(--accent); }
/* 三股线由实到虚：透明度交给样式表控制，夜间可整体提亮，避免最深一股在深色卡上看不见 */
#wd-arrow > :nth-child(1),
#wd-arrow > :nth-child(2) { opacity: 0.92; }
#wd-arrow > :nth-child(3),
#wd-arrow > :nth-child(4) { opacity: 0.6; }
#wd-arrow > :nth-child(5),
#wd-arrow > :nth-child(6) { opacity: 0.38; }
body.night #wd-arrow > :nth-child(3),
body.night #wd-arrow > :nth-child(4) { opacity: 0.75; }
body.night #wd-arrow > :nth-child(5),
body.night #wd-arrow > :nth-child(6) { opacity: 0.55; }
/* 风向不明：线条改虚线、去掉箭头三角（偶序为三角），表达「有风但不定向」 */
#wd-arrow.is-unknown > :nth-child(odd) { stroke-dasharray: 5 4; }
#wd-arrow.is-unknown > :nth-child(even) { display: none; }

/* 风纹「流动」：用 stroke-dashoffset 沿路径方向推移「一处缺口」，营造被风吹过的连续感。
   路径绘制方向是自下而上（…62 → …25），所以 dashoffset 取负值 = 缺口朝箭头方向游走。

   ① 硬约束：任何时刻每条线上最多只能出现「一个」缺口，绝不能碎成两段以上。
      判据是「图案周期 > 最长那一股」：三股线实测 getTotalLength() = 38.23 / 36.20 / 23.98，
      最长 38.23 仍短于周期 42，路径跨度装不下第二个缺口起点，任意相位下最多跨一次缺口，
      约束天然成立。
      实段取 37（略小于最长路径）则是为了「整条线几乎全程可见」：线2、线3 在部分相位能完全
      闭合（覆盖率到 100%），而最长的线1 会始终带一道缺口（上限 96.8%，永不到 100%）——
      这是 37 < 38.23 的必然结果，也正好符合意图：最长那股一直留一道看得见的缝，
      流动感不会被读丢。若想让线1 也能闭合，实段需 ≥ 38.23，但那样 37+5=42 的整周期就
      被破坏，keyframes 行程必须一并从 -42 改掉 —— 代价大于收益，不做。
      （这里踩过坑：初版用 20 22，实段 20 远短于线长，一条线上并排出现两处缺口，最短那股
      被切成一截加一个孤点，整组读作「断线 + 三个悬空三角」，比改前的连续风纹明显退化，
      且 1x 尺寸下就看得出来。改 dasharray 必须同时验两条判据：周期 > 最长路径（保证单缺口）、
      实段 ≥ 最长路径（保证线不被切成短划）。）

   ② 周期 37 + 5 = 42，与 @keyframes windSparkFlow 的行程 0 → -42 严格相等：
      虚线图样在偏移空间以「dasharray 之和」为周期，行程走整数倍（此处 1 倍）后，终点与
      起点的渲染完全等价，首尾无缝。故关键帧无需随 dasharray 改动。

   ③ 缺口取 5 单位是刻意的，圆头收笔会吃掉其中一部分：stroke-linecap: round 让每个实段
      两端各外扩 1.05（stroke-width 2.1 的一半），故真机看得见的断口只有 5 - 2.1 ≈ 2.9
      单位（≈3px）。所以不必按「5 / 23.98 = 21%」担心断口过大 —— 实际观感是缺口在每股
      线上周期性张开到 3px 再闭合，读作「一股气流掠过线身」，不会读成断线；而缺口必须
      能被看见才叫流动，故没有继续收窄。
      （退档 38 4 的可见断口只剩 4 - 2.1 ≈ 1.9 单位 ≈ 2px，已接近看不见，不建议。）

   ④ 相位错开量按图案周期算：p = 42 与行程等长，故 -0.73s（偏移 42 × 0.73 / 2.2 ≈ 13.94）
      正好是 1/3 个图案周期，三股线落在相位 0 / 0.33 / 0.66，任意瞬间缺口位置都不重合。
      注意：日后若改动 dasharray 使 p ≠ 42，延时步长必须按 p/3 重算，不能沿用行程的 1/3
      —— 例如 p=14 时，-0.73s 恰好约等于 0.996 个图案周期，三股线会整体退回同相。

   ⑤ 为什么必须排除 .is-unknown：风向不明时线条的语义是「有风但不定向」，
      靠静态虚线 stroke-dasharray: 5 4 + 隐藏三角来表达；此时若继续滚 dashoffset，
      虚线会变成一串跑动的小点，观感上又像在指方向，等于把 unknown 的语义推翻了。
      所以流动只在「有明确风向」时启用。 */
#wd-arrow:not(.is-unknown) > :nth-child(odd) {
  stroke-dasharray: 37 5;
  animation: windSparkFlow 2.2s linear infinite;
}
/* 相位错开（详见上面 ④）：步长 = 行程的 1/3 = 图案周期（42）的 1/3。
   写法必须放在 animation 简写之后，才能覆盖简写重置掉的 delay。 */
#wd-arrow:not(.is-unknown) > :nth-child(1) { animation-delay: 0s; }
#wd-arrow:not(.is-unknown) > :nth-child(3) { animation-delay: -0.73s; }
#wd-arrow:not(.is-unknown) > :nth-child(5) { animation-delay: -1.46s; }
@keyframes windSparkFlow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -42; }
}

/* 三角箭头「被风轻推」：只沿箭头朝向做 1.1 用户单位（≈1.1px）的位移，
   幅度再大就从「被吹」变成「抖动」。
   周期沿用流动的 2.2s，延时步长也与三股线的错相步长一致（0 / -0.73s / -1.46s）：
   每条线与它自己的三角同相位，整组读作同一股风把三条纹路连同箭头一起推出去。
   若日后把错相步长改小，务必两端同步改 —— 线和三角相位不一致时，箭头会像在
   跟线上的缺口「对不上拍」，观感上比幅度过大更显脏。
   注意作用对象是 :nth-child(even)（三条线之间的三角），不是 #wd-arrow 本身 ——
   #wd-arrow 的 transform 是 JS 写入的方位角属性，CSS transform 会把它覆盖掉。 */
#wd-arrow:not(.is-unknown) > :nth-child(even) {
  transform-box: view-box;
  transform-origin: center;
  animation: windSparkHeadPush 2.2s ease-in-out infinite;
}
#wd-arrow:not(.is-unknown) > :nth-child(2) { animation-delay: 0s; }
#wd-arrow:not(.is-unknown) > :nth-child(4) { animation-delay: -0.73s; }
#wd-arrow:not(.is-unknown) > :nth-child(6) { animation-delay: -1.46s; }
@keyframes windSparkHeadPush {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.1px); }
}

/* 风向袋：风级越大袋身越平举（角度由 JS 写入 transform），布身为琥珀色带白色条带 */
.wind-sock__pole { stroke: var(--text-sub); stroke-width: 2.2; stroke-linecap: round; opacity: 0.45; }
.wind-sock__cloth { fill: #f0b429; }
.wind-sock__stripe { fill: #fff; opacity: 0.6; }

/* 风向袋摆动：绕挂环点轻微摆 + 布身极轻胀缩，像被持续的风吹着（信息图形，克制为先，
   幅度过大会被误读成「风级在变化」）。
   注意：为什么摆动必须放在内层 #wd-sock-sway：外层 #wd-sock 的倾角是 SVG transform
   **属性**（rotate(deg 15 19)，deg 随当前风级变化）。CSS transform 的优先级高于
   表现属性，只要在同一个元素上声明 CSS transform，属性里的真实倾角就被整体丢弃，
   风袋会永远停在同一条线（风级信息随之失效）。分层后：外层只吃属性旋转，内层叠加
   小幅度摆动，两者互不覆盖。这也同样适用于左侧风纹的 #wd-arrow。
   轴心取 15px/19px（挂环点）：该点在父级属性旋转下是不动点，所以无论风袋被转到哪个
   角度，内层绕它摆动都精确地「挂在钩上」，不会出现拖影式的偏移。 */
#wd-sock-sway {
  transform-box: view-box;
  transform-origin: 15px 19px;
  animation: windSockSway 3.6s ease-in-out infinite;
}
/* 0/100 与 50 首尾同值 → 无缝回环；±2.2° 的摆幅在 74px 画布上约合末端 1.6 单位位移 */
@keyframes windSockSway {
  0%, 100% { transform: rotate(-2.2deg) scale(1); }
  50% { transform: rotate(2.2deg) scale(1.015); }
}

/* 降级动效：风力页三处新增动画一并关掉。
   风纹这里除了停动画，还要显式把 stroke-dasharray 收回 none —— 否则只会退化成一条
   静止的虚线（虚线段数还在），而改前是实线；用户要的是「不动的原样」，不是「不动的虚线」。
   只在 :not(.is-unknown) 下收回：风向不明态的 5 4 虚线是语义的一部分，必须保留。
   风袋关掉后停在 JS 写入的真实倾角上，信息语义没有任何损失 —— 动效只是修辞，不承载数据。
   这一块刻意写在上面几条规则之后、且选择器刻意带上 :not(.is-unknown)：
   那些规则的优先级是 (1,2,0)，若用简化的 `#wd-arrow > :nth-child(odd)`（1,1,0）
   或写在文件前部的既有 reduced-motion 块里，都会被覆盖而失效。 */
@media (prefers-reduced-motion: reduce) {
  #wd-arrow:not(.is-unknown) > :nth-child(odd) {
    animation: none;
    stroke-dasharray: none;
  }
  #wd-arrow:not(.is-unknown) > :nth-child(even),
  #wd-sock-sway { animation: none; }
}

/* AQI 详情：污染物卡片 + 健康提示（双徽章样式见 .detail-current__*） */
#detail-air-card { display: flex; flex-direction: column; gap: 14px; }
#detail-air-card[hidden] { display: none; }
.air-pollutants { display: flex; flex-direction: column; gap: 10px; }
.air-p-row { display: flex; flex-direction: column; gap: 4px; }
.air-p-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.air-p-name { font-size: 13px; }
.air-p-val { font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
/* AQI 等级：国标六级对照表（当前等级高亮，色条+深字） */
.air-health { display: flex; flex-direction: column; }
.air-lv-table { display: flex; flex-direction: column; gap: 10px; }
.air-lv-table[hidden] { display: none; } /* .air-lv-table 自带 display:flex，会盖掉 hidden 属性 */
.air-lv-row {
  display: grid;
  grid-template-columns: 3px 58px 52px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-sub);
}
.air-lv-row__bar { width: 3px; height: 18px; border-radius: 2px; background: var(--card-border); }
.air-lv-row__name { white-space: nowrap; }
.air-lv-row__range { white-space: nowrap; font-variant-numeric: tabular-nums; }
.air-lv-row__desc { line-height: 1.4; }
.air-lv-row.is-now { color: var(--text); font-weight: 600; }

/* 美标表：名称最长「对敏感人群不健康」8 字，单行会把区间和提示挤烂，
   改成名称与区间同行、健康提示折到第二行（色条仍竖在第一列贯通两行） */
.air-lv-table--us .air-lv-row {
  grid-template-columns: 3px minmax(0, 1fr) auto;
  grid-template-areas:
    "bar name range"
    "bar desc desc";
  row-gap: 3px;
  column-gap: 10px;
  align-items: start;
  font-size: 12px;
}
.air-lv-table--us .air-lv-row__bar { grid-area: bar; margin-top: 2px; }
.air-lv-table--us .air-lv-row__name { grid-area: name; white-space: normal; line-height: 1.3; }
.air-lv-table--us .air-lv-row__range { grid-area: range; line-height: 1.3; }
.air-lv-table--us .air-lv-row__desc { grid-area: desc; font-size: 11.5px; }

/* 某套标准标不出当前等级时的补白（贴在表尾，跟着表一起显示/隐藏） */
.air-lv-note { margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--text-sub); opacity: 0.8; }

/* 等级卡标题行：标题靠左、国标/美标切换滑块靠右（与卡片右内边距对齐） */
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.card__head .card__title { margin-bottom: 0; }

/* ---------- 国标 / 美标切换滑块：两段胶囊 + 滑动拇指 ---------- */
.std-switch {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex: none;
  padding: 2px;
  border-radius: 999px;
  background: var(--hairline);
  border: 1px solid var(--card-border);
  -webkit-tap-highlight-color: transparent;
}
.std-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  border-radius: 999px;
  background: var(--pill-bg);
  box-shadow: 0 1px 3px rgba(44, 58, 71, 0.18);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.25, 1);
  pointer-events: none;
}
.std-switch.is-us .std-switch__thumb { transform: translateX(100%); }
/* 夜间：轨道压暗、拇指提亮（--pill-bg 夜间比轨道还深，选中侧会看不出来） */
body.night .std-switch { background: rgba(0, 0, 0, 0.18); }
body.night .std-switch__thumb { background: rgba(255, 255, 255, 0.2); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
.std-switch__opt {
  position: relative;
  z-index: 1;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  padding: 5px 9px;
  border-radius: 999px;
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  color: var(--text-sub);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease;
}
.std-switch__opt.is-on { color: var(--text); font-weight: 600; }
.std-switch__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) {
  .std-switch__thumb { transition: none; }
}

/* 24 小时 AQI 柱状图：24 根柱等分铺满卡宽（不横向滚动），柱高映射 AQI 数值、柱色取国标等级色。
   纵轴只画等级分界刻度线，数值与时刻每 3 小时标一个——列宽仅 11.7px，全标必然糊在一起。 */
.aqi-bars { display: block; }
.aqi-bars__plot {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  box-sizing: border-box;
  /* 右侧留出刻度数字的独立通道，柱子和「50/100…」不会挤在一起（时刻轴同宽，柱与刻度仍对齐） */
  padding-right: 22px;
  /* 基线：柱子有落点，不然 2px 的矮柱像浮在空中 */
  border-bottom: 1px solid rgba(86, 116, 148, 0.16);
}
.aqi-bars__col {
  position: relative; /* 柱顶数值标签的定位基准 */
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
/* 今日/明日分界：竖线画在「明日首柱」左侧的 2px 列间隙里（伪元素不参与布局，24 根柱仍等分）。
   top 从绘图区顶端到底部基线，与柱子共用同一条落点；实线 1px 比刻度虚线更醒目 */
.aqi-bars__col--daycut::before {
  content: "";
  position: absolute;
  left: -1.5px;
  top: 0;
  bottom: -1px;
  width: 1px;
  /* 顶部留白段渐隐：图顶没有内容，硬切一条线会像「挂」在半空 */
  background: linear-gradient(to bottom,
    rgba(86, 116, 148, 0) 0,
    rgba(86, 116, 148, 0.42) 18px,
    rgba(86, 116, 148, 0.42) 100%);
  pointer-events: none;
}
.aqi-bars__bar {
  width: 100%;
  border-radius: 3px 3px 1px 1px;
  /* 顶沿一道极淡高光，避免纯色块在玻璃卡上显得发平 */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
/* 刻度线从卡片左内边一直拉到右内边，文字贴在线右侧上方（不压线，无需底色遮断） */
.aqi-bars__grid {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(86, 116, 148, 0.22);
  pointer-events: none;
}
.aqi-bars__grid-v {
  position: absolute;
  right: 0;
  bottom: 1px;
  font-size: 9px;
  line-height: 1;
  color: var(--text-sub);
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}
/* 柱顶数值：绝对定位于柱顶上方 2px（bottom 由 JS 按柱高写入），左右居中后可外溢到相邻空格列 */
.aqi-bars__v {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  line-height: 1;
  font-weight: 600;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}
.aqi-bars__axis {
  display: flex;
  gap: 2px;
  margin-top: 5px;
  padding-right: 22px; /* 与绘图区同宽，逐时时刻才落在对应柱子正下方 */
}
.aqi-bars__tick {
  flex: 1 1 0;
  min-width: 0;
  font-size: 10px;
  line-height: 1;
  color: var(--text-sub);
  text-align: center;
  white-space: nowrap; /* 文字宽于列宽时向两侧外溢，落在相邻空格列里，不裁字 */
}
/* 分界列的时刻文字：改成「明日」并加深一档，与上方竖线呼应；
   left 左移半列，让文字中心落在竖线上（竖线在列左缘外 1.5px） */
.aqi-bars__tick--daycut {
  color: var(--text);
  opacity: 0.72;
  font-weight: 600;
  position: relative;
  left: -4px;
}
.aqi-bars__sum {
  margin-top: 9px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}
body.night .aqi-bars__grid { border-top-color: rgba(168, 184, 200, 0.20); }
body.night .aqi-bars__plot { border-bottom-color: rgba(168, 184, 200, 0.18); }
body.night .aqi-bars__col--daycut::before {
  background: linear-gradient(to bottom,
    rgba(178, 194, 212, 0) 0,
    rgba(178, 194, 212, 0.34) 18px,
    rgba(178, 194, 212, 0.34) 100%);
}

/* 24 小时横向列表 */
.detail-hourly {
  position: relative; /* 曲线 SVG 的定位基准，同时让 item.offsetLeft 以本容器为准 */
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.detail-hourly::-webkit-scrollbar { display: none; }
.detail-hourly { scrollbar-width: none; }

.detail-h-item {
  flex-shrink: 0;
  width: 56px;
  text-align: center;
  background: var(--pill-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 6px;
}
.detail-h-item__time { font-size: 12px; color: var(--text-sub); white-space: nowrap; }
.detail-h-item__val { font-size: 14px; font-weight: 600; margin-top: 6px; white-space: nowrap; }
.detail-h-item__sub { font-size: 11px; margin-top: 2px; white-space: nowrap; }
/* 列表里的单位小字（能见度 km/m）：列宽只有 56px，正文字号带单位会顶到相邻列 */
.detail-unit { font-size: 10px; font-weight: 500; color: var(--text-sub); margin-left: 1px; }

/* 风力详情 24 小时：与主页气温同构的「裸文字列 + 风速变化曲线」。
   胶囊底色与比例条去掉，底部留出一条曲线带（高度与 JS 里 stripH 对应），
   曲线只在这条带里起伏，不压时间与风级数字 */
.detail-hourly.is-wind {
  padding-bottom: 50px;
}
.detail-hourly.is-wind .detail-h-item {
  background: transparent;
  border-color: transparent;
  padding: 10px 2px 4px;
}
.detail-hourly.is-wind .detail-h-item__val { font-size: 15px; }
.detail-hourly .detail-h-item { position: relative; z-index: 1; }

/* 曲线宽高由 JS 按滚动内容实测尺寸写入（百分比只等于可视区，会被水平压缩错位） */
.detail-wind-curve {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0.72;
}
.detail-wind-curve__line {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}
.detail-wind-curve stop.dwc-hi { stop-color: var(--accent); stop-opacity: 0.26; }
.detail-wind-curve stop.dwc-lo { stop-color: var(--accent); stop-opacity: 0; }
.detail-wind-curve__dot { fill: var(--accent); }
/* 夜间：主色在深底上偏暗，整体提亮一档保证曲线可辨 */
body.night .detail-wind-curve { opacity: 0.85; }
body.night .detail-wind-curve stop.dwc-hi { stop-opacity: 0.28; }

/* 比例条（湿度 / 云量 / 风力等级相对比例） */
.bar {
  height: 6px;
  margin-top: 8px;
  border-radius: 3px;
  background: rgba(127, 145, 165, 0.25);
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

/* 7 天纵向列表 */
.detail-d-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(127, 145, 165, 0.18);
}
.detail-d-item:last-child { border-bottom: none; }

.detail-d-item__date { width: 74px; font-size: 14px; flex-shrink: 0; }
.detail-d-item__date .sub { display: block; font-size: 11px; color: var(--text-sub); }

.detail-d-item__val { width: 56px; font-size: 14px; font-weight: 600; text-align: right; flex-shrink: 0; }
.detail-d-item__spacer { flex: 1; }
.detail-d-item .bar { flex: 1; margin-top: 0; }

/* 空气质量 3 天预报：横向行 + 上下堆叠 */
.air-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.air-day-row__day { font-size: 13px; }
.air-day-row__pill {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- 空气质量页底部：空气污染扩散条件指数（和风天气指数 type=10） ----------
   两行：左列固定「今日 / 明日」，右侧档位名 + 官方原文。
   刻意不复用 AQI 六级色板：扩散条件与 AQI 是两个维度，同色异义会让颜色失去信息量；
   卡内分隔线用 --hairline（--card-border 白天是半透明白，画在白卡上等于没画） */
.air-spread__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
}
.air-spread__row:first-child { padding-top: 2px; }
.air-spread__row:last-child { padding-bottom: 2px; }
.air-spread__row + .air-spread__row { border-top: 1px solid var(--hairline); }

.air-spread__day {
  flex: 0 0 auto;
  width: 26px;
  padding-top: 2px;        /* 与档位名首行中线对齐 */
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: var(--text-sub);
}

.air-spread__body { flex: 1 1 auto; min-width: 0; }

.air-spread__cat {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

.air-spread__text {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 3;   /* 和风原文常见 40–70 字，390 下基本 2 行，最多留 3 行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 逐时预报：标签列 + 单滚动区（四行共享同一个滚动容器） ----------
 * 为什么不是三块各自滚动再同步 scrollLeft：共享一个容器天生同步，
 * 不存在「谁先谁后」的回环触发与首帧错位。行内列宽固定，四行的列自然对齐。 */
.hourly-board {
  display: flex;
  align-items: flex-start;
  /* 标签列收窄到 24px（只剩两字行名）后，原来的 8px 会让组带左边缘几乎贴上标签，
     补到 12px 才重新有「标签 / 数据」的边界感 */
  gap: 12px;
  /* 各行高度集中定义：标签列用同一组值分行，左右才能对齐 */
  --hrow-head: 46px;
  --hrow-temp: 58px;
  --hrow-precip: 46px;
  --hrow-rate: 46px;
  --hrow-wind: 46px;
  --hrow-gust: 46px;
  /* 行间距也只能有一份来源：轨道用 margin-top，标签栅格用 row-gap，
     两边都取这个值。曾经漏在标签一侧，四行累计错开 2/4/6px。 */
  --hrow-gap: 2px;
  /* 组间留白：靠插入一条等高的空行来分隔「温度 / 降水 / 风」三组，
     而不是给某行加 margin-bottom —— 后者只作用于轨道一侧，
     标签栅格算不到，又回到左右错位的老问题。 */
  --hrow-sep: 8px;
}

/* 左侧固定标签列：随卡片静止，不参与横向滚动（否则滑到哪里就不知道哪行是什么）。
   只有行名（温度 / 概率 / 强度 / 风力 / 阵风），分组靠组间空行 + 右侧组带来表达，
   不再额外写「降水 / 风」这类类目字 —— 两字行名已经把话说完了。
   行号仍然显式指定：栅格里有两条组间空行，行号不连续，靠自动放置容易错位。 */
.hourly-labels {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto;
  grid-template-rows: var(--hrow-head) var(--hrow-sep) var(--hrow-temp) var(--hrow-sep)
    var(--hrow-precip) var(--hrow-rate) var(--hrow-sep) var(--hrow-wind) var(--hrow-gust);
  row-gap: var(--hrow-gap);
  font-size: 10.5px;
  color: var(--text-sub);
  letter-spacing: 0.5px;
}
.hourly-labels__blank { grid-column: 1; grid-row: 1; }

/* 行名：右对齐，右边缘一条线 —— 视线从上往下扫时不会左右跳 */
.hourly-labels__item {
  grid-column: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 6px;   /* 温度：3px + (21.4px 行盒 − 12.6px 标签行盒) / 2 ≈ 6px */
  padding-right: 2px;
  line-height: 1.2;
  white-space: nowrap;
}
.hourly-labels__item--precip,
.hourly-labels__item--rate,
.hourly-labels__item--wind {
  padding-top: 4px;   /* 数值行盒 17.4px，字号更小，中线比温度行高一档 */
}
.hourly-labels__item--gust {
  padding-top: 5px;   /* 阵风 12px：行盒再矮 0.6px，中线还要再往下半像素 */
}

/* 各行在栅格里的落点（含两条组间空行，所以行号不连续） */
.hourly-labels__item--temp   { grid-row: 3; }
.hourly-labels__group--precip{ grid-row: 5 / span 2; }
.hourly-labels__item--precip { grid-row: 5; }
.hourly-labels__item--rate   { grid-row: 6; }
.hourly-labels__group--wind  { grid-row: 8 / span 2; }
.hourly-labels__item--wind   { grid-row: 8; }
.hourly-labels__item--gust   { grid-row: 9; }

.hourly-scroll {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.hourly-scroll::-webkit-scrollbar { display: none; }
.hourly-scroll { scrollbar-width: none; }

/* 轨道：四行纵向堆叠，宽度由列数撑开；曲线以它为坐标原点绝对定位 */
.hourly-track { position: relative; width: max-content; min-width: 100%; }

/* 行要参与层级：组背景带在 z-index 0，行与曲线同在 1，色带才不会盖住描边 */
.hourly-row { position: relative; z-index: 1; display: flex; align-items: stretch; }
.hourly-row + .hourly-row,
.hourly-row + .hourly-spacer,
.hourly-spacer + .hourly-row { margin-top: var(--hrow-gap); }
.hourly-row--head { height: var(--hrow-head); }
.hourly-row--temp { height: var(--hrow-temp); }
.hourly-row--precip,
.hourly-row--rate,
.hourly-row--wind,
.hourly-row--gust { height: var(--hrow-precip); }

/* 组间空行：只有高度，没有内容。两侧的 margin 由上面的相邻选择器补齐，
   与标签栅格里两行 row-gap 相加后完全等值 */
.hourly-spacer { height: var(--hrow-sep); }

/* 组背景带：把同组两行包成一个视觉块。刻意压得极淡 —— 它的作用是余光里
   「这两行是一件事」，一旦能单独看见就成了色块，反而打断纵向阅读节奏 */
.hourly-group-band {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 0;
  border-radius: 8px;
  background: rgba(127, 145, 165, 0.07);
  pointer-events: none;
}
body.night .hourly-group-band { background: rgba(255, 255, 255, 0.035); }

/* 列宽 56px：触摸目标与列内留白都够，320 宽下仍可见 4 列 */
.hourly-cell {
  position: relative;
  z-index: 1;           /* 数值压在曲线之上 */
  flex: 0 0 56px;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-snap-align: start;
}
.hourly-cell--head { justify-content: center; gap: 4px; }
.hourly-cell__time { font-size: 12px; color: var(--text-sub); white-space: nowrap; line-height: 1.1; }
/* 首列「现在」加重，一眼能定位当前时刻 */
.hourly-cell--now .hourly-cell__time { color: var(--text); font-weight: 600; }
.hourly-cell__val { padding-top: 3px; line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hourly-row--temp .hourly-cell__val { font-size: 16px; font-weight: 600; color: var(--text); }
.hourly-row--precip .hourly-cell__val { font-size: 12.5px; color: var(--accent); }
/* 降水强度是档位词（小雨/中雨/大雨/暴雨），加重一档才好当结论读；
   「无」降回次级灰：24 个蓝色「无」会把真下雨的格子埋掉 */
.hourly-row--rate .hourly-cell__val { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.hourly-row--rate .hourly-cell--none .hourly-cell__val { font-weight: 400; color: var(--text-sub); }
.hourly-row--wind .hourly-cell__val { font-size: 12.5px; color: var(--text-sub); }
/* 阵风带单位（18km/h），12px 才能让三位数 + 单位在 56px 列宽里不挤 */
.hourly-row--gust .hourly-cell__val { font-size: 12px; color: var(--text-sub); }

/* 跨天竖线（其它指标详情页的逐时列表仍在用 buildDayDivider）：
   竖排「今天」+ 竖线 + 竖排「明天」。今日页的四行轨道改用 .hourly-gap，
   两者都靠 z-index 压在曲线之上，避免曲线盖住文字 */
.day-divider {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 8px 0;
  flex-shrink: 0;
}
.day-divider__label {
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center; /* vertical-rl 下主轴为竖向：文字在分割线全高内居中 */
}
.day-divider__line {
  width: 1px;
  background: rgba(127, 145, 165, 0.35);
}

/* 今日页的跨天分割：宽度固定的一列，每行各插一份，列位置才能继续对齐。
   竖线本身不在这里画 —— 组间有空行，逐行拼接会断成三段，
   改由 .hourly-dayline 在轨道上单独一层贯穿到底（见 app.js addDayDivider） */
.hourly-gap {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
}
.hourly-dayline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  z-index: 0;
  background: rgba(127, 145, 165, 0.35);
  pointer-events: none;
}
.hourly-gap__label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  writing-mode: vertical-rl;
  text-align: center;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-sub);
}

/* 变化曲线：贴在行底部，横向与列位置对齐；数值在上，曲线在下，互不压字 */
.hourly-curve {
  position: absolute;
  left: 0;
  z-index: 1;          /* 与行同层，压在组背景带（0）之上 */
  pointer-events: none;
  /* 0.6 太淡，细线在浅色卡上像一条高亮下划线；提到 0.85 才读得出是数据曲线 */
  opacity: 0.85;
}
.hourly-curve__line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* 温度：琥珀黄（沿用详情页主色），填充向下渐隐 */
.hourly-curve--temp .hourly-curve__line { stroke: #f0b429; }
.hourly-curve--temp stop.hc-hi { stop-color: #ffd75e; stop-opacity: 0.55; }
.hourly-curve--temp stop.hc-lo { stop-color: #ffd75e; stop-opacity: 0.06; }
/* 降水：主题蓝，随明暗主题变化 */
.hourly-curve--precip .hourly-curve__line { stroke: var(--accent); }
.hourly-curve--precip stop.hc-hi { stop-color: var(--accent); stop-opacity: 0.42; }
.hourly-curve--precip stop.hc-lo { stop-color: var(--accent); stop-opacity: 0.06; }

/* 强度与概率同属降水，沿用同一支蓝；靠行标签与数值形态区分 */
.hourly-curve--rate .hourly-curve__line { stroke: var(--accent); }
.hourly-curve--rate stop.hc-hi { stop-color: var(--accent); stop-opacity: 0.34; }
.hourly-curve--rate stop.hc-lo { stop-color: var(--accent); stop-opacity: 0.06; }
/* 风力：钢灰蓝，与上面两条区分开，不抢主色 */
.hourly-curve--wind .hourly-curve__line { stroke: #8aa0b5; }
.hourly-curve--wind stop.hc-hi { stop-color: #8aa0b5; stop-opacity: 0.38; }
.hourly-curve--wind stop.hc-lo { stop-color: #8aa0b5; stop-opacity: 0.06; }
/* 夜间卡片是深底：钢灰蓝要提亮一档，否则和降水蓝糊在一起 */
body.night .hourly-curve--wind .hourly-curve__line { stroke: #9dbcD4; }
body.night .hourly-curve--wind stop.hc-hi { stop-color: #9dbcd4; }
/* 阵风是同一族的风量，钢灰蓝压深一档：两行紧挨着，别让人以为是同一条线的重复 */
.hourly-curve--gust .hourly-curve__line { stroke: #6f8399; }
.hourly-curve--gust stop.hc-hi { stop-color: #6f8399; stop-opacity: 0.34; }
.hourly-curve--gust stop.hc-lo { stop-color: #6f8399; stop-opacity: 0.06; }
body.night .hourly-curve--gust .hourly-curve__line { stroke: #b9d3e8; }
body.night .hourly-curve--gust stop.hc-hi { stop-color: #b9d3e8; }

/* ---------- 生活指数（今日页底部，仅和风源） ----------
   两天分块：块标题「今日 / 明日」，块内三行（穿衣 / 感冒 / 舒适度）。
   档位名固定 44px 标题列 → 三行的档位名严格左对齐，扫读时是一列而不是三段；
   建议文案跨满整行、限两行 —— 若缩进到档位名下，可用宽度少 52px，行数要多一半。
   不给档位加大字重以外的强调：颜色在本产品里已被 AQI 与预警占用，随手加色会让颜色失去信息量。 */
.life-day { padding: 9px 0 4px; }
.life-day:first-child { padding-top: 2px; }
.life-day + .life-day { margin-top: 6px; }

/* 日期头做成「标签 + 拖到右边的细线」：两天的分界一眼可见，
   比在块之间加一条通栏 border 更轻 —— 那条线会跟卡片边框抢，反而看不出分段。 */
.life-day__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: var(--text-sub);
}
.life-day__head::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  /* 必须用 --hairline（卡内分隔线）而不是 --card-border：后者白天是半透明白，
     画在白卡上等于没画 —— 这也是为什么第一个版本的分段线在图里完全看不见 */
  background: var(--hairline);
}

.life-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 2px;
  padding: 4px 0;
}
.life-item:last-child { padding-bottom: 2px; }

.life-item__name {
  padding-top: 3px;          /* 与档位名首行中线对齐 */
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-sub);
}

.life-item__cat {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

.life-item__text {
  grid-column: 1 / -1;        /* 跨满整行：文案是说明，不跟档位名抢那 44px */
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 主页「今日生活指数」（大卡与空气质量之间） ----------
   三块等分并排，每块只有「标签 + 档位」两行，只取今日一条（明日留给详情页）。
   不放建议文案：主页这一条要的是一眼扫到档位，和风原文动辄 25 字，
   塞进 1/3 列宽会把卡片撑成三段小文章 —— 完整建议句仍挂在 title 上，信息没丢。
   去掉长句后留出空间，字号整体上调：标签 11px、档位 16px/600，
   三块内容居中对齐（内容太短，左对齐会在每列右侧留一条参差空白）。
   不给档位加语义色：颜色在本产品里已被 AQI 与预警占用，这里再加就没信息量了。 */
.life-strip-card { padding: 11px 14px; }
.life-strip {
  display: grid;
  grid-template-columns: repeat(var(--life-cols, 3), minmax(0, 1fr));
  align-items: stretch;
}
.life-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 1px 6px;
  text-align: center;
}
/* 等分之间的细竖线：与五等分指标卡同一手法，只占 70% 高度，读作分隔而非边框 */
.life-cell + .life-cell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 70%;
  background: var(--hairline);
}
.life-cell__name {
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.4px;
  color: var(--text-sub);
}
/* 档位名不换行：舒适度最长一档是「非常不舒适」5 个字，
   16px 下 320 宽仍放得下；真遇到更长的按省略号截断，title 里有全文 */
.life-cell__cat {
  max-width: 100%;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ≤340px（iPhone SE 一代）：1/3 列宽只剩 74px，「非常不舒适」5 个字在 16px 下差 7px
   会被省略号切掉 —— 这是舒适度最长的一档，必须完整可见，故降到 14px（70px 放得下）。
   340 是算出来的临界值：(W-60)/3-12 ≥ 81 解得 W ≥ 339 */
@media (max-width: 340px) {
  .life-cell__cat { font-size: 14px; }
}

/* 整卡可点：点开档位弹层。按下时三块一起压暗 —— 不做缩放，卡片边界不在手指下移动 */
.life-strip-card[role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.life-strip-card[role="button"]:active .life-cell { opacity: 0.6; }
.life-strip-card[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 未来页底部：洗车指数 ---------- */
/* 内容只有一句结论，做成一行：结论在前、判定依据紧随其后，读起来是一句话，
   不用 space-between —— 那样在 390 宽下两者会相隔近 200px，像两件互不相关的事。
   不给结论加语义色 —— 颜色在本产品里已被 AQI 等级占用，随手加色会让颜色失去信息量。 */
.wash-body {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: 2px;
}
.wash-value {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.35;
}
.wash-hint {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 11px;
  color: var(--text-sub);
}

/* ---------- 7 天预报 ---------- */
.daily-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--card-border);
}

.daily-item:last-child { border-bottom: none; }

/* 列标题行 */
.daily-item--head { padding: 2px 0 7px; font-size: 11px; font-weight: 500; color: var(--text-sub); }
.daily-item--head .daily-item__date { font-size: 11px; font-weight: 500; }
/* 标题行含与数据行同尺寸的图标占位（app.js 渲染），「天气」二字与数据行天气文字自然纵向对齐 */
.daily-item--head .daily-item__desc { font-size: 11px; font-weight: 500; color: var(--text-sub); text-align: left; white-space: nowrap; }
.daily-item--head .daily-item__precip { color: var(--text-sub); }
.daily-item--head .daily-item__range { font-size: 11px; font-weight: 500; }

/* 昨天行：弱化显示 */
.daily-item--past { opacity: 0.65; }

.daily-item__date { flex: 0 0 64px; font-size: 14px; }
.daily-item__date .sub { display: block; font-size: 11px; color: var(--text-sub); font-weight: 400; }
.daily-item__icon { flex: 0 0 auto; }
.daily-item__desc { flex: 1 1 52px; min-width: 48px; font-size: 13px; color: var(--text-sub); } /* 基准宽 52px 保证四字天气单行； grow 权重低于温度列，避免天气与降水间空白过大 */
.daily-item__precip { flex: 0 0 38px; font-size: 12px; color: var(--accent); text-align: right; }
.daily-item__wind { flex: 0 0 32px; margin-left: 8px; font-size: 12px; color: var(--text-sub); text-align: right; }
/* 温度列：最低温 + 范围色条 + 最高温（与今昨对比条同款样式）；弹性伸展吸收天气列右侧空白
   grow 4 : 天气列 grow 1，多余空间优先加长色条而非扩大天气列空隙；封顶避免条过长 */
.daily-item__range { flex: 4 1 124px; max-width: 168px; display: flex; align-items: center; gap: 6px; }
.daily-item__range .min { color: var(--text-sub); font-weight: 400; margin-left: 4px; } /* 无轴回退的纯文本样式 */
.daily-item--head .daily-item__range { display: block; text-align: center; font-size: 11px; font-weight: 500; }
.daily-range__min, .daily-range__max {
  min-width: 26px;
  font-size: 12px;
  white-space: nowrap;
}
.daily-range__min { text-align: right; color: var(--text-sub); }
.daily-range__max { font-weight: 600; }
.daily-range__track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(120, 140, 160, 0.18);
}
body.night .daily-range__track { background: rgba(255, 255, 255, 0.14); }
.daily-range__seg {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent), #f5a34c);
}
.daily-range__seg--past { opacity: 0.55; } /* 昨天行色条淡化 */

/* 窄屏（iPhone 375-430px）：卡片内容区仅约 311px，压缩各列保证天气列四字单行、色条仍可见
   温度条弹性伸展（基准 98px、封顶 140px），天气列基准 52px，中段空白让给温度条 */
@media (max-width: 430px) {
  .daily-item { gap: 6px; }
  .daily-item__date { flex: 0 0 46px; font-size: 13px; }
  .daily-item .w-icon--md { width: 26px; height: 26px; }
  .daily-item__desc { font-size: 12px; }
  .daily-item__precip { flex: 0 0 30px; font-size: 11px; }
  .daily-item__wind { flex: 0 0 30px; margin-left: 0; font-size: 11px; }
  .daily-item__range { flex: 4 1 98px; max-width: 140px; gap: 4px; }
  .daily-range__min, .daily-range__max { min-width: 21px; font-size: 11px; }
  /* 顶部大卡上排两格：半宽格内收紧图标与字号，保证两位温度与状况文字单行显示 */
  .hero-card .current-card, .hero-card .astro-card { padding: 10px; }
  .current-card__hero { min-height: 68px; gap: 8px; }
  .current-card .w-icon--lg { width: 68px; height: 68px; }
  .current-card__meta { gap: 4px; }
  .current-card__temp { font-size: clamp(32px, 10.5vw, 42px); }
  .current-card__desc { font-size: 14px; letter-spacing: 0.1px; }
  .astro-times { font-size: 10px; }
  /* 温度对比右侧体感文字：与指标卡数值同级 18px，窄屏不降字号（已无内边距可收） */
  .range-compare-wrap { gap: 10px; }
  .range-compare-wrap .pill--feels { font-size: 18px; }
}

/* 小屏（≤375px）：风力详情三联卡收紧字号与图形，保证「阵风 ≈132 km/h」这类长值与标签不贴边 */
@media (max-width: 375px) {
  /* 云量示意图：窄屏收到 84x48（仍是 1.75 比例），给左侧百分比留出宽度 */
  .cloud-vis { width: 84px; height: 48px; border-radius: 12px; }
  /* 湿度水滴：窄屏收到 56x76（仍是 56:76 原始比例），给左侧百分比留出宽度 */
  .drop-vis { width: 56px; height: 76px; }
  .wind-panel { padding: 9px; }
  .wind-kv__k { font-size: 10px; }
  .wind-kv__v { font-size: 12px; }
  .wind-kv__unit { font-size: 8.5px; }
  .wind-figure { width: 66px; height: 66px; }
  /* 温度对比条：窄屏下压缩固定列宽与行内间距，把宽度尽量留给轨道 */
  .range-compare-wrap { gap: 9px; }
  .range-row { gap: 4px; }
  .range-row__label { min-width: 20px; }
  .range-bar__min, .range-bar__max { min-width: 22px; }
}

/* ---------- 三卡片行（云量 / 湿度 / 紫外线） ---------- */
.card-pair {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* 两卡片行（气压 / 能见度）：均分整行 */
.card-pair--2 { grid-template-columns: repeat(2, 1fr); }

/* 可点开详情的卡片按钮：沿用 .card 外观，补按钮样式重置 */
.metric-card {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.metric-card:active { transform: scale(0.97); }

.aqi-card__body { display: flex; align-items: baseline; gap: 8px; }

.aqi-value { font-size: 32px; font-weight: 700; line-height: 1; }

.aqi-level {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--card-border);
  font-weight: 600;
  white-space: nowrap;
}

/* AQI 等级色（文字色） */
.level-1 { color: #2e9e5b; }
.level-2 { color: #c28f1e; }
.level-3 { color: #d97b29; }
.level-4 { color: #cf4f43; }
.level-5 { color: #b03a5b; }
.level-6 { color: #8a3f6e; }

.aqi-card__pm { margin-top: 8px; font-size: 12px; color: var(--text-sub); }

/* ---------- 生活指数三宫格 ---------- */
/* 已整卡移除（洗车移到「未来」页，穿衣与运动随生活指数卡一并删掉） */

/* ---------- 页脚 ---------- */
/* 形式与原先一致（12px 次要小字，页脚而非卡内脚注），只改位置：
   抵消 .app 的列间距，紧贴最下侧卡片下方；不再用 margin-top:auto 把它甩到视口底部 */
.footer {
  margin-top: calc(-1 * var(--app-gap));
  padding: 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub);
}
.footer:empty { display: none; }

/* ---------- 遮罩 ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 20, 30, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.backdrop.show { opacity: 1; }

/* ---------- 底部弹层 ---------- */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  max-width: 480px;
  margin: 0 auto;
  background: #f7fafc;
  color: #2c3a47;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0.3, 1);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}

.sheet.open { transform: translateY(0); visibility: visible; }

.sheet__grip {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #c9d4de;
  margin: 2px auto 8px;
  flex-shrink: 0;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.sheet__title { font-size: 17px; font-weight: 600; }
.sheet__close { background: #eef2f6; border: none; box-shadow: none; color: #2c3a47; }

/* 搜索条 */
.search-bar { flex-shrink: 0; }

.search-bar__input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #d5dde5;
  background: #fff;
  font-size: 15px;
  outline: none;
}

.search-bar__input:focus { border-color: #3d82c6; }

/* 定位按钮 */
.locate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed #b7c6d4;
  background: #eef5fb;
  color: #3d82c6;
  font-size: 14px;
  flex-shrink: 0;
}

/* 搜索结果 */
.result-list { margin-top: 10px; overflow-y: auto; flex-shrink: 0; max-height: 32vh; }

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 10px;
  border: none;
  border-bottom: 1px solid #e7edf3;
  background: none;
  font-size: 15px;
  color: #2c3a47;
  text-align: left;
}

.result-item__admin { font-size: 12px; color: #8a99a8; margin-left: 8px; }

.result-empty {
  padding: 14px 10px;
  font-size: 13px;
  color: #8a99a8;
  text-align: center;
}

/* 最近查看 */
.recent-block { margin-top: 12px; flex-shrink: 0; }

.recent-block__title { font-size: 13px; color: #8a99a8; font-weight: 500; margin-bottom: 8px; }

.recent-list { display: flex; flex-wrap: wrap; gap: 8px; }

.recent-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #d5dde5;
  background: #fff;
  font-size: 13px;
  color: #2c3a47;
}

.recent-chip--active { border-color: #3d82c6; color: #3d82c6; background: #eef5fb; }

/* 设置弹层 */
.setting-group { margin-bottom: 16px; flex-shrink: 0; }

/* 设置弹层滚动区：头部固定，内容超出 78vh 时可上下滚动 */
.sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin: 0 -6px;
  padding: 0 6px;
}

/* ---------- 生活指数档位弹层 ---------- */
/* 与 AQI 等级卡同一套读法：色条 + 档位名 + 序号 + 说明，今日那一档整行加粗、色条点亮。
   但不给每档配不同颜色 —— 颜色在本产品里已被 AQI 与预警占用，且舒适度的序号不是单调的
   （5 极不舒适比 6 不舒适更极端），按序号取色会画出相反的深浅（详见 app.js 里 INDEX_LEVELS）。 */
.idx-sec { padding: 12px 0 2px; }
.idx-sec + .idx-sec { margin-top: 10px; padding-top: 14px; border-top: 1px solid #e7eef5; }
.idx-sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.idx-sec__title { font-size: 14px; font-weight: 600; color: #2c3a47; }
/* 今日档位放在标题右边：滚到下半屏时标题还在，不用回头找哪一行是高亮的 */
.idx-sec__now { flex: none; font-size: 12px; font-weight: 600; color: #3d82c6; }
.idx-sec__now.is-none { font-weight: 400; color: #93a2b0; }
.idx-lv-table { display: flex; flex-direction: column; gap: 9px; }
.idx-lv-row {
  display: grid;
  grid-template-columns: 3px 68px 34px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #5b6b7a;
}
.idx-lv-row__bar { width: 3px; height: 16px; border-radius: 2px; background: #e3e9ef; }
.idx-lv-row__name { white-space: nowrap; }
.idx-lv-row__lv { white-space: nowrap; color: #9aa8b5; font-variant-numeric: tabular-nums; }
.idx-lv-row__desc { line-height: 1.45; }
.idx-lv-row.is-now { color: #2c3a47; font-weight: 600; }
.idx-lv-row.is-now .idx-lv-row__bar { background: #3d82c6; }
.idx-lv-row.is-now .idx-lv-row__lv { color: #2c3a47; }
.idx-note { margin-top: 8px; font-size: 11px; line-height: 1.5; color: #93a2b0; }
.idx-foot {
  margin-top: 14px;
  padding-top: 10px;
  font-size: 11px;
  line-height: 1.5;
  color: #93a2b0;
  border-top: 1px solid #e7eef5;
}

.setting-label { display: block; font-size: 13px; color: #8a99a8; margin-bottom: 8px; }

/* 数据源固定后的只读值（替代原来的四条 radio） */
.setting-src { margin: 0; font-size: 15px; color: #2c3a47; }

.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  font-size: 15px;
  color: #2c3a47;
}

.token-row { display: flex; gap: 8px; }
/* API Host 是第二行输入，与 Key 那行拉开距离（原先靠 hidden 切换，不需要间距） */
#host-row { margin-top: 8px; }

.token-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d5dde5;
  font-size: 14px;
  outline: none;
}

.btn-primary {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: #3d82c6;
  color: #fff;
  font-size: 14px;
}

.setting-hint { margin-top: 8px; font-size: 12px; color: #8a99a8; line-height: 1.5; }

/* 和风请求额度：一条细进度条 + 两行明细。
   这里不是空气质量也不是预警，不借 AQI/预警的语义色，只用中性蓝，越界才转橙/红。 */
.quota-head { display: flex; align-items: baseline; justify-content: space-between; }

.quota-head .setting-label { margin-bottom: 8px; }

.quota-refresh {
  padding: 0 0 8px;
  border: none;
  background: none;
  font-size: 12px;
  color: #3d82c6;
}

.quota-refresh:active { opacity: 0.6; }

.quota { padding: 12px 14px 13px; border-radius: 12px; background: #eef2f6; }

.quota__sum { display: flex; align-items: baseline; gap: 6px; }

.quota__used {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  color: #2c3a47;
  font-variant-numeric: tabular-nums;
}

.quota__cap { font-size: 12px; color: #8a99a8; font-variant-numeric: tabular-nums; }

.quota__track {
  height: 6px;
  margin-top: 9px;
  border-radius: 3px;
  background: #dbe3ea;
  overflow: hidden;
}

.quota__fill {
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: #3d82c6;
  transition: width 0.35s ease;
}

/* 80% 提醒、95% 警示：只换填充色，不整块变红，避免弹层里一片高饱和 */
.quota__fill.is-warn { background: #d98324; }

.quota__fill.is-danger { background: #d9534f; }

.quota__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  font-size: 12px;
  color: #6b7a89;
  font-variant-numeric: tabular-nums;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  z-index: 200;
  max-width: 320px;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(30, 42, 56, 0.92);
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 加载 / 错误状态 ---------- */
.loading-bar {
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--card-border);
}

.loading-bar__inner {
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 2px;
  animation: loadingSlide 1.1s ease-in-out infinite;
}

@keyframes loadingSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}

.error-card {
  text-align: center;
  padding: 20px 16px;
}

.error-card p { font-size: 14px; color: var(--text-sub); margin-bottom: 12px; line-height: 1.6; }

.retry-btn {
  padding: 9px 22px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}

/* =========================================================
 * 动态天气场景（js/scenes.js 生成 DOM，这里定义样式与动画）
 * ========================================================= */
.scene { position: absolute; inset: 0; overflow: hidden; }

/* 太阳光芒 */
.scene-sun {
  position: absolute;
  top: -60px;
  right: -40px;
  width: 220px;
  height: 220px;
}

.scene-sun__core {
  position: absolute;
  inset: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 102, 0.95) 0%, rgba(255, 214, 102, 0.25) 70%, rgba(255, 214, 102, 0) 100%);
}

.scene-sun__rays {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 230, 150, 0.28) 0deg 6deg, rgba(255, 230, 150, 0) 6deg 30deg);
  -webkit-mask-image: radial-gradient(circle, transparent 30%, #000 45%, transparent 72%);
  mask-image: radial-gradient(circle, transparent 30%, #000 45%, transparent 72%);
  animation: sunSpin 60s linear infinite;
}

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

/* 云朵 */
.cloud {
  position: absolute;
  width: 130px;
  height: 38px;
  background: #fff;
  border-radius: 999px;
  opacity: 0.9;
  animation: cloudDrift linear infinite;
}

.cloud::before {
  content: "";
  position: absolute;
  width: 64px;
  height: 64px;
  background: inherit;
  border-radius: 50%;
  top: -30px;
  left: 20px;
}

.cloud::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  background: inherit;
  border-radius: 50%;
  top: -22px;
  left: 62px;
}

.cloud--dark { background: #eef1f5; }
.cloud--back { opacity: 0.55; transform-origin: center; }

@keyframes cloudDrift {
  from { transform: translateX(-160px); }
  to { transform: translateX(calc(100vw + 160px)); }
}

/* 星星 */
.star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  animation: starTwinkle ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  from { opacity: 0.25; }
  to { opacity: 1; }
}

/* 月亮 */
.scene-moon {
  position: absolute;
  top: 48px;
  right: 56px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f2f0e4;
  box-shadow: 0 0 40px 12px rgba(242, 240, 228, 0.35);
}

.scene-moon::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(43, 58, 78, 0.18);
  top: 14px;
  left: 16px;
  box-shadow: 22px 14px 0 -3px rgba(43, 58, 78, 0.14);
}

/* 雨滴 */
.raindrop {
  position: absolute;
  top: -40px;
  width: 2px;
  height: 26px;
  border-radius: 2px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75));
  animation: rainFall linear infinite;
}

@keyframes rainFall {
  0% { transform: translateY(0); }
  100% { transform: translateY(115vh); }
}

/* 雪花 */
.snowflake {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  animation: snowFall linear infinite;
}

@keyframes snowFall {
  0% { transform: translate(0, -10px) scale(1); }
  50% { transform: translate(16px, 55vh) scale(0.9); }
  100% { transform: translate(-6px, 112vh) scale(1); }
}

/* 雾带 */
.fogband {
  position: absolute;
  width: 130%;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(28px);
  animation: fogMove ease-in-out infinite alternate;
}

@keyframes fogMove {
  from { transform: translateX(-8%); }
  to { transform: translateX(8%); }
}

/* ---------- 动效降级：由 js/app.js 依据「背景动画」设置与系统偏好控制 ---------- */
/* body.no-motion 由 app.js 添加：用户选「关闭」，或「跟随系统」且系统开启减弱动效 */
body.no-motion *,
body.no-motion *::before,
body.no-motion *::after {
  animation: none !important;
  transition-duration: 0.01ms !important;
}

/* 弹层在无动画模式下仍需可见/隐藏正确 */
body.no-motion .sheet { visibility: hidden; }
body.no-motion .sheet.open { visibility: visible; }
