:root {
  --bg: #0b1d33;
  --panel: rgba(13, 26, 45, .88);
  --panel-border: rgba(120, 190, 255, .25);
  --text: #dce9f5;
  --muted: #8aa4bd;
  --accent: #3fa9f5;
  --accent2: #ffc83d;
  /* 顶部"使用警示条"的高度。只给首帧一个初值, 页面底部的小脚本会按文字实际换行后的高度
     回写到 <html> 上 —— 窄屏上提示语要折两三行, 写死高度会让下面的浮层压到条上。 */
  --law-h: 34px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--text); background: var(--bg); }
#map { position: absolute; inset: 0; background: #0a1a2c; }

/* ---------- 顶部使用警示条 ----------
 * 全站统一的一条法务提示, 固定在页面最上方(叠在地图之上, 不参与地图布局)。
 * 用实心警示红 + 白字, 亮/暗两套主题下都清晰, 因此不随 data-theme 变化。
 * 高度由 --law-h 给出, 下面的浮层统一按它下移(见文件末尾的"让位"段)。 */
.law-bar { position: absolute; z-index: 2400; left: 0; right: 0; top: 0; height: 30px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px 0 214px; overflow: hidden;
  background: linear-gradient(90deg, #8f1c12, #c0392b 42%, #c0392b 58%, #8f1c12);
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .5);
  color: #fff; font-size: 12.5px; line-height: 1.5; letter-spacing: .2px; }
.law-bar .ico { font-size: 13px; line-height: 1; flex: none; }
.law-bar b { color: #ffe9a8; }
.law-bar a { color: #ffe9a8; font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px; white-space: nowrap; }
.law-bar a:hover { color: #fff; }
/* 滚动字: 警示语从右向左循环滚动; 桌面端左侧给标题框让出位置(见"让位"段), 文字不被挡 */
.law-bar .marquee { flex: 1; height: 100%; overflow: hidden; display: flex; align-items: center; }
.law-bar .track { display: inline-block; white-space: nowrap; padding-left: 100%;
  animation: lawmarq 32s linear infinite; }
.law-bar .track span { padding-right: 44px; }
@keyframes lawmarq { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.olap { position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 500; }
#cv-cloud { z-index: 510; }
#cv-wind { z-index: 520; }
#cv-vec { z-index: 530; }

/* ---------- 顶部标题 ---------- */
/* 叠在地图上, 直接压字会被云图/风场的亮区吃掉对比度, 故加一层玻璃拟态底板(与右侧面板同源) */
.app-title { position: absolute; z-index: 1000; left: 14px; top: 12px;
  display: flex; gap: 10px; align-items: center; pointer-events: none;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 7px 13px; backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(0,0,0,.38);
  text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.app-title .logo { font-size: 26px; }
.app-title h1 { margin: 0; font-size: 18px; letter-spacing: 1px; }
.app-title h1 span { display: block; font-weight: 400; font-size: 11px; color: var(--accent); }
/* 第三行: 企划归属(比英文名再小一档、更淡) */
.app-title h1 span.org { font-size: 9.5px; letter-spacing: .3px; color: #9fc4e6; }
.app-title .ver-line { font-size: 11px; font-weight: 500; letter-spacing: .5px; color: #9fc4e6; }

/* ---------- 控制面板 ---------- */
.panel { position: absolute; z-index: 1100; top: 74px; right: 12px; width: 322px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  backdrop-filter: blur(8px); box-shadow: 0 8px 26px rgba(0,0,0,.35); font-size: 12.5px;
  max-height: calc(100% - 96px); overflow: hidden; display: flex; flex-direction: column; }
.tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,.08); }
.tabs .tab { flex: 1; padding: 9px 0; background: none; border: none; color: var(--muted);
  font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs .tab.on { color: #fff; border-bottom-color: var(--accent); }
.tabs.mini { border-bottom: none; margin-bottom: 6px; }
.tabs.mini .tab { padding: 5px 0; font-size: 12.5px; }
.tabpage { padding: 12px 12px 14px; overflow-y: auto; display: none; }
.tabpage.on { display: block; }
.subpage { display: none; }
.subpage.on { display: block; }

/* ---------- 抽屉把手(仅手机等窄屏, 见移动端段) ----------
   桌面是右上浮层, 没有也不需要有把手 —— 桌面收起面板用标签栏里的「收起 ›」按钮。 */
.panel-grab { display: none; }

/* ---------- 面板收起 / 展开 ---------- */
/* 收起后只留顶部这条标签条: 面板收窄到内容宽(不再占满 322px), 把被挡住的右上角地图让出来。
   三个标签仍在, 且点任一个都会自动展开(见 sim.js 的 wirePanel), 不用先去找收起按钮。 */
.panel-toggle { flex: none; padding: 0 11px; border: none; border-left: 1px solid rgba(255,255,255,.08);
  background: none; color: var(--muted); font-size: 12px; line-height: 1; white-space: nowrap; cursor: pointer; }
.panel-toggle:hover { color: var(--text); }
.panel-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.panel.collapsed { width: auto; }
.panel.collapsed .tabpage { display: none; }
.panel.collapsed .tabs { border-bottom: none; }
.panel.collapsed .tabs .tab { flex: 0 0 auto; padding: 9px 12px; }

.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.row.between { justify-content: space-between; }
.row label { flex: 0 0 auto; color: var(--muted); }

select, input[type="range"] { accent-color: var(--accent); }
select { background: #0e2a4a; color: var(--text); border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 5px 6px; font-size: 12px; width: 100%; }
.field { margin: 8px 0; }
.field label { display: block; margin-bottom: 4px; color: #cfe0ef; }
.field b { color: var(--accent2); }
input[type="range"] { width: 100%; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; }

.btn { background: #123b63; border: 1px solid var(--panel-border); color: var(--text);
  border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 12.5px; }
.btn:hover { background: #1a4a7c; }
.btn.primary { background: linear-gradient(90deg, #1c7ed6, #3fa9f5); border: none; color: #fff;
  font-weight: 600; }
.btn.wide { flex: 1; padding: 8px 0; }

.time-info { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
#time-date { font-size: 15px; font-weight: 700; color: #fff; }
#time-hour { font-size: 13px; color: var(--accent2); }
.muted { color: var(--muted); font-size: 11px; }
.note { margin-top: 10px; line-height: 1.7; border-top: 1px dashed rgba(255,255,255,.12); padding-top: 8px; }

.storm-cards { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.scard { background: rgba(20,48,84,.5); border: 1px solid rgba(255,255,255,.1); border-radius: 8px;
  padding: 6px 9px; cursor: pointer; transition: background .15s, border-color .15s; }
/* 可点击: 点击该卡片可重新显示已淡出的路径(见 sim.js revealStorm) */
.scard:hover { background: rgba(28,66,112,.62); border-color: rgba(140,200,255,.42); }
.scard .sc-head { display: flex; justify-content: space-between; font-weight: 600; }
.scard .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.scard table { width: 100%; border-collapse: collapse; margin-top: 3px; font-size: 11.5px; }
.scard td { padding: 1px 0; color: #c6d7e8; }
.scard td:last-child { text-align: right; color: #fff; }
.cat-chip { padding: 1px 6px; border-radius: 6px; color: #fff; font-size: 11px; }

/* 图层页 */
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button { background: #123b63; color: var(--text); border: 1px solid var(--panel-border);
  padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 11.5px; }
.seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
/* 不可用的选项(如气压场正在修复): 置灰并禁用点击 */
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.check { display: flex; align-items: center; gap: 7px; margin: 7px 0; cursor: pointer; }
.check input { accent-color: var(--accent); }

.legend { margin-top: 10px; border-top: 1px dashed rgba(255,255,255,.12); padding-top: 8px; }
.lg-title { color: var(--muted); margin-bottom: 4px; }
#wind-legend { width: 220px; height: 14px; }
.cat-legend { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11px; }
.cat-legend .it { display: flex; align-items: center; gap: 4px; }
.cat-legend .sw { width: 12px; height: 12px; border-radius: 3px; }

/* 历史列表 */
.real-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.real-item { display: flex; gap: 8px; align-items: center; background: #12365f; border-radius: 8px;
  padding: 7px 9px; cursor: pointer; border: 1px solid transparent; }
.real-item:hover { border-color: var(--accent); }
.real-item .nm { font-weight: 700; }
.real-item .mt { font-size: 11px; color: var(--muted); flex: 1; }
.real-item .go { color: var(--accent2); font-size: 15px; }
/* 数据来源标记(如"教学示意"): 面向使用者的来源说明, 小字加描边不喧宾夺主 */
.real-item .src { font-size: 10px; color: var(--muted); border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
/* 列表项可键盘操作(role=button + tabindex), 需要可见焦点 */
.real-item:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* 底部状态(仅保留时间线/网格/种子等技术信息) */
/* 与标题同理: 小字号灰字直接压在地图上会被亮区淹没, 加同款玻璃底板 */
.status { position: absolute; z-index: 1000; left: 14px; bottom: 14px; display: flex;
  gap: 12px; align-items: center; pointer-events: none;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px;
  padding: 5px 11px; backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(0,0,0,.38);
  text-shadow: 0 1px 4px rgba(0,0,0,.7); }

/* loading */
.loading { position: fixed; inset: 0; z-index: 2000; background: rgba(4,10,20,.82);
  display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; }
.loading.hidden { display: none; }
.spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,.15);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-sub { color: var(--muted); font-size: 12px; }

.toast { position: fixed; z-index: 2200; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: #e5484d; color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.toast.hidden { display: none; }

/* ---------- 鼠标位置读数(极小浮层; pointer-events:none 保证绝不挡住交互) ---------- */
.probe { position: absolute; z-index: 640; pointer-events: none; white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
  background: rgba(8,22,40,.84); border: 1px solid rgba(120,190,255,.28); border-radius: 6px;
  padding: 2px 6px; font-size: 11px; line-height: 1.5; color: #dbe9f7;
  text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.probe.hidden { display: none; }
.probe b { color: #fff; font-weight: 600; }
/* 风向箭头: 指向"风吹去的方向", 随气流旋转 */
.probe .dirar { width: 13px; height: 13px; flex: none; fill: #ffd23e;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }

/* ---------- 路径节点信息卡 ---------- */
/* 宽度写死(原 172px→150px)有个隐患: 浏览器若设了"最小字号", 实际渲染的字会比 CSS 指定的更大,
   此时定宽面板装不下 "2026-08-22 06:00"、"23.4°N, 138.7°E" 这类长值, 数值就会溢出到卡片外面。
   改用 max-content: 卡片宽度贴着内容走, 既不溢出, 也不会多留空白(通常比原来的 172px 还窄)。
   max-width 只是兜底, 防止某个超长地名/名称把卡片撑得过大。 */
.node-card { position: absolute; z-index: 650; width: max-content; max-width: 200px;
  background: rgba(10,26,46,.94); border: 1px solid rgba(120,190,255,.35); border-radius: 8px;
  /* 字号与下面的台风名标题(.nc-head b)取同一档, 整张卡片是统一的一个字号 */
  padding: 5px 7px 6px; font-size: 10.5px; line-height: 1.45; box-shadow: 0 8px 22px rgba(0,0,0,.5);
  backdrop-filter: blur(6px); }
.node-card.hidden { display: none; }
.node-card .nc-head { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.node-card .nc-head b { font-size: 10.5px; }
.node-card .nc-cat { margin-left: auto; padding: 1px 4px; border-radius: 5px; color: #fff; font-size: 9px; }
.node-card .nc-x { cursor: pointer; color: #9ab; margin-left: 3px; font-size: 11.5px; line-height: 1; }
.node-card .nc-x:hover { color: #fff; }
.node-card table { width: 100%; border-collapse: collapse; }
/* 不能让数值 nowrap —— 那会把定宽容器里的长值直接顶出卡片边界; 交给它自然折行,
   再加 overflow-wrap 兜住极长的无空格串, 任何字号下都不会跑到卡片外面去。 */
.node-card td { padding: 0; color: #c6d7e8; overflow-wrap: anywhere; }
.node-card td:first-child { padding-right: 10px; }   /* 标签与数值之间留一道缝 */
.node-card td:last-child { text-align: right; color: #fff; }

/* Leaflet 相关 */
.leaflet-control-attribution { font-size: 10px; background: rgba(0,0,0,.35) !important; color: #9ab !important; }
.leaflet-control-zoom a { background: #0e2a4a !important; color: var(--text) !important; }

/* ---------- 引导入口按钮(跳转独立引导页) ---------- */
.help-btn { position: absolute; z-index: 1050; left: 14px; top: 74px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  border-radius: 50%; border: 1px solid var(--panel-border); background: rgba(13,26,45,.85);
  color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.help-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 右上角: 亮色 / 暗色 主题切换 ---------- */
/* 按钮显示的是"点了会切到哪个主题"(暗色下显示 ☀ 亮色), 不靠悬停也能看懂;
   右侧面板从 top:74px 起, 本按钮只占 12~42px 那一段, 两者不重叠。 */
.theme-btn { position: absolute; z-index: 1050; right: 12px; top: 12px;
  display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--panel-border); background: rgba(13,26,45,.85);
  color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; line-height: 1;
  backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.theme-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.theme-btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* ---------- 左上: 本季 ACE 按钮(含进度条) / 本季 PDI / 各月 ACE 卡片 ---------- */
.ace-widget { position: absolute; z-index: 1050; left: 14px; top: 112px; width: 208px;
  padding: 8px 11px 10px; border-radius: 10px; border: 1px solid var(--panel-border);
  background: rgba(8,20,36,.78); backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35); pointer-events: none; }
.ace-label { font-size: 11.5px; color: #bcd3e8; letter-spacing: .5px; }
.ace-val { font-size: 12px; color: #fff; }
.ace-val b { font-size: 14.5px; color: var(--accent2); }
.ace-max { color: var(--muted); font-size: 10.5px; }
/* 本季 ACE: 整行(数值 + 进度条)就是一个按钮, 点击展开下方各月累计卡片 */
.ace-btn { display: block; width: 100%; margin: 0; padding: 2px 4px 4px; border: 0;
  border-radius: 7px; background: none; font: inherit; color: inherit; text-align: left;
  cursor: pointer; pointer-events: auto; }
.ace-btn:hover { background: rgba(255,255,255,.08); }
.ace-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ace-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.ace-caret { display: inline-block; margin-left: 5px; font-style: normal; font-size: 10px;
  color: var(--muted); transition: transform .15s ease; }
.ace-btn[aria-expanded="true"] .ace-caret { transform: rotate(180deg); }
.ace-track { display: block; position: relative; height: 8px; border-radius: 999px;
  overflow: hidden; background: rgba(255,255,255,.12); }
/* 渐变锚定在整条轨道上(而非填充元素本身): 用 clip-path 裁出"已累积"的一段。
   旧写法 background 铺在填充元素上, 渐变随宽度被拉伸 —— 同一个 ACE 值在
   10% 与 90% 时取到的颜色完全不同, 读起来像两套刻度。
   色阶也要按"ACE 值"分档铺满, 而不是把两档蓝摊在 0-55%: 本模拟一季 ACE 多在
   100-250(即 33%-83%), 若前 55% 只有蓝, 则整条填充永远落在蓝段 —— 看上去"只剩蓝色"。
   现按 6 档色相均分(蓝→青→绿→黄→橙→红), 任意进度下填充末端都有可读的颜色区分。 */
.ace-fill { display: block; position: absolute; inset: 0; clip-path: inset(0 100% 0 0);
  background: linear-gradient(90deg,
    #1c7ed6 0%, #2ea8de 20%, #3ad07e 42%, #ffd23e 64%, #ff9f43 82%, #ef5a5a 100%);
  transition: clip-path .18s linear; }
.ace-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.32); }
/* 超过典型活跃季(300): 满格, 并在末端补一段品红提示"已超出参照量级" */
.ace-widget.over .ace-fill { background: linear-gradient(90deg,
    #1c7ed6 0%, #2ea8de 15%, #3ad07e 32%, #ffd23e 48%, #ff9f43 63%, #ef5a5a 78%, #d4329e 100%); }
/* ACE 下方: 本季 PDI(与 ACE 同一套取样口径, 只给数值) */
.ace-sub { display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 6px; padding: 0 4px; }
.ace-sub .ace-val b { font-size: 13px; }
/* 各月 ACE 累计卡片: 位于 PDI 下方, 默认隐藏, 由按钮展开 */
.ace-months { margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,.14);
  pointer-events: auto; }
.ace-months.hidden { display: none; }
/* 一季最长可跨 13 个自然月, 行数多时在卡片内滚动, 避免顶到屏幕外 */
.am-list { max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.am-head { display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 7px; font-size: 11px; color: #bcd3e8; letter-spacing: .5px; }
.am-head .am-total { color: var(--muted); font-size: 10.5px; }
.am-head .am-total b { color: var(--accent2); font-size: 12.5px; }
.am-row { display: grid; grid-template-columns: 52px 1fr 42px; gap: 6px; align-items: center;
  margin: 3px 0; }
.am-row .am-m { font-size: 10px; color: #bcd3e8; font-variant-numeric: tabular-nums; }
/* 条形用"绝对刻度"(满格 50, 见卡片底部说明): 各行可直接横向比较、也能读出量级,
   不再随"当月最大值"等比拉伸(那样最大月恒为满格, 看不出真实多寡)。 */
.am-row .am-bar { height: 7px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.am-row .am-bar i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #1c7ed6, #3ad07e, #ffd23e, #ff9f43); }
.am-row .am-v { font-size: 11px; color: #fff; text-align: right; font-variant-numeric: tabular-nums; }
/* 不足月(季初那个月与尚未走完的当月)累计值天然偏低, 标记出来避免误判 */
.am-row.partial .am-m { color: var(--muted); }
.am-foot { margin-top: 7px; font-size: 10px; line-height: 1.5; color: var(--muted); }
.am-foot b { color: #bcd3e8; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }

/* ============================================================
   亮色主题(右上角按钮切换; 默认仍是原来的暗色)
   ------------------------------------------------------------
   本段只在 <html data-theme="light"> 时生效(见页面 <head> 里的防闪烁脚本与 sim.js 的 wireTheme)。
   上半部分是变量覆盖 —— 凡是走 var() 的地方自动跟着变;
   下半部分针对的是写死在暗色里的**表面色**(玻璃拟态底板、卡片、浮层、控件),
   它们在亮色下必须换成浅底深字: 否则深色半透明底板糊在浅色底图上会变成一片脏灰。
   地图叠加层(风场色块/粒子、路径、图标、色带)由 JS 直接绘制且本就按浅色底图调过色,
   不随主题变化, 故此处不涉及。
   ============================================================ */
html[data-theme="light"] {
  --bg: #eef4fb;
  --panel: rgba(255, 255, 255, .92);
  --panel-border: rgba(28, 80, 140, .22);
  --text: #1d2b3a;
  --muted: #5b7286;
  --accent: #1c7ed6;
  /* 暗色下的亮琥珀 #ffc83d 压在白底上几乎读不出来, 换深琥珀 */
  --accent2: #b26a00;
  --shadow: 0 6px 20px rgba(29, 43, 58, .14);
}
html[data-theme="light"] #map { background: #dfe9f3; }
/* 深色玻璃底板靠"黑投影 + 文字描边"跟地图拉开层次; 白底上这两样只会显脏 */
html[data-theme="light"] .app-title,
html[data-theme="light"] .status { text-shadow: none; box-shadow: var(--shadow); }
html[data-theme="light"] .app-title .ver-line { color: #4c6b88; }
html[data-theme="light"] .panel { box-shadow: var(--shadow); }
html[data-theme="light"] .tabs { border-bottom-color: rgba(29, 43, 58, .12); }
html[data-theme="light"] .tabs .tab.on { color: var(--accent); }
html[data-theme="light"] .panel-toggle { border-left-color: rgba(29, 43, 58, .12); }
html[data-theme="light"] select,
html[data-theme="light"] .btn,
html[data-theme="light"] .seg button,
html[data-theme="light"] .real-item { background: #fff; border-color: rgba(28, 80, 140, .28); }
html[data-theme="light"] .btn:hover,
html[data-theme="light"] .real-item:hover { background: #e8f2fc; }
/* 但上面那条白底覆盖会连"主操作按钮"一起刷白 —— 而它们的文字是白字(.btn.primary 与分段按钮的选中态),
   白底白字等于按钮整个消失。这两类本来就是「蓝底白字」的实心按钮, 在浅底页面上照样清晰,
   只需把蓝换成亮色主题里更深的那支(--accent 已是 #1c7ed6), 保证白字对比度够。 */
html[data-theme="light"] .btn.primary { background: linear-gradient(90deg, #1668b3, #1c7ed6); color: #fff; }
html[data-theme="light"] .btn.primary:hover { background: linear-gradient(90deg, #125a9e, #1a72c2); }
html[data-theme="light"] .seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
/* 同理: 这两个圆形按钮悬停时本该转成蓝底白字, 也会被白底规则盖掉 */
html[data-theme="light"] .help-btn:hover,
html[data-theme="light"] .theme-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
html[data-theme="light"] .field label { color: #35506b; }
html[data-theme="light"] #time-date { color: #12202e; }
html[data-theme="light"] .note,
html[data-theme="light"] .legend { border-top-color: rgba(29, 43, 58, .12); }
html[data-theme="light"] .scard { background: #fff; border-color: rgba(28, 80, 140, .18); }
html[data-theme="light"] .scard:hover { background: #e8f2fc; border-color: rgba(28, 80, 140, .45); }
html[data-theme="light"] .scard td { color: #4c6b88; }
html[data-theme="light"] .scard td:last-child { color: #12202e; }
html[data-theme="light"] .help-btn,
html[data-theme="light"] .theme-btn { background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); }
html[data-theme="light"] .loading { background: rgba(238, 244, 251, .86); }
html[data-theme="light"] .spinner { border-color: rgba(29, 43, 58, .15); }
html[data-theme="light"] .toast { box-shadow: var(--shadow); }
html[data-theme="light"] .probe { background: rgba(255, 255, 255, .94); border-color: rgba(28, 80, 140, .3);
  color: #22384d; text-shadow: none; box-shadow: var(--shadow); }
html[data-theme="light"] .probe b { color: #0f1c29; }
/* 风向箭头是深色描边加投影; 浅底上换成亮描边 */
html[data-theme="light"] .probe .dirar { filter: drop-shadow(0 1px 1px rgba(255, 255, 255, .95)); }
html[data-theme="light"] .node-card { background: rgba(255, 255, 255, .96);
  border-color: rgba(28, 80, 140, .3); box-shadow: var(--shadow); }
html[data-theme="light"] .node-card td { color: #4c6b88; }
html[data-theme="light"] .node-card td:last-child { color: #12202e; }
html[data-theme="light"] .node-card .nc-x { color: #7b93a8; }
html[data-theme="light"] .node-card .nc-x:hover { color: #12202e; }
html[data-theme="light"] .leaflet-control-attribution { background: rgba(255, 255, 255, .78) !important; color: #4c6b88 !important; }
html[data-theme="light"] .leaflet-control-zoom a { background: #fff !important; color: var(--text) !important;
  border-color: rgba(28, 80, 140, .25) !important; }
html[data-theme="light"] .ace-widget { background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); }
html[data-theme="light"] .ace-label,
html[data-theme="light"] .am-head,
html[data-theme="light"] .am-row .am-m,
html[data-theme="light"] .am-foot b { color: #4c6b88; }
html[data-theme="light"] .ace-val,
html[data-theme="light"] .am-row .am-v { color: #12202e; }
html[data-theme="light"] .ace-btn:hover { background: rgba(28, 80, 140, .08); }
html[data-theme="light"] .ace-track,
html[data-theme="light"] .am-row .am-bar { background: rgba(29, 43, 58, .12); }
html[data-theme="light"] .ace-tick { background: rgba(29, 43, 58, .3); }
html[data-theme="light"] .ace-months { border-top-color: rgba(29, 43, 58, .14); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(29, 43, 58, .22); }

/* ============================================================
   移动端适配(手机 / 窄窗口)
   ------------------------------------------------------------
   断点 760px。桌面那套"右上角 322px 浮层面板 + 左侧挂件"放到手机上会把地图整个盖住,
   这里改成:
   ① 控制面板变**贴底抽屉**(全宽、带把手、可收起只留标签条), 地图留在上半屏;
   ② 左上按 标题 → 状态条 → ACE 挂件 竖排, 右上按 主题 → 帮助 → 缩放 竖排, 两侧互不重叠;
   ③ 所有可点元素抬到 ≥38px 高(手指可靠点按的下限), 复选框/滑块一并放大;
   ④ 输入框字号 ≥16px —— iOS 上小于 16px 时聚焦会强制放大整页且不复原;
   ⑤ 适配刘海屏/底部横条(env(safe-area-inset-*), 需页面 viewport 带 viewport-fit=cover)
      与 iOS 动态视口高度(dvh: 地址栏收起时不再留一条空白);
   ⑥ 触摸设备没有光标, 跟随光标的读数浮层(.probe)直接隐藏, 免得点一下就残留在屏幕上。
   放在亮色段之后: 需要覆盖同一属性时统一加 html[data-theme="light"] 前缀,
   不重复声明亮色段已改过的属性(否则会把浅色底重刷回深色)。
   ============================================================ */
@media (max-width: 760px) {
  /* ---------- 视口 ---------- */
  html, body { height: 100%; overscroll-behavior: none;    /* 禁掉下拉橡皮筋, 免得拖地图时整页跟着弹 */
    -webkit-tap-highlight-color: transparent; }            /* 去掉 iOS/安卓点按时的灰色闪块 */
  @supports (height: 100dvh) { html, body { height: 100dvh; } }
  #map { inset: 0; }

  /* ---------- 左上: 标题 → 状态条 → ACE 挂件 ---------- */
  .app-title { left: 8px; top: calc(8px + env(safe-area-inset-top, 0px));
    padding: 5px 10px; gap: 8px; border-radius: 10px;
    max-width: calc(100% - 92px); }   /* 右侧给主题/帮助两个圆按钮留位 */
  .app-title .logo { font-size: 20px; }
  .app-title h1 { font-size: 15px; letter-spacing: .5px; }
  .app-title h1 span { font-size: 10px; }
  .app-title .ver-line { font-size: 10px; }

  /* 状态条原本贴左下, 会被底部抽屉压掉 —— 挪到标题正下方 */
  .status { left: 8px; right: auto; bottom: auto; top: calc(54px + env(safe-area-inset-top, 0px));
    max-width: 62vw; padding: 3px 8px; gap: 8px; font-size: 10.5px; border-radius: 8px; }
  .status .muted { font-size: 10.5px; }

  .ace-widget { left: 8px; top: calc(84px + env(safe-area-inset-top, 0px));
    width: min(56vw, 186px); padding: 6px 9px 8px; }
  .am-list { max-height: 30vh; }      /* 展开各月卡片后仍要给地图留出空间 */

  /* ---------- 右上: 主题 → 帮助 → 缩放 ---------- */
  .theme-btn { right: 8px; top: calc(8px + env(safe-area-inset-top, 0px));
    height: 30px; padding: 0 9px; font-size: 11.5px; }
  .help-btn { left: auto; right: 8px; top: calc(42px + env(safe-area-inset-top, 0px));
    width: 30px; height: 30px; }
  .leaflet-top.leaflet-right { top: calc(78px + env(safe-area-inset-top, 0px)) !important; }
  .leaflet-control-zoom a { width: 34px !important; height: 34px !important;
    line-height: 32px !important; font-size: 18px !important; }
  /* 底图版权条在右下角, 会被贴底抽屉整个压掉(各底图许可都要求署名) —— 抬到抽屉之上 */
  .leaflet-bottom { bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important; }
  .leaflet-control-attribution { max-width: 58vw; }

  /* ---------- 控制面板 → 贴底抽屉 ---------- */
  .panel { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none;
    max-height: 62vh;                        /* 老浏览器: 用 vh */
    border-radius: 16px 16px 0 0; border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 26px rgba(0, 0, 0, .45); }
  @supports (max-height: 62dvh) { .panel { max-height: 62dvh; } }
  /* 手机上的收起/展开统一走顶部把手: 标签栏里那个「收起 ›」按钮是同一个功能的第二个入口,
     与把手并排时反而让人不知道该点哪个 —— 窄屏直接隐藏(桌面保留, 那边没有把手)。 */
  .panel-toggle { display: none; }
  .panel-grab { display: block; position: absolute; left: 0; right: 0; top: 0; height: 22px;
    padding: 0; border: 0; background: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent; }
  /* 把手横杠(图形): 与 iOS 底部抽屉的 grabber 同形, 提示"这里可以拖/点" */
  .panel-grab::before { content: ''; display: block; width: 38px; height: 4px; margin: 8px auto 0;
    border-radius: 999px; background: rgba(255, 255, 255, .32); }
  html[data-theme="light"] .panel-grab::before { background: rgba(29, 43, 58, .25); }
  .panel-grab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .panel.collapsed { width: auto; }          /* 抽屉全宽, 收起只是变矮 */

  .tabs { padding-top: 22px; }               /* 让开把手(它 absolute 盖在面板顶部 22px) */
  .tabs .tab { padding: 13px 0; font-size: 13.5px; }
  /* 收起态: 桌面那条"标签收窄到内容宽"的规则会把标签挤到左边、右侧留一大片空白;
     抽屉是全宽的, 让三个标签平分整条更像是 tab bar。 */
  .panel.collapsed .tabs .tab { flex: 1; padding: 13px 14px; }
  .tabs.mini .tab { padding: 9px 0; }
  .tabpage { padding: 10px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch; }

  /* ---------- 触控目标 ---------- */
  .btn { min-height: 42px; padding: 10px 12px; font-size: 13.5px; }
  .btn.wide { padding: 10px 0; }
  .seg button { min-height: 38px; padding: 8px 12px; font-size: 12.5px; }
  .real-item { min-height: 46px; padding: 9px 11px; }
  .scard { padding: 9px 11px; }
  .check { min-height: 40px; margin: 4px 0; font-size: 13px; }
  .check input { width: 18px; height: 18px; }
  #slider-time { height: 32px; }             /* 时间轴: 加高盒子即加大可拖区域 */
  /* 表单控件: 字号 ≥16px 才不会让 iOS 聚焦时整页放大; 顺手跟 select 统一成深底浅字 */
  select { font-size: 16px; padding: 9px 8px; min-height: 42px; }
  input[type="number"], input[type="datetime-local"] {
    width: 100%; font-size: 16px; padding: 9px 8px; min-height: 42px;
    background: #0e2a4a; color: var(--text);
    border: 1px solid var(--panel-border); border-radius: 6px; }
  html[data-theme="light"] input[type="number"],
  html[data-theme="light"] input[type="datetime-local"] {
    background: #fff; color: var(--text); border-color: rgba(28, 80, 140, .28); }

  /* ---------- 浮层 / 卡片 ---------- */
  .storm-cards { max-height: 150px; }
  #wind-legend { width: 100%; height: 14px; }   /* 定宽 220px 在窄屏会溢出面板 */
  .node-card { font-size: 12px; max-width: min(72vw, 240px); padding: 7px 9px 8px; }
  .node-card .nc-head b { font-size: 12px; }
  .node-card .nc-cat { font-size: 10px; }
  .node-card .nc-x { font-size: 16px; }
  .probe { display: none !important; }          /* 没有光标, 留着只会残留 */
  .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    max-width: 88vw; text-align: center; }
  .loading-sub { font-size: 11.5px; max-width: 82vw; text-align: center; }
}

/* 横屏(矮屏): 上下空间都很紧, 进一步压缩顶部挂件、把抽屉放高一点 */
@media (max-height: 460px) and (max-width: 900px) {
  .app-title { padding: 4px 9px; }
  .app-title h1 { font-size: 14px; }
  .status { top: calc(50px + env(safe-area-inset-top, 0px)); max-width: 52vw; }
  .ace-widget { top: calc(76px + env(safe-area-inset-top, 0px)); width: min(44vw, 170px); }
  .am-list { max-height: 24vh; }
  .leaflet-top.leaflet-right { top: calc(70px + env(safe-area-inset-top, 0px)) !important; }
  .panel { max-height: 76vh; }
  @supports (max-height: 76dvh) { .panel { max-height: 76dvh; } }
  .storm-cards { max-height: 110px; }
}

/* 触摸设备(含平板): 一律不显示跟随光标的读数浮层 */
@media (hover: none) and (pointer: coarse) {
  .probe { display: none !important; }
}

/* ============================================================
   顶部使用警示条的"让位"
   ------------------------------------------------------------
   上面所有浮层原本都以视口顶边为 0 定位; 警示条占了最上面 `--law-h` 那一条,
   这里把顶部各挂件整体下移相同的量, 免得被条压住(缩放按钮是 Leaflet 自带的,
   要加 !important 才盖得过它的内联样式)。
   放在文件最后: 同权重下后者生效, 因此不必回头逐条去改上面的 top 值;
   各断点的小偏移(8/42/54/78/84px)照抄上面的原值, 只多一个 + --law-h。
   贴底抽屉(.panel)在窄屏是 bottom 定位, 这里按宽度把 top 还原成 auto。 */
.app-title { top: 0; z-index: 2500; }   /* 桌面端标题框直接叠在横幅上(横幅左侧已留白, 不挡滚动字) */
.theme-btn  { top: calc(var(--law-h) + 12px); }
.help-btn   { top: calc(var(--law-h) + 74px); }
.panel      { top: calc(var(--law-h) + 74px); }
.ace-widget { top: calc(var(--law-h) + 112px); }
.panel      { max-height: calc(100% - var(--law-h) - 96px); }

@media (max-width: 760px) {
  .law-bar    { padding: 0 12px; }   /* 窄屏标题框改到横幅下方, 横幅恢复整行滚动 */
  .app-title  { top: calc(var(--law-h) + 8px + env(safe-area-inset-top, 0px)); z-index: 1000; }
  .theme-btn  { top: calc(var(--law-h) + 8px + env(safe-area-inset-top, 0px)); }
  .status     { left: 8px; right: auto; top: auto; bottom: 8px; max-width: 70vw; }  /* 移到底部, 不再与标题框重叠 */
  .help-btn   { top: calc(var(--law-h) + 42px + env(safe-area-inset-top, 0px)); }
  .ace-widget { top: calc(var(--law-h) + 84px + env(safe-area-inset-top, 0px)); }
  .leaflet-top.leaflet-right { top: calc(var(--law-h) + 78px + env(safe-area-inset-top, 0px)) !important; }
  .panel { top: auto; max-height: 62vh; }
}
@media (max-width: 760px) {
  @supports (max-height: 62dvh) { .panel { max-height: 62dvh; } }
}

@media (max-height: 460px) and (max-width: 900px) {
  .status     { top: auto; bottom: 8px; }
  .ace-widget { top: calc(var(--law-h) + 76px + env(safe-area-inset-top, 0px)); }
  .leaflet-top.leaflet-right { top: calc(var(--law-h) + 70px + env(safe-area-inset-top, 0px)) !important; }
  .panel { max-height: 76vh; top: auto; }
  @supports (max-height: 76dvh) { .panel { max-height: 76dvh; } }
}
