: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%); } }
/* 关闭按钮: 提示语滚满 3 遍后才淡入可点(计时见页面底部脚本), 点后整条向上收起 */
.law-bar .law-close { flex: none; width: 22px; height: 22px; margin-left: 4px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 6px; cursor: pointer;
  background: rgba(0, 0, 0, .18); color: #fff; font: inherit; font-size: 15px; line-height: 1;
  opacity: 0; transform: scale(.8); pointer-events: none;
  transition: opacity .35s ease, transform .35s ease, background .15s ease; }
.law-bar.law-closable .law-close { opacity: .85; transform: none; pointer-events: auto; }
.law-bar .law-close:hover { background: rgba(0, 0, 0, .45); }
.law-bar .law-close:focus-visible { outline: 2px solid #ffe9a8; outline-offset: 1px; }
.law-bar.law-hidden { height: 0; border-bottom-width: 0; box-shadow: none; opacity: 0; overflow: hidden;
  transition: height .28s ease, opacity .28s ease; }
.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-grid { z-index: 525; }
#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; }

/* ---------- 统一身份角标(标题框内、版本行末尾) ----------
 * 未登录时是一枚「统一身份登录」小药丸, 登录后变成「昵称 + 退出」。
 * 标题框整体 pointer-events: none(免得挡住地图拖动), 角标要单独放开才点得到;
 * 内容由 js/auth.js 按 /api/auth/me 的结果填, 没接统一身份时元素保持空、不占位置。 */
.auth-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 9px;
  pointer-events: auto; font-size: 10.5px; letter-spacing: .3px; vertical-align: baseline; }
.auth-chip:empty { display: none; }
.auth-chip b { font-weight: 600; color: #ffd97a; }
.auth-chip a { padding: 1px 9px; border-radius: 999px; border: 1px solid var(--panel-border);
  color: var(--accent); background: rgba(255, 255, 255, .06); text-decoration: none; font-weight: 600; }
.auth-chip a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-chip a:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* ---------- 控制面板 ---------- */
.panel { position: absolute; z-index: 1100; top: 74px; right: 12px; width: 338px;
  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); }
/* 外层四个标签的文案是 5 个字(种子/模拟、导出/存档), 13px 下相邻两个几乎贴在一起,
   降到 12.5px 并把面板放宽 16px —— 四个标签各留出约 7px 的左右余白。 */
.tabs .tab { flex: 1; padding: 9px 0; background: none; border: none; color: var(--muted);
  font-size: 12.5px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.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); }
/* 种子码: 四段并排一行(强度 / 类型 / 位移 / 编号)。前三项是选择式, 从结构上排除非法输入;
   选项里只写代码本身(0.25…4 / old…wpsh / 0|1), 中文含义在 title 与下方提示里。
   没有位移的类型(如 old / 副高)那一格只显示「—」并置灰, 点不动。
   列宽按内容分配: 类型那一段最长(nino / wpsh 四个字母), 给它最大的一份。 */
.seed4 { display: grid; grid-template-columns: .8fr 1.4fr .7fr 1fr; gap: 5px; }
.seed4 select, .seed4 input { width: 100%; min-width: 0; }
.seed4 select { padding: 5px 2px 5px 6px; font-size: 12px; }
.seed4 select:disabled, .seed4 input:disabled { opacity: .5; cursor: not-allowed; }
.seed4 input[type="number"] { background: #0e2a4a; color: var(--text); border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 5px 6px; font-size: 12px; }
html[data-theme="light"] .seed4 input[type="number"] { background: #fff; border-color: rgba(28, 80, 140, .28); }
.seed-hint { margin-top: 5px; line-height: 1.55; }
.seed-hint b { color: var(--accent2); font-weight: 600; }
.seed-hint i { font-style: normal; color: #9fb6cc; }
/* ---------- 服务器存档 ----------
   存档页最下面那一块: 一行「名字 + 存到服务器」, 下面是把服务器上已有的档列出来(载入 / 删除)。
   条目是两行小字 —— 名字一行(长了省略号), 时间与大小一行, 右边两个按钮不参与换行。 */
.srv-name { flex: 1 1 auto; min-width: 0; background: #0e2a4a; color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 6px; padding: 5px 6px; font-size: 12px; }
.srv-name::placeholder { color: #7d94a9; }
html[data-theme="light"] .srv-name { background: #fff; border-color: rgba(28, 80, 140, .28); }
.srv-list { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.srv-item { display: flex; align-items: center; gap: 5px; padding: 5px 6px; border-radius: 7px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.srv-item .srv-meta { flex: 1 1 auto; min-width: 0; }
.srv-item .srv-meta b { display: block; font-size: 12px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 时间 · 大小 · 类型 挤在一行: 宁可尾部省略号, 也不要折成两行把条目撑高 */
.srv-item .srv-meta span { display: block; font-size: 11px; color: var(--muted); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 一行要放下「载入 / 下载 / 删除」三个按钮, 338px 的面板里内边距得收一点;
   载入是主动作, 给它主色描边 —— 以前三个按钮一样淡, 玩家常看不出哪一个是"取回来"。 */
.srv-item button { flex: none; padding: 3px 6px; border-radius: 5px; font-size: 11px; cursor: pointer;
  background: none; border: 1px solid rgba(255, 255, 255, .16); color: var(--text); }
.srv-item button.ld { color: var(--accent); border-color: rgba(63, 169, 245, .45); }
.srv-item button.ld:hover { background: rgba(63, 169, 245, .12); border-color: var(--accent); }
.srv-item button:hover { border-color: var(--accent); color: var(--accent); }
.srv-item button.del { color: #ff9c9c; border-color: rgba(255, 140, 140, .3); }
.srv-item button.del:hover { background: rgba(255, 90, 90, .12); border-color: #ff9c9c; color: #ffc2c2; }
.srv-item button:disabled { opacity: .5; cursor: default; }
.srv-empty { font-size: 11.5px; color: var(--muted); padding: 2px 1px; }
html[data-theme="light"] .srv-item { background: rgba(29, 43, 58, .03); border-color: rgba(29, 43, 58, .1); }
html[data-theme="light"] .srv-item button { border-color: rgba(29, 43, 58, .18); }
html[data-theme="light"] .srv-item button.ld { color: #1c6fb8; border-color: rgba(28, 111, 184, .45); }
html[data-theme="light"] .srv-item button.del { color: #b42318; border-color: rgba(180, 35, 24, .28); }
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;
  flex: none; }
/* 可点击: 点击该卡片可重新显示已淡出的路径(见 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; }
/* 台风卡的 SMCY 彩色底纹: 整卡铺一段随等级变色的底, 表格压在一层深色玻璃上(见 sim.js setCardBg) */
.scard { position: relative; overflow: hidden; }
.scard .sc-bg { position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  border-radius: 7px; pointer-events: none; z-index: 0; }
.scard.has-bg, .scard.has-bg:hover { background: rgba(9,19,33,.74);
  border-color: rgba(255,255,255,.18); color: #eaf3fb; }
.scard.has-bg > .sc-head, .scard.has-bg > table { position: relative; z-index: 1; }
/* 底纹是彩色的, 白字压一层投影才在亮黄、亮橙的底上也立得住 */
.scard.has-bg .sc-head, .scard.has-bg table { text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
/* 底纹是彩色的 —— 浅色主题下原本的深字会糊在深色玻璃上, 这两种卡一律改回浅字 */
html[data-theme="light"] .scard.has-bg, html[data-theme="light"] .scard.has-bg:hover {
  background: rgba(9,19,33,.74); border-color: rgba(255,255,255,.18); color: #eaf3fb; }
html[data-theme="light"] .scard.has-bg td { color: #cfdff0; }
html[data-theme="light"] .scard.has-bg td:last-child { color: #fff; }

/* 图层页 */
.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, #press-legend, #sst-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; }
/* 温带气旋那一组的小标题: 占满一行, 把"变性之后另有一套分级"这件事交代清楚 */
.cat-legend .lg-sub { flex: 0 0 100%; margin: 3px 0 1px; font-size: 10.5px; opacity: .72; }

/* 登陆点图例: 左边是与地图同源的形状(同一个 lfPathD 生成), 右边是风速区间。
   行高固定, 六行排下来不会因为星形外环被裁掉而高低不齐。 */
.lf-legend { display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.lf-legend .it { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.lf-legend .it svg { flex: 0 0 auto; overflow: visible; }
.lf-legend .it em { margin-left: auto; font-style: normal; font-size: 10px; color: var(--muted);
  font-variant-numeric: tabular-nums; }
/* 温带登陆点那一组的小标题: 与等级图例同一个写法, 把"变性之后换的是另一套记号"交代清楚 */
.lf-legend .lg-sub { margin: 5px 0 1px; font-size: 10.5px; opacity: .72; }

/* 历史列表 */
.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; }

/* 存档页的文本框: 等宽字体便于辨认里面的字段, 高度可拖; 导出的那只是只读的, 点一下就能全选复制 */
.save-ta { display: block; width: 100%; margin: 4px 0 2px; padding: 8px 9px; border-radius: 8px;
  background: #0e2a48; border: 1px solid var(--panel-border); color: var(--text);
  font: 11.5px/1.6 ui-monospace, Menlo, Consolas, "Courier New", monospace;
  resize: vertical; min-height: 64px; }
.save-ta:focus { outline: 2px solid var(--accent2); outline-offset: 1px; }
.save-ta::placeholder { color: var(--muted); font-family: inherit; }

/* 底部状态(仅保留时间线/网格/种子等技术信息) */
/* 与标题同理: 小字号灰字直接压在地图上会被亮区淹没, 加同款玻璃底板 */
.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); }

/* 日期显示模块: 挂在左下角状态胶囊上方(图层页三选一: 关 / SMCY 圆盘 / 横条) */
.date-mod { position: absolute; z-index: 1000; left: 14px; bottom: 54px; pointer-events: none; }
.date-mod[hidden] { display: none; }
.date-mod canvas { display: block; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.38); }
html[data-theme="light"] .date-mod canvas { box-shadow: var(--shadow); }

/* 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); }
/* 填充: 渐变**整条铺在轨道上**(档位锚定轨道绝对位置, 由 JS 按满格参照写进 inline
   background), 只用 clip-path 从右往左裁出"已累积"的一段。
   关键: 不能用 width 缩放填充 —— 那样渐变会随宽度被拉伸, 同一个 ACE 值在 10% 与 90%
   时取到不同颜色。clip-path 则让渐变原地不动、只改变露出的长度, 末端颜色只由 ACE 值决定。 */
.ace-fill { display: block; position: absolute; inset: 0; clip-path: inset(0 100% 0 0);
  background: linear-gradient(90deg, #1c7ed6, #2ea8de, #3ad07e, #ffd23e, #ff9f43, #ef5a5a);
  transition: clip-path .18s linear; }
/* 刻度线: 每 50 一格, 由 JS 按当前满格参照摆位(见 renderAceTicks)，落在整齐值上。 */
.ace-ticks { position: absolute; inset: 0; pointer-events: none; }
.ace-ticks i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.32); }
/* 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-empty { font-size: 10.5px; color: var(--muted); padding: 4px 0 2px; }
.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; }
/* 亮色下"已登录"的用户名用深琥珀(暗色那支的 #ffd97a 在白底上看不清), 药丸底色改成纯白 */
html[data-theme="light"] .auth-chip b { color: #b8770a; }
html[data-theme="light"] .auth-chip a { background: #fff; }
html[data-theme="light"] .auth-chip a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
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"] .save-ta,
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,
html[data-theme="light"] .ace-ticks i { 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 挂件 ---------- */
  /* 手机上标题框高 76px(中文名/英文名/企划/版本号四行), 把行高压紧一档, 省下来的是地图。 */
  .app-title { left: 8px; top: calc(8px + env(safe-area-inset-top, 0px));
    padding: 4px 9px; gap: 7px; border-radius: 10px;
    max-width: calc(100% - 92px); }   /* 右侧给主题/帮助两个圆按钮留位 */
  .app-title .logo { font-size: 18px; }
  .app-title h1 { font-size: 15px; letter-spacing: .5px; line-height: 1.2; }
  .app-title h1 span { font-size: 10px; line-height: 1.25; }
  .app-title h1 span.org { font-size: 9px; }
  .app-title .ver-line { font-size: 10px; }

  /* 状态条贴左下会被抽屉整个压掉(抽屉占满下半屏, 而状态条在屏幕最底), 所以排在标题框正下方。
     不能写死 54px: 标题框是四行(中文名/英文名/企划/版本号), 实测 76px, 换字号、登录之后冒出
     「统一身份认证」都会让它变高。--title-h / --status-h 由 sim.js 的 syncTopStack() 量好写进
     <html>, 这里只按它们往下排 —— 三块浮层谁都不会压到谁。 */
  .status { left: 8px; right: auto; bottom: auto;
    top: calc(var(--law-h, 0px) + 8px + env(safe-area-inset-top, 0px) + var(--title-h, 76px) + 6px);
    max-width: calc(100% - 16px); padding: 3px 8px; gap: 8px; font-size: 10.5px; border-radius: 8px; }
  .status .muted { font-size: 10.5px; }

  /* 状态条挪到了顶上, 日期模块仍贴左下, 但要抬到底部抽屉把手上方 */
  .date-mod { left: 8px; bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    transform: scale(.88); transform-origin: left bottom; }

  .ace-widget { left: 8px;
    top: calc(var(--law-h, 0px) + 8px + env(safe-area-inset-top, 0px) + var(--title-h, 76px)
             + var(--status-h, 30px) + 12px);
    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-control-zoom a { width: 34px !important; height: 34px !important;
    line-height: 32px !important; font-size: 18px !important; }

  /* ---------- 右下: 缩放按钮 + 底图版权条 ----------
     这一带平时是贴底抽屉的地盘: 抽屉收起时压掉底部一条, 展开时压掉大半个屏。
     故把整条控制角按抽屉的实测高度往上抬(--panel-h 由 sim.js 量好写进 <html>),
     抽屉展开/收起、切换标签页改变高度时按钮都跟着走, 始终停在抽屉上沿之外。
     抽屉自身已经带了安全区内边距(offsetHeight 含在内), 这里不再重复加 env()。
     默认值 66px 是抽屉收起时的高度, 脚本还没跑到时先按这个摆。 */
  .leaflet-bottom.leaflet-right { bottom: calc(var(--panel-h, 66px) + 6px) !important; }
  .leaflet-bottom.leaflet-left { bottom: calc(8px + 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; }
  /* 种子码: 桌面四段排一行; 手机抽屉虽是全宽(约 340px), 四段并列会把 nino / wpsh 挤得读不出,
     这里折回 2×2(强度|类型 / 位移|编号) */
  .seed4 { grid-template-columns: 1fr 1fr; gap: 6px; }
  .seed4 input[type="number"] { font-size: 16px; height: 42px; }
  .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; }
  /* 服务器存档名: 只抬字号与高度 —— 它在 .row 里跟着 flex 走, 撑成 100% 会把按钮挤出去 */
  .srv-name { font-size: 16px; padding: 9px 8px; min-height: 42px; }
  input[type="number"], #sim-seed, 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"] #sim-seed,
  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; }
  .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` 那一条,
   这里把顶部各挂件整体下移相同的量, 免得被条压住。
   放在文件最后: 同权重下后者生效, 因此不必回头逐条去改上面的 top 值;
   各断点的小偏移(8/42/54/74/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)); }
  .help-btn   { top: calc(var(--law-h) + 42px + env(safe-area-inset-top, 0px)); }
  /* ACE 的位置必须在这里再声明一次: 上一段(文件靠后的全局"让位"规则)也写了一条
     .ace-widget 的 top, 同权重、又排在窄屏段之后, 光在前面改是盖不住它的。 */
  .ace-widget { top: calc(var(--law-h, 0px) + 8px + env(safe-area-inset-top, 0px) + var(--title-h, 76px)
             + var(--status-h, 30px) + 12px); }
  .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) {
  .panel { max-height: 76vh; top: auto; }
  @supports (max-height: 76dvh) { .panel { max-height: 76dvh; } }
}


/* ---- 24 / 48 小时警戒线的文字标签(Leaflet divIcon) ----
   半透明深底 + 白字: 浅色/深色底图、四种配色主题下都读得清; 不接收鼠标事件,
   免得挡住它下面的地图拖拽与风力读数。 */
.warn-tag {
  font-size: 11px; line-height: 15px; text-align: center; white-space: nowrap;
  color: #fff; background: rgba(24, 34, 48, .72); border-radius: 8px; padding: 0 5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none;
}

/* ===== 导出页（视频导出） ===== */
/* 时刻读数用等宽数字：拖动滑块时数字宽度不跳，右侧那排控件不会跟着左右抖 */
.ve-now { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .02em; }
.ve2 { display: inline-flex; align-items: center; gap: 6px; }
.ve2 input[type="number"] { width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.ve2 .btn { padding: 4px 10px; }
.ve-prog { height: 6px; border-radius: 3px; margin: 6px 0; overflow: hidden; background: rgba(120, 190, 255, .16); }
.ve-prog span { display: block; height: 100%; width: 0; transition: width .16s linear;
  background: linear-gradient(90deg, #35c934, #5aa7e8 60%, #8b5cf6); }
#ve-prog-wrap .muted { margin-top: 2px; }

/* ============================================================
   手机端浮层收紧(文件最后: 同权重下这一段赢)
   ------------------------------------------------------------
   不靠缩字号换空间 —— 字号压到 9.5px 时标题三行小字挤成一团, 状态条也发糊。
   这一版把字号全部还原到能看清的一档, 高度改从"少几行、少几项"里省:
   · 状态条改**单行**: 内容由 sim.js 按屏宽裁短(手机上只报 时间线 / 网格 / 种子 ID),
     桌面那条含天数、计算耗时、种子码名的一长串不会出现在这块小屏上;
   · ACE 挂件仍**竖排两块**(ACE 与 PDI 各一行), 只把内边距与行距收紧, 不改布局;
   · 标题保持三行(中文 / 英文 / 企划), 行距压紧、logo 略小。
   各块 top 仍按 --title-h / --status-h 实测值往下排(见 sim.js 的 syncTopStack),
   标题或状态条变矮之后下面两块会自动上移, 这里不写死坐标。
   ============================================================ */
@media (max-width: 760px) {
  /* ---------- 顶部警示条 ---------- */
  .law-bar { height: 24px; padding: 0 10px; font-size: 11px; letter-spacing: 0; }
  .law-bar .ico { font-size: 11px; }
  .law-bar .law-close { width: 18px; height: 18px; margin-left: 2px; font-size: 11px; }

  /* ---------- 标题框: 三行不删, 只压行距 ---------- */
  .app-title { padding: 3px 8px; gap: 6px; border-radius: 9px;
    max-width: calc(100% - 76px); }        /* 右侧给主题/帮助两个按钮留位 */
  .app-title .logo { font-size: 16px; }
  .app-title h1 { font-size: 14.5px; letter-spacing: .4px; line-height: 1.16; }
  .app-title h1 span { font-size: 9.5px; line-height: 1.2; }
  .app-title h1 span.org { font-size: 8.5px; }
  .app-title .ver-line { font-size: 9.5px; letter-spacing: .3px; }

  /* ---------- 状态条: 单行 ---------- */
  /* 手机上这条只放 sim.js 拼好的短句(时间线 / 网格 / 种子 ID); 万一文案再变长,
     ellipsis 让它收住, 不会折成第二行把地图又压低 13px。 */
  .status { padding: 3px 8px; border-radius: 8px; font-size: 10.5px; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .status .muted { font-size: 10.5px; }

  /* ---------- ACE 挂件: 竖排不动, 只收内边距 ---------- */
  .ace-widget { width: min(56vw, 176px); padding: 5px 9px 6px; }
  .ace-label { font-size: 10.5px; }
  .ace-val { font-size: 11.5px; }
  .ace-val b { font-size: 13.5px; }
  .ace-top { margin-bottom: 3px; }
  .ace-track { height: 5px; }
  .ace-sub { margin-top: 3px; }
  .ace-sub .ace-val b { font-size: 12px; }
  .am-list { max-height: 24vh; }

  /* ---------- 右上两颗按钮 ---------- */
  .theme-btn { height: 28px; padding: 0 9px; font-size: 11px; border-radius: 8px; }
  .help-btn { width: 28px; height: 28px; font-size: 14px;
    top: calc(var(--law-h) + 8px + env(safe-area-inset-top, 0px) + 34px); }
  .leaflet-control-zoom a { width: 32px !important; height: 32px !important;
    line-height: 30px !important; font-size: 17px !important; }

  /* ---------- 底部抽屉 ---------- */
  .panel { max-height: 58vh; }
  @supports (max-height: 58dvh) { .panel { max-height: 58dvh; } }
  .panel-grab { height: 20px; }
  .panel-grab::before { width: 36px; height: 4px; margin: 7px auto 0; }
  .tabs { padding-top: 20px; }
  .tabs .tab { padding: 10px 0; font-size: 13px; }
  .panel.collapsed .tabs .tab { flex: 1; padding: 10px 12px; }
  .tabs.mini .tab { padding: 8px 0; }

  /* ---------- 抽屉里的控件: 只微收, 仍保证手指点得准 ---------- */
  .btn { min-height: 40px; padding: 9px 12px; font-size: 13px; }
  .btn.wide { padding: 9px 0; }
  .seg button { min-height: 36px; padding: 8px 11px; font-size: 12.5px; }
  .check { min-height: 36px; margin: 3px 0; font-size: 12.5px; }
  .real-item { min-height: 44px; padding: 8px 10px; }
}

/* ============================================================
   横屏这一档**必须留在文件最后**
   ------------------------------------------------------------
   667×375 这类窄机横过来时同时命中两档: 宽度 667 < 760(竖屏/窄屏那套贴底抽屉),
   屏高 375 < 520(横屏那套右上浮层)。两档同权重, 谁在后面谁赢 —— 抽屉那套的
   left:0/right:0/width:auto 会把浮层几何整个压回贴底横条(标签栏孤零零一条、内容看不见)。
   所以把横屏段整个搬到末尾, 让它对矮屏永远最后生效。
   ============================================================ */

/* ============================================================
   手机横屏: 单独一档(按"触摸 + 矮屏"判断, 不看宽度)
   ------------------------------------------------------------
   手机横过来宽度常是 780~930px, 一越 760px 那道断点, 上面整套手机样式就一条都不命中 ——
   落回桌面布局后, 面板是 332px 的浮层(吃掉四成宽)、按钮还是桌面那个 30px 高的小尺寸,
   手指点不准、字也小, 这就是"横过来特别别扭"的来源。
   这里不把竖屏那套贴底抽屉硬套过来: 横屏屏高只有 390px 上下, 抽屉一展开就是 76vh,
   地图只剩一条缝。改成**右上浮层但收窄**(min(46vw, 320px)), 控件按手指尺寸放大。
   顶部三块(标题/状态条/ACE)仍走 --title-h / --status-h 那套实测竖排, 与竖屏同一口径。
   ============================================================ */
@media (max-height: 520px) and (hover: none) and (pointer: coarse) {
  html, body { height: 100%; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
  @supports (height: 100dvh) { html, body { height: 100dvh; } }
  #map { inset: 0; }

  .law-bar { padding: 0 12px; }                 /* 标题框已让到横幅下方, 滚动字恢复整行 */
  .law-bar .law-close { width: 26px; height: 26px; }   /* 这条 22px 的关闭按钮, 拇指按得到才不会点空 */

  /* ---------- 左上: 标题 → 状态条 → ACE ---------- */
  .app-title { left: 8px; top: calc(var(--law-h, 0px) + 6px + env(safe-area-inset-top, 0px));
    padding: 4px 9px; gap: 7px; border-radius: 9px;
    max-width: calc(100% - 100px); }
  .app-title .logo { font-size: 17px; }
  .app-title h1 { font-size: 14px; letter-spacing: .4px; line-height: 1.2; }
  .app-title h1 span { font-size: 9.5px; line-height: 1.25; }
  .app-title h1 span.org { font-size: 9px; }
  .app-title .ver-line { font-size: 9.5px; }

  /* 横屏一行放不下整条状态(时间线/计算耗时/网格/种子/ID), 让它折两行 ——
     截断会把种子和 ID 这两样最要紧的切掉。高度由 syncTopStack() 量, ACE 跟着往下走。 */
  .status { left: 8px; right: auto; bottom: auto;
    top: calc(var(--law-h, 0px) + 6px + env(safe-area-inset-top, 0px) + var(--title-h, 52px) + 4px);
    max-width: 46vw; padding: 2px 7px; gap: 6px; font-size: 9.5px; border-radius: 7px;
    line-height: 1.35; }
  .status .muted { font-size: 9.5px; }

  .ace-widget { left: 8px;
    top: calc(var(--law-h, 0px) + 6px + env(safe-area-inset-top, 0px) + var(--title-h, 52px)
             + var(--status-h, 22px) + 8px);
    width: min(40vw, 176px); padding: 5px 8px 6px; }
  .am-list { max-height: 22vh; }

  /* ---------- 右上: 主题 + 帮助 **横排** 在面板上面一条 ----------
     竖着排(桌面那样)会占掉 66px 高度, 而横屏总共才 390px, 面板就没剩多少了:
     这两个按钮横着并排, 面板从它们下面开始。 */
  .theme-btn { right: 8px; top: calc(var(--law-h, 0px) + 6px + env(safe-area-inset-top, 0px));
    height: 30px; padding: 0 9px; font-size: 11.5px; }
  .help-btn { left: auto; right: 74px;
    top: calc(var(--law-h, 0px) + 6px + env(safe-area-inset-top, 0px));
    width: 30px; height: 30px; }

  /* ---------- 控制面板: 右上浮层(不是抽屉) ---------- */
  /* 窄而矮的机器(如 667×375)会**同时命中竖屏那档**, 所以这里要把竖屏的抽屉几何整套覆盖掉:
     那边写的是 left:0/right:0/width:auto 的贴底抽屉, 只改 right 会因为 left 更强而无效
     (绝对定位下 left + width 齐全时 right 被忽略) —— 必须显式 left:auto。 */
  .panel { top: calc(var(--law-h, 0px) + 42px + env(safe-area-inset-top, 0px));
    left: auto; right: 8px; bottom: auto; width: min(46vw, 320px);
    max-height: calc(100% - var(--law-h, 0px) - 50px - env(safe-area-inset-top, 0px));
    border: 1px solid var(--panel-border); border-bottom: 1px solid var(--panel-border);
    border-radius: 10px; padding-bottom: 0; font-size: 12px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .35); }
  .tabs { padding-top: 0; }           /* 这一档没有抽屉把手, 不用给把手留 22px */
  .panel.collapsed { width: auto; }
  .panel-grab { display: none; }      /* 这一档没有把手: 收起/展开走标签栏那个按钮 */
  .panel-toggle { display: block; }
  .tabs .tab { padding: 8px 0; font-size: 12px; }
  .tabs.mini .tab { padding: 6px 0; }
  .tabpage { padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch; }

  /* ---------- 控件: 按手指能点的大小, 不按桌面的 30px ---------- */
  .btn { min-height: 34px; padding: 7px 10px; font-size: 12.5px; }
  .btn.wide { padding: 7px 0; }
  .seg button { min-height: 32px; padding: 7px 10px; font-size: 12px; }
  .check { min-height: 34px; margin: 2px 0; font-size: 12.5px; }
  .check input { width: 17px; height: 17px; }
  /* 16px 是 iOS 的硬门槛: 小于它一聚焦就整页放大且不缩回, 横屏这档也不能降 */
  select { font-size: 16px; padding: 6px 7px; min-height: 34px; }
  input[type="number"], #sim-seed, input[type="datetime-local"] {
    font-size: 16px; padding: 6px 7px; min-height: 34px; }
  #slider-time { height: 28px; }
  .seed4 { gap: 5px; }
  .storm-cards { max-height: 92px; }

  /* ---------- 地图控件与浮层 ---------- */
  .leaflet-control-zoom a { width: 32px !important; height: 32px !important;
    line-height: 30px !important; font-size: 17px !important; }
  /* 面板在右下, 而且换到「种子/模拟」这类内容多的页会撑到 310px 高 —— 缩放按钮原位置会被它
     整个盖住(点不到)。把整条右下控制角(缩放 + 版权条)让到面板左侧, 竖屏那套是按抽屉高度抬
     bottom, 这里反过来是按面板宽度挪 right。 */
  .leaflet-bottom.leaflet-right { right: calc(min(46vw, 320px) + 16px) !important;
    bottom: calc(6px + env(safe-area-inset-bottom, 0px)) !important; }
  .leaflet-control-attribution { max-width: 40vw; }
  .date-mod { left: 8px; bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    transform: scale(.82); transform-origin: left bottom; }
  .node-card { font-size: 11.5px; max-width: min(46vw, 220px); padding: 6px 8px 7px; }
  .probe { display: none !important; }
  .toast { bottom: 10px; max-width: 70vw; text-align: center; }
  .loading-sub { font-size: 11px; max-width: 70vw; text-align: center; }
}