/* 设备监控中心 — 严格按参考效果图高还原
   配色：主蓝 #3B82F6 / 绿 #10B981 / 橙 #F59E0B / 红 #EF4444 / 灰 #6B7280 */
:root {
  --sidebar-w: 184px;
  --primary: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray: #6b7280;
  --gray-bg: #f3f4f6;
  --text: #1f2937;
  --text-dark: #111827;
  --border: #e5e7eb;
  --card-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: #f5f7fa;
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.layout { min-height: 100vh; }
.main { margin-left: var(--sidebar-w); padding: 0 24px 20px; min-width: 0; }

/* ════════ 左侧导航栏 ════════ */
.sidebar {
  width: var(--sidebar-w);
  position: fixed; top: 0; left: 0; bottom: 0;
  background: #fff;
  border-right: 1px solid #e8ecf0;
  display: flex; flex-direction: column;
  padding: 16px 16px 12px;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 2px 2px 16px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(59,130,246,.35);
}
.brand-text { min-width: 0; white-space: nowrap; }
.brand-title { font-size: 13px; font-weight: 700; color: var(--text-dark); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: #9ca3af; line-height: 1.3; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: 8px;
  color: #374151; text-decoration: none; font-size: 14px;
  transition: background .15s;
}
.nav-item .nav-ic { display: flex; color: #6b7280; }
.nav-item:hover { background: #f5f7fb; }
.nav-item.active {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 10px rgba(59,130,246,.3);
}
.nav-item.active .nav-ic { color: #fff; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.sidebar-foot { margin-top: auto; }
.promo {
  position: relative; overflow: hidden; border-radius: 12px;
  background: linear-gradient(135deg, #e0edff, #d7e7ff 45%, #bfdbfe);
  padding: 16px 14px;
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.25), 0 6px 14px rgba(59,130,246,.14);
}
.promo-blob { position: absolute; right: -18px; top: -20px; width: 88px; height: 88px; border-radius: 50%; background: rgba(255,255,255,.55); }
.promo-ill { position: absolute; right: 6px; bottom: 6px; opacity: .95; }
.promo-txt { position: relative; z-index: 2; color: #1e40af; font-size: 13px; font-weight: 700; line-height: 1.7; }
.version { text-align: center; margin-top: 12px; font-size: 11px; color: #9ca3af; }
.sidebar-author { margin-top: 10px; text-align: center; color: #4b5563; font-size: 12px; font-weight: 700; line-height: 1.4; }

/* ════════ 顶部栏 ════════ */
.topbar {
  position: relative;
  display: flex; align-items: center; gap: 18px;
  height: 60px; padding: 0 4px;
}
.page-head { flex: 1; min-width: 0; }
.page-title { font-size: 20px; font-weight: 600; color: var(--text-dark); white-space: nowrap; }
.page-sub { font-size: 13px; color: var(--gray); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-utils { flex: 0 0 auto; display: flex; align-items: center; gap: 16px; }
.search-pill {
  display: flex; align-items: center; gap: 8px;
  width: 250px; height: 36px; padding: 0 14px;
  background: var(--gray-bg); border-radius: 999px;
}
.search-pill input { border: none; background: transparent; outline: none; flex: 1; font-size: 13px; color: var(--text); }
.search-pill input::placeholder { color: #9ca3af; }
.icon-btn { position: relative; border: none; background: none; cursor: pointer; display: flex; }
.notif-dot { position: absolute; top: 1px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.user { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#3b82f6,#60a5fa); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.user-name { font-size: 14px; color: var(--text); }
.clock { position: absolute; right: 4px; bottom: -2px; font-size: 12px; color: #9ca3af; }

/* ════════ 顶部统计卡 ════════ */
.stats {
  display: flex; align-items: stretch; gap: 14px;
  margin-top: 19px;
}
.stat-card {
  flex: 1; background: #fff; border-radius: 12px;
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--card-shadow); min-height: 118px;
}
.stat-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 44px; }
.ic-blue { background: var(--primary); }
.ic-green { background: var(--success); }
.ic-gray { background: var(--gray); }
.ic-red { background: var(--danger); }
.stat-label { font-size: 13px; color: var(--gray); }
.stat-values { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.stat-num { font-size: 24px; font-weight: 700; color: var(--text-dark); line-height: 1.1; }
.stat-delta { font-size: 12px; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--success); }
.stat-delta.sub { color: var(--gray); }
.stat-delta.danger { color: var(--danger); }

/* 生成报告（顶栏入口卡） */
.report-btn {
  flex: 1; background: #fff; border-radius: 12px;
  border: 1px solid #eef0f4; box-shadow: var(--card-shadow); cursor: pointer;
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 14px 18px; min-width: 0; min-height: 118px; text-align: left;
}
.report-ic {
  width: 48px; height: 48px; border-radius: 12px; flex: 0 0 48px;
  background: #eef4ff; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.report-copy { min-width: 0; flex: 1; }
.report-txt { font-size: 14px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.report-sub { display: block; margin-top: 4px; color: #9ca3af; font-size: 11px; white-space: nowrap; }
.report-arrow { color: #7b8798; font-size: 24px; line-height: 1; }
.report-btn:hover { box-shadow: 0 6px 16px rgba(59,130,246,.2); }

/* ════════ 内容区：两列网格（>=1280 参考图布局） ════════
   设备列表 | 设备详情
   设备趋势 | 最新告警
   <1280 由底部媒体查询改为单列纵向（表格获得整页宽度）。 */
.content {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto auto;
  gap: 18px;
  margin-top: 16px;
  align-items: stretch;
}
.device-card { grid-column: 1; grid-row: 1; min-width: 0; }
.detail-card { grid-column: 2; grid-row: 1; }
.trend-card  { grid-column: 1; grid-row: 2; min-width: 0; }
.alert-card  { grid-column: 2; grid-row: 2; }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 16px; font-weight: 600; color: var(--text-dark); }
.card-count { font-size: 13px; color: var(--gray); font-weight: 400; }

/* 表格筛选 */
.table-filters { display: flex; align-items: center; gap: 10px; }
.sel {
  height: 34px; padding: 0 12px; border: 1px solid var(--border);
  background: #fff; border-radius: 8px; font-size: 13px; color: var(--text);
  outline: none; cursor: pointer;
}
.mini-search {
  display: flex; align-items: center; gap: 6px; height: 34px; width: 210px;
  padding: 0 12px; background: var(--gray-bg); border-radius: 999px;
}
.mini-search input { border: none; background: transparent; outline: none; flex: 1; font-size: 13px; }
.mini-search input::placeholder { color: #9ca3af; }

/* 数据表格：table-layout:fixed + 按比例列宽 → 8 列始终可见，避免横向滚动 */
.table-wrap { overflow-x: hidden; }
.dt { width: 100%; table-layout: fixed; border-collapse: collapse; }
.dt thead th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--gray);
  padding: 9px 6px; border-bottom: 1px solid var(--border); background: #fafbfc;
  white-space: normal; line-height: 1.4; word-break: break-word;
}
.dt thead th:nth-child(1) { width: 17%; }
.dt thead th:nth-child(2) { width: 11%; }
.dt thead th:nth-child(3) { width: 13%; }
.dt thead th:nth-child(4) { width: 16%; }
.dt thead th:nth-child(5) { width: 11%; }
.dt thead th:nth-child(6) { width: 11%; }
.dt thead th:nth-child(7) { width: 10%; }
.dt thead th:nth-child(8) { width: 11%; }
.dt tbody td { padding: 9px 6px; border-bottom: 1px solid #f3f4f6; font-size: 12px; color: var(--text); vertical-align: middle; word-break: break-word; overflow-wrap: break-word; }
.dt tbody tr { border-left: 4px solid transparent; }
.dt tbody tr.selected { background: #f0f6ff; border-left: 4px solid var(--primary); }
.dt tbody tr:hover { background: #f7f9fc; }
.dt .cell-acct { font-weight: 600; color: var(--text-dark); }
.dt .cell-sub { color: var(--gray); font-size: 12px; }

/* 状态徽标（圆角胶囊） */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-normal { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger, .badge-critical { background: #fee2e2; color: #b91c1c; }
.badge-offline { background: #e5e7eb; color: #4b5563; }

/* 设备详情 */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.detail-top { display: flex; align-items: flex-start; gap: 10px; }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); margin-top: 6px; box-shadow: 0 0 0 4px rgba(16,185,129,.15); }
.detail-name { font-size: 16px; font-weight: 600; color: var(--text-dark); }
.detail-store { font-size: 12px; color: var(--gray); margin-top: 2px; }
.detail-actions { display: flex; align-items: center; gap: 8px; }
.connect-btn {
  border: 1px solid var(--primary); color: var(--primary); background: #fff;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.connect-btn:hover { background: #f0f6ff; }
.more-btn { border: 1px solid var(--border); background: #fff; border-radius: 8px; width: 34px; height: 34px; font-size: 14px; color: var(--gray); cursor: pointer; }
.detail-list { margin: 0; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13px; }
.detail-row dt { color: var(--gray); }
.detail-row dd { color: var(--text); font-weight: 500; text-align: right; }
.detail-row dd.ok { color: var(--success); }
.detail-row dd.bad { color: var(--danger); }

/* 趋势图 */
.range-toggle { display: flex; background: var(--gray-bg); border-radius: 999px; padding: 3px; }
.range { border: none; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--gray); cursor: pointer; }
.range.active { background: var(--primary); color: #fff; font-weight: 500; }
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; }

/* 最新告警 */
.alert-card { padding: 14px 20px; }
.view-all { color: var(--primary); font-size: 13px; text-decoration: none; }
.alert-list { display: flex; flex-direction: column; }
.alert-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 4px;
  border-left: 4px solid transparent; border-radius: 6px;
}
.alert-item.crit { border-left-color: var(--danger); }
.alert-item.warn { border-left-color: var(--warning); }
.alert-ic { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 32px; }
.alert-ic.crit { background: #fee2e2; color: var(--danger); }
.alert-ic.warn { background: #fef3c7; color: var(--warning); }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.alert-sub { font-size: 12px; color: var(--gray); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-time { font-size: 12px; color: var(--gray); white-space: nowrap; }

/* ════════ 窄屏响应式（<1280）：单列纵向，表格获得整页宽度，禁止横向挤压 ════════
   顺序：设备列表 → 设备详情 → 设备在线趋势 → 最新告警 */
@media (max-width: 1279.98px) {
  .content {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .device-card,
  .detail-card,
  .trend-card,
  .alert-card {
    grid-column: 1; grid-row: auto;
  }
  .detail-card { grid-row: auto; }
  .alert-card  { grid-row: auto; }
}

/* ════════ 前端交互（视图切换 / 空态 / 轻提示） ════════ */
.view { margin-top: 16px; }
[hidden] { display: none !important; }
.nav-item, .view-all, .range, .connect-btn, .report-btn, .more-btn, .sel { cursor: pointer; }
.build-state {
  background: #fff; border-radius: 12px; box-shadow: var(--card-shadow);
  padding: 64px 20px; text-align: center;
}
.build-ic { display: flex; justify-content: center; margin-bottom: 16px; }
.build-text { font-size: 18px; font-weight: 600; color: #6b7280; }
.build-sub { font-size: 13px; color: #9ca3af; margin-top: 6px; }
#toast {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%);
  background: rgba(17,24,39,.92); color: #fff; font-size: 13px;
  padding: 10px 20px; border-radius: 8px; z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity .2s; white-space: nowrap;
}
#toast.show { opacity: 1; }

/* ════════ 设备管理页 / 完整详情（真正功能页） ════════ */
/* 设备名/ID 不折断：单行 + 省略 + hover 完整 */
.dt .cell-id { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

/* 设备管理表格：横向可滚动，禁止把列压没 */
.mng-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mng-table { min-width: 1180px; width: max-content; }
.mng-table th, .mng-table td { white-space: nowrap; }
.mng-table td:first-child { font-weight: 600; }
.dev-list .device-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.dev-list .dev-table { width: 100%; min-width: 1000px; table-layout: fixed; }
.dev-list .dev-table thead th:nth-child(1) { width: 13%; }
.dev-list .dev-table thead th:nth-child(2) { width: 10%; }
.dev-list .dev-table thead th:nth-child(3) { width: 12%; }
.dev-list .dev-table thead th:nth-child(4) { width: 15%; }
.dev-list .dev-table thead th:nth-child(5) { width: 9%; }
.dev-list .dev-table thead th:nth-child(6) { width: 11%; }
.dev-list .dev-table thead th:nth-child(7) { width: 8%; }
.dev-list .dev-table thead th:nth-child(8), .dev-list .dev-table tbody td:nth-child(8) { width: 220px; }
.dev-list .device-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.dev-list .device-actions > button { white-space: nowrap; flex-shrink: 0; }
.mng-count { color: var(--gray); }
.view-link-btn {
  border: 1px solid var(--primary); color: var(--primary); background: #fff;
  border-radius: 8px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.view-link-btn:hover { background: #f0f6ff; }
.device-actions { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.device-focus-toggle { border: 1px solid #dbe3ef; border-radius: 7px; padding: 5px 8px; color: #475569; background: #fff; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.device-focus-toggle.is-focused { border-color: #f4d28c; color: #986000; background: #fff8e8; }
.device-focus-toggle:disabled { opacity: .65; cursor: wait; }
.focus-device-table { min-width: 880px; }
.focus-device-table td:last-child { width: 190px; }

/* 首页摘要卡 → 完整详情入口 */
.detail-view-link { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); text-align: center; }
.view-full-btn {
  width: 100%; border: 1px solid var(--primary); color: var(--primary); background: #fff;
  border-radius: 8px; padding: 9px 0; font-size: 14px; font-weight: 600; cursor: pointer;
}
.view-full-btn:hover { background: #f0f6ff; }

/* 详情页 */
.detail-page-card { min-height: 320px; }
.detail-page-head { justify-content: flex-start; gap: 16px; }
.back-btn {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.back-btn:hover { background: #f5f7fb; }
.detail-section { margin-bottom: 24px; }
.detail-section > h3 {
  font-size: 15px; font-weight: 600; color: var(--text-dark);
  border-left: 3px solid var(--primary); padding-left: 10px; margin-bottom: 12px;
}
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 24px; }
.detail-grid .d-item dt { color: var(--gray); font-size: 12px; margin-bottom: 2px; }
.detail-grid .d-item dd { color: var(--text); font-size: 14px; font-weight: 500; word-break: break-word; }
.detail-empty { color: #9ca3af; font-weight: 400; font-size: 13px; }

/* 趋势空态（移除 MOCK 曲线后的占位） */
.trend-empty {
  height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #9ca3af; font-size: 14px;
}
.trend-empty .te-ic { opacity: .6; }

/* ════════ 立即刷新按钮（前台仅手动触发；30 分钟自动不动） ════════ */
.refresh-now {
  border: 1px solid var(--border); background: #fff; color: var(--primary);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: var(--card-shadow); white-space: nowrap;
}
.refresh-now:hover:not(:disabled) { background: #f0f6ff; }
.refresh-now:disabled { color: #9ca3af; cursor: not-allowed; opacity: .75; }

/* 显示器区块（完整详情） */
.mon-block { padding: 6px 0 14px; }
.mon-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* 远程控制模块（完整详情） */
.rc-block { display: flex; flex-direction: column; gap: 8px; }
.rc-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f8fafc; border: 1px solid #eef0f4; border-radius: 8px; }
.rc-name { min-width: 60px; font-size: 13px; font-weight: 600; color: var(--text-dark); }
.rc-val { flex: 1; font-size: 13px; color: var(--text); font-family: "Consolas","Menlo",monospace; word-break: break-all; }
.rc-copy {
  border: 1px solid var(--primary); color: var(--primary); background: #fff;
  border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.rc-copy:hover { background: #f0f6ff; }

/* ═══════════ 首页监控总览 ═══════════ */
.home { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.home > .card, .home-cols > .card { margin: 0; }
.ov-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ov-box { background: #fafbfc; border: 1px solid #eef0f4; border-radius: 10px; padding: 12px 14px; }
.ov-label { font-size: 12px; color: var(--gray); font-weight: 600; }
.ov-metrics { font-size: 20px; font-weight: 700; color: var(--text-dark); margin: 6px 0 10px; line-height: 1.3; }
.ov-metrics .ov-sub { font-size: 12px; font-weight: 400; color: var(--gray); }
.ov-bars { display: flex; flex-wrap: wrap; gap: 6px; }
.ov-seg { padding: 2px 9px; border-radius: 6px; font-size: 12px; color: #fff; line-height: 1.6; }
.seg-ok { background: var(--success); }
.seg-warn { background: var(--warning); }
.seg-crit { background: var(--danger); }
.seg-off { background: #6b7280; }
.seg-unknown { background: #cdd5e0; color: #374151; }
.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.manage-list { display: flex; flex-direction: column; }
.focus-item { padding: 11px 12px; border-bottom: 1px solid #f3f4f6; cursor: pointer; transition: background .15s; }
.focus-item:last-child { border-bottom: none; }
.focus-item:hover { background: #f7f9fc; }
.focus-line { display: flex; align-items: center; gap: 8px; }
.f-name { font-weight: 600; color: var(--text-dark); }
.f-g3 { color: var(--gray); font-size: 12px; }
.f-reason { color: var(--danger); font-size: 12px; margin-top: 3px; }
.focus-time { color: #9ca3af; font-size: 12px; margin-top: 3px; }
.f-status { font-size: 12px; font-weight: 600; }
.f-status.normal { color: var(--success); }
.f-status.offline { color: #6b7280; }
.f-status.warning { color: var(--warning); }
.f-status.critical { color: var(--danger); }

/* ═══════════ 设备管理：左列表 72% + 右详情 28% ═══════════ */
.dev-mgr { display: grid; grid-template-columns: 72fr 28fr; gap: 16px; margin-top: 16px; align-items: start; }
.dev-list, .dev-quick { margin: 0; min-width: 0; }
.dev-quick .detail-list { margin-top: 4px; }
.qv { color: #9ca3af; font-size: 12px; }
@media (max-width: 1200px) { .ov-grid { grid-template-columns: repeat(2, 1fr); } .dev-mgr { grid-template-columns: 65fr 35fr; } .home-cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .dev-mgr { grid-template-columns: 1fr; } .dev-quick { order: 2; } }

/* ═══════════ 门店管理 / 门店详情 ═══════════ */
.title-cell { font-weight: 600; color: var(--text-dark); }
.ss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 6px 0 18px; }
.ss-item { background: #fafbfc; border: 1px solid #eef0f4; border-radius: 10px; padding: 10px 12px; }
.ss-item dt { font-size: 12px; color: var(--gray); }
.ss-item dd { font-size: 18px; font-weight: 700; color: var(--text-dark); margin-top: 2px; }
.ss-item.bad dd { color: var(--danger); }
.ss-item.ok dd { color: var(--success); }

/* ═══════════ 弹层 Popover（远程连接 / [...] 菜单） ═══════════ */
.pop { position: fixed; top: 60px; right: 24px; width: 300px; background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(17,24,39,.16); border: 1px solid var(--border); z-index: 1250; overflow: hidden; }
.pop-head { font-weight: 600; color: var(--gray); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.pop-body { padding: 6px; }
.pop-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px; }
.pop-item { display: block; width: 100%; text-align: left; border: none; background: none; padding: 9px 12px; font-size: 13px; color: var(--text); cursor: pointer; border-radius: 8px; }
.pop-item:hover { background: #f5f7fb; }
.pop-item.danger { color: var(--danger); }
.pop-item.danger:hover { background: #fef2f2; }

/* ═══════════ 首页 5-3-3 骨架（严格按参考图） ═══════════ */
.home { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.mid-sub { font-size: 12px; color: #8b95a5; margin: -6px 0 14px; }
.home-mid { display: grid; grid-template-columns: 40fr 33fr 27fr; gap: 16px; align-items: stretch; }
.home-bot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.home-mid > .card, .home-bot > .card { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.home-bot > .card { min-height: 278px; }
.home .card { border: 1px solid #edf0f4; border-radius: 12px; box-shadow: 0 2px 8px rgba(31,41,55,.045); padding: 18px 20px; }
.home .card-head { margin-bottom: 8px; }
.home .card-title { display: flex; align-items: center; gap: 10px; }
.section-ic { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.section-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.section-ic.blue { color: #2875e5; background: #edf5ff; }
.section-ic.red { color: #ef4444; background: #fff0f0; }
.section-ic.green { color: #0da878; background: #e9fbf4; }
.section-ic.amber { color: #df8e08; background: #fff6e8; }
.section-ic.pale { color: #2875e5; background: #edf5ff; }
.card-sub { margin: 4px 0 0 48px; color: #929cab; font-size: 12px; line-height: 1.35; }
.home .view-all { font-size: 12px; font-weight: 500; white-space: nowrap; }
/* 门店运行概览 */
.store-dist { flex: 1; min-height: 184px; display: flex; flex-direction: column; padding: 15px 16px; border-radius: 11px; border: 1px solid #edf1f6; background: linear-gradient(135deg,#fbfdff,#f7faff); }
.store-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.store-dist .dist-title { font-size: 12px; color: #697586; font-weight: 600; }
.live-label { display: inline-flex; align-items: center; gap: 5px; color: #8b95a5; font-size: 11px; }
.live-label i, .legend-dot, .abn-state i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.store-chart-body { display: flex; align-items: center; justify-content: center; gap: clamp(20px,4vw,54px); flex: 1; padding: 8px 4px 2px; }
.dist-ring { width: 134px; height: 134px; flex: 0 0 134px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--success) 0 var(--normal-rate), #ef6a69 var(--normal-rate) 100%); position: relative; }
.dist-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px #edf1f6; }
.ring-center { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.ring-center strong { color: #182436; font-size: 26px; font-weight: 700; }
.ring-center span { color: #96a0ae; font-size: 11px; margin-top: 3px; }
.dist-legend { min-width: 110px; max-width: 185px; flex: 1; }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #e9eef4; color: #758092; font-size: 12px; }
.legend-row span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-row strong { color: #243247; font-size: 16px; }
.legend-dot.ok { background: var(--success); }
.legend-dot.bad { background: #ef6a69; }
.dist-note { margin-top: 10px; color: #a0a9b6; font-size: 10px; line-height: 1.35; }
.store-chart-empty { flex: 1; min-height: 135px; display: grid; place-items: center; color: #9ca3af; font-size: 13px; }
.store-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.sc-card { background: #fff; border: 1px solid #edf0f4; border-radius: 10px; padding: 10px 12px; }
.sc-label { font-size: 12px; color: var(--gray); }
.sc-val { font-size: 22px; font-weight: 700; color: var(--text-dark); margin: 4px 0 2px; }
.sc-val.ok { color: var(--success); }
.sc-val.bad { color: var(--danger); }
.sc-sub { font-size: 11px; color: #9ca3af; line-height: 1.3; }
/* 异常监控 */
.abn-list { display: flex; flex-direction: column; flex: 1; }
.abn-item { display: flex; align-items: center; gap: 12px; padding: 16px 2px; flex: 1; min-height: 82px; border-bottom: 1px solid #edf0f4; }
.abn-item:last-child { border-bottom: 0; }
.abn-ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 600; flex: 0 0 42px; }
.abn-ic.red { color: #e94141; background: #fff0f0; }
.abn-ic.amber { color: #d88709; background: #fff4e4; }
.abn-ic.gray { color: #59677a; background: #eef1f5; }
.abn-body { flex: 1; min-width: 0; }
.abn-title { font-size: 13px; color: #4b586a; font-weight: 500; }
.abn-num { font-size: 24px; font-weight: 700; color: #182436; line-height: 1.15; margin-top: 2px; }
.abn-state { display: flex; align-items: center; gap: 6px; color: #929cab; font-size: 11px; white-space: nowrap; }
.abn-state.is-ok i { background: #21b784; }
.abn-state.has-issue { color: #e28b13; }
.abn-state.has-issue i { background: #f3a52f; }
/* 快捷入口 */
.quick-list { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.quick-item { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #edf0f4; border-radius: 10px; padding: 8px 11px; text-decoration: none; flex: 1; min-height: 54px; }
.quick-item:hover { background: #f0f6ff; }
.qi-ic { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; flex: 0 0 32px; }
.qi-ic.blue { background: var(--primary); }
.qi-ic.red { background: var(--danger); }
.qi-ic.amber { background: var(--warning); }
.qi-ic.green { background: var(--success); }
.qi-ic.purple { background: #8b5cf6; }
.qi-t { flex: 1; min-width: 0; }
.qi-ti { display: block; font-size: 13px; font-weight: 600; color: var(--text-dark); }
.qi-su { display: block; font-size: 11px; color: #9ca3af; }
.qi-arrow { color: #9ca3af; font-size: 16px; }
/* 底部三栏紧凑表格 */
.list-table { min-width: 0; flex: 1; }
.home-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.home-table th { padding: 8px 5px; color: #748093; background: #f7f9fc; border-bottom: 1px solid #e8edf3; text-align: left; font-size: 11px; font-weight: 600; white-space: nowrap; }
.home-table td { padding: 9px 5px; color: #465367; border-bottom: 1px solid #edf0f4; font-size: 11px; line-height: 1.35; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-table tbody tr { cursor: pointer; }
.home-table tbody tr:hover { background: #f8fafc; }
.home-table tbody tr:last-child td { border-bottom: 0; }
.home-table th:nth-child(1), .home-table td:nth-child(1) { width: 24%; }
.home-alerts-table th:nth-child(2), .home-alerts-table td:nth-child(2) { width: 22%; }
.home-alerts-table th:nth-child(3), .home-alerts-table td:nth-child(3) { width: 20%; }
.home-alerts-table th:nth-child(4), .home-alerts-table td:nth-child(4) { width: 34%; }
.home-recent-table th:nth-child(1), .home-recent-table td:nth-child(1) { width: 36%; }
.home-recent-table th:nth-child(2), .home-recent-table td:nth-child(2) { width: 36%; }
.home-recent-table th:nth-child(3), .home-recent-table td:nth-child(3) { width: 28%; }
.home-focus-table th:nth-child(1), .home-focus-table td:nth-child(1) { width: 22%; }
.home-focus-table th:nth-child(2), .home-focus-table td:nth-child(2) { width: 14%; }
.home-focus-table th:nth-child(3), .home-focus-table td:nth-child(3) { width: 18%; }
.home-focus-table th:nth-child(4), .home-focus-table td:nth-child(4) { width: 25%; }
.home-focus-table th:nth-child(5), .home-focus-table td:nth-child(5) { width: 21%; }
.home-table .home-time { color: #8490a0; font-size: 10px; }
.home-table .home-device { color: #354257; font-weight: 500; }
.home-table .home-store { color: #758194; }
.home-table .home-alert-text { color: #59677a; }
.home-table .home-empty { height: 136px; color: #9aa4b1; text-align: center; cursor: default; }
.home-table tr:hover .home-empty { background: #fff; }
.home-focus-table .badge { font-size: 10px; padding: 3px 7px; gap: 4px; }
.home-focus-table .badge .dot { width: 6px; height: 6px; }
.empty { color: #9ca3af; font-size: 13px; padding: 14px 4px; }
@media (max-width: 1200px) { .home-mid { grid-template-columns: 1fr 1fr; } .mid-right { grid-column: 1 / -1; } .home-bot { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .home-mid { grid-template-columns: 1fr; } }

/* 大桌面首页按视口分配纵向空间，中部和底部共同吸收剩余高度。 */
@media (min-width: 1280px) and (min-height: 960px) {
  .home { min-height: calc(100vh - 231px); }
  .home-mid { flex: 1.5 1 414px; min-height: 414px; }
  .home-bot { flex: 1 1 278px; min-height: 278px; }
  .dist-ring { width: clamp(134px, 15vh, 162px); height: clamp(134px, 15vh, 162px); flex-basis: clamp(134px, 15vh, 162px); }
}

/* 真实通知：铃铛计数 + 通知面板 + 告警条目 */
.notif-count {
  position: absolute; top: -6px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.notif-panel {
  position: fixed; top: 60px; right: 24px; width: 360px; max-height: 70vh; overflow: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(17,24,39,.16);
  border: 1px solid var(--border); z-index: 1200;
}
.notif-panel-head { font-weight: 600; color: var(--text-dark); padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-panel-body { max-height: calc(70vh - 44px); overflow: auto; }
.nitem { padding: 10px 14px; border-bottom: 1px solid #f3f4f6; cursor: pointer; }
.nitem:last-child { border-bottom: none; }
.nitem:hover { background: #f7f9fc; }
.nitem-title { font-weight: 600; color: var(--text-dark); font-size: 13px; }
.nitem-line { font-size: 12px; color: var(--gray); margin-top: 2px; word-break: break-all; }
.nitem-line.dim { color: #9ca3af; }
.nitem-line .nid { color: #6b7280; }
.npill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.npill.nsev1 { background: var(--danger); }
.npill.nsev2 { background: #dc2626; }
.npill.nsev3 { background: var(--warning); }

/* 删除设备记录（危险操作） */
.del-btn {
  margin-left: auto; border: 1px solid #fca5a5; color: var(--danger); background: #fff;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.del-btn:hover { background: #fef2f2; }
.mng-del {
  border: 1px solid #fca5a5; color: var(--danger); background: #fff;
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.mng-del:hover { background: #fef2f2; }
.del-modal { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; }
.del-mask { position: absolute; inset: 0; background: rgba(17,24,39,.45); }
.del-dialog {
  position: relative; width: 420px; max-width: calc(100vw - 40px);
  background: #fff; border-radius: 12px; box-shadow: 0 18px 48px rgba(17,24,39,.25); padding: 20px 22px;
}
.del-title { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.del-desc { margin-top: 12px; font-size: 14px; color: var(--text); font-weight: 600; }
.del-note { margin-top: 10px; font-size: 13px; color: var(--gray); line-height: 1.6; }
.del-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.del-cancel, .del-confirm { border-radius: 8px; padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.del-cancel { border: 1px solid var(--border); background: #fff; color: var(--text); }
.del-cancel:hover { background: #f5f7fb; }
.del-confirm { border: none; background: var(--danger); color: #fff; }
.del-confirm:hover { background: #dc2626; }
.del-confirm:disabled { opacity: .7; cursor: not-allowed; }

/* 管理员登录与门店手动关注 */
.admin-login[hidden] { display: none; }
.admin-login:not([hidden]) { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px; background: #f5f7fa; }
.admin-login-card { width: min(400px, 100%); padding: 34px; border: 1px solid #e8ecf0; border-radius: 16px; background: #fff; box-shadow: 0 16px 44px rgba(31,41,55,.12); }
.admin-login-mark { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 13px; color: #fff; background: linear-gradient(135deg,#3b82f6,#60a5fa); font-size: 13px; font-weight: 700; box-shadow: 0 4px 10px rgba(59,130,246,.25); }
.admin-login-card h1 { color: var(--text-dark); font-size: 20px; }
.admin-login-card p { margin-top: 7px; color: var(--gray); font-size: 13px; }
.admin-login-card label { display: block; margin: 24px 0 7px; color: #4b5563; font-size: 13px; font-weight: 600; }
.admin-login-card input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; font: inherit; }
.admin-login-card input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.admin-login-card button { width: 100%; height: 42px; margin-top: 14px; border: 0; border-radius: 8px; color: #fff; background: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }
.admin-login-card button:disabled { cursor: wait; opacity: .7; }
.admin-login-message { min-height: 18px; margin-top: 8px; color: var(--danger); font-size: 12px; }
.logout-btn { border: 0; padding: 7px 2px; color: #6b7280; background: transparent; font-size: 12px; cursor: pointer; white-space: nowrap; }
.logout-btn:hover { color: var(--primary); }
.store-actions { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.store-focus-toggle { border: 1px solid #f0d9a8; border-radius: 7px; padding: 5px 9px; color: #a66a00; background: #fffaf0; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.store-focus-toggle.is-focused { border-color: #f4d28c; color: #986000; background: #fff5dc; }
.store-focus-toggle:disabled { opacity: .65; cursor: wait; }
.store-detail-focus { margin-left: auto; }
.store-actions .view-link-btn { padding: 5px 8px; }
.focus-open-btn { padding: 0; border: 0; color: var(--primary); background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.focus-open-btn:hover { text-decoration: underline; }

/* 管理员设置 */
.settings-card { max-width: 640px; }
.password-form { max-width: 460px; padding: 8px 0 18px; }
.password-form > label { display: block; margin: 16px 0 7px; color: #4b5563; font-size: 13px; font-weight: 600; }
.password-field { display: flex; align-items: center; width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.password-field:focus-within { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.password-field input { width: 100%; height: 100%; min-width: 0; padding: 0 12px; border: 0; outline: 0; border-radius: 8px; background: transparent; color: var(--text-dark); font: inherit; }
.password-visibility { display: grid; place-items: center; width: 40px; height: 38px; flex: 0 0 40px; border: 0; border-radius: 7px; color: #8b95a3; background: transparent; cursor: pointer; }
.password-visibility:hover { color: var(--primary); background: #f4f8ff; }
.password-visibility svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.password-change-message { min-height: 20px; margin-top: 12px; color: var(--danger); font-size: 12px; }
.password-submit { height: 40px; padding: 0 18px; border: 0; border-radius: 8px; color: #fff; background: var(--primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.password-submit:hover { background: #2563eb; }
.password-submit:disabled { cursor: wait; opacity: .7; }

/* 软件下发 UI 框架 */
.software-deploy-page { display: grid; gap: 16px; }
.software-deploy-card, .software-tasks-card { min-width: 0; }
.software-deploy-form { display: grid; gap: 20px; }
.software-card-sub { margin-top: 4px; color: #929cab; font-size: 12px; }
.software-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.software-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.software-field > label, .software-device-picker > label { color: #4b5563; font-size: 13px; font-weight: 600; }
.software-field input, .software-field select, .software-device-picker select {
  width: 100%; min-width: 0; height: 38px; padding: 0 11px; border: 1px solid var(--border);
  border-radius: 8px; outline: none; background: #fff; color: var(--text); font: inherit; font-size: 13px;
}
.software-field input:focus, .software-field select:focus, .software-device-picker select:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.software-field-wide { grid-column: 1 / -1; }
.software-field-hint { color: #929cab; font-size: 12px; line-height: 1.5; }
.software-target-group { min-width: 0; margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; }
.software-target-group legend { padding: 0 6px; color: var(--text-dark); font-size: 13px; font-weight: 600; }
.software-target-options { display: flex; flex-wrap: wrap; gap: 24px; }
.software-target-options label { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-size: 13px; cursor: pointer; }
.software-target-options input { margin: 0; accent-color: var(--primary); }
.software-target-note { margin-top: 12px; color: var(--gray); font-size: 12px; }
.software-device-picker { display: grid; gap: 7px; max-width: 560px; margin-top: 14px; }
.software-deploy-actions { display: flex; justify-content: flex-end; }
.software-publish-btn { min-height: 40px; padding: 0 18px; border: 0; border-radius: 8px; color: #fff; background: var(--primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.software-publish-btn:hover { background: #2563eb; }
.software-task-wrap { width: 100%; overflow-x: auto; }
.software-task-table { min-width: 760px; }
.software-task-empty { height: 120px; text-align: center !important; }
@media (max-width: 760px) { .software-fields-grid { grid-template-columns: 1fr; } .software-field-wide { grid-column: auto; } }
