/* ============================================================================
   冷站实时监控 · 最小闭环页面样式
   深色工业风：现场大屏常年 24 小时常亮，深色底 + 高对比数字比浅色更耐看
   ============================================================================ */
:root {
  --bg: #060a10;
  --pan: #0c1622;
  --pan2: #101d2b;
  --line: rgba(72, 140, 200, 0.18);
  --line2: rgba(72, 140, 200, 0.34);
  --txt: #eaf6ff;
  --txt2: #9ec4e2;
  --txt3: #5f87a8;
  --run: #35d29a;
  --standby: #ffb347;
  --alarm: #ff5a5a;
  --stop: #8b98a8;
  --accent: #35c2ff;
  --mono: Consolas, Monaco, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(ellipse at 50% -10%, #0c1a28 0%, var(--bg) 64%);
  color: var(--txt);
  font: 14px/1.5 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(9, 17, 27, 0.96), rgba(9, 17, 27, 0.72));
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 10px; height: 34px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #1d6fa5);
}
.brand h1 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: 0.5px; }
.brand p { margin: 2px 0 0; font-size: 11.5px; color: var(--txt3); }

.kpis { display: flex; gap: 10px; margin-left: auto; }
.kpi {
  min-width: 96px; padding: 6px 12px 7px;
  background: rgba(6, 12, 20, 0.66);
  border: 1px solid var(--line); border-radius: 9px;
}
.kpi .k { display: block; font-size: 10.5px; color: var(--txt3); }
.kpi b { font-family: var(--mono); font-size: 18px; font-weight: 400; }

.conn { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--txt2); }
.dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--stop);
  box-shadow: 0 0 0 3px rgba(139, 152, 168, 0.18);
}
.dot.on { background: var(--run); box-shadow: 0 0 0 3px rgba(53, 210, 154, 0.2); }
.dot.off { background: var(--alarm); box-shadow: 0 0 0 3px rgba(255, 90, 90, 0.2); }

/* ---------------------------------------------------------------- 工具条 */
main { padding: 14px 20px 60px; }
.toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 12.5px;
  background: rgba(6, 12, 20, 0.6); color: var(--txt2);
  border: 1px solid var(--line); transition: all .15s;
}
.tab:hover { border-color: var(--line2); color: var(--txt); }
.tab.on { background: rgba(53, 194, 255, 0.14); border-color: var(--accent); color: var(--txt); }
.tab em { font-style: normal; color: var(--txt3); margin-left: 5px; font-size: 11px; }

.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--txt2); cursor: pointer; }

/* ---------------------------------------------------------------- 卡片网格 */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
  background: linear-gradient(180deg, var(--pan2), var(--pan));
  border: 1px solid var(--line); border-left-width: 3px;
  border-radius: 10px; padding: 11px 13px 12px;
  transition: border-color .2s;
}
.card.run     { border-left-color: var(--run); }
.card.standby { border-left-color: var(--standby); }
.card.alarm   { border-left-color: var(--alarm); }
.card.stop    { border-left-color: var(--stop); }
.card:hover { border-color: var(--line2); }

.card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.card-head .code { font-family: var(--mono); font-size: 12px; color: var(--txt3); }
.card-head .name { font-size: 13.5px; color: var(--txt); flex: 1; }
.badge {
  font-size: 11px; padding: 1.5px 8px; border-radius: 10px;
  background: rgba(53, 210, 154, 0.14); color: var(--run);
  border: 1px solid rgba(53, 210, 154, 0.3);
}
.card.standby .badge { background: rgba(255, 179, 71, 0.13); color: var(--standby); border-color: rgba(255, 179, 71, 0.32); }
.card.stop .badge { background: rgba(139, 152, 168, 0.14); color: var(--stop); border-color: rgba(139, 152, 168, 0.3); }
.card.alarm .badge { background: rgba(255, 90, 90, 0.16); color: var(--alarm); border-color: rgba(255, 90, 90, 0.36); }

.rows { display: grid; gap: 4px; }
.row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.row .lbl { color: var(--txt3); min-width: 78px; }
.row .val {
  font-family: var(--mono); font-size: 14px; color: var(--txt);
  margin-left: auto; font-variant-numeric: tabular-nums;
}
.row .val.stale { color: #7a6a3a; }         /* 超过阈值未刷新：置灰提示，而不是继续显示旧值当真值 */
.row .unit { color: var(--txt3); font-size: 11px; min-width: 34px; text-align: right; }

.empty { color: var(--txt3); font-size: 13px; padding: 40px 0; text-align: center; }

/* ---------------------------------------------------------------- 页脚 */
.foot {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; gap: 16px;
  padding: 7px 20px; font-size: 11.5px; color: var(--txt3);
  background: rgba(6, 10, 16, 0.92); border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

/* ---------------------------------------------------------------- 登录 */
.login {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 12, 0.86); backdrop-filter: blur(4px);
}
.login-card {
  width: 320px; padding: 28px 26px 22px;
  background: linear-gradient(180deg, #0e1722, #0b111a);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.login-card h2 { margin: 0 0 4px; font-size: 18px; color: var(--txt); }
.login-sub { margin: 0 0 18px; font-size: 12px; color: var(--txt3); }
.login-card label {
  display: block; margin-bottom: 12px;
  font-size: 12px; color: var(--txt3);
}
.login-card input {
  width: 100%; margin-top: 4px; padding: 9px 10px;
  font-size: 13px; color: var(--txt);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line); border-radius: 7px; outline: none;
}
.login-card input:focus { border-color: #2f6f4f; }
.login-btn {
  width: 100%; margin-top: 6px; padding: 10px;
  font-size: 13.5px; font-weight: 600; color: #061009;
  background: linear-gradient(180deg, #35c47a, #23a05e);
  border: none; border-radius: 7px; cursor: pointer;
}
.login-btn:disabled { opacity: 0.55; cursor: default; }
.login-msg { min-height: 16px; margin: 10px 0 0; font-size: 12px; color: #e08a6a; }

/* 顶栏用户区 */
.conn .admin-link {
  padding: 3px 9px; margin-right: 8px; font-size: 11.5px;
  color: var(--txt2); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 5px;
}
.conn .admin-link:hover { color: var(--txt); border-color: var(--accent); text-decoration: none; }
.conn .user { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.conn .user #userName { color: var(--txt2); font-size: 12px; }
.conn .logout {
  padding: 2px 8px; font-size: 11px; color: var(--txt3);
  background: transparent; border: 1px solid var(--line);
  border-radius: 5px; cursor: pointer;
}
.conn .logout:hover { color: var(--txt); border-color: #2f6f4f; }

/* ---------------------------------------------------------------- 趋势抽屉 */
.trend {
  position: fixed; inset: 0; z-index: 998;
  display: flex; justify-content: flex-end;
  background: rgba(2, 5, 9, 0.6); backdrop-filter: blur(2px);
}
.trend-panel {
  width: min(680px, 96vw); height: 100%;
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #0d151f, #0a1017);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.trend-head { display: flex; align-items: center; }
.trend-head b { font-size: 16px; color: var(--txt); }
.trend-close {
  margin-left: auto; width: 28px; height: 28px;
  color: var(--txt3); background: transparent;
  border: 1px solid var(--line); border-radius: 6px;
  cursor: pointer; font-size: 13px;
}
.trend-close:hover { color: var(--txt); border-color: #2f6f4f; }
.trend-ranges { display: flex; gap: 6px; }
.trend-ranges button {
  padding: 4px 12px; font-size: 12px; color: var(--txt3);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.trend-ranges button.on { color: #061009; background: #35c47a; border-color: #35c47a; font-weight: 600; }
.trend-points {
  display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 96px; overflow: auto;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
}
.trend-points .tp {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--txt2); cursor: pointer; user-select: none;
}
.trend-points .tp input { accent-color: #35c47a; }
.trend-points .dim { color: var(--txt3); font-size: 12px; }
.trend-cv {
  flex: 1; min-height: 260px; width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line); border-radius: 8px;
}
.trend-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.trend-legend .lg { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--txt2); }
.trend-legend .lg i { width: 14px; height: 3px; border-radius: 2px; }
.trend-hint { margin: 0; font-size: 11px; color: var(--txt3); }

/* 卡片可点击的暗示 */
.card { cursor: pointer; }
.card:hover { border-color: #2f6f4f; }

/* ---------------------------------------------------------------- 顶部导航与报警 */
.nav { display: flex; gap: 6px; margin-left: 18px; }
.nav button {
  padding: 6px 14px; font-size: 13px; color: var(--txt3);
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  border-radius: 7px; cursor: pointer;
  white-space: nowrap;   /* 6 个视图按钮后顶栏变挤，禁止文字换行 */
}
.alarm-btn { white-space: nowrap; }
.nav button.on { color: #061009; background: #35c47a; border-color: #35c47a; font-weight: 600; }
.alarm-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin-right: 12px; padding: 4px 10px; font-size: 12px; color: var(--txt2);
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  border-radius: 7px; cursor: pointer;
}
.alarm-btn b { font-family: var(--mono); color: var(--txt); }
.alarm-btn b.hot { color: #ff6b6b; }

/* 报警面板 */
.alarm-panel {
  position: fixed; inset: 0; z-index: 998;
  display: flex; justify-content: flex-end;
  background: rgba(2,5,9,0.6); backdrop-filter: blur(2px);
}
.alarm-box {
  width: min(560px, 96vw); height: 100%;
  display: flex; flex-direction: column; gap: 12px; padding: 18px 20px;
  background: linear-gradient(180deg, #0d151f, #0a1017);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 60px rgba(0,0,0,0.5);
}
.alarm-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.alarm-row {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.alarm-row.act { border-left: 3px solid #ff6b6b; }
.alarm-row.clr { opacity: 0.62; border-left: 3px solid #3a4a3f; }
.alarm-row.lv-critical.act { border-left-color: #ff4d4f; }
.alarm-row.lv-major.act { border-left-color: #ff9c4d; }
.alarm-row.lv-minor.act { border-left-color: #ffd84d; }
.alarm-row.lv-info.act { border-left-color: #6aa9ff; }
.ar-main { display: flex; gap: 8px; align-items: baseline; }
.ar-lv { font-size: 11px; font-weight: 700; color: #ff8f8f; min-width: 34px; }
.ar-msg { font-size: 13px; color: var(--txt); }
.ar-sub { display: flex; gap: 12px; margin-top: 5px; font-size: 11.5px; color: var(--txt3); }
.ar-ack {
  margin-left: auto; padding: 2px 10px; font-size: 11.5px; color: #061009;
  background: #35c47a; border: none; border-radius: 5px; cursor: pointer;
}
.ar-ack:disabled { opacity: 0.5; }
.dim { color: var(--txt3); }

/* ---------------------------------------------------------------- 控制区 */
.trend-control {
  border-top: 1px dashed var(--line); padding-top: 10px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12.5px;
}
.ctl-head { color: var(--txt3); font-size: 11.5px; }
.ctl-lock { display: flex; align-items: center; gap: 10px; color: var(--txt2); flex-wrap: wrap; }
.ctl-lock b { color: var(--txt); }
.ctl-btn {
  padding: 3px 10px; font-size: 11.5px; color: var(--txt2);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  border-radius: 5px; cursor: pointer;
}
.ctl-btn:hover { color: var(--txt); border-color: #2f6f4f; }
.ctl-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* 主操作按钮：绿色 = 安全方向的操作（解锁机组 / 重新挂牌 / 取消）。
   ⚠ 注意别把「下发」这类真正改变现场设备的动作也用绿色 —— 见下面的 ctl-danger。 */
.ctl-btn.ctl-primary { color: #0b1a12; background: #4fd1a1; border-color: #4fd1a1; font-weight: 600; }
.ctl-btn.ctl-primary:hover { background: #5fdfae; border-color: #5fdfae; }
/* 危险操作按钮：橙红 = 会真正作用于现场设备的动作（确认下发）。
   工业 HMI 惯例——绿色在本行业语义里是"运行/安全/正常"，用绿色做确认下发，
   等于在视觉上告诉操作员"这一步是安全的"，与弹窗警示语自相矛盾，也容易被
   条件反射式点下去。橙红让手指在落下前多停半秒。 */
.ctl-btn.ctl-danger {
  color: #1a0e06; background: #f0842e; border-color: #f0842e; font-weight: 600;
}
.ctl-btn.ctl-danger:hover { background: #ff9544; border-color: #ff9544; }
.ctl-row { display: flex; align-items: center; gap: 8px; }
.ctl-row .lbl { color: var(--txt2); min-width: 130px; }
.ctl-row .lbl em { color: var(--txt3); font-style: normal; font-size: 11px; }
.ctl-row input {
  width: 110px; padding: 5px 8px; font-size: 12.5px; color: var(--txt);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 5px;
}
.ctl-msg { min-height: 15px; color: #8fd6b2; font-size: 12px; }

/* ---------------------------------------------------------------- 下发确认弹窗 */
/* 下发控制前的人工确认。层级必须高于趋势抽屉（.trend = 998）与报警面板（998），
   否则弹窗会被抽屉盖住 —— 那正是「点了下发却什么都没发生」的典型成因。 */
.ctl-modal-mask {
  position: fixed; inset: 0; z-index: 9990;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 12, 0.62);
}
.ctl-modal {
  width: 380px; max-width: calc(100vw - 40px);
  background: var(--panel, #12181f); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 18px 48px rgba(0,0,0,0.55);
  overflow: hidden;
}
.ctl-modal-head {
  padding: 12px 16px; font-size: 13.5px; font-weight: 600; color: var(--txt);
  border-bottom: 1px solid var(--line);
}
.ctl-modal-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.ctl-cfm-row { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; }
.ctl-cfm-row > span { color: var(--txt3); min-width: 52px; }
.ctl-cfm-row > b { color: var(--txt); font-weight: 500; }
.ctl-cfm-row .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
/* 目标值高亮：用暖橙与「确认下发」按钮同色系 —— 这是操作员最需要看清、
   也最容易填错的字段，视觉上应该"跳出来"，而不是融进一片绿色读数里。 */
.ctl-cfm-val { color: #ffa94d !important; font-size: 15px; font-weight: 700 !important; }
.ctl-cfm-warn { margin: 4px 0 0; font-size: 11.5px; color: #f0a92e; line-height: 1.5; }
.ctl-modal-foot {
  padding: 11px 16px; display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- 能耗报表页 */
.hint2 { font-size: 11.5px; color: var(--txt3); }
.energy-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px;
}
.energy-kpis .kpi { background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 10px; }
.energy-two { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; }
.energy-cv {
  height: 380px; width: 100%;
  background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: 10px;
}
.energy-tb { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.energy-tb th, .energy-tb td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.energy-tb th { color: var(--txt3); font-weight: 500; font-size: 11.5px; }
.energy-tb td { color: var(--txt2); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 运维工单 */
.ar-ack.wo { background: rgba(255,255,255,0.06); color: var(--txt2); border: 1px solid var(--line); }
.wo-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; overflow: auto; max-height: calc(100vh - 210px); }
.wo-card {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,0.02);
}
.wo-card.st-open { border-left: 3px solid #ff9c4d; }
.wo-card.st-accepted { border-left: 3px solid #35c47a; }
.wo-card.st-closed { border-left: 3px solid #3a4a3f; opacity: 0.72; }
.wo-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wo-code { font-family: var(--mono); font-size: 13px; color: var(--txt); margin-right: 4px; }
.wo-badge {
  padding: 1px 8px; font-size: 11px; border-radius: 9px;
  background: rgba(255,255,255,0.05); color: var(--txt3); border: 1px solid var(--line);
}
.wo-badge.prio { font-weight: 600; }
.p-high .wo-badge.prio { color: #ff6b6b; border-color: rgba(255,107,107,0.4); }
.p-normal .wo-badge.prio { color: #ffd84d; border-color: rgba(255,216,77,0.35); }
.p-low .wo-badge.prio { color: #8fd6b2; border-color: rgba(143,214,178,0.3); }
.wo-head .ctl-btn { margin-left: auto; }
.wo-descr { margin: 8px 0 6px; font-size: 13px; color: var(--txt2); line-height: 1.5; }
.wo-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--txt3); }

/* ---------------------------------------------------------------- 工艺组态 */
.scada-wrap {
  margin-top: 12px; width: 100%;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.scada-svg { display: block; width: 100%; height: auto; }
.scada-flow { animation: scadaflow 0.9s linear infinite; }
@keyframes scadaflow {
  to { stroke-dashoffset: -24; }
}
.scada-name {
  fill: #d7e2ea; font-size: 15px; font-weight: 600;
  font-family: system-ui, sans-serif;
}
.scada-val {
  fill: #9fe8c0; font-size: 13px;
  font-family: ui-monospace, monospace;
}

/* ============================================================
   2D 图控 + 图控配置（画法移植自 demo chiller-3d/css/app.css）
   图元是"设备立体简图"：金属渐变 + 端面 + 名牌板 + 参数面板
   管线是"工程图纸风格"：深色底衬 + 介质色虚线 + 流动亮虚线 + 流向箭头
   ============================================================ */
.scada-cfg-wrap {
  margin-top: 12px; width: 100%;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}

/* ---- 图控配置页：双工作区（2D 工艺组态 / 三维组态）----
   同一页内切换 —— 共用"设备清单 + 属性 + 保存落库"的心智模型，只换画布。 */
.cfg-ws { margin-top: 12px; }
.cfg-ws-tabs {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.cfg-ws-tabs .tab {
  padding: 7px 18px; border-radius: 8px 8px 0 0; cursor: pointer;
  font-size: 13px; color: var(--txt3);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line); border-bottom: 2px solid transparent;
  transition: all .15s;
}
.cfg-ws-tabs .tab:hover { color: var(--txt2); border-color: var(--line2); }
.cfg-ws-tabs .tab.on {
  color: var(--txt); background: rgba(53,194,255,0.10);
  border-color: var(--accent); border-bottom-color: var(--accent);
}
.cfg-ws-hint {
  margin-left: auto; font-size: 11.5px; color: #4f7a9c; font-style: normal;
}
.cfg-ws-body { min-height: 0; }

/* ---- 按钮组（demo 的 .btn 系列）---- */
.btn {
  padding: 6px 14px; border-radius: 7px; cursor: pointer; font-size: 12.5px;
  background: rgba(6, 12, 20, 0.6); color: var(--txt2);
  border: 1px solid var(--line); transition: all .15s;
}
.btn:hover { border-color: var(--line2); color: var(--txt); }
.btn.primary { background: rgba(53, 194, 255, 0.16); border-color: var(--accent); color: var(--txt); }
.btn.danger { border-color: rgba(255, 90, 90, 0.4); color: #ff8a8a; }
.btn.small { padding: 3px 10px; font-size: 11.5px; }
.btn.small.on { background: rgba(53, 194, 255, 0.14); border-color: var(--accent); color: var(--txt); }

/* ---- 2D 图控容器 ---- */
.p2-root {
  position: relative; height: calc(100vh - 190px); min-height: 560px;
  overflow: hidden; border-radius: 12px;
  background: radial-gradient(ellipse at 50% -10%, #0c1a28 0%, #060a10 64%);
}
.p2-top {
  position: absolute; top: 0; left: 0; right: 0; height: 54px; z-index: 12;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 14px;
  background: linear-gradient(180deg, rgba(9, 17, 27, 0.96), rgba(9, 17, 27, 0.7));
  border-bottom: 1px solid rgba(72, 140, 200, 0.2);
}
.p2-kpis { display: flex; gap: 8px; }
.p2-kpi { min-width: 92px; padding: 4px 12px 5px; border-radius: 9px;
  background: rgba(6, 12, 20, 0.66); border: 1px solid rgba(72, 140, 200, 0.18); }
.p2-kpi .k { font-size: 10.5px; color: #6b93b2; margin-bottom: 1px; letter-spacing: .3px; }
.p2-kpi .v { font-size: 17px; line-height: 1.15; color: #9fe8ff; font-family: var(--mono);
  text-shadow: 0 0 12px rgba(53, 194, 255, 0.35); }
.p2-ops { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.p2-body { position: absolute; inset: 54px 0 0 0; }
.p2-stage { position: relative; overflow: hidden; cursor: grab; width: 100%; height: 100%; }
.p2-stage.dragging { cursor: grabbing; }
.p2-svg { width: 100%; height: 100%; display: block; }
.p2-svg .p2-grid line { stroke: rgba(40, 80, 120, 0.13); stroke-width: 0.6; }
.p2-hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: #4a6b86; z-index: 11; pointer-events: none; white-space: nowrap; }

/* ---- 管线：工程图纸风格 ---- */
.p2-line .p2-halo { fill: none; stroke: #05090f; stroke-opacity: 0.86;
  stroke-linecap: round; stroke-linejoin: round; }
.p2-line .p2-base { fill: none; stroke-linecap: butt; stroke-linejoin: round;
  stroke-dasharray: 10 7; opacity: 0.95; transition: opacity .22s; }
.p2-line.main .p2-base { stroke-dasharray: 13 8; }
.p2-line .p2-flow { fill: none; stroke-linecap: butt; stroke-dasharray: 4 16;
  opacity: 0; transition: opacity .25s; }
.p2-line.on .p2-flow { opacity: 1; animation: p2flow 1.05s linear infinite; }
.p2-line:not(.on) .p2-base { opacity: 0.3; stroke-dasharray: 3 9; }
.p2-line .p2-arrows { transition: opacity .25s; opacity: 0.95; }
.p2-line:not(.on) .p2-arrows { opacity: 0.16; }
@keyframes p2flow { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -20; } }
.p2-line .p2-hit { fill: transparent; cursor: pointer; }
.p2-line .p2-arrows path, .p2-line .p2-node-dot { pointer-events: none; }
.p2-node-dot { stroke: #05090f; stroke-width: 1.2; }
.p2-root.hide-labels .p2-labels { display: none; }
.p2-lg-label { font-size: 15px; paint-order: stroke; stroke: rgba(6, 10, 16, 0.85); stroke-width: 3px; }

/* ---- 设备图元 ---- */
.p2-node { cursor: pointer; }
.p2-node .p2-box { fill: rgba(9, 17, 27, 0.72); stroke: rgba(70, 120, 160, 0.42); stroke-width: 1.1; }
.p2-node[data-type="chiller"] .p2-box { stroke: rgba(58, 112, 153, 0.6); }
.p2-node[data-type="tower"] .p2-box { stroke: rgba(96, 128, 66, 0.6); }
.p2-node[data-type="pump"] .p2-box { stroke: rgba(47, 120, 96, 0.6); }
.p2-node .p2-box.cool { stroke: rgba(96, 128, 66, 0.6); }
.p2-node .p2-box.sup { stroke: rgba(47, 107, 160, 0.7); }
.p2-node .p2-box.ret { stroke: rgba(43, 122, 92, 0.7); }
.p2-node .p2-shell { fill: url(#p2-metalH); stroke: #8fb0c8; stroke-width: 0.9; }
.p2-node .p2-shell-v { fill: url(#p2-metalV); stroke: #8fb0c8; stroke-width: 0.9; }
.p2-node[data-type="tower"] .p2-shell-v { fill: url(#p2-towerG); stroke: #86a892; }
.p2-node .p2-shell-cap { fill: url(#p2-capH); stroke: #7a97ad; stroke-width: 0.8; }
.p2-node .p2-wrap { fill: url(#p2-bodyG); stroke: #56789a; stroke-width: 0.9; }
.p2-node .p2-hood { fill: rgba(66, 96, 126, 0.9); stroke: #86adcc; stroke-width: 0.9; }
.p2-node .p2-fan { fill: rgba(26, 44, 62, 0.92); stroke: #9dc3de; stroke-width: 0.9; }
.p2-node .p2-fr { fill: #7f97ab; stroke: #aec6d8; stroke-width: 0.7; }
.p2-node .p2-base { fill: #2c3b4b; stroke: #4e6a84; stroke-width: 0.8; }
.p2-node .p2-edge { fill: none; stroke: #6d8ba5; stroke-width: 1; }
.p2-node .p2-louver { fill: none; stroke: #4e6d86; stroke-width: 1.4; stroke-linecap: round; }
.p2-node .p2-louver2 { fill: none; stroke: rgba(12, 26, 20, 0.62); stroke-width: 2.4; stroke-linecap: round; }
.p2-node .p2-edge2 { fill: none; stroke: rgba(120, 168, 150, 0.5); stroke-width: 1.2; }
.p2-node .p2-tower-core { fill: rgba(20, 38, 30, 0.42); stroke: none; }
.p2-node .p2-fill { fill: none; stroke: rgba(142, 182, 212, 0.5); stroke-width: 1; }
.p2-node .p2-pipe { fill: none; stroke: #6d90a8; stroke-width: 2.4; stroke-linecap: round; }
.p2-node .p2-chan { fill: none; stroke: #4b7ea8; stroke-width: 3.4; stroke-linecap: butt; }
.p2-node .p2-glass { fill: url(#p2-glassG); stroke: #62b6e8; stroke-width: 0.8; }
.p2-node .p2-plate { fill: url(#p2-plateG); stroke: #3f6d92; stroke-width: 0.9; }
.p2-node .p2-plate.mainline { stroke: rgba(120, 170, 210, 0.5); }
.p2-node .p2-panel { fill: rgba(5, 12, 20, 0.72); stroke: rgba(70, 120, 160, 0.26); stroke-width: 0.8; }
.p2-node .p2-lamp { fill: #35d29a; stroke: none; }
.p2-node .p2-lamp-slot { fill: #35d29a; stroke: none; }
.p2-node .p2-hit { fill: transparent; cursor: pointer; }

/* ---- 图元文字 ---- */
.p2-node .p2-name { font-size: 12px; fill: #dceaf6; }
.p2-node .p2-name.xs { font-size: 10.5px; }
.p2-node .p2-k { font-size: 10px; fill: #6b93b2; }
.p2-node .p2-v { font-size: 10.5px; fill: #eaf6ff; font-family: var(--mono); }
.p2-node .p2-v.sm { font-size: 10px; }
.p2-node .p2-scr-val { font-size: 11.5px; fill: #d8f4ff; font-family: var(--mono); }
.p2-hdr-param { font-size: 10px; fill: #9ec4e2; font-family: var(--mono); }
.p2-fm-val { font-size: 11.5px; fill: #d8f4ff; font-family: var(--mono); }
.p2-fm-unit { font-size: 8.5px; fill: #7fa3c0; }

/* ---- 状态与交互 ---- */
.p2-node:hover .p2-box { stroke: #35c2ff; }
.p2-node:hover .p2-name { fill: #7fd4ff; }
.p2-node.st-alarm .p2-box { stroke: #ff5a5a; }
.p2-node.st-alarm .p2-lamp { animation: p2alarm 1s ease-in-out infinite; }
.p2-node.st-off .p2-shell, .p2-node.st-off .p2-shell-v,
.p2-node.st-off .p2-wrap, .p2-node.st-off .p2-hood { opacity: 0.62; }
@keyframes p2alarm { 0%, 100% { fill-opacity: 1; } 50% { fill-opacity: 0.3; } }
.p2-node[data-type="valve"] .p2-valve-body { fill: #35597a; stroke: #8fb6d4; stroke-width: 1.1; }
.p2-node[data-type="valve"] .p2-valve-hub { fill: #b8d4e8; }
.p2-node[data-type="valve"] .p2-valve-act { fill: #3a5570; stroke: #8fb6d4; stroke-width: 1; }
.p2-node[data-type="valve"] .p2-valve-lamp { fill: #35d29a; }
.p2-root.hide-params .p2-panel, .p2-root.hide-params .p2-k,
.p2-root.hide-params .p2-v, .p2-root.hide-params .p2-hdr-param,
.p2-root.hide-params .p2-fm-val, .p2-root.hide-params .p2-fm-unit,
.p2-root.hide-params .p2-scr-val { display: none; }

/* ---- 图例 ---- */
.p2-legend { position: absolute; left: 14px; bottom: 12px; z-index: 12; width: 200px;
  padding: 10px 12px 12px; border-radius: 11px; background: rgba(9, 17, 27, 0.86);
  border: 1px solid rgba(72, 140, 200, 0.22); backdrop-filter: blur(8px); }
.p2-lg-title { font-size: 11.5px; color: #7fb6e0; letter-spacing: 1px; margin-bottom: 8px; }
.p2-lg-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #9ab6cd; margin-bottom: 6px; }
.p2-lg-row i { width: 16px; height: 4px; border-radius: 2px; flex: none; }
.p2-lg-row .st { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.p2-lg-note { font-size: 10px; color: #4f7a9c; line-height: 1.6; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed rgba(72, 140, 200, 0.18); }

/* ============================================================
   图控配置编辑器（交互移植自 demo admin-2d）
   ============================================================ */
.e2-wrap { display: grid; grid-template-columns: 190px 1fr 300px; gap: 12px;
  height: calc(100vh - 190px); min-height: 560px; }
.cfg-col { min-height: 0; }
.cfg-col-title { font-size: 11px; color: #7fb6e0; letter-spacing: .5px; margin: 2px 0 8px; }
.cfg-col-title em { font-style: normal; color: var(--txt3); margin-left: 8px; }
.e2-left { display: flex; flex-direction: column; }
.e2-list { flex: 1; overflow-y: auto; padding-right: 2px; }
.e2-group { margin-bottom: 8px; }
.e2-group-t { font-size: 11px; color: #7fb6e0; margin: 6px 0 4px; letter-spacing: .4px; }
.e2-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px;
  font-size: 11.5px; color: #b9d2e6; cursor: pointer; border: 1px solid transparent; }
.e2-item:hover { background: rgba(53, 194, 255, 0.08); border-color: rgba(53, 194, 255, 0.28); }
.e2-item.on { background: rgba(53, 194, 255, 0.16); border-color: #35c2ff; color: #eaf6ff; }
.e2-item i { width: 12px; height: 4px; border-radius: 2px; flex: none; }
.e2-item b { font-weight: 500; }
.e2-edited { font-style: normal; font-size: 9.5px; color: #ffb347; margin-left: auto; }
.e2-canvas-col { display: flex; flex-direction: column; }
.e2-canvas { flex: 1; min-height: 0; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse at 50% -10%, #0c1a28 0%, #060a10 64%);
  border: 1px solid rgba(72, 140, 200, 0.2); }
.e2-canvas svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.e2-canvas svg .p2-node, .e2-canvas svg .p2-line, .e2-canvas svg .e2-label { cursor: move; }
.e2-label-hit { cursor: move; }
.e2-handles .e2-sel { fill: none; stroke: #35c2ff; stroke-width: 1.6; stroke-dasharray: 7 5; }
.e2-handles .e2-sel-line { fill: none; stroke: #35c2ff; stroke-width: 2; stroke-dasharray: 9 6; opacity: .95; }
.e2-handles .e2-stem { stroke: #35c2ff; stroke-width: 1.2; stroke-dasharray: 4 3; }
.e2-handles .e2-rot { fill: rgba(9, 20, 32, .96); stroke: #35c2ff; stroke-width: 1.6; cursor: grab; }
.e2-handles .e2-rot:active { cursor: grabbing; }
.e2-handles .e2-rot-dot { fill: #35c2ff; pointer-events: none; }
.e2-handles .e2-vtx { fill: #0b1a28; stroke: #ffb347; stroke-width: 1.6; cursor: move; }
.e2-handles .e2-vtx:hover { fill: #ffb347; }
.cfg-right { display: flex; flex-direction: column; overflow-y: auto; }
.cfg-props { flex: none; }
.prop-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px;
  color: var(--txt2); padding: 4px 2px; border-bottom: 1px dashed rgba(72, 140, 200, 0.1); }
.prop-row label { width: 62px; flex: none; color: var(--txt3); }
.prop-row .prop-val { color: var(--txt); font-family: var(--mono); font-size: 11.5px; }
.prop-row input {
  background: rgba(6, 12, 20, 0.7); border: 1px solid var(--line); border-radius: 5px;
  color: var(--txt); font-family: var(--mono); font-size: 11.5px; padding: 3px 6px; min-width: 0;
}
.e2-ops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.e2-ops .btn { flex: 1 1 46%; }
.e2-btnrow { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.e2-vtx-head { font-size: 11px; color: #7fb6e0; margin: 10px 0 4px; }
.e2-vtx-row { gap: 5px; }
.e2-vtx-row label { width: 24px; }
.e2-vtx-row input { width: 56px; flex: 1; }
.cfg-empty { font-size: 11.5px; color: #5f87a8; line-height: 1.7; padding: 10px 4px; }
.cfg-status { font-size: 11.5px; color: #5f87a8; margin-top: 4px; }
.cfg-status.ok { color: #35d29a; }
.cfg-status.err { color: #ffb347; }
.cfg-col-tip { font-size: 10.5px; color: #4f7a9c; line-height: 1.7; margin-top: 8px; }

/* ============================================================
   三维组态配置（scene3d-edit.js）
   画布是"平面俯视图"（工程布置图打法）：横轴 = 东西(X)，纵轴 = 进深(Z)，
   标高不进平面、走右侧数值面板 —— 与暖通设备布置图 + 剖面标高的读图习惯一致。
   复用 2D 编辑器的外壳样式（.e2-wrap / .cfg-col / .e2-item / .prop-row），
   这里只补三维特有的画布元素。
   ============================================================ */
.s3-line { transition: stroke-width .1s; }
.e2-canvas svg .s3-node, .e2-canvas svg .s3-line { cursor: move; }
.s3-handles .s3-sel { fill: none; stroke: #35c2ff; stroke-width: 1.8; stroke-dasharray: 7 5; }
.s3-handles .s3-sel-line { fill: none; stroke: #35c2ff; stroke-width: 2; stroke-dasharray: 9 6; opacity: .9; }
.s3-handles .s3-rot { fill: rgba(9, 20, 32, .96); stroke: #35c2ff; stroke-width: 1.8; cursor: grab; }
.s3-handles .s3-rot:active { cursor: grabbing; }
.s3-handles .s3-rot-dot { fill: #35c2ff; pointer-events: none; }
.s3-handles .s3-vtx { fill: #0b1a28; stroke: #ffb347; stroke-width: 1.8; cursor: move; }
.s3-handles .s3-vtx:hover { fill: #ffb347; }
.s3-handles .s3-stem { stroke: rgba(53, 194, 255, .6); stroke-width: 1.4; }
/* 三维属性面板：坐标输入是三列（X / Z / 标高Y），比 2D 多一列 */
.prop-sec { font-size: 10.5px; color: #7fb6e0; letter-spacing: .4px;
  margin: 12px 0 4px; padding-bottom: 3px; border-bottom: 1px solid rgba(72, 140, 200, .18); }
.s3-num { gap: 6px; }
.s3-num label { width: 56px; }
.s3-num input { width: 68px; flex: none; }
.s3-num em { font-style: normal; font-size: 10.5px; color: var(--txt3); }
.s3-vtx-row label { width: 22px; }
.s3-vtx-row input { width: 48px; flex: 1; min-width: 0; }
.s3-vtx-row button { flex: none; padding: 2px 7px; }

/* ============================================================================
   设备详情面板（device-panel.js）—— 二维工艺组态页点设备打开
   与三维监控页的详情面板（hud.css 里 #view3D .panel-detail 那套）是**同一套语义**：
   参数行 + 采集点位实时值 + 远程设定下发。样式刻意做得相近（同样的 .dr / .dsec /
   .dtags / .dset / .vbtn 类名与配色），让"点设备出す详情"在两个页面看起来就是同一件事。
   ============================================================================ */
.p2-detail {
  position: absolute; top: 66px; right: 14px; width: 330px; max-height: calc(100% - 96px);
  z-index: 14; display: none; flex-direction: column;
  background: linear-gradient(180deg, rgba(11, 22, 34, 0.97), rgba(8, 16, 26, 0.97));
  border: 1px solid rgba(72, 140, 200, 0.3); border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}
.p2-detail.show { display: flex; animation: p2dIn .22s ease; }
@keyframes p2dIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.dv-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border-bottom: 1px solid rgba(72, 140, 200, 0.2);
}
.dv-bar-t { font-size: 12.5px; color: #9ec4e2; letter-spacing: .5px; }
.dv-close {
  margin-left: auto; padding: 0 6px; font-family: inherit; font-size: 14px;
  color: #5f87a8; background: none; border: none; cursor: pointer; line-height: 1.4;
}
.dv-close:hover { color: #eaf6ff; }
.dv-body {
  padding: 11px 13px 13px; overflow-y: auto; flex: 1; min-height: 0;
}
.dv-body::-webkit-scrollbar { width: 4px; }
.dv-body::-webkit-scrollbar-thumb { background: rgba(72, 140, 200, 0.35); border-radius: 2px; }
.dv-control {
  border-top: 1px solid rgba(72, 140, 200, 0.2);
  padding: 11px 13px; max-height: 46%; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; font-size: 12.5px;
}
.dv-control::-webkit-scrollbar { width: 4px; }
.dv-control::-webkit-scrollbar-thumb { background: rgba(72, 140, 200, 0.35); border-radius: 2px; }
.dv-control:empty { display: none; }

/* 面板抬头：状态灯 + 简称 + 编号 */
.dv-head { padding-bottom: 9px; border-bottom: 1px dashed rgba(72, 140, 200, 0.16); }
.dv-title { display: flex; align-items: center; gap: 7px; }
.dv-lamp { width: 8px; height: 8px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 3px rgba(139, 152, 168, 0.16); }
.dv-title b { font-size: 14px; font-weight: 500; color: #eaf6ff; }
.dv-title em { font-style: normal; font-family: var(--mono); font-size: 11.5px; color: #7fb6e0; margin-left: auto; }
.dv-sub { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-size: 11.5px; }
.dv-st { color: #eaf6ff; }
.dv-type { color: #5f87a8; }
.p2-detail.dv-alarm { border-color: rgba(255, 90, 90, 0.55); }

/* 面板内部复用三维详情面板的那套类名（配色在此按二维页面底色微调） */
.p2-detail .dsec { font-size: 11.5px; color: #7fb6e0; margin: 11px 0 6px; }
.p2-detail .dr { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0;
  border-bottom: 1px dashed rgba(72, 140, 200, 0.14); }
.p2-detail .dr:last-child { border-bottom: none; }
.p2-detail .dr span { color: #7fa4c2; }
.p2-detail .dr b { color: #e2f1fd; font-weight: 400; font-family: var(--mono); }
.p2-detail .dtags { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.p2-detail .dtag { display: flex; align-items: baseline; gap: 4px; font-size: 11px; padding: 4px 6px;
  border-radius: 6px; background: rgba(6, 12, 20, 0.66); border: 1px solid rgba(72, 140, 200, 0.16); }
.p2-detail .dtag span { color: #8fb4cf; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2-detail .dtag b { font-family: var(--mono); font-weight: 400; }
.p2-detail .dtag em { font-style: normal; color: #5f87a8; font-size: 10px; }
.p2-detail .dtag.bad { border-color: rgba(255, 90, 90, 0.5); }
.p2-detail .dtag.set { border-color: rgba(255, 179, 71, 0.42); background: rgba(255, 179, 71, 0.07); }
.p2-detail .dtag .wr { font-style: normal; font-size: 9px; color: #ffb347;
  border: 1px solid rgba(255, 179, 71, 0.6); border-radius: 3px; padding: 0 2px; vertical-align: 1px; }
.p2-detail .dtag-more { font-size: 11px; color: #5f87a8; margin-top: 7px; line-height: 1.6; }
.p2-detail .dset { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.p2-detail .dset span { font-size: 11.5px; color: #9ec4e2; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2-detail .dset input { width: 72px; flex: none; font-family: var(--mono); font-size: 12px; color: #eaf6ff;
  background: rgba(6, 12, 20, 0.9); border: 1px solid rgba(72, 140, 200, 0.36); border-radius: 7px;
  padding: 5px 7px; outline: none; }
.p2-detail .dset input:focus { border-color: #35c2ff; box-shadow: 0 0 0 2px rgba(53, 194, 255, 0.18); }
.p2-detail .dset input.err { border-color: #ff5a5a; color: #ffc9c9; }
.p2-detail .dset em { font-style: normal; font-size: 11px; color: #7fb6e0; width: 30px; flex: none; }
.p2-detail .mini { font-family: inherit; font-size: 11.5px; color: #9ec4e2; cursor: pointer;
  padding: 5px 10px; border-radius: 7px; background: rgba(9, 17, 27, 0.8);
  border: 1px solid rgba(72, 140, 200, 0.3); }
.p2-detail .mini:hover { color: #eaf6ff; border-color: #35c2ff; }
.p2-detail .mini.primary { color: #06131f; background: #35c2ff; border-color: #35c2ff; }
.p2-detail .mini:disabled { opacity: 0.55; cursor: wait; }
.p2-detail .dacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.p2-detail .vbtn { flex: 1 1 44%; font-family: inherit; font-size: 12px; color: #cfe9ff; cursor: pointer;
  padding: 7px 0; border-radius: 8px; background: rgba(53, 194, 255, 0.12);
  border: 1px solid rgba(53, 194, 255, 0.45); transition: all .18s; }
.p2-detail .vbtn:hover { background: #35c2ff; color: #06131f; }
.dv-msg { margin-top: 10px; font-size: 11.5px; min-height: 15px; color: #8fd6b2; line-height: 1.6; }
.dv-msg.err { color: #ffb0b0; }

/* 被选中的图元：加一圈呼吸高亮，明确"面板讲的是这一台" */
.p2-node.sel .p2-box { stroke: #35c2ff !important; stroke-width: 2.2 !important; }
.p2-node.sel { filter: drop-shadow(0 0 9px rgba(53, 194, 255, 0.55)); }


/* ============================================================================
   组态图元 CRUD 弹窗（scada-crud.js）—— 非破坏性的表单/选择类弹窗
   与 .ctl-modal（控制下发确认）分开命名，因为两者语义不同：
     · .ctl-modal  —— 工业操作的"最后一道人工确认"，视觉要重、要显眼；
     · .sc-modal   —— 配置期的表单，信息密度优先，保持克制的边框与留白。
   沿用 .ctl-modal-mask 作遮罩，保证"同一时刻只有一个弹窗"的观感一致。
   ============================================================================ */
.sc-modal {
  width: 100%; background: var(--pan); border: 1px solid var(--line2);
  border-radius: 10px; box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
  display: flex; flex-direction: column; max-height: min(78vh, 720px); overflow: hidden;
}
.sc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; font-size: 13.5px; font-weight: 600; color: var(--txt);
  background: linear-gradient(180deg, rgba(53, 194, 255, 0.09), transparent);
  border-bottom: 1px solid var(--line);
}
.sc-x {
  width: 24px; height: 24px; flex: none; border-radius: 5px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--txt2); font-size: 12px;
}
.sc-x:hover { border-color: var(--line2); color: var(--txt); }
.sc-sub {
  padding: 9px 16px; font-size: 12px; line-height: 1.65; color: var(--txt3);
  border-bottom: 1px solid var(--line);
}
.sc-sub b { color: var(--txt2); font-weight: 600; }
.sc-body { padding: 12px 16px; overflow: auto; flex: 1; }
.sc-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px;
  padding: 11px 16px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.16);
}
.sc-count { margin-right: auto; font-size: 12px; color: var(--txt3); }
.sc-count b { color: var(--accent); }
.sc-empty { padding: 22px 8px; text-align: center; font-size: 12.5px; color: var(--txt3); }
.sc-hint { margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--txt3); }
.sc-warn { margin: 8px 0 0; font-size: 12.5px; line-height: 1.65; color: #ffb347; }
.sc-confirm-body { font-size: 13px; line-height: 1.8; color: var(--txt2); }
.sc-confirm-body p { margin: 0; }

/* ---- 字段 ---- */
.sc-field { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--txt2); }
.sc-field > span { flex: none; min-width: 62px; color: var(--txt3); }
.sc-field input, .sc-field select {
  flex: 1; padding: 7px 10px; font: inherit; font-size: 13px;
  background: var(--pan2); border: 1px solid var(--line); border-radius: 6px; color: var(--txt);
}
.sc-field input:focus, .sc-field select:focus { outline: none; border-color: var(--accent); }

/* ---- 设备选择 ---- */
.sc-search { padding: 10px 16px 0; }
.sc-search input {
  width: 100%; padding: 8px 11px; font: inherit; font-size: 13px;
  background: var(--pan2); border: 1px solid var(--line); border-radius: 6px; color: var(--txt);
}
.sc-search input:focus { outline: none; border-color: var(--accent); }
.sc-pick {
  display: grid; grid-template-columns: 88px 1fr auto auto; align-items: center; gap: 10px;
  padding: 9px 11px; margin-bottom: 5px; cursor: pointer;
  background: var(--pan2); border: 1px solid var(--line); border-radius: 7px;
}
.sc-pick:hover { border-color: var(--accent); background: rgba(53, 194, 255, 0.08); }
.sc-pick b { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.sc-pick-n { font-size: 12.5px; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-pick-t { font-size: 11.5px; font-style: normal; color: var(--txt3); }
.sc-pick-c { font-size: 11.5px; font-style: normal; color: var(--txt3); }

/* ---- 绑点编辑 ---- */
.sc-bind-body { max-height: 46vh; }
.sc-bind-row {
  display: grid; grid-template-columns: 26px 1fr 130px; align-items: center; gap: 9px;
  padding: 7px 10px; margin-bottom: 4px; border-radius: 6px;
  background: var(--pan2); border: 1px solid transparent;
}
.sc-bind-row.on { border-color: rgba(53, 194, 255, 0.5); background: rgba(53, 194, 255, 0.08); }
.sc-bind-chk { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sc-bind-name { font-size: 12.5px; color: var(--txt2); min-width: 0; }
.sc-bind-name em {
  display: block; margin-top: 1px; font-style: normal;
  font-size: 11px; font-family: var(--mono); color: var(--txt3);
}
.sc-bind-slot {
  width: 100%; padding: 5px 8px; font: inherit; font-family: var(--mono); font-size: 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px; color: var(--txt);
}
.sc-bind-slot:focus { outline: none; border-color: var(--accent); }

/* ---- 设备管理按钮区（与"布局操作"分色，避免误点破坏性操作）---- */
.e2-ops-crud { border-left: 2px solid rgba(53, 194, 255, 0.32); padding-left: 9px; }
