/* 鲁班天气 · 样式（移动端优先，自研实现） */

:root {
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-ink: #2b3a4e;
  --ink-soft: #6b7a8d;
  --accent: #3d7fd9;
  --radius: 18px;
  --tabbar-h: 62px;
  font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: #283649;
  color: var(--card-ink);
  overflow: hidden;
}

/* ============ 动态天气背景 ============ */
#app {
  position: relative;
  max-width: 480px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #4a90d9 0%, #6db3e8 55%, #a8d8f0 100%);
  transition: background 1.2s ease;
  overflow: hidden;
}
#app::before { /* 柔光装饰 */
  content: "";
  position: absolute; top: -80px; right: -100px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
#app::after {
  content: "";
  position: absolute; top: 120px; left: -120px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

#app[data-theme="clear-day"]   { background: linear-gradient(180deg, #3d7fd9 0%, #5aa7e6 50%, #9fd4f2 100%); --tabbar-bg: rgba(79,147,202,.84); }
#app[data-theme="clear-night"] { background: linear-gradient(180deg, #101c3a 0%, #1e3160 55%, #3a5590 100%); --tabbar-bg: rgba(26,43,84,.86); }
#app[data-theme="cloudy"]      { background: linear-gradient(180deg, #5b83ad 0%, #83a8c9 55%, #b9cede 100%); --tabbar-bg: rgba(115,148,177,.84); }
#app[data-theme="overcast"]    { background: linear-gradient(180deg, #5d7080 0%, #7f93a3 55%, #aebcc6 100%); --tabbar-bg: rgba(112,129,143,.84); }
#app[data-theme="rain"]        { background: linear-gradient(180deg, #3d566e 0%, #52708c 55%, #8fa9bd 100%); --tabbar-bg: rgba(72,99,123,.84); }
#app[data-theme="snow"]        { background: linear-gradient(180deg, #6d87a8 0%, #93aec9 55%, #d5e3ef 100%); --tabbar-bg: rgba(129,153,177,.84); }
#app[data-theme="fog"]         { background: linear-gradient(180deg, #77808a 0%, #98a1ab 55%, #c9cfd6 100%); --tabbar-bg: rgba(134,142,150,.84); }
#app[data-theme="thunder"]     { background: linear-gradient(180deg, #2c2f45 0%, #454a6b 55%, #6f7797 100%); --tabbar-bg: rgba(61,65,94,.86); }

/* 夜间模式文字反白 */
#app[data-theme="clear-night"], #app[data-theme="thunder"] {
  --card-bg: rgba(20, 32, 56, 0.82);
  --card-ink: #e8eefb;
  --ink-soft: #9db1d4;
}

/* 动漫天气动画层（weather-fx.js 动态插入） */
.hero-fx-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}

/* 气压趋势提示 */
.trend-chip {
  display: inline-block; margin-top: 8px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.78rem; letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.trend-chip[data-lv="bad"] { background: rgba(255, 120, 100, 0.32); border-color: rgba(255, 150, 130, 0.55); }
.trend-chip[data-lv="warn"] { background: rgba(255, 200, 90, 0.3); border-color: rgba(255, 215, 130, 0.55); }
.trend-chip[data-lv="good"] { background: rgba(110, 220, 150, 0.28); border-color: rgba(140, 230, 170, 0.55); }
.trend-chip[hidden] { display: none; }

/* 24h 列多模型一致率分歧点 */
.h-agree {
  display: block; width: 5px; height: 5px;
  border-radius: 50%; margin: 0 auto 2px;
}
.h-agree[data-lv="good"] { background: #4cd97b; }
.h-agree[data-lv="mid"] { background: #f0c14b; }
.h-agree[data-lv="low"] { background: #98a2ae; }

/* ============ 顶栏 ============ */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 8px;
  color: #fff;
  flex-shrink: 0;
}
.loc { display: flex; align-items: center; gap: 6px; cursor: pointer; min-width: 0; }
.loc-icon { display: flex; }
.loc-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.loc-text b { font-size: 1.25rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-text i { font-size: 0.72rem; font-style: normal; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 50%;
  background: rgba(255, 255, 255, 0.26); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  backdrop-filter: blur(4px);
}
.icon-btn:active { background: rgba(255, 255, 255, 0.32); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 搜索面板 ============ */
.search-panel {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(15, 25, 45, 0.55);
  backdrop-filter: blur(14px);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.search-panel[hidden] { display: none; }
.search-box { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 10px 12px; }
.search-box-icon { display: flex; color: #98a7ba; }
.search-box input { flex: 1; border: none; outline: none; font-size: 1rem; color: var(--card-ink); background: transparent; }
.search-close { border: none; background: none; color: var(--accent); font-size: 0.95rem; cursor: pointer; }
.search-results {
  list-style: none; background: #fff; border-radius: 12px;
  overflow-y: auto; max-height: 60vh;
}
.search-results:empty { display: none; }
.search-results li { padding: 13px 14px; border-bottom: 1px solid #f0f3f7; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.search-results li:last-child { border-bottom: none; }
.search-results li:active { background: #f2f7fd; }
.search-results .sr-name { font-weight: 600; font-size: 1rem; }
.search-results .sr-admin { color: var(--ink-soft); font-size: 0.8rem; text-align: right; }
.search-results .sr-empty { justify-content: center; color: var(--ink-soft); }

/* ============ 主体 ============ */
#main {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 14px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  position: relative; z-index: 2;
}

/* 主信息区 */
.hero { color: #fff; text-align: center; padding: 18px 8px 6px; text-shadow: 0 1px 6px rgba(0,0,0,0.18); }
.hero-temp { font-size: 6.2rem; font-weight: 200; line-height: 1.05; letter-spacing: -4px; }
.hero-temp em { font-style: normal; font-size: 3.4rem; font-weight: 200; vertical-align: 0.9rem; }
.hero-desc { font-size: 1.35rem; font-weight: 500; margin-top: 2px; }
.hero-range { font-size: 0.95rem; opacity: 0.92; margin-top: 6px; }
.hero-meta { font-size: 0.85rem; opacity: 0.8; margin-top: 4px; }
.hero-update { font-size: 0.7rem; opacity: 0.55; margin-top: 10px; }
.hero-update.warn { opacity: 1; color: #ffd666; }

/* 降水提醒横幅 */
.alert-banner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff; border-radius: 12px;
  padding: 10px 14px; margin: 10px 0 2px;
  font-size: 0.86rem;
  backdrop-filter: blur(6px);
}
.alert-banner[hidden] { display: none; }
.alert-icon { display: flex; }
.alert-icon svg { width: 18px; height: 18px; color: #bbdefb; }

/* 离线 / 历史数据 横幅 */
.offline-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  z-index: 50;
  background: linear-gradient(135deg, rgba(46, 64, 90, 0.92), rgba(70, 100, 130, 0.92));
  color: #ffe082; font-size: 0.78rem; font-weight: 500;
  padding: 10px 14px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: bannerIn 0.28s ease;
}
.offline-banner::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #ffb74d; box-shadow: 0 0 6px #ffb74d; flex: 0 0 auto;
}
.offline-banner[hidden] { display: none; }
@keyframes bannerIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 加载 */
.loading { text-align: center; color: #fff; padding: 40px 0 20px; background: transparent !important; box-shadow: none !important; }
.loading p { margin-top: 12px; font-size: 0.9rem; opacity: 0.9; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto;
  border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* ============ 卡片 ============ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-top: 12px;
  padding: 14px 16px 10px;
  box-shadow: 0 4px 18px rgba(10, 30, 60, 0.12);
  color: var(--card-ink);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 1px solid rgba(120, 140, 160, 0.14);
  margin-bottom: 12px;
}
.card-head h2 { font-size: 0.98rem; font-weight: 600; }
.card-sub { font-size: 0.72rem; color: var(--ink-soft); }

/* ---- 24小时 ---- */
.hourly-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 99%); mask-image: linear-gradient(90deg, #000 88%, transparent 99%); }
.hourly-scroll::-webkit-scrollbar { display: none; }
.hourly-inner { position: relative; }
.temp-curve { display: block; height: 74px; overflow: visible; }
.temp-curve .curve-area { fill: url(#curveGrad); opacity: 0.35; }
.temp-curve .curve-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.temp-curve .curve-dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.temp-curve .curve-temp { fill: var(--card-ink); font-size: 11px; font-weight: 600; text-anchor: middle; }
/* 降水概率曲线（叠加层） */
.temp-curve .curve-pop-area { fill: url(#popGrad); opacity: 0.55; }
.temp-curve .curve-pop-line { fill: none; stroke: #4fc1a8; stroke-width: 1.8; stroke-dasharray: 5 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.temp-curve .curve-pop-dot { fill: #4fc1a8; }
.temp-curve .curve-pop { fill: #4fc1a8; font-size: 9px; font-weight: 700; text-anchor: middle; }
/* 图例 */
.curve-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 0.72rem; color: var(--ink-soft);
  padding: 4px 2px 8px;
}
.curve-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.curve-legend .lg i {
  display: inline-block; width: 18px; height: 3px; border-radius: 2px;
}
.curve-legend .lg-temp i { background: var(--accent); height: 3px; }
.curve-legend .lg-pop i { background: #4fc1a8; background-image: linear-gradient(90deg, #4fc1a8 50%, transparent 50%); background-size: 6px 3px; height: 3px; }
.curve-legend[hidden] { display: none; }

.hourly-track { display: flex; }
.hour-col {
  flex: 0 0 62px; width: 62px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding-bottom: 10px;
}
.hour-col.now .h-label { color: var(--accent); font-weight: 700; }
.h-label { font-size: 0.72rem; color: var(--ink-soft); }
.hour-col svg { width: 26px; height: 26px; }
.h-temp { font-size: 0.95rem; font-weight: 600; }
.h-pop { font-size: 0.66rem; color: #4aa3e8; min-height: 0.9em; }

/* ---- 15天 ---- */
.daily-list { list-style: none; }
.daily-list li {
  display: grid;
  grid-template-columns: 76px 30px 1fr 118px;
  align-items: center; gap: 8px;
  padding: 9px 0; cursor: pointer;
  border-bottom: 1px solid rgba(120, 140, 160, 0.1);
}
.daily-list li:last-child { border-bottom: none; }
.daily-list li.today .d-day { color: var(--accent); font-weight: 700; }
.d-day { font-size: 0.86rem; }
.d-day small { display: block; font-size: 0.66rem; color: var(--ink-soft); font-weight: 400; }
.d-icon { display: flex; justify-content: center; }
.d-icon svg { width: 27px; height: 27px; }
.d-desc { font-size: 0.78rem; color: var(--card-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-bar { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.d-bar .t-min { color: var(--ink-soft); text-align: right; width: 36px; }
.d-bar .t-max { width: 30px; }
.bar-track {
  flex: 1; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, #74b6f2, #ffcf5c);
  position: relative; opacity: 0.9;
}
.bar-fill {
  position: absolute; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #57a7ea, #ffb03a);
}
.d-detail {
  grid-column: 1 / -1;
  display: none; padding: 8px 10px; margin-bottom: 4px;
  background: rgba(90, 150, 210, 0.08); border-radius: 10px;
  font-size: 0.76rem; color: var(--ink-soft); line-height: 1.7;
}
.daily-list li.expanded .d-detail { display: block; }

/* ---- 空气质量 ---- */
.air-body { display: flex; align-items: center; gap: 16px; padding-bottom: 8px; flex-wrap: wrap; }
.air-gauge { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.gauge-svg { width: 110px; height: 110px; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: rgba(120, 140, 160, 0.15); stroke-width: 9; }
.gauge-fg {
  fill: none; stroke: #00c853; stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 314; stroke-dashoffset: 314;
  transition: stroke-dashoffset 1s ease, stroke 0.5s;
}
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.gauge-center b { font-size: 1.9rem; font-weight: 600; line-height: 1; }
.gauge-center i { font-style: normal; font-size: 0.74rem; color: var(--ink-soft); margin-top: 3px; }
.air-desc { flex: 1; min-width: 130px; font-size: 0.84rem; line-height: 1.75; color: var(--ink-soft); }
.air-desc b { color: var(--card-ink); }
.pollutants { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; padding-bottom: 6px; }
.pollutant {
  background: rgba(90, 150, 210, 0.08);
  border-radius: 10px; padding: 8px 4px; text-align: center;
}
.pollutant i { display: block; font-style: normal; font-size: 0.66rem; color: var(--ink-soft); }
.pollutant b { font-size: 0.9rem; font-weight: 600; }
.pollutant .p-lv { font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 8px; color: #fff; display: inline-block; margin-top: 3px; }

/* ---- 生活指数 ---- */
.indices-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding-bottom: 8px; }
.index-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(90, 150, 210, 0.07); border-radius: 12px;
  padding: 12px 4px 10px; cursor: pointer; text-align: center;
}
.index-item svg { width: 26px; height: 26px; color: var(--accent); }
.index-item .ix-name { font-size: 0.72rem; color: var(--ink-soft); }
.index-item .ix-lv { font-size: 0.84rem; font-weight: 700; }
.index-item .ix-tip {
  display: none; font-size: 0.74rem; color: var(--ink-soft);
  line-height: 1.6; padding: 2px 6px; text-align: left;
}
.indices-grid.expanded .index-item { background: transparent; }
.indices-grid.expanded { grid-template-columns: 1fr; gap: 2px; }
.indices-grid.expanded .index-item { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 9px 8px; background: rgba(90,150,210,0.06); border-radius: 10px; }
.indices-grid.expanded .index-item .ix-tip { display: block; flex: 1; padding: 0; }
.indices-grid.expanded .index-item .ix-name, .indices-grid.expanded .index-item .ix-lv { min-width: 3.2em; }

/* ---- 今日详情 ---- */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-bottom: 8px; }
.d-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: rgba(90, 150, 210, 0.07); border-radius: 12px; padding: 13px 4px;
}
.d-item svg { width: 24px; height: 24px; color: var(--accent); }
.d-item .dt-name { font-size: 0.68rem; color: var(--ink-soft); }
.d-item .dt-val { font-size: 0.92rem; font-weight: 600; }
.d-item .dt-sub { font-size: 0.64rem; color: var(--ink-soft); }

/* ============ 城市面板 ============ */
.mask {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(10, 20, 35, 0.45); backdrop-filter: blur(3px);
}
.mask[hidden] { display: none; }
.city-panel {
  position: absolute; z-index: 31; inset: 0 0 auto 0;
  top: 8%; bottom: var(--tabbar-h);
  background: var(--card-bg); color: var(--card-ink);
  border-radius: 20px 20px 0 0;
  transform: translateY(105%); transition: transform 0.32s cubic-bezier(.32,.72,.28,1), visibility 0s linear .32s;
  visibility: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
  padding: 16px 16px 12px;
}
.city-panel.open { transform: translateY(0); visibility: visible; transition: transform 0.32s cubic-bezier(.32,.72,.28,1); }
.city-panel-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; }
.city-panel-head h3 { font-size: 1.05rem; }
.city-close { border: none; background: rgba(120,140,160,0.12); border-radius: 14px; padding: 5px 14px; font-size: 0.8rem; color: var(--ink-soft); cursor: pointer; }
.city-list { list-style: none; flex: 1; overflow-y: auto; padding: 0; margin: 0; }
.city-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid rgba(120,140,160,0.12); cursor: pointer;
}
.city-list li[data-id] { padding-left: 14px; }
.city-list .c-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.city-list .c-name { font-weight: 600; font-size: 0.98rem; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-list .c-name .tag { font-size: 0.62rem; color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 6px; font-weight: 400; flex: 0 0 auto; }
.city-list .c-name .tag-cache { background: #8aa1b8; }
.city-list .c-sub { font-size: 0.7rem; color: var(--ink-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-list .c-temp { font-size: 1.3rem; font-weight: 300; color: var(--ink-soft); margin-right: 4px; }
.city-list .c-del { border: none; background: none; color: var(--ink-soft); cursor: pointer; padding: 6px; display: flex; opacity: 0.6; }
.city-list .c-del svg { width: 16px; height: 16px; }
.city-list .city-empty { justify-content: center; color: var(--ink-soft); padding: 24px 8px; cursor: default; border: none; }

/* 省份/区域分组 */
.city-list .city-group { display: block; padding: 0; border-bottom: 1px solid rgba(120,140,160,0.12); }
.city-list .city-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 4px; cursor: pointer; user-select: none;
  background: rgba(120, 140, 160, 0.06);
  border-radius: 8px; margin: 8px 0 0;
}
.city-list .city-group-head:hover { background: rgba(120, 140, 160, 0.12); }
.city-list .city-group-head .caret {
  display: inline-block; width: 14px; text-align: center; color: var(--ink-soft);
  transition: transform 0.22s ease;
}
.city-list .city-group.collapsed .caret { transform: rotate(-90deg); }
.city-list .city-group-head .cg-name { font-weight: 600; font-size: 0.86rem; color: var(--card-ink); flex: 1; }
.city-list .city-group-head .cg-count {
  font-size: 0.7rem; color: var(--ink-soft);
  background: rgba(120, 140, 160, 0.18);
  border-radius: 10px; padding: 1px 8px;
}
.city-list .city-group-list { list-style: none; padding: 0; margin: 0; max-height: 9999px; overflow: hidden; transition: max-height 0.25s ease; }
.city-list .city-group.collapsed .city-group-list { max-height: 0; }
.city-list .city-group.collapsed { border-bottom-color: transparent; }
.city-list .city-group-list li:last-child { border-bottom: none; }
.city-add {
  margin-top: 10px; width: 100%;
  border: 1.5px dashed rgba(90, 140, 200, 0.5); background: rgba(90, 150, 210, 0.06);
  color: var(--accent); border-radius: 12px; padding: 12px;
  font-size: 0.9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.city-add svg { width: 16px; height: 16px; }
.city-tip { text-align: center; font-size: 0.68rem; color: var(--ink-soft); margin-top: 10px; opacity: 0.8; }

/* ============ 底部导航 ============ */
.tabbar {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: var(--tabbar-bg, rgba(15, 25, 42, 0.78));
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -6px 24px rgba(8, 15, 30, 0.35);
}
.tab {
  flex: 1; border: none; background: none; cursor: pointer;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.74rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: color .2s, transform .2s;
}
.tab svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }
.tab.active { color: #fff; font-weight: 600; }
.tab.active svg { filter: drop-shadow(0 0 7px rgba(255, 220, 130, .55)); transform: translateY(-1px); }

.typhoon-body { padding-bottom: 6px; }
.ty-empty { text-align: center; padding: 16px 8px; font-size: 0.84rem; color: var(--ink-soft); line-height: 1.8; }
.ty-empty span { display: block; font-size: 0.72rem; opacity: 0.75; }
.ty-item { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid rgba(120,140,160,0.1); }
.ty-item:last-of-type { border-bottom: none; }
.ty-ico { font-size: 1.5rem; animation: typhoon-spin 6s linear infinite; }
@keyframes typhoon-spin { to { transform: rotate(360deg); } }
.ty-info { flex: 1; min-width: 0; line-height: 1.5; }
.ty-info b { font-size: 0.95rem; }
.ty-info i { font-style: normal; font-size: 0.76rem; color: #ff7a45; margin-left: 4px; }
.ty-info span { display: block; font-size: 0.74rem; color: var(--ink-soft); }
.ty-track { border: none; border-radius: 999px; padding: 7px 13px; font-size: 0.78rem; cursor: pointer; background: #ff7a45; color: #fff; white-space: nowrap; }
.ty-upd { font-size: 0.66rem; color: var(--ink-soft); text-align: right; padding-top: 8px; }
.dis-sec { padding: 8px 0 4px; }
.dis-sec > b { display: block; font-size: 0.84rem; margin-bottom: 4px; color: var(--card-ink); }
.dis-ok { font-size: 0.8rem; color: #4cd97b; padding: 6px 0; }
.dis-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(120,140,160,0.08); }
.dis-mag { font-size: 0.95rem; font-weight: 700; color: #f0a74b; min-width: 3.2em; }
.dis-mag.big { color: #ff4d4f; }
.dis-info { flex: 1; min-width: 0; line-height: 1.5; }
.dis-info span { display: block; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dis-info i { font-style: normal; font-size: 0.7rem; color: var(--ink-soft); }
.dis-flood-top { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--ink-soft); padding: 4px 0; }
.dis-flood-top b { color: var(--card-ink); }
.dis-riskbar { display: flex; align-items: center; gap: 5px; padding: 4px 0 8px; }
.dis-riskbar i { width: 34px; height: 6px; border-radius: 3px; display: inline-block; }
.dis-riskbar b { font-size: 0.78rem; margin-left: 6px; }
.notify-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notify-btn { border: none; border-radius: 999px; padding: 9px 16px; font-size: 0.84rem; cursor: pointer; background: var(--accent, #3d7fd9); color: #fff; }
.notify-btn:disabled { opacity: 0.7; cursor: default; }
.notify-state { font-size: 0.74rem; color: var(--ink-soft); }
.notify-tip { font-size: 0.72rem; color: var(--ink-soft); line-height: 1.7; margin: 8px 0 0; }
.us-switch { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--card-ink); cursor: pointer; padding: 6px 0; }
.us-switch input { width: 18px; height: 18px; accent-color: var(--accent, #3d7fd9); }
.us-switch.us-auto { padding: 4px 0 10px; }
.us-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.us-row label { font-size: 0.8rem; color: var(--ink-soft); min-width: 3.5em; }
.us-row select { flex: 1; max-width: 220px; padding: 7px 8px; border-radius: 8px; border: 1px solid rgba(120,140,160,0.3); background: var(--card-bg); color: var(--card-ink); font-size: 0.8rem; }
.us-row input[type="range"] { flex: 1; accent-color: var(--accent, #3d7fd9); }
.us-row output { font-size: 0.74rem; color: var(--accent, #3d7fd9); min-width: 4.5em; }
.us-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.us-cats .us-switch { font-size: 0.8rem; }
/* AI 临近预报卡 */
.airadar-card { border: 1px solid rgba(90, 167, 230, 0.35); background: linear-gradient(160deg, rgba(90,167,230,0.14), var(--card-bg) 45%); }
.airadar-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #5aa7e6, #8f6fe8); color: #fff;
}
.airadar-main { font-size: 1.05rem; font-weight: 600; color: var(--card-ink); padding: 6px 0 10px; }
.airadar-tl { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; }
.airadar-tl .tl-seg { flex: 1; transition: background 0.3s; }
.airadar-tl-labels { display: flex; justify-content: space-between; font-size: 0.62rem; color: var(--ink-soft); margin: 4px 0 10px; }
.airadar-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.74rem; color: var(--ink-soft); margin-bottom: 10px; }
.airadar-conf { font-weight: 700; }
.airadar-text { font-size: 0.8rem; line-height: 1.7; color: var(--card-ink); background: rgba(120,150,190,0.08); border-radius: 10px; padding: 10px 12px; }
.foot-note { text-align: center; font-size: 0.66rem; color: rgba(255,255,255,0.55); margin: 18px 0 4px; line-height: 1.8; }
.foot-note[hidden] { display: none; }
.foot-icp { color: rgba(255,255,255,0.55); text-decoration: none; display: inline-block; margin-left: 6px; }
.foot-icp[hidden] { display: none; }
.site-announce {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 235, 160, 0.22);
  border: 1px solid rgba(255, 220, 130, 0.4);
  color: #fff; border-radius: 12px;
  padding: 10px 14px; margin: 0 0 2px;
  font-size: 0.84rem; line-height: 1.5;
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.site-announce[hidden] { display: none; }
/* App 更新弹窗 */
.update-modal {
  position: fixed; z-index: 90; left: 50%; top: 24%;
  transform: translateX(-50%);
  width: min(330px, 86vw);
  background: var(--card-bg);
  color: var(--card-ink);
  border-radius: 18px;
  padding: 22px 20px 18px;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
  animation: upd-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes upd-in { from { opacity: 0; transform: translateX(-50%) translateY(-24px) scale(0.94); } }
.upd-icon { font-size: 2.6rem; margin-bottom: 4px; }
.update-modal h3 { font-size: 1.1rem; margin: 0 0 2px; }
.upd-ver { font-size: 0.8rem; color: var(--accent, #5aa7e6); font-weight: 600; margin-bottom: 10px; }
.upd-log { list-style: none; text-align: left; margin: 0 0 16px; padding: 10px 12px; background: rgba(120, 150, 190, 0.1); border-radius: 12px; max-height: 180px; overflow-y: auto; }
.upd-log li { font-size: 0.8rem; line-height: 1.8; color: var(--ink-soft, #9db1d4); }
.upd-actions { display: flex; gap: 10px; }
.upd-btn { flex: 1; border: none; border-radius: 12px; padding: 11px 0; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.upd-btn.primary { background: linear-gradient(135deg, #4a90d9, #5aa7e6); color: #fff; }
.upd-btn.ghost { background: rgba(130, 160, 200, 0.15); color: var(--card-ink); }
.foot-link {
  border: none; background: none; cursor: pointer;
  font-size: inherit; color: rgba(255,255,255,0.72);
  text-decoration: underline; text-underline-offset: 3px; padding: 2px 4px;
}
.about-body { padding: 14px 18px 20px; overflow-y: auto; flex: 1; }
.about-body h4 { margin: 14px 0 6px; font-size: 0.92rem; color: var(--card-ink); }
.about-body h4:first-child { margin-top: 2px; }
.about-body ul { margin: 0; padding-left: 18px; }
.about-body li { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.9; }

/* ============ 下拉刷新提示 ============ */
.pull-hint {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1;
  text-align: center; color: rgba(255,255,255,0.85); font-size: 0.8rem;
  padding: 8px 0; pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}

/* ============ 错误提示 ============ */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(20, 30, 50, 0.88); color: #fff;
  padding: 9px 18px; border-radius: 20px; font-size: 0.82rem;
  z-index: 99; pointer-events: none; white-space: nowrap;
  animation: toastIn 0.25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ============ PC 大屏适配：手机框居中 ============ */
@media (min-width: 700px) {
  body {
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1200px 700px at 50% 20%, #31415a 0%, #1b2536 70%);
  }
  #app {
    height: min(880px, 94vh); width: 420px;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 10px rgba(0, 0, 0, 0.35);
  }
}
@media (max-width: 699px) {
  #app { max-width: none; width: 100%; }
}

/* 小屏微调 */
@media (max-width: 360px) {
  .hero-temp { font-size: 5.2rem; }
  .indices-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 天气粒子动画层 ============ */
#fxCanvas {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ============ 卡片入场动效 ============ */
#main .card { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
#main .card.in { opacity: 1; transform: none; }
.curve-line.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLine 1.2s .15s ease forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }

/* ============ 分钟级降水 ============ */
.minute-text { font-size: 0.95rem; font-weight: 600; margin-bottom: 12px; }
.minute-text.good { color: #2e9e5b; }
.minute-text.warn { color: #e07b28; }
.m-chart { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding-bottom: 2px; }
.m-empty {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink-soft); font-size: 0.86rem;
  background: rgba(46, 158, 91, 0.06); border-radius: 10px;
}
.m-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.m-col span { font-size: 0.62rem; color: var(--ink-soft); white-space: nowrap; }
.m-bar { flex: 1; width: 100%; max-width: 26px; display: flex; align-items: flex-end; background: rgba(90, 150, 210, 0.07); border-radius: 6px; overflow: hidden; }
.m-bar i {
  display: block; width: 100%; min-height: 3px;
  background: rgba(90, 150, 210, 0.28); border-radius: 6px 6px 0 0;
  transform-origin: bottom; animation: barUp .7s ease both;
}
.m-bar i.wet { background: linear-gradient(180deg, #57a7ea, #2e7dd1); }
@keyframes barUp { from { transform: scaleY(0); } }

/* ============ 雷达入口卡 ============ */
.radar-body { display: flex; align-items: center; gap: 14px; padding-bottom: 8px; }
.radar-desc { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.radar-desc b { font-size: 0.92rem; }
.radar-desc span { font-size: 0.74rem; color: var(--ink-soft); line-height: 1.5; }
.radar-desc .radar-sat { font-size: 0.68rem; opacity: 0.75; }
.radar-open {
  flex-shrink: 0; border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  font-size: 0.86rem; font-weight: 600;
  padding: 10px 16px; border-radius: 20px;
  box-shadow: 0 3px 10px rgba(61, 127, 217, 0.35);
}
.radar-open:active { transform: scale(0.96); }

/* ============ 雷达/卫星全屏地图 ============ */
.map-layer {
  position: absolute; inset: 0; z-index: 60;
  background: #0e1626; color: #e8eefb;
  display: flex; flex-direction: column;
}
.map-layer[hidden] { display: none; }
.map-top {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
  background: rgba(14, 22, 38, 0.92);
  z-index: 1000;
}
.map-back {
  border: none; background: rgba(255,255,255,0.12); color: #fff;
  border-radius: 16px; padding: 7px 14px; font-size: 0.85rem; cursor: pointer;
}
.map-top b { flex: 1; font-size: 0.98rem; }
.layer-tabs { display: flex; background: rgba(255,255,255,0.1); border-radius: 16px; padding: 2px; }
.layer-tab {
  border: none; background: none; color: rgba(255,255,255,0.7);
  font-size: 0.78rem; padding: 6px 14px; border-radius: 14px; cursor: pointer;
}
.layer-tab.active { background: #fff; color: #17233a; font-weight: 700; }
#radarMap { flex: 1; z-index: 1; }
.map-wx-canvas {
  position: absolute; inset: 0; z-index: 450;
  pointer-events: none;
}
.map-wxbar {
  padding: 6px 14px; font-size: 0.74rem; color: #cfe0f5;
  background: rgba(61, 127, 217, 0.25);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 1000;
}
#radarMap .rv-tiles { mix-blend-mode: normal; }
.map-ctrl {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: rgba(14, 22, 38, 0.94);
  z-index: 1000;
}
.play-btn {
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 1rem; cursor: pointer;
  flex-shrink: 0;
}
.timeline { flex: 1; accent-color: var(--accent); height: 4px; }
.tl-info { min-width: 92px; text-align: right; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.tl-info .fc-tag { color: #ffb300; }
.map-legend {
  display: flex; justify-content: center; gap: 12px;
  padding: 6px 10px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: rgba(14, 22, 38, 0.94); font-size: 0.68rem; color: #9db1d4;
  z-index: 1000;
}
.map-legend span { display: flex; align-items: center; gap: 4px; }
.map-legend i { width: 14px; height: 8px; border-radius: 3px; display: inline-block; }
body.no-scroll #main { overflow: hidden; }
/* Leaflet 容器底色 */
#radarMap { background: #0e1626; }
.leaflet-tooltip { background: rgba(20,30,50,.9); color: #fff; border: none; font-size: .8rem; }
.leaflet-tooltip-top:before { border-top-color: rgba(20,30,50,.9); }

/* ============ 墨迹式底部 Tab 分页 ============ */
.page { display: none; }
.page.active { display: block; animation: pageIn .3s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 我的页 */
.mine-card { margin-bottom: 12px; }
.mine-cur {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,.14);
}
.mine-cur-icon svg { width: 30px; height: 30px; }
.mine-cur-txt { flex: 1; min-width: 0; }
.mine-cur-txt b { display: block; font-size: 1.15rem; }
.mine-cur-txt i { font-style: normal; font-size: .85rem; opacity: .8; }
.mine-switch {
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12);
  color: inherit; border-radius: 999px; padding: 6px 16px; font-size: .85rem; cursor: pointer;
}
.mine-actions { display: flex; gap: 10px; padding-top: 12px; }
.mine-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1);
  color: inherit; border-radius: 12px; padding: 11px 8px; font-size: .92rem; cursor: pointer;
  transition: background .2s;
}
.mine-btn:active { background: rgba(255,255,255,.22); }
.mine-btn svg { width: 18px; height: 18px; }
.mine-list { display: flex; flex-direction: column; }
.mine-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: 0; color: inherit; text-align: left;
  padding: 13px 4px; font-size: .98rem; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.mine-row:last-child { border-bottom: 0; }
.mine-row svg { width: 20px; height: 20px; opacity: .9; }
.mine-row .mine-arrow { margin-left: auto; font-style: normal; opacity: .5; font-size: 1.2rem; line-height: 1; }
.mine-row .mine-val { margin-left: auto; font-weight: 600; opacity: .85; }
.mine-row.static { cursor: default; }
.mine-brand { text-align: center; font-size: .78rem; opacity: .55; padding: 12px 0 2px; }
