:root {
  --bg: #0b1d33;
  --panel: rgba(13, 26, 45, .88);
  --panel-border: rgba(120, 190, 255, .25);
  --text: #dce9f5;
  --muted: #8aa4bd;
  --accent: #3fa9f5;
  --accent2: #ffc83d;
}
* { 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; }
.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; }

.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)); }

/* ---------- 路径节点信息卡 ---------- */
.node-card { position: absolute; z-index: 650; width: 172px;
  background: rgba(10,26,46,.94); border: 1px solid rgba(120,190,255,.35); border-radius: 9px;
  padding: 7px 9px 8px; font-size: 11.5px; 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: 5px; margin-bottom: 3px; }
.node-card .nc-head b { font-size: 12.5px; }
.node-card .nc-cat { margin-left: auto; padding: 1px 6px; border-radius: 6px; color: #fff; font-size: 10.5px; }
.node-card .nc-x { cursor: pointer; color: #9ab; margin-left: 4px; font-size: 14px; line-height: 1; }
.node-card .nc-x:hover { color: #fff; }
.node-card table { width: 100%; border-collapse: collapse; }
.node-card td { padding: 1px 0; color: #c6d7e8; }
.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); }

/* ---------- 左上: 本季 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; }
