/* ============================================================
   妙联 · 智能方舱 IoT 平台 - 样式
   深色 · 霓虹边框 · 赛博朋克
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif; color: #cfe8ff; background: #040814; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
.hidden { display: none !important; }

/* ============ 登录页 ============ */
.login-view {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 30%, #0d1f3c 0%, #050a16 50%, #02050d 100%);
  z-index: 9999;
}
.login-bg { position: absolute; inset: 0; }
.login-bg canvas { width: 100%; height: 100%; display: block; }

.login-container {
  position: relative;
  width: 460px; padding: 38px 44px 28px;
  background: linear-gradient(180deg, rgba(13,28,56,0.92) 0%, rgba(7,15,30,0.96) 100%);
  border: 1px solid rgba(61,217,255,0.25);
  border-radius: 14px;
  box-shadow:
    0 0 30px rgba(61,217,255,0.18),
    0 0 80px rgba(24,121,255,0.10),
    inset 0 0 60px rgba(61,217,255,0.04);
  z-index: 1;
}
.login-decoration { position: absolute; width: 80px; height: 80px; border: 2px solid #3DD9FF; opacity: 0.6; }
.login-decoration.left { top: -1px; left: -1px; border-right: none; border-bottom: none; border-top-left-radius: 14px; }
.login-decoration.right { bottom: -1px; right: -1px; border-left: none; border-top: none; border-bottom-right-radius: 14px; }

.login-brand { text-align: center; margin-bottom: 22px; }
.brand-icon { width: 64px; height: 64px; margin: 0 auto 10px; filter: drop-shadow(0 0 8px rgba(61,217,255,0.6)); }
.login-brand h1 { font-size: 22px; color: #fff; letter-spacing: 4px; font-weight: 600; }
.brand-sub { color: #5fa8d6; font-size: 11px; letter-spacing: 1.5px; margin-top: 4px; }

.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 12px; color: #7fb6d9; margin-bottom: 6px; letter-spacing: 1px; }
.input-wrap {
  position: relative; display: flex; align-items: center;
  background: rgba(8,20,40,0.7);
  border: 1px solid rgba(61,217,255,0.25);
  border-radius: 6px; padding: 0 12px;
  transition: all .2s;
}
.input-wrap:focus-within { border-color: #3DD9FF; box-shadow: 0 0 0 3px rgba(61,217,255,0.12); }
.input-icon { font-size: 14px; margin-right: 8px; opacity: 0.7; }
.input-wrap input {
  flex: 1; padding: 11px 0; background: none; border: 0; outline: 0;
  color: #e6f4ff; font-size: 14px; letter-spacing: 0.5px;
}
.toggle-pwd { cursor: pointer; opacity: 0.6; transition: opacity .2s; }
.toggle-pwd:hover { opacity: 1; }

.role-tabs { display: flex; gap: 8px; }
.role-tab {
  flex: 1; padding: 8px 0; border: 1px solid rgba(61,217,255,0.25);
  border-radius: 6px; background: rgba(8,20,40,0.5); color: #7fb6d9; font-size: 12px;
  transition: all .2s;
}
.role-tab:hover { color: #3DD9FF; border-color: rgba(61,217,255,0.45); }
.role-tab.active {
  background: linear-gradient(135deg, rgba(61,217,255,0.25), rgba(24,121,255,0.25));
  border-color: #3DD9FF; color: #fff;
  box-shadow: 0 0 10px rgba(61,217,255,0.3);
}

.form-extra { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin: 14px 0 18px; }
.check { display: flex; align-items: center; gap: 5px; color: #7fb6d9; cursor: pointer; }
.check input { accent-color: #3DD9FF; }
.forgot { color: #3DD9FF; text-decoration: none; }
.forgot:hover { text-decoration: underline; }

.btn-login {
  width: 100%; padding: 12px; border-radius: 6px;
  background: linear-gradient(135deg, #1879FF 0%, #3DD9FF 100%);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 4px;
  box-shadow: 0 4px 20px rgba(24,121,255,0.4);
  transition: transform .15s, box-shadow .15s;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(24,121,255,0.55); }
.btn-login:active { transform: translateY(0); }

.login-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; font-size: 11px; color: #5f8bab;
}
.status-dot { color: #4cd97b; }

/* ============ 主控台 ============ */
.dashboard-view {
  position: relative; width: 100%; height: 100vh;
  background: radial-gradient(ellipse at 50% 50%, #0a1830 0%, #050a16 60%, #02050d 100%);
  display: flex; flex-direction: column;
}
.dashboard-view::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(61,217,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61,217,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* 顶部 */
.topbar {
  position: relative;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 60px; padding: 0 24px;
  background: linear-gradient(180deg, rgba(13,28,56,0.85), rgba(7,15,30,0.85));
  border-bottom: 1px solid rgba(61,217,255,0.18);
  z-index: 2;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #7fb6d9; }
.topbar-right { justify-content: flex-end; }
.topbar-center { position: relative; padding: 0 60px; }
.topbar-center h1 {
  font-size: 26px; color: #3DD9FF; letter-spacing: 8px; font-weight: 600;
  text-shadow: 0 0 12px rgba(61,217,255,0.6), 0 0 24px rgba(24,121,255,0.4);
}
.corner-l, .corner-r { position: absolute; top: 50%; width: 60px; height: 22px; transform: translateY(-50%); }
.corner-l { left: 0; }
.corner-r { right: 0; }
.corner-l::before, .corner-r::before { content: ""; position: absolute; top: 0; height: 1px; background: linear-gradient(90deg, transparent, #3DD9FF, transparent); }
.corner-l::after, .corner-r::after { content: ""; position: absolute; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, #3DD9FF, transparent); }
.corner-l::before { left: 0; width: 60px; }
.corner-l::after { left: 0; width: 60px; }
.corner-r::before { right: 0; width: 60px; }
.corner-r::after { right: 0; width: 60px; }

.tb-btn {
  padding: 6px 14px; border: 1px solid rgba(61,217,255,0.35); border-radius: 4px;
  background: rgba(8,20,40,0.6); color: #cfe8ff; font-size: 12px;
  transition: all .2s;
}
.tb-btn:hover { border-color: #3DD9FF; color: #fff; box-shadow: 0 0 8px rgba(61,217,255,0.4); }
.tb-warn { border-color: rgba(255,107,107,0.45); color: #ff9a9a; }
.tb-warn:hover { border-color: #ff6b6b; box-shadow: 0 0 8px rgba(255,107,107,0.4); }
.tb-user { color: #3DD9FF; font-size: 12px; }

/* 主三栏 */
.main-grid {
  flex: 1; display: grid;
  grid-template-columns: 250px 1fr 280px;
  gap: 14px; padding: 14px;
  overflow: hidden;
  min-height: 0;
}

.sidebar, .rightbar { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.sidebar::-webkit-scrollbar, .rightbar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb, .rightbar::-webkit-scrollbar-thumb { background: rgba(61,217,255,0.3); border-radius: 2px; }

/* 通用面板 */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(11,25,52,0.7), rgba(7,15,30,0.7));
  border: 1px solid rgba(61,217,255,0.22);
  border-radius: 6px; padding: 12px 12px 14px;
  backdrop-filter: blur(6px);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 12px; height: 12px;
  border: 2px solid #3DD9FF; opacity: 0.85;
}
.panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.panel::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.panel-title {
  font-size: 13px; color: #cfe8ff; letter-spacing: 1px;
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(61,217,255,0.18);
}
.panel-title .icon { color: #3DD9FF; margin-right: 4px; }
.panel-title small { color: #5fa8d6; font-size: 11px; margin-left: 4px; font-weight: normal; }

/* 功能舱列表 */
.lab-list { list-style: none; }
.lab-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; margin-bottom: 6px;
  font-size: 13px; color: #a8c5db;
  background: rgba(8,20,40,0.45);
  border: 1px solid rgba(61,217,255,0.1);
  border-radius: 4px; cursor: pointer; transition: all .2s;
}
.lab-list li:hover { border-color: rgba(61,217,255,0.4); color: #fff; }
.lab-list li.active {
  background: linear-gradient(90deg, rgba(24,121,255,0.25), rgba(61,217,255,0.1));
  border-color: #3DD9FF; color: #fff;
  box-shadow: 0 0 10px rgba(61,217,255,0.25);
}
.lab-list .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #3DD9FF; box-shadow: 0 0 6px #3DD9FF;
}
.lab-list li:not(.active) .dot { background: #5f8bab; box-shadow: none; }

/* 用能 */
.energy-row { display: flex; gap: 8px; margin-bottom: 8px; }
.energy-row:last-child { margin-bottom: 0; }
.energy-card {
  flex: 1; padding: 10px 12px;
  background: linear-gradient(180deg, rgba(11,25,52,0.7), rgba(7,15,30,0.7));
  border: 1px solid rgba(61,217,255,0.15); border-radius: 4px;
}
.energy-card.sub { flex: 1; }
.energy-label { font-size: 11px; color: #7fb6d9; margin-bottom: 4px; }
.energy-val { display: flex; align-items: baseline; gap: 4px; color: #fff; }
.energy-val b { font-size: 22px; font-weight: 700; color: #3DD9FF;
  text-shadow: 0 0 8px rgba(61,217,255,0.5); }
.energy-val span { font-size: 11px; color: #7fb6d9; }
.energy-val.green b { color: #4cd97b; text-shadow: 0 0 8px rgba(76,217,123,0.5); }
.energy-val.cyan b { color: #cfe8ff; }

/* 设备状态 */
.device-state { list-style: none; }
.device-state li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 4px; font-size: 12px;
  border-bottom: 1px dashed rgba(61,217,255,0.1);
}
.device-state li:last-child { border-bottom: 0; }
.device-state li span { color: #a8c5db; }
.device-state li b { font-size: 14px; }
.green { color: #4cd97b !important; }
.cyan  { color: #3DD9FF !important; }
.warn  { color: #ff9a4d !important; }
.fail  { color: #ff6b6b !important; }
.gray  { color: #7f96a8 !important; }

/* 中间内容 */
.content { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: hidden; }

/* 监控卡片 */
.monitor-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.monitor-card {
  position: relative;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(11,25,52,0.85), rgba(7,15,30,0.85));
  border-radius: 6px;
  border: 1px solid rgba(61,217,255,0.22);
  overflow: hidden;
}
.monitor-card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 4px;
}
.mc-temp::before { background: linear-gradient(180deg, #FF7A45, #FFB84D); box-shadow: 0 0 8px #FF7A45; }
.mc-hum::before  { background: linear-gradient(180deg, #3DD9FF, #1879FF); box-shadow: 0 0 8px #3DD9FF; }
.mc-co2::before  { background: linear-gradient(180deg, #7CFFCB, #00C896); box-shadow: 0 0 8px #00C896; }
.mc-light::before{ background: linear-gradient(180deg, #C792EA, #7C4DFF); box-shadow: 0 0 8px #7C4DFF; }

.mc-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #cfe8ff; margin-bottom: 10px; }
.mc-icon { font-size: 16px; }
.mc-state {
  margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: rgba(76,217,123,0.18); color: #4cd97b;
}
.mc-state.warn { background: rgba(255,154,77,0.18); color: #ff9a4d; }
.mc-state.fail { background: rgba(255,107,107,0.18); color: #ff6b6b; }
.mc-val { font-size: 32px; color: #fff; font-weight: 700; margin: 4px 0 6px;
  text-shadow: 0 0 14px rgba(61,217,255,0.5); }
.mc-val b { color: #3DD9FF; }
.mc-val sup { font-size: 14px; margin-left: 2px; color: #7fb6d9; font-weight: 400; }
.mc-range { font-size: 11px; color: #5fa8d6; }

/* 图表 */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 0; }
.chart-card {
  background: linear-gradient(180deg, rgba(11,25,52,0.7), rgba(7,15,30,0.7));
  border: 1px solid rgba(61,217,255,0.22);
  border-radius: 6px; padding: 10px 12px 6px;
  display: flex; flex-direction: column; min-height: 0;
}
.chart-title {
  font-size: 13px; color: #cfe8ff; letter-spacing: 1px;
  padding-bottom: 6px; margin-bottom: 4px;
  border-bottom: 1px solid rgba(61,217,255,0.15);
}
.chart-box { flex: 1; min-height: 0; }

/* 远程控制 */
.ctrl-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.ctrl-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  background: rgba(8,20,40,0.5);
  border: 1px solid rgba(61,217,255,0.15);
  border-radius: 4px;
}
.ctrl-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #cfe8ff; }
.ctr-icn {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(61,217,255,0.12); border-radius: 4px; color: #3DD9FF; font-size: 13px;
}
.switch { position: relative; width: 38px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; cursor: pointer; transition: .3s;
  background: #1c3559; border-radius: 20px;
}
.switch span::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #5f8bab; transition: .3s;
}
.switch input:checked + span { background: linear-gradient(90deg, #1879FF, #3DD9FF); box-shadow: 0 0 8px rgba(61,217,255,0.5); }
.switch input:checked + span::before { transform: translateX(18px); background: #fff; }

/* 告警 */
.alert-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.alert-list { list-style: none; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.alert-list::-webkit-scrollbar { width: 4px; }
.alert-list::-webkit-scrollbar-thumb { background: rgba(61,217,255,0.3); border-radius: 2px; }
.alert-item {
  padding: 9px 10px;
  background: rgba(8,20,40,0.55);
  border-left: 3px solid;
  border-radius: 3px;
}
.alert-item.warn { border-color: #ff9a4d; }
.alert-item.info { border-color: #3DD9FF; }
.alert-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.alert-type { color: #cfe8ff; font-weight: 600; }
.alert-time { color: #7fb6d9; font-size: 11px; }
.alert-body { font-size: 12px; color: #a8c5db; line-height: 1.5; margin-bottom: 6px; }
.alert-foot { display: flex; justify-content: space-between; align-items: center; }
.alert-tag { font-size: 11px; color: #ff9a4d; }
.alert-btn {
  padding: 3px 12px; font-size: 11px;
  border: 1px solid rgba(61,217,255,0.45); border-radius: 3px;
  background: rgba(61,217,255,0.15); color: #3DD9FF;
  transition: all .2s;
}
.alert-btn:hover { background: rgba(61,217,255,0.3); color: #fff; }

/* 底部 */
.statusbar {
  display: flex; align-items: center; gap: 22px;
  padding: 6px 24px; height: 28px;
  background: rgba(7,15,30,0.85);
  border-top: 1px solid rgba(61,217,255,0.18);
  font-size: 11px; color: #7fb6d9;
  z-index: 2;
}
.statusbar b { font-weight: 600; }
.ml-auto { margin-left: auto; }

/* ============ 大屏模式 ============ */
.dashboard-view.fullscreen .main-grid { grid-template-columns: 280px 1fr 320px; gap: 18px; padding: 18px; }
.dashboard-view.fullscreen .topbar { height: 72px; }
.dashboard-view.fullscreen .topbar-center h1 { font-size: 32px; letter-spacing: 12px; }
.dashboard-view.fullscreen .monitor-card { padding: 20px 22px; }
.dashboard-view.fullscreen .mc-val { font-size: 42px; }
.dashboard-view.fullscreen .panel { padding: 14px 14px 16px; }
.dashboard-view.fullscreen #fullscreenBtn { display: none; }

/* ============ 响应式 ============ */
@media (max-width: 1400px) {
  .main-grid { grid-template-columns: 220px 1fr 240px; }
}
@media (max-width: 1200px) {
  .main-grid { grid-template-columns: 200px 1fr; }
  .rightbar { display: none; }
}

/* ============================================================
   管理后台 (AI运营管理平台 - 参考eam.iotomp.com)
   ============================================================ */
.admin-view {
  position: relative; width: 100%; height: 100vh;
  background: #f5f7fb; color: #303133;
  display: flex; flex-direction: column;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 顶部深色导航 ---------- */
.ad-topbar {
  height: 50px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  background: linear-gradient(90deg, #1e2a47 0%, #27395f 55%, #1e2a47 100%);
  color: #fff;
}
.ad-logo { display: flex; align-items: center; gap: 8px; margin-right: 10px; flex-shrink: 0; }
.ad-logo svg { width: 26px; height: 26px; }
.ad-logo-text { font-size: 15px; font-weight: 600; letter-spacing: 1px; white-space: nowrap; }

.ad-nav {
  flex: 1; display: flex; align-items: stretch; overflow-x: auto;
  height: 100%;
}
.ad-nav::-webkit-scrollbar { display: none; }
.ad-nav-i {
  display: flex; align-items: center; gap: 3px;
  padding: 0 15px; color: #c5cfe2; font-size: 13px;
  cursor: pointer; white-space: nowrap; position: relative;
  transition: color .15s, background .15s;
}
.ad-nav-i:hover { color: #fff; background: rgba(255,255,255,0.06); }
.ad-nav-i.active { color: #fff; background: rgba(58,119,255,0.35); }
.ad-nav-i.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 2px; background: #6f9dff; border-radius: 2px;
}
.ad-nav-arrow { font-size: 9px; opacity: 0.7; font-style: normal; }

.ad-topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.ad-tb-ic { position: relative; cursor: pointer; font-size: 15px; opacity: 0.9; }
.ad-tb-ic:hover { opacity: 1; }
.ad-badge {
  position: absolute; top: -5px; right: -9px;
  background: #ff4d4f; color: #fff; font-size: 10px; font-style: normal;
  border-radius: 8px; padding: 0 4px; line-height: 14px;
}
.ad-back-btn { padding: 4px 10px !important; font-size: 12px !important; }
.ad-user { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.ad-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #3a77ff, #7ea2ff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 600;
}
.ad-toggle { cursor: pointer; font-size: 15px; opacity: 0.8; }

/* ---------- 主体两栏 ---------- */
.ad-body {
  flex: 1; display: grid; grid-template-columns: 220px 1fr;
  min-height: 0; overflow: visible;
  transition: grid-template-columns .25s ease;
}
.ad-body.collapsed { grid-template-columns: 64px 1fr; }

/* ============ 左侧菜单（深色 Element-UI 风格 + 可折叠） ============ */
.ad-side {
  background: #1f2940; color: #c5cee0;
  display: flex; flex-direction: column;
  position: relative; z-index: 50;
  min-height: 0; overflow: hidden;
}
.ad-side-brand {
  /* 品牌已合并到顶栏 logo；侧栏仅保留一条分隔线保持视觉节奏 */
  display: none;
}
.ad-side-brand svg { width: 22px; height: 22px; flex-shrink: 0; }
.ad-side-brand-text { font-size: 14px; font-weight: 600; letter-spacing: 1px; }

.ad-menu-wrap {
  flex: 1; overflow-x: visible; overflow-y: auto; padding: 8px 0;
}
.ad-menu-wrap::-webkit-scrollbar { width: 4px; }
.ad-menu-wrap::-webkit-scrollbar-thumb { background: #2d3a55; border-radius: 2px; }
.ad-menu-wrap::-webkit-scrollbar-track { background: transparent; }

.ad-menu { list-style: none; }

/* 父级菜单项 */
.ad-mi {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 0 20px; font-size: 14px; color: #c5cee0;
  cursor: pointer; transition: background .15s, color .15s; user-select: none;
  position: relative; white-space: nowrap; flex-wrap: wrap;
}
.ad-mi > i.ad-icn {
  font-style: normal; font-size: 18px; width: 20px; text-align: center; flex-shrink: 0;
}
.ad-mi > .ad-mi-label { flex: 0 1 auto; }
.ad-mi > .ad-arrow { flex-shrink: 0; }
.ad-mi:hover { background: #283450; color: #fff; }
.ad-mi.active {
  background: linear-gradient(90deg, #2b6bf2 0%, #1e4fd1 100%);
  color: #fff; font-weight: 500;
}
.ad-mi.has-sub.active { /* 包含激活子项的父项保留高亮 */ }

/* 父项第一行：图标 + 标签 + 箭头，强制占满一行 */
.ad-mi > i.ad-icn,
.ad-mi > .ad-mi-label,
.ad-mi > .ad-arrow {
  flex: 0 0 auto;
  align-self: center;
}

.ad-arrow {
  margin-left: auto; font-size: 10px; font-style: normal;
  color: #8896b0; transition: transform .2s; flex-shrink: 0;
}
.ad-mi.expanded .ad-arrow { transform: rotate(180deg); color: #fff; }

/* 子菜单（内联展开 - 不再整块深色背景，仅当前项高亮） */
.ad-sub {
  list-style: none;
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease;
  flex-basis: 100%;
  flex-shrink: 0;
}
.ad-mi.expanded > .ad-sub { max-height: 600px; }

.ad-sub-i {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 20px 0 52px; font-size: 13px; color: #8a96b0;
  cursor: pointer; transition: color .15s; user-select: none; white-space: nowrap;
  position: relative;
}
.ad-sub-i::before {
  content: ''; position: absolute; left: 32px; top: 50%;
  width: 14px; height: 1.5px; background: #4a5878; transition: background .15s;
}
.ad-sub-i:hover { color: #fff; background: rgba(43, 107, 242, .18); }
.ad-sub-i:hover::before { background: #93a3c4; }
.ad-sub-i.active {
  color: #fff; font-weight: 500;
  background: linear-gradient(90deg, #2b6bf2 0%, #1e4fd1 100%);
}
.ad-sub-i.active::before { background: #fff; }

/* 折叠按钮 */
.ad-collapse-btn {
  height: 44px; padding: 0 20px; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid #2a3550;
  color: #8896b0; cursor: pointer; user-select: none; font-size: 13px;
  transition: all .15s; white-space: nowrap;
}
.ad-collapse-btn:hover { color: #fff; background: #283450; }
.ad-collapse-icn { font-size: 12px; transition: transform .25s; }
.ad-body.collapsed .ad-collapse-icn { transform: rotate(180deg); }

/* 折叠模式：仅图标，子菜单变弹层 */
.ad-body.collapsed .ad-side-brand-text,
.ad-body.collapsed .ad-mi > .ad-mi-label,
.ad-body.collapsed .ad-mi > .ad-arrow,
.ad-body.collapsed .ad-collapse-btn-label { display: none; }
.ad-body.collapsed .ad-sub .ad-mi-label { display: inline; }
.ad-body.collapsed .ad-mi { padding: 0; justify-content: center; height: 48px; min-height: 48px; flex-wrap: nowrap; }
.ad-body.collapsed .ad-mi > i.ad-icn { font-size: 20px; }
.ad-body.collapsed .ad-collapse-btn { padding: 0; justify-content: center; }
.ad-body.collapsed .ad-mi.has-sub { position: relative; }
.ad-body.collapsed .ad-mi.has-sub .ad-sub {
  position: absolute; left: 64px; top: 0;
  min-width: 180px; max-height: none !important;
  background: #283450; box-shadow: 4px 4px 14px rgba(0,0,0,.35);
  display: none; padding: 6px 0; z-index: 100;
  border-radius: 0 6px 6px 0;
}
.ad-body.collapsed .ad-mi.has-sub.expanded > .ad-sub {
  display: block; max-height: none; overflow: visible;
  position: fixed; left: 64px; top: auto;
  min-width: 180px; background: #283450;
  box-shadow: 4px 4px 14px rgba(0,0,0,.35);
  padding: 6px 0; z-index: 200; border-radius: 0 6px 6px 0;
}
.ad-body.collapsed .ad-sub-i { padding: 0 18px; height: 38px; color: #d6def0; }
.ad-body.collapsed .ad-sub-i:hover { background: rgba(91, 141, 245, .25); color: #fff; }
.ad-body.collapsed .ad-sub-i::before { display: none; }

/* 主内容 */
.ad-main { display: flex; flex-direction: column; min-height: 0; overflow: visible; }

/* 页签栏 */
.ad-tabs {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  height: 34px; padding: 0 12px;
  background: #fff; border-bottom: 1px solid #e8ecf3;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
}
.ad-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 12px; color: #5a6577;
  background: #f0f3f9; border-radius: 3px; cursor: pointer;
  transition: all .15s;
  white-space: nowrap; flex-shrink: 0;
}
.ad-tab:hover { color: #3a77ff; }
.ad-tab.active { background: #3a77ff; color: #fff; }
.ad-tab-close { font-style: normal; opacity: 0.55; cursor: pointer; }
.ad-tab-close:hover { opacity: 1; }
.ad-tab-plus { font-style: normal; color: #97a3b6; cursor: pointer; padding: 0 6px; }
.ad-tab-plus:hover { color: #3a77ff; }

/* 页面 */
.ad-page { flex: 1; overflow-y: auto; padding: 14px 16px 20px; }
.ad-page.hidden { display: none !important; }
.ad-page::-webkit-scrollbar { width: 6px; }
.ad-page::-webkit-scrollbar-thumb { background: #dde3ee; border-radius: 3px; }

/* 卡片 */
.ad-card {
  background: #fff; border: 1px solid #e8ecf3; border-radius: 4px;
}

/* 过滤区 */
.ad-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 12px;
}
.ad-filter-item { display: flex; align-items: center; gap: 6px; }
.ad-filter-item label { font-size: 13px; color: #5a6577; white-space: nowrap; }
.ad-filter-item input, .ad-filter-item select {
  padding: 6px 10px; min-width: 150px;
  border: 1px solid #d9e0ea; border-radius: 3px;
  font-size: 13px; color: #303133; outline: none;
  transition: border-color .15s; background: #fff;
}
.ad-filter-item input:focus, .ad-filter-item select:focus { border-color: #3a77ff; }
.ad-filter-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ad-update { font-size: 12px; color: #97a3b6; }
.ad-update b { color: #3a77ff; font-weight: 500; }

/* 按钮 */
.ad-btn {
  padding: 6px 14px; border: 1px solid #d9e0ea;
  background: #fff; color: #5a6577; border-radius: 3px;
  font-size: 13px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.ad-btn:hover { color: #3a77ff; border-color: #3a77ff; }
.ad-btn.primary { background: #3a77ff; border-color: #3a77ff; color: #fff; }
.ad-btn.primary:hover { background: #2f68e8; }
.ad-btn.success { background: #22b573; border-color: #22b573; color: #fff; }
.ad-btn.success:hover { background: #1c9d63; }
.ad-btn.warn { background: #ff9900; border-color: #ff9900; color: #fff; }
.ad-btn.warn:hover { background: #e68600; }

/* 提示条 */
.ad-notice {
  padding: 9px 14px; margin-bottom: 12px;
  background: #ecf2ff; border: 1px solid #cddcfa; border-radius: 3px;
  color: #4a6bb5; font-size: 12.5px;
}

/* 表格 */
.ad-table-wrap { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; }
.ad-table th {
  padding: 11px 10px; background: #f7f9fc;
  font-size: 12.5px; color: #5a6577; font-weight: 600;
  text-align: left; border-bottom: 1px solid #e8ecf3; white-space: nowrap;
}
.ad-table td {
  padding: 10px; font-size: 13px; color: #303133;
  border-bottom: 1px solid #f0f3f8; white-space: nowrap;
}
.ad-table tr:hover td { background: #fafbfd; }
.ad-table.sm th, .ad-table.sm td { padding: 8px 10px; font-size: 12.5px; }
.ad-table code { color: #3a77ff; background: #ecf2ff; padding: 1px 6px; border-radius: 2px; font-size: 12px; }
.ad-table .op-link { color: #3a77ff; cursor: pointer; margin-right: 10px; font-size: 12.5px; }
.ad-table .op-link:hover { text-decoration: underline; }
.ad-table .op-link.danger { color: #ff4d4f; }

.ad-tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11.5px; font-weight: 500;
}
.ad-tag-online { background: #e5f7ee; color: #22b573; }
.ad-tag-offline { background: #f0f2f6; color: #97a3b6; }
.ad-tag-alarm { background: #ffeded; color: #ff4d4f; }
.ad-tag-normal { background: #ecf2ff; color: #3a77ff; }
.ad-tag-run { background: #e5f7ee; color: #22b573; }
.ad-tag-stop { background: #fff4e6; color: #ff9900; }

/* 开关(产品启用) */
.ad-sw { position: relative; display: inline-block; width: 34px; height: 18px; }
.ad-sw input { opacity: 0; width: 0; height: 0; }
.ad-sw span {
  position: absolute; inset: 0; background: #cfd6e0; border-radius: 18px;
  cursor: pointer; transition: .25s;
}
.ad-sw span::before {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: .25s;
}
.ad-sw input:checked + span { background: #3a77ff; }
.ad-sw input:checked + span::before { transform: translateX(16px); }

/* 空态 */
.ad-empty { padding: 60px 0; text-align: center; color: #a8b2c1; font-size: 13px; }
.ad-placeholder { padding: 80px 20px; text-align: center; color: #a8b2c1; font-size: 13.5px; }

/* 分页 */
.ad-pager {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px;
}
.ad-pager > span { font-size: 12.5px; color: #7a8699; }
.ad-pager-ctrl { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ad-pager-ctrl button {
  min-width: 28px; height: 28px; padding: 0 9px;
  border: 1px solid #d9e0ea; background: #fff; color: #5a6577;
  border-radius: 3px; font-size: 12.5px; cursor: pointer; transition: all .15s;
}
.ad-pager-ctrl button:hover:not(:disabled) { color: #3a77ff; border-color: #3a77ff; }
.ad-pager-ctrl button.active { background: #3a77ff; color: #fff; border-color: #3a77ff; }
.ad-pager-ctrl button:disabled { opacity: .45; cursor: not-allowed; }
.ad-pager-ctrl input {
  width: 44px; height: 28px; text-align: center;
  border: 1px solid #d9e0ea; border-radius: 3px; outline: none;
}

/* KPI 看板卡片 */
.ad-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.ad-kpi-card { padding: 14px 16px; }
.ad-kpi-card h4 {
  font-size: 13.5px; color: #303133; font-weight: 600;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px solid #eef1f6;
}
.ad-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ad-kpi { text-align: center; padding: 8px 4px; }
.ad-kpi b {
  display: block; font-size: 24px; font-weight: 700; color: #3a77ff;
  margin-bottom: 4px;
}
.ad-kpi b i { font-style: normal; font-size: 13px; margin-left: 1px; color: #7a8699; }
.ad-kpi span { font-size: 12px; color: #97a3b6; }
.ad-kpi.ok b { color: #22b573; }
.ad-kpi.warn b { color: #ff9900; }
.ad-kpi.err b { color: #ff4d4f; }

/* 图表网格 */
.ad-dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.ad-dash-grid.g2 { grid-template-columns: repeat(3, 1fr); }
.ad-chart-box {
  background: #fff; border: 1px solid #e8ecf3; border-radius: 4px;
  padding: 10px 12px 8px; height: 290px;
  display: flex; flex-direction: column; overflow: hidden;
}
.ad-chart-title {
  font-size: 13.5px; font-weight: 600; color: #303133;
  padding-bottom: 8px; margin-bottom: 6px;
  border-bottom: 1px solid #eef1f6;
}
.ad-chart-title small { font-weight: 400; color: #97a3b6; margin-left: 6px; }
.ad-chart-title small b { color: #3a77ff; font-weight: 500; }
.ad-chart { flex: 1; min-height: 0; }

/* 表格双栏 */
.ad-table-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ad-tbl-card { padding: 14px 16px; }
.ad-tbl-card h4 {
  font-size: 13.5px; font-weight: 600; color: #303133;
  padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid #eef1f6;
}
.ad-tbl-card .ad-empty { padding: 30px 0; }

/* 响应式 */
@media (max-width: 1200px) {
  .ad-body { grid-template-columns: 200px 1fr; }
  .ad-dash-grid { grid-template-columns: 1fr 1fr; }
  .ad-kpi-grid, .ad-table-grid { grid-template-columns: 1fr; }
}
/* ============================================================
   设备详情 Modal
   ============================================================ */
.dev-modal {
  position: fixed; inset: 0; background: rgba(0,10,30,0.45);
  display: none; align-items: center; justify-content: center;
  z-index: 999; backdrop-filter: blur(2px);
}
.dev-modal.show { display: flex; }
.dm-card {
  width: 920px; max-width: calc(100vw - 40px); max-height: 86vh;
  background: #fff; border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  display: flex; flex-direction: column; overflow: hidden; animation: dmIn .18s ease-out;
}
@keyframes dmIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.dm-head { padding: 16px 22px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #ecf0f6; background: linear-gradient(180deg, #fafcff 0%, #f5f8fd 100%); }
.dm-head-l { display: flex; align-items: center; gap: 12px; }
.dm-avatar { width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #3a77ff, #6f9dff); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 18px; }
.dm-name   { font-size: 18px; font-weight: 700; color: #1c2942; }
.dm-type   { font-size: 12px; color: #6f7d99; margin-top: 3px; }
.dm-head-r { display: flex; align-items: center; gap: 8px; }
.dm-last   { font-size: 12px; color: #97a3b6; }
.dm-close  { cursor: pointer; font-size: 22px; color: #97a3b6; padding: 0 6px; line-height: 1; }
.dm-close:hover { color: #ff5252; }

.dm-tabs { display: flex; padding: 0 22px; border-bottom: 1px solid #ecf0f6; background: #fff; }
.dm-tab  { padding: 12px 18px; font-size: 14px; color: #6f7d99; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .15s; }
.dm-tab:hover { color: #3a77ff; }
.dm-tab.active { color: #3a77ff; border-bottom-color: #3a77ff; font-weight: 600; }

.dm-body { flex: 1; overflow-y: auto; padding: 18px 22px; background: #fbfcfe; }
.dm-panel { animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 实时参数网格 */
.dm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pp-cell { background: #fff; border: 1px solid #ecf0f6; border-radius: 6px;
  padding: 12px 14px; position: relative; transition: all .2s; }
.pp-cell:hover { border-color: #b8cdf6; box-shadow: 0 4px 12px rgba(58,119,255,0.08); }
.pp-label { font-size: 12px; color: #97a3b6; margin-bottom: 4px; }
.pp-value { font-size: 22px; line-height: 1; display: flex; align-items: baseline; gap: 4px; }
.pp-value b { font-weight: 700; color: #1c2942; font-family: 'Consolas', 'Monaco', monospace; }
.pp-value span { font-size: 12px; color: #6f7d99; }
.pp-state { position: absolute; top: 10px; right: 10px; font-size: 10px; padding: 2px 6px;
  border-radius: 8px; font-weight: 600; }
.pp-state.ok   { background: #e6f7ed; color: #22b573; }
.pp-state.warn { background: #fff2e0; color: #ff9900; }
.pp-state.mute { background: #f0f3f8; color: #97a3b6; }
.pp-range { font-size: 10px; color: #97a3b6; margin-top: 6px; font-family: 'Consolas', 'Monaco', monospace; }

/* 基本信息 */
.dm-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px;
  background: #fff; border: 1px solid #ecf0f6; border-radius: 6px; padding: 16px; }
.dm-info-item { display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px dashed #eef1f6; font-size: 13px; }
.dm-info-item:nth-last-child(-n+2) { border-bottom: none; }
.dm-info-item label { color: #97a3b6; }
.dm-info-item span  { color: #1c2942; font-family: 'Consolas', 'Monaco', monospace; }

/* 历史曲线 */
.dm-history-title { font-size: 14px; font-weight: 600; color: #1c2942; margin-bottom: 8px; }
.dm-chart { height: 320px; background: #fff; border: 1px solid #ecf0f6; border-radius: 6px; padding: 10px; }

.dm-foot { padding: 12px 22px; border-top: 1px solid #ecf0f6; background: #fafcff;
  display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 900px) {
  .dm-card { width: 100%; max-height: 92vh; }
  .dm-grid { grid-template-columns: repeat(2, 1fr); }
  .dm-info { grid-template-columns: 1fr; }
}

/* ============================================================
   设备参数管理页 (page-dev-params)
   ============================================================ */
.ad-page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.ad-h2 { font-size: 18px; font-weight: 700; color: #1c2942; margin: 0; }
.ad-sub-h2 { font-size: 12px; color: #6f7d99; margin: 4px 0 0; }
.ad-page-actions { display: flex; gap: 8px; align-items: center; }
.ad-page-actions .ad-select { height: 30px; padding: 0 10px; border: 1px solid #d8dde6; border-radius: 4px;
  font-size: 12px; background: #fff; color: #1c2942; outline: none; }
.ad-input { height: 30px; padding: 0 10px; border: 1px solid #d8dde6; border-radius: 4px;
  font-size: 12px; background: #fff; color: #1c2942; outline: none; }

.param-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.param-kpi { padding: 16px 18px; background: linear-gradient(135deg, #fff 0%, #f5f8fd 100%);
  border: 1px solid #ecf0f6; border-radius: 6px; }
.pk-label { font-size: 12px; color: #6f7d99; }
.pk-val   { font-size: 26px; font-weight: 700; color: #1c2942; margin-top: 6px;
  font-family: 'Consolas','Monaco',monospace; }
.pk-val.warn { color: #ff5252; }

.param-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.param-card { background: #fff; border: 1px solid #ecf0f6; border-radius: 6px; padding: 14px 16px;
  transition: all .2s; }
.param-card:hover { border-color: #b8cdf6; box-shadow: 0 6px 16px rgba(58,119,255,0.08); }
.param-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.param-card-title { font-size: 14px; font-weight: 600; color: #1c2942; }
.param-card-count { font-size: 12px; color: #6f7d99; }
.param-card-count b { color: #3a77ff; font-weight: 700; }
.param-stats { display: flex; flex-direction: column; gap: 6px; }
.param-stat-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0;
  border-bottom: 1px dashed #eef1f6; }
.param-stat-row:last-child { border-bottom: none; }
.param-stat-row .ps-name { color: #6f7d99; }
.param-stat-row .ps-val { font-family: 'Consolas','Monaco',monospace; color: #1c2942; font-weight: 600; }
.param-stat-row .ps-val.ok   { color: #22b573; }
.param-stat-row .ps-val.warn { color: #ff9900; }
.param-stat-row .ps-val.bad  { color: #ff5252; }

.ad-table-title { padding: 12px 16px; border-bottom: 1px solid #ecf0f6;
  display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #1c2942; }

.shadow-desired  { color: #3a77ff; font-family: 'Consolas','Monaco',monospace; }
.shadow-reported { color: #1c2942; font-family: 'Consolas','Monaco',monospace; font-weight: 600; }

@media (max-width: 1200px) {
  .param-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .param-type-grid { grid-template-columns: repeat(2, 1fr); }
  .dm-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
   扩展后台页面（adminx.js）样式 — 复刻参考站 22 页通用组件
   ================================================================ */
/* 通用容器重置 */
#gpContent.ad-placeholder { padding: 0; text-align: left; background: transparent; box-shadow: none; border: none; color: inherit; font-size: inherit; }
.xp-loading { padding: 70px 0; text-align: center; color: #97a3b6; font-size: 13.5px; }
.xp-page { width: 100%; }
.xp-filterbar .ad-filter-item input[type="date"] { min-width: 0; width: 138px; }
.xp-filterbar .ad-select { min-width: 140px; }

/* 分段切换（告警/故障） */
.xp-seg { display: inline-flex; border: 1px solid #d9e0ea; border-radius: 4px; overflow: hidden; }
.xp-seg-i { padding: 5px 14px; font-size: 13px; color: #5a6577; background: #fff; border: none; cursor: pointer; }
.xp-seg-i + .xp-seg-i { border-left: 1px solid #d9e0ea; }
.xp-seg-i.on { background: #3a77ff; color: #fff; }

/* 表格滚动 + 分页 */
.xp-table-scroll { overflow-x: auto; }
.xp-table-wrap { margin-top: 0; }
.xp-pager-wrap { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-top: 1px solid #f0f3f8; flex-wrap: wrap; gap: 8px; }
.xp-info { font-size: 12.5px; color: #8b98af; }
.xp-pager { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ad-pg { min-width: 26px; height: 26px; padding: 0 7px; border: 1px solid #e0e5ee; background: #fff; color: #5a6577; border-radius: 3px; font-size: 12px; cursor: pointer; }
.ad-pg:hover { border-color: #3a77ff; color: #3a77ff; }
.ad-pg.on { background: #3a77ff; border-color: #3a77ff; color: #fff; }
.ad-pg:disabled { color: #c6cdd8; cursor: not-allowed; border-color: #eef1f6; }
.td-ops { white-space: nowrap; }
.td-ops-th { background: #f7f9fc; }

/* 汇总条（终端用户） */
.xp-summary { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.xp-summary-i { flex: 1; min-width: 150px; background: #fff; border: 1px solid #e8ecf3; border-radius: 4px; padding: 14px 16px; }
.xp-summary-i b { display: block; font-size: 24px; color: #3a77ff; margin-bottom: 2px; }
.xp-summary-i span { font-size: 12px; color: #8b98af; }

/* 安装管理：分组树 + 列表 */
.xp-install { display: flex; gap: 12px; align-items: flex-start; }
.xp-tree { width: 240px; background: #fff; border: 1px solid #e8ecf3; border-radius: 4px; padding: 10px 0; flex-shrink: 0; }
.xp-tree-title { padding: 8px 14px; font-weight: 600; font-size: 13px; color: #3f4d68; border-bottom: 1px solid #f0f3f8; margin-bottom: 6px; }
.xp-tree-i { display: flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 13px; color: #5a6577; cursor: pointer; }
.xp-tree-i:hover { background: #f5f8ff; color: #3a77ff; }
.xp-tree-i.on { background: #ecf2ff; color: #3a77ff; font-weight: 600; }
.xp-tree-i em { margin-left: auto; font-style: normal; font-size: 11px; background: #eef1f6; color: #8b98af; padding: 0 7px; border-radius: 9px; }
.xp-tree-i .xpf { font-style: normal; }
.xp-install-main { flex: 1; min-width: 0; }
.xp-install-pager { border-top: none; padding-top: 6px; }

/* 设备地图 */
.xp-map-card { padding: 0; overflow: hidden; }
.xp-map-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #eef1f6; }
.xp-map-head b { color: #3f4d68; }
.xp-map-legend { display: inline-flex; gap: 10px; font-size: 12px; color: #6f7d99; align-items: center; }
.xp-map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; vertical-align: -1px; }
.lg-on { background: #22b573; } .lg-off { background: #c6cdd8; } .lg-al { background: #ff9900; } .lg-err { background: #ff4d4f; }
.xp-map { position: relative; background: #f3f7fb; min-height: 420px; }
.map-road { fill: #e9eef6; stroke: #d7e0ee; }
.xp-map-svg { width: 100%; height: auto; display: block; }
.xp-pin { cursor: pointer; stroke: #fff; stroke-width: 1.5; transition: r .15s; }
.xp-pin-g:hover .xp-pin { r: 10; }
.p-on { fill: #22b573; } .p-off { fill: #c6cdd8; } .p-al { fill: #ff9900; } .p-err { fill: #ff4d4f; }
.xp-tip { position: absolute; z-index: 20; background: #fff; border: 1px solid #dfe6f1; border-radius: 6px; box-shadow: 0 6px 18px rgba(31,45,74,.14); padding: 7px 10px; min-width: 150px; pointer-events: none; }
.xp-tip b { display: block; font-size: 12.5px; color: #3f4d68; }
.xp-tip span { display: block; font-size: 11px; color: #8b98af; margin-top: 2px; }
.xp-map-hint { position: absolute; right: 12px; bottom: 10px; font-size: 11.5px; color: #aab4c4; background: rgba(255,255,255,.85); padding: 3px 9px; border-radius: 10px; }
.xp-map-stat { display: flex; gap: 20px; padding: 11px 16px; border-top: 1px solid #eef1f6; font-size: 12.5px; color: #6f7d99; flex-wrap: wrap; }
.xp-map-stat b { color: #3f4d68; margin-left: 3px; }
.xp-map-stat b.g { color: #22b573; } .xp-map-stat b.gr { color: #97a3b6; } .xp-map-stat b.w { color: #ff9900; }

/* 平台配置表单 */
.xp-form { padding: 0 0 8px; }
.xp-form-sec { padding: 18px 20px 8px; border-bottom: 1px dashed #e8ecf3; }
.xp-form-sec h3 { font-size: 14.5px; color: #3f4d68; margin: 0 0 4px; }
.xp-form-sec p { font-size: 12px; color: #97a3b6; margin: 0 0 12px; }
.xf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px 18px; padding-bottom: 10px; }
.xf-item { display: flex; align-items: center; gap: 10px; }
.xf-item label { width: 130px; font-size: 12.5px; color: #5a6577; text-align: right; flex-shrink: 0; }
.xf-item .xf-in { flex: 1; min-width: 0; }
.xp-form-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; }

/* 站内信 */
.msg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff4d4f; }
.msg-dot.read { background: transparent; border: 1px solid #cfd6e0; }
.msg-unread { font-weight: 600; color: #303133; }
.msg-read { color: #97a3b6; }
.xp-msg-head { padding: 10px 14px; font-size: 13px; }
.xp-msg-head .warn { color: #ff9900; font-weight: 600; }

/* Toast */
.xp-toast { position: fixed; left: 50%; bottom: 46px; transform: translate(-50%, 16px); z-index: 9999;
  background: #2f3a52; color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: all .25s; box-shadow: 0 8px 22px rgba(20,30,60,.25); max-width: 70vw; }
.xp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.xp-toast.ok { background: #22b573; }
.xp-toast.err { background: #ff4d4f; }

/* 详情抽屉 */
.xp-mask { position: fixed; inset: 0; background: rgba(23, 33, 52, .42); z-index: 1000; display: flex; justify-content: flex-end; }
.xp-drawer { width: 480px; max-width: 92vw; height: 100%; background: #fff; box-shadow: -10px 0 30px rgba(20,30,60,.18);
  display: flex; flex-direction: column; animation: xpSlide .22s ease; }
@keyframes xpSlide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.xp-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px;
  border-bottom: 1px solid #eef1f6; font-size: 15px; color: #3f4d68; }
.xp-drawer-x { cursor: pointer; color: #aab4c4; font-size: 20px; line-height: 1; }
.xp-drawer-x:hover { color: #ff4d4f; }
.xp-drawer-body { flex: 1; overflow-y: auto; padding: 6px 18px; }
.xp-drawer-tbl td { white-space: normal; word-break: break-word; }
.xp-drawer-tbl td.dt-l { width: 120px; color: #97a3b6; font-size: 12.5px; background: #fafbfd; }
.xp-drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid #eef1f6; }
