/* 河南汝阳三项目 · 欧适能数字孪生 —— 明亮浅色监控风格 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #edf1f7;
  --bg2: #f7f9fd;
  --panel: #ffffff;
  --panel2: #eff4fa;
  --line: #d8e0ea;
  --txt: #22303f;
  --dim: #64748b;
  --cyan: #0e7490;
  --cyan-bright: #00c2d1;
  --cyan-dim: #155e75;
  --orange: #f59e0b;
  --green: #0fb981;
  --red: #0891b2;
  --gold: #b45309;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  font-size: 13px;
}

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

/* ---------- 顶部导航 ---------- */
#topnav {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  gap: 8px;
  flex: none;
  /* 内容超宽时整行横向滚动兜底，按钮一律不压缩不折行 */
  overflow-x: auto;
  scrollbar-width: thin;
}
#topnav::-webkit-scrollbar { height: 4px; }
#topnav::-webkit-scrollbar-thumb { background: #c3cedb; border-radius: 2px; }
.nav-left { display: flex; align-items: center; gap: 8px; flex: none; }
.brand-logo {
  background: linear-gradient(135deg, var(--cyan-bright), #0891b2);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 7px;
  border-radius: 6px;
  letter-spacing: 1px;
  flex: none;
}
.brand-title { font-size: 15px; font-weight: 700; white-space: nowrap; flex: none; }
.nav-center { display: flex; align-items: center; gap: 6px; flex: none; }
.nav-link {
  color: var(--dim);
  text-decoration: none;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
  flex: none;
  transition: .15s;
}
.nav-link:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.nav-right { display: flex; align-items: center; gap: 6px; flex: none; }

.scene-switch, .speed-switch { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.scene-switch button, .speed-switch button {
  background: transparent;
  border: none;
  color: var(--dim);
  padding: 6px 9px;
  font-size: 12px;
  white-space: nowrap;
  flex: none;
  transition: .15s;
}
.scene-switch button i {
  font-style: normal;
  color: var(--cyan-dim);
  margin-right: 4px;
  font-weight: 700;
}
.scene-switch button.active, .speed-switch button.active {
  background: var(--cyan-dim);
  color: #ffffff;
}
.scene-switch button.active i { color: #a5f3fc; }
.scene-switch button:hover:not(.active), .speed-switch button:hover:not(.active) { color: var(--txt); background: var(--panel2); }

.ctl-btn {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--txt);
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  flex: none;
  transition: .15s;
}
.ctl-btn:hover { border-color: var(--cyan-dim); color: var(--cyan); }
.ctl-btn.warn { background: rgba(245,158,11, .1); border-color: rgba(245,158,11, .45); color: var(--orange); }

/* ---------- 主体布局 ---------- */
#main {
  display: flex;
  height: calc(100vh - 46px - 196px);
  min-height: 320px;
}
#viewport { flex: 1 1 68%; position: relative; min-width: 0; background: #e8f2fa; }
#canvas-wrap { position: absolute; inset: 0; }
#canvas-wrap canvas { display: block; }

#sidebar {
  flex: 0 0 340px;
  overflow-y: auto;
  background: var(--bg2);
  border-left: 1px solid var(--line);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-thumb { background: #c3cedb; border-radius: 3px; }

/* ---------- 面板通用 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  flex: none;
}
.panel h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.panel h2 .src { font-size: 10px; color: var(--dim); font-weight: 400; }

/* ---------- 天气面板 ---------- */
.w-main { display: flex; gap: 12px; align-items: center; }
.w-left { text-align: center; flex: 0 0 84px; }
#w-icon { font-size: 40px; line-height: 1.2; }
#w-cond { color: var(--dim); font-size: 12px; margin-top: 2px; }
#w-coldwave {
  margin-top: 6px;
  background: linear-gradient(135deg, #0891b2, #b45309);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 5px;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.w-right { flex: 1; }
#w-temp {
  font-size: 38px;
  font-weight: 800;
  color: #0b2b45;
  letter-spacing: -1px;
}
#w-temp.cold { color: #0891b2; }
#w-temp.warm { color: var(--orange); }
.w-sub { display: flex; gap: 10px; color: var(--dim); margin-top: 4px; }
.w-sub span { white-space: nowrap; }
.w-sub b { color: var(--txt); }
#w-tcurve {
  width: 100%;
  height: 72px;
  margin-top: 8px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.w-stats { display: flex; gap: 8px; margin-top: 8px; }
.w-stats > div {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}
.w-stats label { display: block; font-size: 10px; color: var(--dim); }
.w-stats b { font-size: 14px; color: var(--gold); }

/* ---------- 项目档案 ---------- */
#p-body .p-name { font-size: 16px; font-weight: 700; color: #0b2b45; }
#p-body .p-addr { color: var(--dim); font-size: 11px; margin: 2px 0 6px; }
#p-body .p-status {
  font-size: 11px;
  color: var(--orange);
  background: rgba(245,158,11, .08);
  border: 1px solid rgba(245,158,11, .25);
  border-radius: 6px;
  padding: 5px 7px;
  margin-bottom: 8px;
}
.p-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.p-kv div { display: flex; justify-content: space-between; border-bottom: 1px dashed #e2e8f0; padding: 3px 0; }
.p-kv label { color: var(--dim); }
.p-kv b { color: var(--txt); font-weight: 600; text-align: right; }
.p-equip { margin-top: 8px; }
.p-equip .eq {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan-dim);
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 5px;
  font-size: 11px;
}
.p-equip .eq b { color: var(--cyan); }
.p-equip .eq span { color: var(--dim); display: block; margin-top: 1px; }
.p-fee { margin-top: 6px; font-size: 11px; color: var(--dim); line-height: 1.5; }
.p-fee b { color: var(--gold); }

.pay-ctl { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.pay-ctl label { display: block; color: var(--dim); font-size: 11px; margin-bottom: 4px; }
.pay-ctl label b { color: var(--cyan); font-size: 14px; }
#pay-slider { width: 100%; accent-color: var(--cyan); }

/* ---------- 钱流仪表 ---------- */
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.m-item {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}
.m-item.wide { grid-column: 1 / -1; }
.m-item label { display: block; font-size: 10px; color: var(--dim); }
.m-item b { font-size: 16px; font-weight: 700; color: #0b2b45; }
.m-item b.pos { color: var(--green); }
.m-item b.neg { color: var(--red); }
#m-power { color: var(--cyan); }
.m-progress {
  margin-top: 8px;
  height: 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 7px;
  position: relative;
  overflow: hidden;
}
#m-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan-bright));
  transition: width .3s;
}
#m-progress-txt {
  position: absolute;
  inset: 0;
  text-align: center;
  font-size: 10px;
  line-height: 14px;
  color: #ffffff;
}

/* ---------- 优势面板 ---------- */
#adv-compare .cmp-row { margin-bottom: 6px; }
#adv-compare .cmp-row label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 2px;
}
#adv-compare .cmp-row label b { color: var(--txt); }
#adv-compare .bar { height: 10px; border-radius: 5px; background: var(--bg2); overflow: hidden; }
#adv-compare .bar i { display: block; height: 100%; border-radius: 5px; }
#adv-compare .bar.hp i { background: linear-gradient(90deg, #0fb981, #0fb981); }
#adv-compare .bar.eb i { background: linear-gradient(90deg, #b45309, var(--red)); }
#adv-compare .bar.gb i { background: linear-gradient(90deg, #6d28d9, #a78bfa); }
#adv-compare .save-tag {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  background: rgba(15,185,129, .1);
  border: 1px solid rgba(15,185,129, .3);
  border-radius: 6px;
  padding: 4px;
  margin: 6px 0;
}
.adv-list { list-style: none; margin-top: 4px; }
.adv-list li {
  font-size: 11px;
  color: var(--dim);
  padding: 3px 0 3px 14px;
  position: relative;
  line-height: 1.5;
}
.adv-list li::before { content: '▸'; position: absolute; left: 0; color: var(--cyan); }
.adv-list b { color: var(--txt); }

/* ---------- 照片面板 ---------- */
.photo-box { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
#photo-img { width: 100%; height: 170px; object-fit: cover; display: block; }
.ph-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(6, 12, 22, .65);
  color: #fff;
  border: none;
  width: 26px;
  height: 40px;
  font-size: 18px;
}
.ph-nav.prev { left: 0; border-radius: 0 6px 6px 0; }
.ph-nav.next { right: 0; border-radius: 6px 0 0 6px; }
.ph-nav:hover { background: rgba(14, 116, 144, .8); }
#photo-idx {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(6, 12, 22, .7);
  color: #f1f5f9;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
}

/* ---------- 视口覆盖物 ---------- */
#sim-clock {
  position: absolute;
  top: 12px;
  left: 14px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 16px rgba(51, 65, 85, .14);
}
#clock-date { font-size: 15px; font-weight: 700; color: #0b2b45; }
#clock-time { font-size: 24px; font-weight: 800; color: var(--cyan); font-variant-numeric: tabular-nums; }
#clock-day { font-size: 11px; color: var(--dim); }

#scene-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(51, 65, 85, .16);
}

#intro-tip {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--dim);
  font-size: 11px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 12px;
  pointer-events: none;
  transition: opacity 1s;
}

/* 机组工况卡 */
#unit-card {
  position: absolute;
  width: 240px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(51, 65, 85, .22);
  z-index: 20;
}
.uc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--cyan);
  font-weight: 700;
}
#uc-close { background: none; border: none; color: var(--dim); font-size: 16px; }
#uc-close:hover { color: var(--cyan); }
.uc-body { padding: 8px 12px 10px; }
.uc-body .row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed #e2e8f0; }
.uc-body .row label { color: var(--dim); }
.uc-body .row b { color: #0b2b45; font-variant-numeric: tabular-nums; }
.uc-body .row b.hot { color: var(--orange); }
.uc-body .row b.aux-on { color: var(--red); animation: pulse 1.2s infinite; }
.uc-body .uc-desc { margin-top: 6px; font-size: 11px; color: var(--dim); line-height: 1.5; }

/* ---------- 底部图表条 ---------- */
#charts {
  height: 196px;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  flex: none;
  overflow-x: auto;
}
.chart-cell {
  flex: 1 1 0;
  min-width: 240px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
}
.chart-cell h3 { font-size: 11px; color: var(--dim); font-weight: 600; margin-bottom: 4px; }
.chart-cell canvas { width: 100%; height: 150px; flex: 1; }

#compare-cell { flex: 0 0 300px; }
#compare-cards { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.cmp-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.cmp-card.active { border-left-color: var(--cyan); background: rgba(6, 148, 180, .08); }
.cmp-card .nm { font-weight: 700; color: var(--txt); white-space: nowrap; flex: none; }
/* 指标组允许换行：窄卡片内三项指标放不下时折到第二行，保证数字完整可见 */
.cmp-card .vals { display: flex; flex-wrap: wrap; gap: 2px 8px; color: var(--dim); }
.cmp-card .vals span { white-space: nowrap; }
.cmp-card .vals b { color: var(--txt); font-weight: 600; }
.cmp-card .vals b.pos { color: var(--green); }
.cmp-card .vals b.neg { color: var(--red); }

/* ---------- 季总结弹窗 ---------- */
#summary-modal {
  position: fixed;
  inset: 0;
  background: rgba(51, 65, 85, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
}
.summary-box {
  width: 520px;
  max-width: 92vw;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--cyan-dim);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 20px 60px rgba(51, 65, 85, .25);
}
.summary-box h2 { color: var(--cyan); font-size: 18px; margin-bottom: 14px; }
#summary-body .s-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
#summary-body .s-item { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
#summary-body .s-item label { display: block; font-size: 11px; color: var(--dim); }
#summary-body .s-item b { font-size: 18px; color: #0b2b45; }
#summary-body .s-item b.pos { color: var(--green); }
#summary-body .s-item b.neg { color: var(--red); }
#summary-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
#summary-body th, #summary-body td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: right; }
#summary-body th:first-child, #summary-body td:first-child { text-align: left; }
#summary-body th { color: var(--dim); font-weight: 600; }
#summary-body td.hl { color: var(--green); font-weight: 700; }
.summary-btns { display: flex; gap: 10px; margin-top: 16px; }
.summary-btns button {
  flex: 1;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--txt);
  font-size: 13px;
}
#summary-replay { background: var(--cyan-dim); border-color: var(--cyan-dim); color: #ffffff; font-weight: 700; }
.summary-btns button:hover { filter: brightness(1.05); }

.hidden { display: none !important; }

/* ---------- 电影模式 ---------- */
body.cinematic #sidebar, body.cinematic #charts { display: none; }
body.cinematic #main { height: 100vh; }
body.cinematic #topnav { opacity: .25; transition: opacity .3s; }
body.cinematic #topnav:hover { opacity: 1; }
body.cinematic #topnav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
}

/* ---------- 天气面板 · 水系统联动 ---------- */
.w-hvac {
  margin-top: 8px;
  background: rgba(6, 148, 180, .06);
  border: 1px solid rgba(6, 148, 180, .25);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#w-supply { font-size: 12px; font-weight: 700; color: var(--cyan); }
#w-strategy { font-size: 10px; color: var(--dim); overflow-wrap: anywhere; }

/* ---------- 专业系统面板 ---------- */
.pro-btns { display: flex; gap: 6px; }
.pro-btns button {
  flex: 1;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--txt);
  font-size: 11px;
  padding: 7px 4px;
  border-radius: 6px;
  transition: .15s;
}
.pro-btns button:hover { border-color: var(--cyan-dim); color: var(--cyan); }
.pro-kv { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.pro-kv div { display: flex; justify-content: space-between; border-bottom: 1px dashed #e2e8f0; padding: 2px 0; font-size: 11px; }
.pro-kv label { color: var(--dim); }
.pro-kv b { color: var(--txt); font-weight: 600; }

/* ---------- 专业弹窗通用 ---------- */
.pro-modal {
  position: fixed;
  inset: 0;
  background: rgba(51, 65, 85, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  backdrop-filter: blur(3px);
}
.pro-box {
  width: 700px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--cyan-dim);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 20px 60px rgba(51, 65, 85, .25);
}
.pro-box.wide { width: 900px; }
.pro-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pro-head h2 { color: var(--cyan); font-size: 16px; }
.pro-head h2 span { font-size: 12px; color: var(--dim); font-weight: 400; margin-left: 8px; }
.pro-close { background: none; border: none; color: var(--dim); font-size: 20px; line-height: 1; }
.pro-close:hover { color: var(--txt); }
.pro-meta {
  font-size: 11px;
  color: var(--dim);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  margin-bottom: 8px;
  line-height: 1.6;
}
.pro-meta b { color: var(--txt); }
#elec-canvas, #hvac-canvas {
  width: 100%;
  background: #f7f9fd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ---------- 图纸档案查看器 ---------- */
.draw-cols { display: flex; gap: 12px; }
.draw-files { flex: 0 0 250px; display: flex; flex-direction: column; gap: 5px; }
.draw-files .df {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan-dim);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 11px;
  color: var(--txt);
  line-height: 1.5;
}
.draw-files .df.dwg { border-left-color: var(--orange); }
.draw-files .df small { display: block; color: var(--dim); font-size: 10px; margin-top: 1px; }
.draw-viewer { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.draw-imgbox {
  background: #f7f9fd;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
#draw-img { max-width: 100%; max-height: 56vh; display: block; }
.draw-nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.draw-nav button {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--txt);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
}
.draw-nav button:hover { border-color: var(--cyan-dim); color: var(--cyan); }
#draw-idx { color: var(--dim); font-size: 12px; }
.draw-thumbs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
.draw-thumbs img {
  height: 46px;
  border: 2px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  flex: none;
}
.draw-thumbs img.active { border-color: var(--cyan); }
.draw-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--gold);
  background: rgba(180, 83, 9, .07);
  border: 1px solid rgba(180, 83, 9, .25);
  border-radius: 6px;
  padding: 6px 10px;
  line-height: 1.6;
}
.draw-noimg {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  min-height: 200px;
  text-align: center;
  padding: 20px;
  line-height: 1.8;
}

/* ---------- 响应式：平板（≤960px）纵向单列 ---------- */
@media (max-width: 960px) {
  html, body { height: auto; overflow: auto; }
  #topnav { flex-wrap: wrap; height: auto; padding: 6px 8px; gap: 6px; }
  .brand-title { font-size: 13px; }
  .nav-center { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  /* 开关组 overflow:hidden 允许被 flex 压缩到内容以下，需禁止收缩，让整行统一横向滚动 */
  .scene-switch, .speed-switch { flex: none; }
  .nav-right { margin-left: auto; }
  #main { flex-direction: column; height: auto; }
  #viewport { flex: none; height: 56vh; min-height: 320px; }
  #sidebar { flex: none; width: 100%; border-left: none; border-top: 1px solid var(--line); overflow: visible; }
  #charts { flex-direction: column; height: auto; overflow-x: visible; }
  .chart-cell { min-width: 0; flex: none; }
  .chart-cell canvas { height: 150px; }
  #compare-cell { flex: none; }
  .pro-box { width: calc(100vw - 16px); max-height: 92vh; padding: 12px; }
  .draw-cols { flex-direction: column; }
  .draw-files { flex: none; }
  .summary-box { width: calc(100vw - 16px); padding: 14px 16px; }
  #unit-card { max-width: calc(100vw - 16px); }
  body.cinematic #main { height: 100vh; }
  body.cinematic #viewport { height: 100%; min-height: 0; }
}

/* ---------- 响应式：手机（≤640px） ---------- */
@media (max-width: 640px) {
  body { font-size: 12px; }
  .brand-logo { font-size: 11px; padding: 3px 6px; }
  .brand-title { font-size: 12px; }
  /* 窄屏下速度档 + 控制按钮总宽可能超过屏宽，允许换行防止横向溢出 */
  .nav-right { flex-wrap: wrap; row-gap: 6px; justify-content: flex-end; }
  .nav-link, .ctl-btn, .scene-switch button, .speed-switch button {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }
  #viewport { height: 55vh; min-height: 300px; }
  #sim-clock { padding: 6px 10px; top: 8px; left: 8px; }
  #clock-date { font-size: 12px; }
  #clock-time { font-size: 19px; }
  #clock-day { font-size: 12px; }
  #intro-tip { font-size: 12px; width: max-content; max-width: 92vw; text-align: center; }
  #scene-toast { font-size: 12px; max-width: 90vw; text-align: center; }

  /* 小字号统一提升至 12px，保证手机可读 */
  .panel h2 .src, .w-stats label, .w-sub, #w-strategy, #w-cond,
  .p-fee, .p-equip .eq, .p-equip .eq span, #p-body .p-addr, #p-body .p-status,
  #p-body div[style], .adv-list li, .pro-kv div, .m-item label, .cmp-card,
  .draw-nav button, #draw-idx, .pro-meta, .chart-cell h3, .pay-ctl label,
  .uc-body .uc-desc, #photo-idx, .draw-files .df, .draw-files .df small,
  .draw-note, .draw-noimg, #summary-body th, #summary-body td { font-size: 12px; }

  #w-icon { font-size: 32px; }
  #w-temp { font-size: 30px; }
  .w-stats b { font-size: 13px; }
  .m-item b { font-size: 15px; }
  .pro-btns button { min-height: 36px; font-size: 12px; }
  .ph-nav { width: 36px; height: 48px; font-size: 20px; }
  #photo-img { height: 200px; }
  #unit-card { width: 224px; }
  .uc-head { padding: 8px 10px; }
  #uc-close { font-size: 20px; padding: 4px 8px; }
  .draw-imgbox { min-height: 200px; }
  #draw-img { max-height: 46vh; }
  .draw-thumbs img { height: 40px; }
  .draw-nav button { min-height: 36px; }
  .summary-btns button { min-height: 40px; }
  .pro-head h2 { font-size: 14px; }
  .pro-close { font-size: 24px; padding: 4px 8px; }
}

/* ---------- 设备结构 iframe 弹窗 ---------- */
#equip-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(51, 65, 85, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.equip-box {
  position: relative;
  width: 92vw;
  height: 88vh;
  background: var(--panel);
  border: 1px solid var(--cyan-dim);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(51, 65, 85, .25);
}
.equip-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #f7f9fd;
}
#equip-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--dim);
  border: 1px solid var(--line);
  font-size: 18px;
  line-height: 1;
}
#equip-close:hover { border-color: var(--cyan); color: var(--cyan); }

/* 工况卡内设备结构按钮与能源罐注释 */
.uc-struct-btn {
  width: 100%;
  margin-top: 8px;
  min-height: 36px;
  background: var(--cyan-dim);
  border: none;
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}
.uc-struct-btn:hover { filter: brightness(1.15); }
.uc-note { margin-top: 6px; font-size: 11px; color: var(--dim); line-height: 1.5; }

@media (max-width: 640px) {
  .equip-box { width: 100vw; height: 100dvh; border-radius: 0; border: none; }
  .uc-note { font-size: 12px; }
}

/* ---------- 手机端信息面板抽屉（≤768px） ---------- */
/* 悬浮开关按钮：桌面端隐藏，仅手机显示；触控目标 52px ≥ 44px */
#panel-fab { display: none; }
@media (max-width: 768px) {
  /* 侧边信息面板改为底部弹层抽屉：默认收起，点悬浮按钮开合，避免长面板把 3D 首屏顶下去 */
  #sidebar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 80;
    max-height: 72vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg2);
    border-top: 1px solid var(--cyan-dim);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -12px 40px rgba(51, 65, 85, .3);
    transform: translateY(102%);
    transition: transform .3s ease;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  body.panel-open #sidebar { transform: translateY(0); }
  #panel-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 14px; bottom: 14px;
    z-index: 90;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--cyan-dim);
    color: #ffffff;
    border: 1px solid var(--cyan);
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 6px 18px rgba(51, 65, 85, .35);
  }
  #panel-fab:active { filter: brightness(1.15); }
}

/* ================= 扩展模块样式（2026-07-29 新增：时间轴回放 / 报警中心 / 数据接入 / 72h预演） ================= */

/* ---------- 数据模式胶囊（导航左侧） ---------- */
#data-mode-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; white-space: nowrap; cursor: default;
  flex: none;
  background: rgba(6, 148, 180, .06);
}
#data-mode-pill .dm-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan-bright); box-shadow: 0 0 6px var(--cyan-bright);
  animation: dm-breathe 2.4s ease-in-out infinite;
}
@keyframes dm-breathe { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- 导航新按钮 ---------- */
#btn-fx.off { opacity: .45; }
.alarm-btn { position: relative; }
#alarm-badge {
  position: absolute; top: -7px; right: -8px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
  box-shadow: 0 0 8px rgba(8,145,178, .55);
}
#alarm-badge.pulse { animation: ab-pulse 1.2s ease-in-out infinite; }
@keyframes ab-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.live-btn { border-color: var(--cyan-dim); color: var(--cyan) !important; }
.live-btn:hover { background: rgba(6, 148, 180, .12); }

/* ---------- 历史时间轴回放 ---------- */
#timeline-bar {
  position: absolute; left: 14px; right: 14px; bottom: 12px;
  z-index: 30;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 14px 6px;
  box-shadow: 0 8px 24px rgba(51, 65, 85, .18);
  transition: transform .3s ease, opacity .3s ease;
}
#timeline-bar.collapsed { transform: translateY(calc(100% - 34px)); opacity: .92; }
.tl-head { display: flex; align-items: center; gap: 12px; height: 26px; }
.tl-title { font-size: 12px; font-weight: 800; color: var(--cyan); letter-spacing: 1px; white-space: nowrap; }
#tl-cursor-label {
  font-size: 12px; font-weight: 700; color: var(--txt);
  font-variant-numeric: tabular-nums;
  background: rgba(6, 148, 180, .1); border: 1px solid rgba(6, 148, 180, .35);
  border-radius: 6px; padding: 1px 10px; white-space: nowrap;
}
.tl-actions { margin-left: auto; display: flex; gap: 6px; }
.tl-actions button {
  font-size: 11px; color: var(--dim); background: transparent;
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px;
  white-space: nowrap;
}
.tl-actions button:hover { color: var(--cyan); border-color: var(--cyan-dim); }
#tl-track {
  position: relative; height: 26px; margin-top: 6px;
  background: linear-gradient(90deg, rgba(8,145,178, .06), rgba(6, 148, 180, .08));
  border: 1px solid var(--line); border-radius: 8px;
  cursor: crosshair; touch-action: none;
}
#tl-events { position: absolute; inset: 0 4px; pointer-events: none; overflow: hidden; border-radius: 8px; }
.tl-ev { position: absolute; top: 50%; transform: translate(-50%, -50%); pointer-events: auto; cursor: help; }
.tl-ev.cold { width: 7px; height: 7px; border-radius: 2px; background: #39e6f5; box-shadow: 0 0 6px #39e6f5; transform: translate(-50%, -50%) rotate(45deg); }
.tl-ev.chill { width: 5px; height: 5px; border-radius: 50%; background: #93c5fd; opacity: .8; }
.tl-ev.coldest { color: var(--red); font-size: 12px; text-shadow: 0 0 8px rgba(8,145,178, .4); }
.tl-ev.aux { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 6px rgba(245,158,11, .6); top: 30%; }
.tl-ev.def { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan-bright); opacity: .75; top: 70%; }
#tl-progress {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, rgba(6, 148, 180, .18), rgba(6, 148, 180, .34));
  border-right: 1px solid var(--cyan-bright);
  border-radius: 8px 0 0 8px; pointer-events: none;
}
#tl-handle {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--cyan-bright); border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(6, 148, 180, .55), 0 0 3px #fff inset;
  pointer-events: none; z-index: 2;
}
#tl-tip {
  position: absolute; top: -30px; transform: translateX(-50%);
  background: rgba(255, 255, 255, .95); border: 1px solid var(--cyan-dim);
  border-radius: 6px; padding: 2px 10px;
  font-size: 11px; color: var(--txt); white-space: nowrap;
  pointer-events: none; z-index: 3;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(51, 65, 85, .18);
}
.tl-scale { display: flex; justify-content: space-between; margin-top: 3px; padding: 0 2px; }
.tl-scale span { font-size: 10px; color: var(--dim); }
body.cinematic #timeline-bar { opacity: 0; pointer-events: none; }

/* ---------- 报警中心面板 ---------- */
#panel-alarm.flash { animation: al-flash .4s ease 3; }
@keyframes al-flash { 0%,100% { box-shadow: none; } 50% { box-shadow: 0 0 0 2px var(--red), 0 0 24px rgba(8,145,178, .35); } }
#alarm-list { max-height: 300px; overflow-y: auto; }
.al-empty { text-align: center; color: var(--dim); font-size: 12px; padding: 18px 6px; line-height: 1.9; }
.al-empty span { font-size: 11px; opacity: .75; }
.al-item {
  position: relative; display: flex; gap: 0;
  border: 1px solid var(--line); border-radius: 9px;
  margin-bottom: 8px; overflow: hidden;
  background: var(--bg2);
  animation: al-in .35s ease;
}
@keyframes al-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.al-item.acked { opacity: .55; }
.al-bar { flex: none; width: 4px; }
.lv-major .al-bar { background: var(--red); box-shadow: 0 0 8px rgba(8,145,178, .5); }
.lv-minor .al-bar { background: var(--orange); }
.lv-info .al-bar { background: var(--cyan-bright); }
.al-main { flex: 1; padding: 7px 10px 8px; min-width: 0; }
.al-head { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.al-head b { font-size: 12.5px; }
.al-lv { font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.al-time { margin-left: auto; font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.al-msg { font-size: 11.5px; color: var(--dim); line-height: 1.55; margin-top: 3px; }
.al-ops { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.al-ops button {
  font-size: 10.5px; padding: 2px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent; color: var(--dim);
}
.al-ops .al-jump:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.al-ops .al-ack:hover { color: var(--green); border-color: var(--green); }
.al-acked { font-size: 10.5px; color: var(--green); }

/* ---------- 未来 72h 预演小卡片 ---------- */
.w-forecast { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 9px; }
.fc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.fc-head > span:first-child { font-size: 12.5px; font-weight: 800; color: var(--txt); }
.fc-src {
  font-size: 10px; color: var(--gold); border: 1px solid rgba(180, 83, 9, .4);
  border-radius: 5px; padding: 1px 7px; background: rgba(180, 83, 9, .08); cursor: help;
}
.fc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fc-grid > div {
  background: rgba(6, 148, 180, .05); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 7px; text-align: center;
}
.fc-grid label { display: block; font-size: 10px; color: var(--dim); }
.fc-grid b { font-size: 12.5px; color: var(--txt); font-variant-numeric: tabular-nums; }
.fc-grid b.cold { color: #0891b2; }
.fc-grid b.cost { color: #F59E0B; }
.fc-warn, .fc-ok { margin-top: 7px; font-size: 11px; border-radius: 7px; padding: 5px 9px; line-height: 1.5; }
.fc-warn { color: #0e7490; background: rgba(8,145,178, .08); border: 1px solid rgba(8,145,178, .3); }
.fc-ok { color: #0fb981; background: rgba(15,185,129, .08); border: 1px solid rgba(15,185,129, .3); }

/* ---------- 实时数据接入弹窗 ---------- */
#live-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(51, 65, 85, .45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
#live-modal.hidden { display: none; }
.live-box {
  width: min(680px, 94vw); max-height: 88vh; overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--cyan-dim); border-radius: 14px;
  box-shadow: 0 0 50px rgba(6, 148, 180, .12), 0 24px 60px rgba(51, 65, 85, .22);
}
.live-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #ffffff; z-index: 2;
}
.live-head h2 { font-size: 16px; }
.live-tag {
  font-size: 10px; color: var(--gold); font-weight: 400;
  border: 1px solid rgba(180, 83, 9, .45); border-radius: 5px;
  padding: 1px 8px; margin-left: 8px; background: rgba(180, 83, 9, .07);
}
#live-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--panel2); color: var(--dim); border: 1px solid var(--line); font-size: 16px;
}
#live-close:hover { border-color: var(--cyan); color: var(--cyan); }
.live-note {
  margin: 12px 18px 0; padding: 10px 13px;
  font-size: 12px; color: var(--dim); line-height: 1.7;
  background: rgba(6, 148, 180, .06); border: 1px solid rgba(6, 148, 180, .2); border-radius: 9px;
}
.live-note b { color: var(--cyan); }
.live-body { padding: 12px 18px 18px; }
.lv-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lv-row > label { flex: none; width: 86px; font-size: 12px; color: var(--dim); text-align: right; }
.lv-row input, .lv-row select {
  flex: 1; min-width: 0; height: 32px;
  background: #ffffff; border: 1px solid var(--line); border-radius: 7px;
  color: var(--txt); font-size: 12.5px; padding: 0 10px; outline: none;
  font-family: inherit;
}
.lv-row input:focus, .lv-row select:focus { border-color: var(--cyan-dim); box-shadow: 0 0 0 2px rgba(6, 148, 180, .15); }
.lv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.lv-grid .lv-row.w90 input { max-width: 90px; }
.lv-seg { display: flex; gap: 6px; flex: 1; }
.lv-seg button {
  flex: 1; height: 32px; border-radius: 7px; font-size: 12px;
  border: 1px solid var(--line); background: #f7f9fd; color: var(--dim);
}
.lv-seg button.active { color: #ffffff; background: var(--cyan-dim); border-color: var(--cyan-dim); font-weight: 800; }
.lv-points-title { font-size: 12.5px; font-weight: 800; margin: 14px 0 6px; color: var(--txt); }
.lv-points-title span { font-size: 10.5px; color: var(--dim); font-weight: 400; margin-left: 8px; }
.lv-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.lv-table th {
  text-align: left; color: var(--cyan); font-size: 11px; font-weight: 700;
  padding: 5px 8px; border-bottom: 1px solid var(--cyan-dim);
}
.lv-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.lv-table td.dim { color: var(--dim); font-size: 10.5px; }
.lv-table input {
  width: 100%; height: 26px; background: #ffffff; border: 1px solid var(--line);
  border-radius: 5px; color: var(--cyan); font-size: 11px; padding: 0 8px; outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.lv-table input:focus { border-color: var(--cyan-dim); }
.lv-result { min-height: 22px; font-size: 12px; color: var(--dim); margin-top: 10px; line-height: 1.6; }
.lv-result.pending { color: var(--gold); }
.lv-result.ok { color: var(--green); }
.lv-ops { display: flex; gap: 10px; margin-top: 12px; }
.lv-btn {
  flex: 1; height: 36px; border-radius: 8px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line); background: #f7f9fd; color: var(--dim);
}
.lv-btn.primary { background: var(--cyan-dim); border-color: var(--cyan-dim); color: #ffffff; }
.lv-btn.primary:hover { filter: brightness(1.15); }
.lv-btn.primary:disabled { opacity: .6; cursor: wait; }
.lv-btn.ok { border-color: var(--green); color: var(--green); }
.lv-btn.ok:hover { background: rgba(15,185,129, .1); }

/* ---------- 移动端适配 ---------- */
@media (max-width: 900px) {
  #data-mode-pill { display: none; }
  .live-btn { font-size: 0; }
  .live-btn::after { content: "🔌"; font-size: 13px; }
}
@media (max-width: 768px) {
  #timeline-bar { left: 8px; right: 8px; bottom: 8px; padding: 6px 10px 5px; }
  .tl-head { gap: 8px; }
  .tl-title { font-size: 11px; }
  #tl-cursor-label { font-size: 11px; padding: 1px 7px; }
  .tl-actions button { padding: 2px 6px; font-size: 10px; }
  #tl-track { height: 30px; }
  .lv-grid { grid-template-columns: 1fr; }
  .live-box { max-height: 92vh; }
}
