/**
 * lh-dashboard.css — 物联网后台独立样式（作用域 .lh-dash）
 * Premium dark glass dashboard
 */

body.lh-dash-page {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  background-color: #070b14;
  /* 仅居中光晕；不在 0%/100% 边缘放渐变，避免贴边时左右缘频闪 */
  background-image: radial-gradient(
    ellipse 70% 45% at 50% 18%,
    rgba(56, 189, 248, 0.12),
    transparent 68%
  );
  box-shadow: none;
  border-radius: 0;
}

/* 禁用 fixed 伪元素背景层（网格 mask + 边缘渐变易触发 GPU 贴边频闪） */
body.lh-dash-page::before,
body.lh-dash-page::after {
  content: none;
  display: none;
}

html:has(body.lh-dash-page) {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body.lh-dash-page > .lh-dash {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

/* ── webMain：锁定视口，列表区内滚动 ── */
html:has(body.lh-dash-main) {
  height: 100%;
  overflow: hidden;
  overflow-x: clip;
  overflow-y: clip;
}

body.lh-dash-main {
  height: 100%;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  overflow-x: clip;
  overflow-y: clip;
}

body.lh-dash-main > .lh-dash {
  height: 100%;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: clip;
}

body.lh-dash-main .lh-dash .dash-topbar {
  flex-shrink: 0;
}

body.lh-dash-main .lh-dash .dash-page-body {
  flex: 1;
  min-height: 0;
  max-width: var(--dash-content-w);
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.lh-dash-main .lh-dash .dash-main {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

body.lh-dash-main .lh-dash .dash-overview {
  flex-shrink: 0;
  width: 100%;
}

body.lh-dash-main .lh-dash .dash-list-section {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

body.lh-dash-main .lh-dash .dash-toolbar {
  flex-shrink: 0;
  width: 100%;
}

body.lh-dash-main .lh-dash .dash-table-card {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.lh-dash-main .lh-dash .dash-table-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-height: none;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: auto;
  overscroll-behavior: contain;
}

body.lh-dash-main .lh-dash .dash-table-wrap .dataTables_wrapper {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.lh-dash-main .lh-dash .dash-table-wrap .dataTables_wrapper .dash-table-toolbar,
body.lh-dash-main .lh-dash .dash-table-wrap .dataTables_wrapper .dash-table-footer {
  flex-shrink: 0;
}

body.lh-dash-main .lh-dash .dash-footer {
  flex-shrink: 0;
  width: 100%;
}

body.lh-dash-main .lh-dash .dash-footer.dash-his-footer,
body.lh-dash-mgr-main .lh-dash .dash-footer.dash-his-footer,
body.lh-dash-main .lh-dash .dash-footer.dash-main-footer,
body.lh-dash-mgr-main .lh-dash .dash-footer.dash-main-footer {
  margin-top: auto;
}

/* 全站防频闪：顶栏/卡片/表头去 blur，表格区隔离滚动重绘 */
body.lh-dash-page .lh-dash .dash-topbar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(7, 11, 20, 0.96);
}

body.lh-dash-page .lh-dash .dash-table-card,
body.lh-dash-page .lh-dash .dash-panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.lh-dash-page .lh-dash .dash-device-table thead th {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: #0d1321;
}

body.lh-dash-page .lh-dash .dash-table-wrap {
  contain: paint;
  isolation: isolate;
}

/* KPI 状态分类保留毛玻璃；隔离合成层，避免滚动列表时触发整页频闪 */
body.lh-dash-main .lh-dash .dash-overview,
body.lh-dash-mgr-main .lh-dash .dash-overview {
  isolation: isolate;
  contain: layout style;
}

/* webMain / manager 设备列表：滚动时 hover 会触发整表重绘 */
body.lh-dash-main .lh-dash .dash-device-table tbody tr[data-row-type="device"],
body.lh-dash-mgr-main .lh-dash .dash-device-table tbody tr[data-row-type="device"] {
  transition: none;
}

body.lh-dash-main .lh-dash .dash-device-table tbody tr[data-row-type="device"]:not(.tr-selected):hover td,
body.lh-dash-mgr-main .lh-dash .dash-device-table tbody tr[data-row-type="device"]:not(.tr-selected):hover td {
  background: inherit !important;
}

body.lh-dash-main .lh-dash .dash-device-table tbody tr[data-row-type="device"].tr-odd:not(.tr-selected):hover td,
body.lh-dash-mgr-main .lh-dash .dash-device-table tbody tr[data-row-type="device"].tr-odd:not(.tr-selected):hover td {
  background: var(--dash-row-stripe) !important;
}

/* 历史页（webHisData / webSensorHis / webHisThMsg / gvCheck） */
.lh-dash .dash-his-chart-panel {
  isolation: isolate;
}

.lh-dash .dash-his-dataview-table tbody tr {
  transition: none;
}

.lh-dash .dash-his-dataview-table tbody tr:hover td {
  background: inherit !important;
}

.lh-dash .dash-his-dataview-table tr:first-child:hover td {
  background: rgba(56, 189, 248, 0.1) !important;
}

.lh-dash .dash-his-dataview-table tr.dash-his-dataview-head:hover td {
  background: rgba(255, 255, 255, 0.04) !important;
}

.lh-dash .dash-his-msg-table.dash-device-table tbody tr {
  transition: none;
}

.lh-dash .dash-his-msg-table.dash-device-table tbody tr:not(.tr-selected):hover td {
  background: inherit !important;
}

.lh-dash .dash-his-msg-table.dash-device-table tbody tr.tr-odd:not(.tr-selected):hover td {
  background: var(--dash-row-stripe) !important;
}

/* ── 历史页 / gvCheck：纵向可滚动，禁止横向贴边振荡 ── */
html:has(body.lh-dash-page:not(.lh-dash-main):not(.lh-dash-mgr-main):not(.lh-dash-lhsn)) {
  overflow-x: clip;
}

body.lh-dash-page:not(.lh-dash-main):not(.lh-dash-mgr-main):not(.lh-dash-lhsn) {
  overflow-x: clip;
  overflow-y: auto;
}

body.lh-dash-page:not(.lh-dash-main):not(.lh-dash-mgr-main):not(.lh-dash-lhsn) > .lh-dash {
  overflow-x: clip;
}

body.lh-dash-page .DIV-MAIN-MENU {
  margin-left: 0;
}

/* ── 设计令牌 ── */
.lh-dash {
  --dash-primary: #38bdf8;
  --dash-primary-dark: #0ea5e9;
  --dash-primary-soft: rgba(56, 189, 248, 0.12);
  --dash-primary-glow: rgba(56, 189, 248, 0.35);
  --dash-bg: #070b14;
  --dash-bg-elevated: #0d1321;
  --dash-surface: rgba(255, 255, 255, 0.04);
  --dash-surface-hover: rgba(255, 255, 255, 0.07);
  --dash-surface-muted: rgba(255, 255, 255, 0.025);
  --dash-border: rgba(255, 255, 255, 0.08);
  --dash-border-strong: rgba(255, 255, 255, 0.14);
  --dash-row-stripe: rgba(255, 255, 255, 0.012);
  --dash-text: #f1f5f9;
  --dash-text-secondary: #cbd5e1;
  --dash-muted: #64748b;
  --dash-success: #34d399;
  --dash-success-soft: rgba(52, 211, 153, 0.12);
  --dash-warning: #fbbf24;
  --dash-warning-soft: rgba(251, 191, 36, 0.12);
  --dash-danger: #f87171;
  --dash-danger-soft: rgba(248, 113, 113, 0.12);
  --dash-offline: #94a3b8;
  --dash-offline-soft: rgba(148, 163, 184, 0.1);
  --dash-radius: 16px;
  --dash-radius-sm: 10px;
  --dash-radius-lg: 20px;
  --dash-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --dash-shadow-glow: 0 0 40px rgba(56, 189, 248, 0.08);
  --dash-topbar-h: 64px;
  /* 内容区最大宽度：100% + 内边距留白，避免 calc(100% - Npx) 贴边宽度振荡 */
  --dash-content-max: 1480px;
  --dash-content-w: min(var(--dash-content-max), 100%);
  --dash-blur: blur(20px);

  box-sizing: border-box;
  background: transparent;
  color: var(--dash-text);
  font-family: "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
  position: relative;
}

.lh-dash > * {
  position: relative;
  z-index: 1;
}

.lh-dash *,
.lh-dash *::before,
.lh-dash *::after {
  box-sizing: border-box;
}

.lh-dash button {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.lh-dash a {
  color: inherit;
  text-decoration: none;
}

/* ── 顶栏 ── */
.lh-dash .dash-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--dash-topbar-h);
  background: rgba(7, 11, 20, 0.75);
  backdrop-filter: var(--dash-blur);
  -webkit-backdrop-filter: var(--dash-blur);
  border-bottom: 1px solid var(--dash-border);
}

.lh-dash .dash-topbar-inner {
  max-width: var(--dash-content-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lh-dash .dash-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.lh-dash .dash-brand-menu-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: opacity 0.2s;
}

.lh-dash .dash-brand-menu-btn:hover {
  opacity: 0.85;
}

.lh-dash .dash-brand-menu-btn:hover .dash-brand-logo {
  box-shadow: 0 0 0 2px var(--dash-primary-soft), 0 0 20px var(--dash-primary-glow);
}

.lh-dash .dash-brand-menu-btn:focus-visible {
  outline: 2px solid var(--dash-primary);
  outline-offset: 4px;
  border-radius: 12px;
}

.lh-dash .dash-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.lh-dash .dash-menu-backdrop.is-open {
  display: block;
}

.lh-dash .dash-menu-panel {
  display: none;
  position: fixed;
  top: calc(var(--dash-topbar-h) + 12px);
  left: 20px;
  width: min(340px, calc(100vw - 40px));
  max-height: calc(100vh - var(--dash-topbar-h) - 32px);
  background: rgba(13, 19, 33, 0.95);
  backdrop-filter: var(--dash-blur);
  border: 1px solid var(--dash-border-strong);
  border-radius: var(--dash-radius-lg);
  box-shadow: var(--dash-shadow), var(--dash-shadow-glow);
  z-index: 201;
  overflow: hidden;
  flex-direction: column;
}

.lh-dash .dash-menu-panel.is-open {
  display: flex;
}

.lh-dash .dash-menu-head {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--dash-border);
  color: var(--dash-muted);
}

.lh-dash .dash-menu-list {
  overflow-y: auto;
  padding: 10px;
}

.lh-dash .dash-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: var(--dash-radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--dash-text-secondary);
  transition: background 0.15s, color 0.15s;
}

.lh-dash .dash-menu-item:hover {
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
}

.lh-dash .dash-menu-item.is-current {
  color: var(--dash-muted);
  cursor: default;
}

.lh-dash .dash-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.15));
  padding: 6px;
  border: 1px solid var(--dash-border);
  transition: box-shadow 0.2s;
}

.lh-dash .dash-brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--dash-text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lh-dash .dash-brand-sub {
  font-size: 11px;
  color: var(--dash-muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lh-dash .dash-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lh-dash .dash-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--dash-radius-sm);
  border: 1px solid var(--dash-border);
  background: var(--dash-surface);
  color: var(--dash-text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.lh-dash .dash-topbar-btn:hover {
  border-color: var(--dash-primary);
  color: var(--dash-primary);
  background: var(--dash-primary-soft);
  box-shadow: 0 0 20px var(--dash-primary-glow);
}

.lh-dash .dash-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 16px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--dash-border);
  background: var(--dash-surface);
  backdrop-filter: blur(8px);
}

.lh-dash .dash-profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--dash-border-strong);
}

.lh-dash .dash-profile-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--dash-text);
}

.lh-dash .dash-profile-id {
  font-size: 11px;
  color: var(--dash-muted);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* ── 页面主体（全站统一内容宽度） ── */
.lh-dash .dash-page-body {
  width: 100%;
  max-width: var(--dash-content-w);
  margin-left: auto;
  margin-right: auto;
  padding: 12px 28px 0;
  box-sizing: border-box;
}

.lh-dash .dash-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.lh-dash .dash-page-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--dash-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lh-dash .dash-page-title .iconfont {
  color: var(--dash-primary);
  font-size: 17px;
}

/* ── KPI 概览 ── */
.lh-dash .dash-overview {
  padding-top: 2px;
}

.lh-dash .dash-overview-head {
  margin-bottom: 12px;
}

.lh-dash .dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.lh-dash .dash-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  min-width: 0;
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  backdrop-filter: blur(12px);
  text-align: left;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s, background 0.25s;
  position: relative;
  overflow: hidden;
}

.lh-dash .dash-kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.lh-dash .dash-kpi::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--dash-border);
  transition: background 0.25s, box-shadow 0.25s;
}

.lh-dash .dash-kpi:hover {
  border-color: var(--dash-border-strong);
  background: var(--dash-surface-hover);
}

.lh-dash .dash-kpi.is-active {
  border-color: var(--dash-primary);
  background: var(--dash-primary-soft);
  box-shadow: 0 4px 24px var(--dash-primary-glow), var(--dash-shadow);
}

.lh-dash .dash-kpi.is-active::after {
  background: var(--dash-primary);
  box-shadow: 0 0 12px var(--dash-primary-glow);
}

.lh-dash .dash-kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  width: auto;
  height: auto;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.lh-dash .dash-kpi-icon .iconfont {
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1;
  opacity: 0.9;
}

.lh-dash .dash-kpi-meta {
  min-width: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.lh-dash .dash-kpi-num {
  display: block;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.lh-dash .dash-kpi-label {
  display: block;
  font-size: 11px;
  color: var(--dash-muted);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.lh-dash .dash-kpi--total .dash-kpi-icon { color: var(--dash-primary); }
.lh-dash .dash-kpi--total .dash-kpi-num { color: var(--dash-primary); }
.lh-dash .dash-kpi--ok .dash-kpi-icon { color: var(--dash-success); }
.lh-dash .dash-kpi--ok .dash-kpi-num { color: var(--dash-success); }
.lh-dash .dash-kpi--pending .dash-kpi-icon { color: var(--dash-danger); }
.lh-dash .dash-kpi--pending .dash-kpi-num { color: var(--dash-danger); }
.lh-dash .dash-kpi--offline .dash-kpi-icon { color: var(--dash-offline); }
.lh-dash .dash-kpi--offline .dash-kpi-num { color: var(--dash-text-secondary); }
.lh-dash .dash-kpi--processed .dash-kpi-icon { color: var(--dash-warning); }
.lh-dash .dash-kpi--processed .dash-kpi-num { color: var(--dash-warning); }

/* ── 设备列表区 ── */
.lh-dash .dash-list-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.lh-dash .dash-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lh-dash .dash-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 4px 0;
}

.lh-dash .dash-filter-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border-strong) transparent;
}

.lh-dash .dash-filter-scroll::-webkit-scrollbar {
  height: 4px;
}

.lh-dash .dash-filter-scroll::-webkit-scrollbar-thumb {
  background: var(--dash-border-strong);
  border-radius: 999px;
}

.lh-dash .dash-search {
  flex-shrink: 0;
}

.lh-dash .dash-search input {
  width: 260px;
  max-width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius-sm);
  background: var(--dash-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 12px center;
  font-size: 13px;
  color: var(--dash-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.lh-dash .dash-search input::placeholder {
  color: var(--dash-muted);
}

.lh-dash .dash-search input:focus {
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px var(--dash-primary-soft), 0 0 20px var(--dash-primary-glow);
  background-color: var(--dash-surface-hover);
}

.lh-dash .dash-filter-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: min-content;
  padding-bottom: 2px;
}

.lh-dash .dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--dash-border);
  background: var(--dash-surface);
  color: var(--dash-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.lh-dash .dash-chip:hover {
  border-color: var(--dash-primary);
  color: var(--dash-primary);
  background: var(--dash-primary-soft);
}

.lh-dash .dash-chip.is-active {
  background: linear-gradient(135deg, var(--dash-primary), var(--dash-primary-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px var(--dash-primary-glow);
}

.lh-dash .dash-chip-count {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.lh-dash .dash-chip.is-active .dash-chip-count {
  background: rgba(255, 255, 255, 0.2);
}

/* ── 表格卡片 ── */
.lh-dash .dash-table-card {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius-lg);
  box-shadow: var(--dash-shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.lh-dash .dash-table-wrap {
  overflow-x: auto;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  max-height: calc(100vh - 260px);
  -webkit-overflow-scrolling: touch;
}

.lh-dash .dash-table-card,
.lh-dash .dash-table-wrap,
.lh-dash .dash-table-wrap .dataTables_wrapper,
.lh-dash .dash-table-toolbar,
.lh-dash .dash-table-footer {
  width: 100%;
  box-sizing: border-box;
}

.lh-dash .dash-device-table {
  width: 100% !important;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.lh-dash .dataTables_wrapper .dataTables_empty {
  width: 100% !important;
}

.lh-dash .dash-device-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(13, 19, 33, 0.95);
  backdrop-filter: blur(8px);
  color: var(--dash-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 12px;
  border-bottom: 1px solid var(--dash-border);
  text-align: center;
  white-space: nowrap;
}

.lh-dash .dash-device-table tbody td {
  padding: 12px;
  border-bottom: none;
  font-size: 13px;
  vertical-align: middle;
  text-align: center;
  overflow: hidden;
  color: var(--dash-text-secondary);
}

.lh-dash .dash-device-table tbody tr[data-row-type="device"].tr-odd td {
  background: var(--dash-row-stripe);
}

.lh-dash .dash-device-table tbody tr[data-row-type="device"].tr-even td {
  background: transparent;
}

.lh-dash .dash-device-table tbody tr[data-row-type="device"]:last-child td {
  border-bottom: none;
}

.lh-dash .dash-device-table tbody tr[data-row-type="device"] {
  transition: background 0.15s;
}

.lh-dash .dash-device-table tbody tr[data-row-type="device"]:hover td {
  background: rgba(56, 189, 248, 0.04);
}

.lh-dash .dash-device-table tbody tr.tr-selected td {
  background: var(--dash-primary-soft) !important;
}

.lh-dash .dash-device-table .col-idx {
  width: 32px;
  color: var(--dash-muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.lh-dash .dash-device-table thead th.col-status,
.lh-dash .dash-device-table .col-status {
  width: auto;
  max-width: none;
  white-space: nowrap;
}

.lh-dash .dash-device-table tbody td.col-status {
  width: auto;
  max-width: none;
  overflow: visible;
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
}

.lh-dash .dash-status-cell {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.lh-dash .dash-status-cell > .iconfont {
  font-size: 13px;
  flex-shrink: 0;
}

.lh-dash .dash-action-btn--warn {
  padding: 1px 4px;
  font-size: 9px;
  gap: 1px;
  white-space: nowrap;
  line-height: 1.1;
  border-radius: 4px;
  box-shadow: none;
  flex-shrink: 0;
}

.lh-dash .dash-action-btn--warn .iconfont {
  font-size: 10px;
}

.lh-dash .dash-action-btn--warn:hover {
  box-shadow: 0 2px 8px var(--dash-primary-glow);
  transform: none;
}
.lh-dash .dash-device-table .col-ssn { width: 11%; }
.lh-dash .dash-device-table .col-name {
  width: 140px;
  max-width: 140px;
}
.lh-dash .dash-device-table .col-data { min-width: 15%; }

.lh-dash .dash-device-table .col-wx { width: 52px; }
.lh-dash .dash-device-table .col-sms { width: 52px; }

.lh-dash .dash-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  vertical-align: middle;
}

.lh-dash .dash-status-icon--ok { color: var(--dash-success); }
.lh-dash .dash-status-icon--pending { color: var(--dash-danger); }
.lh-dash .dash-status-icon--processed { color: var(--dash-warning); }
.lh-dash .dash-status-icon--offline { color: var(--dash-offline); }

/* 状态徽章 */
.lh-dash .dash-device-table .col-rssi { width: 36px; }
.lh-dash .dash-device-table .col-power {
  width: 48px;
  min-width: 48px;
  white-space: nowrap;
  text-align: center;
  font-size: 11px;
}

.lh-dash .dash-device-table .col-power .dash-power-cell {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.lh-dash .dash-device-table .col-time { width: 13%; }

.lh-dash .dash-device-table .col-idx,
.lh-dash .dash-device-table .col-wx,
.lh-dash .dash-device-table .col-sms,
.lh-dash .dash-device-table .col-rssi,
.lh-dash .dash-device-table .col-power,
.lh-dash .dash-device-table thead th.col-idx,
.lh-dash .dash-device-table thead th.col-wx,
.lh-dash .dash-device-table thead th.col-sms,
.lh-dash .dash-device-table thead th.col-rssi,
.lh-dash .dash-device-table thead th.col-power,
.lh-dash .dash-device-table tbody td.col-idx,
.lh-dash .dash-device-table tbody td.col-wx,
.lh-dash .dash-device-table tbody td.col-sms,
.lh-dash .dash-device-table tbody td.col-rssi,
.lh-dash .dash-device-table tbody td.col-power {
  padding-left: 4px;
  padding-right: 4px;
}

.lh-dash .dash-device-table tbody td.col-name,
.lh-dash .dash-device-table tbody td.col-ssn,
.lh-dash .dash-device-table tbody td:nth-child(3),
.lh-dash .dash-device-table tbody td:nth-child(4) {
  text-align: left;
}

.lh-dash .dash-device-table tbody td.col-name {
  max-width: 140px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: var(--dash-border-strong) transparent;
}

.lh-dash .dash-device-table tbody td.col-name::-webkit-scrollbar {
  height: 3px;
}

.lh-dash .dash-device-table tbody td.col-name::-webkit-scrollbar-thumb {
  background: var(--dash-border-strong);
  border-radius: 999px;
}

/* 组头行 */
.lh-dash .dash-device-table tr.lh-ui-group-header td {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--dash-border);
  border-top: 1px solid var(--dash-border);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-primary);
  text-align: left;
  letter-spacing: 0.02em;
}

.lh-dash .dash-device-table tr.lh-ui-group-header-ungrouped td {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.06) 0%, transparent 100%);
  color: var(--dash-muted);
}

.lh-dash .lh-ui-group-header-icon {
  margin-right: 8px;
  color: var(--dash-primary);
}

.lh-dash .lh-ui-group-header-ungrouped .lh-ui-group-header-icon {
  color: var(--dash-offline);
}

/* 状态徽章 */
.lh-dash .dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.lh-dash .dash-badge-ok {
  background: var(--dash-success-soft);
  color: var(--dash-success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.lh-dash .dash-badge-warn {
  background: var(--dash-warning-soft);
  color: var(--dash-warning);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.lh-dash .dash-badge-alarm {
  background: var(--dash-danger-soft);
  color: var(--dash-danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.lh-dash .dash-badge-offline {
  background: var(--dash-offline-soft);
  color: var(--dash-offline);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* 传感器数据 */
.lh-dash .td-sensor-data {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  align-content: center;
  gap: 6px 0;
  text-align: center;
  vertical-align: middle;
  line-height: 1.5;
}

.lh-dash .sensor_data {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 4px;
  white-space: nowrap;
}

.lh-dash .dash-device-name {
  display: inline;
  white-space: nowrap;
  color: var(--dash-text);
  font-weight: 500;
}

.lh-dash .dash-device-name--link {
  color: var(--dash-primary);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.lh-dash .dash-device-name--link:hover {
  color: #7dd3fc;
  text-shadow: 0 0 20px var(--dash-primary-glow);
}

.lh-dash .dash-ssn {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--dash-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lh-dash .lh-jquery-history {
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  color: var(--dash-muted);
  transition: color 0.15s;
}

.lh-dash .lh-jquery-history:hover {
  color: var(--dash-primary);
}

.lh-dash .dash-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--dash-primary), var(--dash-primary-dark));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 8px var(--dash-primary-glow);
  transition: box-shadow 0.2s, transform 0.15s;
}

.lh-dash .dash-action-btn:hover {
  box-shadow: 0 4px 16px var(--dash-primary-glow);
  transform: translateY(-1px);
}

/* DataTables */
.lh-dash .dash-table-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--dash-border);
  background: var(--dash-surface-muted);
  overflow-x: auto;
}

.lh-dash .dash-table-toolbar .dataTables_length {
  flex: 0 0 auto;
}

.lh-dash .dash-table-toolbar .dataTables_filter,
.lh-dash .dash-table-toolbar .dash-search {
  flex: 0 0 auto;
  margin-left: auto;
}

.lh-dash .dash-table-toolbar .dataTables_length,
.lh-dash .dash-table-toolbar .dataTables_filter {
  float: none !important;
  margin: 0;
  text-align: left;
}

.lh-dash .dash-table-toolbar .dataTables_length label,
.lh-dash .dash-table-toolbar .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--dash-text-secondary);
}

.lh-dash .dash-table-toolbar .dataTables_length select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 72px;
  width: auto;
  padding: 7px 30px 7px 12px;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius-sm);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
    no-repeat right 10px center,
    var(--dash-surface);
  color: var(--dash-text);
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lh-dash .dash-table-toolbar .dataTables_length select:focus {
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px var(--dash-primary-soft);
}

.lh-dash .dash-table-toolbar .dataTables_length select option {
  background: var(--dash-bg-elevated);
  color: var(--dash-text);
}

.lh-dash .dash-table-toolbar .dataTables_filter input {
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  background: var(--dash-surface);
  color: var(--dash-text);
  min-width: 200px;
}

.lh-dash .dash-table-toolbar .dataTables_filter input:focus {
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px var(--dash-primary-soft);
}

.lh-dash .dash-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--dash-border);
  background: var(--dash-surface-muted);
}

.lh-dash .dash-table-export {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.lh-dash .dash-table-export .dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
}

.lh-dash .dash-table-footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.lh-dash .dash-table-footer .dataTables_info,
.lh-dash .dash-table-footer .dataTables_paginate {
  float: none !important;
  clear: none !important;
  margin: 0;
  padding: 0;
  text-align: left;
}

.lh-dash .dataTables_wrapper .dataTables_info {
  font-size: 13px;
  color: var(--dash-muted);
}

.lh-dash .dataTables_wrapper .dataTables_paginate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  min-width: 0;
  min-height: 0;
  list-style: none;
}

.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button > a,
.lh-dash .dataTables_wrapper .pagination > li > a,
.lh-dash .dataTables_wrapper .pagination > li > span {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 34px;
  padding: 6px 12px !important;
  margin: 0 !important;
  border: 1px solid var(--dash-border) !important;
  border-radius: 8px !important;
  background: var(--dash-surface) !important;
  background-image: none !important;
  color: var(--dash-text-secondary) !important;
  font-size: 12px !important;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none !important;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button:hover > a,
.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button > a:hover,
.lh-dash .dataTables_wrapper .pagination > li > a:hover,
.lh-dash .dataTables_wrapper .pagination > li > span:hover {
  background: var(--dash-surface-hover) !important;
  background-image: none !important;
  border-color: var(--dash-border-strong) !important;
  color: var(--dash-primary) !important;
  box-shadow: none !important;
}

.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button.active > a,
.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button.current > a,
.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button.active:hover > a,
.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover > a,
.lh-dash .dataTables_wrapper .pagination > .active > a,
.lh-dash .dataTables_wrapper .pagination > .active > a:hover,
.lh-dash .dataTables_wrapper .pagination > .active > span,
.lh-dash .dataTables_wrapper .pagination > .active > span:hover {
  background: linear-gradient(135deg, var(--dash-primary), var(--dash-primary-dark)) !important;
  background-image: none !important;
  border-color: transparent !important;
  color: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px var(--dash-primary-glow) !important;
}

.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button.disabled > a,
.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover > a,
.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active > a,
.lh-dash .dataTables_wrapper .pagination > .disabled > a,
.lh-dash .dataTables_wrapper .pagination > .disabled > a:hover,
.lh-dash .dataTables_wrapper .pagination > .disabled > span,
.lh-dash .dataTables_wrapper .pagination > .disabled > span:hover {
  opacity: 0.38;
  cursor: not-allowed;
  background: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  color: var(--dash-muted) !important;
  box-shadow: none !important;
}

.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button:active > a,
.lh-dash .dataTables_wrapper .dataTables_paginate .paginate_button > a:active {
  background: var(--dash-primary-soft) !important;
  background-image: none !important;
  border-color: var(--dash-primary) !important;
  color: var(--dash-primary) !important;
  box-shadow: none !important;
}

.lh-dash .dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--dash-border);
  background: var(--dash-surface-muted);
}

.lh-dash .dt-buttons .dt-button {
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 7px 14px !important;
  border: 1px solid var(--dash-border) !important;
  background: var(--dash-surface) !important;
  color: var(--dash-text-secondary) !important;
  transition: border-color 0.2s, background 0.2s, color 0.2s !important;
}

.lh-dash .dt-buttons .dt-button:hover {
  border-color: var(--dash-primary) !important;
  background: var(--dash-primary-soft) !important;
  color: var(--dash-primary) !important;
}

/* 覆盖 datatables.min.css 内嵌的 Bootstrap 分页：外层 li 透明，样式见上方 .paginate_button > a */
.lh-dash .dataTables_wrapper .pagination {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
}

.lh-dash .dataTables_wrapper .pagination > li {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  float: none !important;
}

/* 空状态 */
.lh-dash .dash-empty-card {
  background: var(--dash-surface);
  border: 1px dashed var(--dash-border-strong);
  border-radius: var(--dash-radius-lg);
  padding: 80px 32px;
  text-align: center;
  backdrop-filter: blur(12px);
}

.lh-dash .dash-empty-icon {
  font-size: 56px;
  color: var(--dash-muted);
  margin-bottom: 16px;
  opacity: 0.6;
}

.lh-dash .dash-empty-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dash-text);
  letter-spacing: -0.01em;
}

.lh-dash .dash-empty-desc {
  color: var(--dash-muted);
  margin: 0;
  font-size: 14px;
}

.lh-dash .dash-filter-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--dash-muted);
  font-size: 14px;
}

.lh-dash .dash-filter-empty[hidden] {
  display: none !important;
  padding: 0;
}

/* 页脚 */
.lh-dash .dash-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: var(--dash-content-w);
  margin-left: auto;
  margin-right: auto;
  padding: 10px 28px 8px;
  box-sizing: border-box;
  font-size: 12px;
  color: var(--dash-muted);
  letter-spacing: 0.04em;
}

.lh-dash .dash-footer.dash-his-footer {
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
}

/* webMain 页脚：设备数与 LOGO 同一行，小尺寸低对比，不抢列表视觉 */
.lh-dash .dash-footer.dash-main-footer {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 28px 12px;
}

.lh-dash .dash-main-footer-logo {
  width: 72px;
  height: auto;
  opacity: 0.5;
  vertical-align: middle;
}

.lh-dash .dash-footer-meta {
  font-size: 12px;
  color: var(--dash-muted);
  letter-spacing: 0.04em;
}

.lh-dash .dash-footer-dot {
  opacity: 0.4;
}

/* 卡片模式兼容（uiStyle != 0） */
.lh-dash .dash-panel {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius-lg);
  box-shadow: var(--dash-shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.lh-dash .dash-panel-body {
  padding: 20px;
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .lh-dash .dash-kpi {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 14px 10px;
  }

  .lh-dash .dash-kpi-meta {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .lh-dash .dash-page-body {
    padding: 16px 16px 0;
  }

  .lh-dash .dash-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* 保持与桌面相同的视口锁定，避免 768px 边界切换滚动容器导致频闪 */
  body.lh-dash-main {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    overflow-y: clip;
  }

  body.lh-dash-main > .lh-dash {
    height: 100%;
    overflow: hidden;
  }

  body.lh-dash-main .lh-dash .dash-list-section,
  body.lh-dash-main .lh-dash .dash-table-card {
    flex: 1;
    min-height: 0;
  }

  body.lh-dash-main .lh-dash .dash-table-wrap {
    max-height: none;
  }

  .lh-dash .dash-topbar-inner {
    padding: 0 16px;
  }

  .lh-dash .dash-brand-sub,
  .lh-dash .dash-profile-id {
    display: none;
  }

  .lh-dash .dash-search input {
    width: 180px;
  }

  .lh-dash .dash-toolbar {
    gap: 10px;
  }

  .lh-dash .dash-table-toolbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    padding: 12px 14px;
    overflow-x: auto;
  }

  .lh-dash .dash-table-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
  }

  .lh-dash .dash-table-toolbar .dataTables_length,
  .lh-dash .dash-table-toolbar .dataTables_filter,
  .lh-dash .dash-table-toolbar .dash-search {
    width: auto;
    flex: 0 0 auto;
  }

  .lh-dash .dash-table-toolbar .dataTables_filter,
  .lh-dash .dash-table-toolbar .dash-search {
    margin-left: auto;
  }

  .lh-dash .dash-table-toolbar .dataTables_filter input {
    width: 100%;
    min-width: 0;
  }

  .lh-dash .dash-table-footer .dataTables_info,
  .lh-dash .dash-table-footer .dataTables_paginate {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .lh-dash .dataTables_wrapper .dataTables_paginate {
    justify-content: center;
  }

  .lh-dash .dash-kpi-grid {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .lh-dash .dash-kpi-grid {
    gap: 6px;
  }

  .lh-dash .dash-kpi {
    padding: 10px 8px;
  }
}

/* ── 历史数据页（webHisData / webSensorHis）子页面视觉 ── */
body.lh-dash-his {
  --dash-his-accent: #2dd4bf;
  --dash-his-accent-soft: rgba(45, 212, 191, 0.14);
  --dash-his-topbar-bg: #0a1018;
  --dash-his-bg: #060910;
  background: var(--dash-his-bg);
}

body.lh-dash-his .lh-dash-his-shell {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(45, 212, 191, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(56, 189, 248, 0.05), transparent 50%),
    var(--dash-his-bg);
}

body.lh-dash-his .dash-his-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: auto;
  min-height: calc(var(--dash-topbar-h) + 4px);
  background: var(--dash-his-topbar-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(45, 212, 191, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

body.lh-dash-his .dash-his-topbar-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--dash-his-accent), rgba(56, 189, 248, 0.65), transparent);
}

body.lh-dash-his .dash-his-topbar-inner {
  flex-wrap: nowrap;
  align-items: center;
  gap: 20px;
  min-height: var(--dash-topbar-h);
  padding-top: 12px;
  padding-bottom: 12px;
}

body.lh-dash-his .dash-his-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
}

body.lh-dash-his .dash-his-back-main {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: var(--dash-his-accent-soft);
  color: #99f6e4;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

body.lh-dash-his .dash-his-back-main:hover {
  border-color: var(--dash-his-accent);
  background: rgba(45, 212, 191, 0.22);
  color: #ccfbf1;
}

body.lh-dash-his .dash-his-back-arrow {
  font-size: 16px;
  line-height: 1;
  opacity: 0.9;
}

body.lh-dash-his .dash-his-context {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.lh-dash-his .dash-his-context-title {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--dash-text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 520px);
}

body.lh-dash-his .dash-his-context-title:not(.dash-his-alias-trigger) {
  cursor: default;
}

body.lh-dash-his .dash-his-context-sn {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #7dd3fc;
  letter-spacing: 0.03em;
}

body.lh-dash-his .dash-his-date-nav {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: var(--dash-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--dash-border);
}

body.lh-dash-his .dash-his-date-nav-label {
  font-size: 11px;
  color: var(--dash-muted);
  padding: 0 4px;
  white-space: nowrap;
}

body.lh-dash-his .dash-his-main {
  padding-top: 20px;
}

body.lh-dash-his .dash-his-meta,
body.lh-dash-his .dash-his-chart-panel,
body.lh-dash-his .dash-his-report-section .dash-panel,
body.lh-dash-his .dash-his-msg-section .dash-table-card {
  border-color: rgba(45, 212, 191, 0.12);
}

.lh-dash .dash-his-topbar-inner {
  flex-wrap: wrap;
  gap: 12px;
  height: auto;
  min-height: var(--dash-topbar-h);
  padding-top: 10px;
  padding-bottom: 10px;
}

.lh-dash .dash-his-date-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.lh-dash .dash-his-nav-btn {
  appearance: none;
  border: 1px solid var(--dash-border);
  background: var(--dash-surface);
  color: var(--dash-text-secondary);
  border-radius: var(--dash-radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  max-width: 220px;
  text-align: center;
}

.lh-dash .dash-his-nav-btn:hover {
  background: var(--dash-surface-hover);
  border-color: var(--dash-border-strong);
  color: var(--dash-primary);
}

.lh-dash .dash-his-back-btn {
  min-width: 72px;
  justify-content: center;
}

.lh-dash .dash-his-main {
  padding-bottom: 24px;
}

.lh-dash .dash-his-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
}

.lh-dash .dash-his-meta-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  min-width: 0;
  grid-column: 1;
}

.lh-dash .dash-his-meta-center {
  min-width: 0;
  justify-self: center;
  width: 100%;
  max-width: 100%;
  grid-column: 2;
}

.lh-dash .dash-his-meta .dash-his-link-btn {
  grid-column: 3;
  margin-left: 0;
}

.lh-dash .dash-his-meta-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.lh-dash .dash-his-meta-label {
  font-size: 12px;
  color: var(--dash-muted);
  flex-shrink: 0;
}

.lh-dash .dash-his-meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--dash-text);
  word-break: break-all;
}

.lh-dash .dash-his-sn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--dash-primary);
}

.lh-dash .dash-his-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--dash-radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.lh-dash .dash-his-link-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--dash-primary);
}

.lh-dash .dash-his-curr-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lh-dash .dash-his-curr-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--dash-primary);
  background: var(--dash-primary-soft);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.lh-dash .dash-his-curr-main {
  flex: 1;
  min-width: 0;
}

.lh-dash .dash-his-curr-chips {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  gap: 6px 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.lh-dash .dash-his-curr-chips::-webkit-scrollbar {
  height: 4px;
}

.lh-dash .dash-his-curr-chips::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.lh-dash .dash-his-curr-chip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--dash-border);
  background: rgba(15, 23, 42, 0.45);
  font-size: 12px;
  white-space: nowrap;
}

.lh-dash .dash-his-curr-chip .iconfont {
  font-size: 12px;
  opacity: 0.65;
}

.lh-dash .dash-his-curr-chip-name {
  color: var(--dash-muted);
}

.lh-dash .dash-his-curr-chip-val {
  font-weight: 700;
  color: var(--dash-text);
  font-variant-numeric: tabular-nums;
}

.lh-dash .dash-his-curr-chip--meta .dash-his-curr-chip-val {
  font-weight: 600;
  font-size: 11px;
}

.lh-dash .dash-his-curr-chip--offline .dash-his-curr-chip-val {
  color: var(--dash-muted);
  font-weight: 600;
}

.lh-dash .dash-his-curr-time-btn {
  cursor: pointer;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.lh-dash .dash-his-curr-time-btn .dash-his-curr-time-text {
  display: none;
}

.lh-dash .dash-his-curr-time-btn.is-open .dash-his-curr-time-icon {
  display: none;
}

.lh-dash .dash-his-curr-time-btn.is-open .dash-his-curr-time-text {
  display: inline;
}

.lh-dash .dash-his-curr-time-btn:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.lh-dash .dash-his-curr-offline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--dash-muted);
}

.lh-dash .dash-his-curr-sub {
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  margin-top: 0;
  padding-left: 4px;
  font-size: 11px;
  color: var(--dash-muted);
  white-space: nowrap;
}

.lh-dash .dash-his-curr-section {
  margin-bottom: 24px;
}

.lh-dash .dash-his-curr-panel .dash-panel-body {
  padding: 18px 20px;
}

.lh-dash .dash-his-curr-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.lh-dash .dash-his-curr-item {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 220px;
  padding: 14px 16px;
  border-radius: var(--dash-radius-sm);
  border: 1px solid var(--dash-border);
  background: rgba(15, 23, 42, 0.45);
}

.lh-dash .dash-his-curr-item-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dash-muted);
  margin-bottom: 8px;
}

.lh-dash .dash-his-curr-item-label .iconfont {
  opacity: 0.7;
  font-size: 13px;
}

.lh-dash .dash-his-curr-item-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--dash-text);
  font-variant-numeric: tabular-nums;
}

.lh-dash .dash-his-curr-item-value--warn {
  font-size: 24px;
}

.lh-dash .dash-his-curr-unit {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dash-muted);
}

.lh-dash .dash-his-curr-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  color: var(--dash-muted);
  font-size: 14px;
}

.lh-dash .dash-his-curr-empty .iconfont {
  font-size: 20px;
  color: var(--dash-offline);
}

.lh-dash .dash-his-curr-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  padding-top: 12px;
  border-top: 1px solid var(--dash-border);
  font-size: 12px;
  color: var(--dash-muted);
}

.lh-dash .dash-his-curr-dot {
  margin: 0 8px;
  opacity: 0.5;
}

.lh-dash .dash-his-chart-panel {
  margin-bottom: 28px;
}

.lh-dash .dash-his-chart-body {
  padding: 12px 8px 8px;
}

.lh-dash .dash-his-chart {
  width: 100%;
  height: 500px;
  min-height: 320px;
}

.lh-dash .dash-his-section-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--dash-text);
  letter-spacing: 0.02em;
}

.lh-dash .dash-his-report-section {
  margin-bottom: 28px;
}

.lh-dash .dash-his-report-panel .dash-panel-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lh-dash .dash-his-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.lh-dash .dash-his-form-label {
  font-size: 13px;
  color: var(--dash-text-secondary);
}

.lh-dash .dash-his-input {
  appearance: none;
  border: 1px solid var(--dash-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--dash-text);
  border-radius: var(--dash-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  min-height: 36px;
}

.lh-dash .dash-his-input-time {
  width: 120px;
}

.lh-dash .dash-his-input:focus {
  outline: none;
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 2px var(--dash-primary-soft);
}

.lh-dash .dash-his-report-block {
  padding: 16px;
  border-radius: var(--dash-radius-sm);
  background: var(--dash-surface-muted);
  border: 1px solid var(--dash-border);
}

.lh-dash .dash-his-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-text-secondary);
  margin-bottom: 12px;
}

.lh-dash .dash-his-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.lh-dash .dash-his-check-group input[type="checkbox"] {
  accent-color: var(--dash-primary);
  width: 16px;
  height: 16px;
  margin: 0 4px 0 0;
  vertical-align: middle;
  cursor: pointer;
}

.lh-dash .dash-his-check-group label,
.lh-dash .dash-his-check-group input[type="checkbox"] + *,
.lh-dash .dash-his-check-group {
  font-size: 13px;
  color: var(--dash-text-secondary);
}

.lh-dash .dash-his-btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.lh-dash .dash-his-btn {
  appearance: none;
  border: 1px solid var(--dash-border);
  background: var(--dash-surface);
  color: var(--dash-text-secondary);
  border-radius: var(--dash-radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.lh-dash .dash-his-btn:hover {
  background: var(--dash-surface-hover);
  border-color: var(--dash-border-strong);
  color: var(--dash-text);
}

.lh-dash .dash-his-btn-primary {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.15));
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--dash-primary);
  font-weight: 600;
  padding: 10px 28px;
}

.lh-dash .dash-his-btn-primary:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(14, 165, 233, 0.25));
  border-color: var(--dash-primary);
  color: #e0f2fe;
}

.lh-dash .dash-his-submit-row {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.lh-dash .dash-his-alias-trigger {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s;
}

.lh-dash .dash-his-alias-trigger:hover,
.lh-dash .dash-his-alias-trigger:focus-visible {
  color: var(--dash-primary);
  outline: none;
}

.lh-dash .dash-his-qr-popup {
  position: fixed;
  z-index: 1200;
  display: none;
  padding: 10px 12px 8px;
  background: #0d1321;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--dash-radius-sm);
  box-shadow: var(--dash-shadow);
  text-align: center;
  pointer-events: auto;
}

.lh-dash .dash-his-qrcode {
  box-sizing: content-box;
  display: inline-block;
  padding: 6px;
  background: #fff;
  border-radius: 8px;
  line-height: 0;
  overflow: visible;
}

.lh-dash .dash-his-qrcode img,
.lh-dash .dash-his-qrcode canvas {
  display: block;
  width: 88px;
  height: 88px;
}

.lh-dash .dash-his-qr-label {
  margin-top: 8px;
  font-size: 11px;
  color: var(--dash-text-secondary);
  letter-spacing: 0.04em;
}

.lh-dash .dash-his-footer {
  flex-direction: column;
  gap: 12px;
  padding-bottom: 40px;
}

.lh-dash .dash-his-footer-logo {
  width: 120px;
  height: auto;
  opacity: 0.85;
}

.lh-dash .dash-his-debug {
  margin: 0 0 24px;
  max-width: 100%;
}

.lh-dash .dash-his-debug-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--dash-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lh-dash .dash-his-debug-pre {
  margin: 0;
  padding: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius-sm);
  color: var(--dash-text-secondary);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 320px;
  overflow: auto;
}

.lh-dash .dash-his-dataview-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  color: var(--dash-text-secondary);
  font-size: 13px;
  background: transparent;
}

.lh-dash .dash-his-dataview-table td {
  border: 1px solid var(--dash-border);
  padding: 6px 10px;
  vertical-align: middle;
}

.lh-dash .dash-his-dataview-table tr:first-child td {
  font-size: 15px;
  font-weight: 600;
  color: var(--dash-text);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.2);
}

.lh-dash .dash-his-dataview-table tr:nth-child(2) td,
.lh-dash .dash-his-dataview-table tr:nth-child(3) td {
  color: var(--dash-muted);
  font-size: 12px;
}

.lh-dash .dash-his-dataview-table tr.dash-his-dataview-head td {
  font-weight: 600;
  color: var(--dash-text);
  background: rgba(255, 255, 255, 0.04);
}

.lh-dash .dash-his-dataview-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.06);
}

@media (max-width: 768px) {
  body.lh-dash-his .dash-his-topbar-inner {
    flex-wrap: wrap;
  }

  body.lh-dash-his .dash-his-topbar-left {
    width: 100%;
  }

  body.lh-dash-his .dash-his-date-nav {
    width: 100%;
    justify-content: flex-start;
  }

  body.lh-dash-his .dash-his-context-title {
    max-width: 100%;
  }

  .lh-dash .dash-his-date-nav {
    width: 100%;
    justify-content: space-between;
  }

  .lh-dash .dash-his-nav-btn {
    max-width: none;
    flex: 1;
    font-size: 11px;
    padding: 8px 6px;
  }

  .lh-dash .dash-his-back-btn {
    flex: 0 0 auto;
  }

  .lh-dash .dash-his-meta {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .lh-dash .dash-his-meta-center {
    justify-self: stretch;
  }

  .lh-dash .dash-his-curr-inline {
    flex-wrap: wrap;
  }

  .lh-dash .dash-his-link-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .lh-dash .dash-his-chart {
    height: 360px;
  }
}

/* ── 消息历史页 ── */
.lh-dash .dash-his-msg-main {
  padding-bottom: 16px;
}

.lh-dash .dash-his-msg-range {
  margin-bottom: 16px;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--dash-text-secondary);
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
}

.lh-dash .dash-his-msg-section {
  margin-bottom: 8px;
}

.lh-dash .dash-his-msg-section .dash-table-wrap {
  max-height: calc(100vh - 220px);
  overflow-x: auto;
  overflow-y: scroll;
  scrollbar-gutter: auto;
}

.lh-dash .dash-his-msg-table {
  table-layout: auto;
  min-width: 1080px;
}

.lh-dash .dash-his-msg-table thead th {
  white-space: nowrap;
}

.lh-dash .dash-his-msg-table.dash-device-table tbody td {
  overflow: visible;
  vertical-align: middle;
  line-height: 1.5;
}

.lh-dash .dash-his-msg-table .col-idx {
  width: 48px;
}

.lh-dash .dash-his-msg-table .col-user {
  width: 140px;
  min-width: 140px;
  max-width: 180px;
  white-space: normal;
  overflow: visible;
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 10px;
}

.lh-dash .dash-his-msg-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 52px;
}

.lh-dash .dash-his-msg-user-text {
  width: 100%;
  word-break: break-all;
  font-size: 12px;
  line-height: 1.45;
  color: var(--dash-text-secondary);
}

.lh-dash .dash-his-msg-user-avatar {
  flex-shrink: 0;
  line-height: 0;
}

.lh-dash .dash-his-msg-table .dash-his-msg-avatar {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.lh-dash .dash-his-msg-table .col-msg {
  text-align: left;
  word-break: break-word;
  min-width: 220px;
  overflow: hidden;
}

.lh-dash .dash-his-msg-table .col-time {
  white-space: nowrap;
  min-width: 140px;
}

.lh-dash .dash-his-msg-table .col-aid {
  white-space: nowrap;
  font-size: 12px;
  color: var(--dash-muted);
}

.lh-dash .dash-his-msg-table td img.dash-his-msg-logo {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  vertical-align: middle;
  object-fit: contain;
}

.lh-dash .dash-his-msg-table .iconfont {
  color: var(--dash-primary);
  opacity: 0.85;
}

/* ── 批量管理主页 (manager/webMain) ── */
.lh-dash .dash-mgr-query {
  margin-bottom: 16px;
}

.lh-dash .dash-mgr-query-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
  padding: 14px 18px;
  border-radius: var(--dash-radius-lg);
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  box-shadow: var(--dash-shadow-sm);
}

.lh-dash .dash-mgr-query-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  flex: 1;
  min-width: 240px;
}

.lh-dash .dash-mgr-query-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--dash-muted);
  min-width: 160px;
}

.lh-dash .dash-mgr-select,
.lh-dash .dash-mgr-input {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--dash-border-strong);
  background: rgba(15, 23, 42, 0.6);
  color: var(--dash-text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lh-dash .dash-mgr-select:focus,
.lh-dash .dash-mgr-input:focus {
  border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px var(--dash-primary-soft);
}

.lh-dash .dash-mgr-query-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lh-dash .dash-mgr-btn-primary {
  background: linear-gradient(135deg, var(--dash-primary), var(--dash-primary-dark));
  border-color: transparent;
  color: #fff;
}

.lh-dash .dash-mgr-query-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-left: auto;
}

.lh-dash .dash-mgr-query-pager-info {
  font-size: 12px;
  color: var(--dash-muted);
  white-space: nowrap;
}

/* ── manager/webMain：整页上下滚动，表格随内容展开 ── */
html:has(body.lh-dash-mgr-main) {
  height: 100%;
  overflow-x: clip;
}

body.lh-dash-mgr-main {
  min-height: 100%;
  overflow-x: clip;
  overflow-y: auto;
}

body.lh-dash-mgr-main > .lh-dash {
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

body.lh-dash-mgr-main .lh-dash .dash-page-body {
  flex: 1;
  max-width: var(--dash-content-w);
  margin-left: auto;
  margin-right: auto;
  overflow: visible;
}

body.lh-dash-mgr-main .lh-dash .dash-main {
  overflow: visible;
  padding-bottom: 16px;
}

body.lh-dash-mgr-main .lh-dash .dash-list-section,
body.lh-dash-mgr-main .lh-dash .dash-mgr-list {
  overflow: visible;
}

body.lh-dash-mgr-main .lh-dash .dash-table-card {
  overflow: visible;
}

body.lh-dash-mgr-main .lh-dash .dash-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

body.lh-dash-mgr-main .lh-dash .dash-mgr-list .dash-table-wrap {
  max-height: none;
}

/* manager/webMain 阻断式居中 Loading 弹层 */
body.lh-dash-mgr-main.is-page-loading {
  overflow: hidden;
  touch-action: none;
}

body.lh-dash-mgr-main.is-page-loading .lh-dash {
  pointer-events: none;
  user-select: none;
}

#dashPageLoading.dash-page-loading {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.38s ease, visibility 0.38s ease;
}

#dashPageLoading.dash-page-loading.is-open,
#dashPageLoading.dash-page-loading.is-closing {
  pointer-events: auto;
}

#dashPageLoading.dash-page-loading.is-open {
  opacity: 1;
  visibility: visible;
}

#dashPageLoading.dash-page-loading.is-closing {
  opacity: 0;
  visibility: hidden;
}

#dashPageLoading.dash-page-loading[hidden] {
  display: none !important;
}

#dashPageLoading .dash-page-loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.38s ease;
}

#dashPageLoading.is-open .dash-page-loading-backdrop {
  opacity: 1;
}

#dashPageLoading.is-closing .dash-page-loading-backdrop {
  opacity: 0;
}

#dashPageLoading .dash-page-loading-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 240px;
  max-width: 90vw;
  padding: 32px 40px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: linear-gradient(165deg, rgba(22, 32, 50, 0.98) 0%, rgba(12, 18, 32, 0.98) 100%);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 40px rgba(56, 189, 248, 0.12);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition:
    opacity 0.42s ease,
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

#dashPageLoading.is-open .dash-page-loading-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#dashPageLoading.is-closing .dash-page-loading-dialog {
  opacity: 0;
  transform: translateY(6px) scale(0.99);
}

#dashPageLoading .dash-page-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(148, 163, 184, 0.25);
  border-top-color: var(--dash-primary);
  border-radius: 50%;
  animation: dash-page-loading-spin 0.75s linear infinite;
}

#dashPageLoading .dash-page-loading-text {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--dash-text);
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.35s ease 0.08s;
}

#dashPageLoading.is-open .dash-page-loading-text {
  opacity: 1;
}

#dashPageLoading.is-closing .dash-page-loading-text {
  opacity: 0;
  transition-delay: 0s;
}

@keyframes dash-page-loading-spin {
  to { transform: rotate(360deg); }
}

body.lh-dash-mgr-main .lh-dash .dash-device-table {
  min-width: 1200px;
}

body.lh-dash-mgr-main .lh-dash .dash-device-table .col-ver {
  width: 56px;
  white-space: nowrap;
  font-size: 12px;
}

body.lh-dash-mgr-main .lh-dash .dash-device-table .col-gw {
  width: 96px;
  max-width: 96px;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--dash-muted);
}

body.lh-dash-mgr-main .lh-dash .dash-device-table .col-rc,
body.lh-dash-mgr-main .lh-dash .dash-device-table .col-dcount {
  width: 36px;
  font-variant-numeric: tabular-nums;
}

body.lh-dash-mgr-main .lh-dash .dash-device-table .col-ver,
body.lh-dash-mgr-main .lh-dash .dash-device-table .col-gw,
body.lh-dash-mgr-main .lh-dash .dash-device-table .col-rc,
body.lh-dash-mgr-main .lh-dash .dash-device-table .col-dcount,
body.lh-dash-mgr-main .lh-dash .dash-device-table thead th.col-ver,
body.lh-dash-mgr-main .lh-dash .dash-device-table thead th.col-gw,
body.lh-dash-mgr-main .lh-dash .dash-device-table thead th.col-rc,
body.lh-dash-mgr-main .lh-dash .dash-device-table thead th.col-dcount,
body.lh-dash-mgr-main .lh-dash .dash-device-table tbody td.col-ver,
body.lh-dash-mgr-main .lh-dash .dash-device-table tbody td.col-gw,
body.lh-dash-mgr-main .lh-dash .dash-device-table tbody td.col-rc,
body.lh-dash-mgr-main .lh-dash .dash-device-table tbody td.col-dcount {
  padding-left: 4px;
  padding-right: 4px;
}

body.lh-dash-mgr-main .lh-dash .dash-device-table .sn-operator,
body.lh-dash-mgr-main .lh-dash .dash-device-table .GV-CHECK {
  cursor: pointer;
}

body.lh-dash-mgr-main .lh-dash .dash-device-table tbody tr.tr-dblclick {
  background: rgba(148, 163, 184, 0.18) !important;
  outline: 1px solid var(--dash-border-strong);
}

body.lh-dash-mgr-main .lh-dash .dash-table-wrap .dataTables_wrapper {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.lh-dash-mgr-main .lh-dash .dash-table-wrap .dataTables_wrapper .dash-table-toolbar,
body.lh-dash-mgr-main .lh-dash .dash-table-wrap .dataTables_wrapper .dash-table-footer {
  flex-shrink: 0;
}

body.lh-dash-mgr-main .lh-dash .dash-device-table tbody td.col-status {
  overflow: visible;
  white-space: nowrap;
  text-align: center;
}

body.lh-dash-mgr-main .lh-dash .dash-device-table tbody td.col-power {
  white-space: nowrap;
  text-align: center;
}

body.lh-dash-mgr-main .lh-dash .dash-device-table tbody td.col-time {
  font-size: 12px;
  line-height: 1.45;
  max-width: 200px;
  white-space: normal;
  text-align: left;
  position: relative;
}

body.lh-dash-mgr-main .lh-dash .dash-device-table .lh-jquery-setting,
body.lh-dash-mgr-main .lh-dash .dash-device-table .lh-jquery-history {
  position: relative;
}

body.lh-dash-mgr-main .lh-dash .text-setting {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 180px;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: var(--dash-radius-sm);
  border: 1px solid var(--dash-border-strong);
  background: var(--dash-bg-elevated);
  color: var(--dash-text-secondary);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.lh-dash-mgr-main .lh-dash .lh-jquery-setting:hover .text-setting {
  display: block;
}

body.lh-dash-mgr-main .lh-dash .tooltiptext {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: var(--dash-radius-sm);
  border: 1px solid var(--dash-border-strong);
  background: var(--dash-bg-elevated);
  color: var(--dash-text-secondary);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

body.lh-dash-mgr-main .lh-dash .lh-jquery-history:hover .tooltiptext {
  display: block;
}

/* ── GV_CHECK 视频监控页 ── */
.lh-dash .dash-gv-meta {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 16px;
}

.lh-dash .dash-gv-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
}

.lh-dash .dash-gv-meta-item {
  font-size: 13px;
  color: var(--dash-text-secondary);
}

.lh-dash .dash-gv-meta-item strong {
  color: var(--dash-text);
  font-weight: 600;
}

.lh-dash .dash-gv-camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.lh-dash .dash-gv-camera-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
}

.lh-dash .dash-gv-camera-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.lh-dash .dash-gv-camera-id {
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-text);
}

.lh-dash .dash-gv-camera-name {
  font-size: 12px;
  color: var(--dash-text-muted);
}

.lh-dash .dash-gv-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.lh-dash .dash-gv-status--online {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
}

.lh-dash .dash-gv-status--offline {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
}

.lh-dash .dash-gv-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--dash-radius-sm);
  background: #000;
  border: 1px solid var(--dash-border-strong);
}

.lh-dash .dash-gv-video-wrap .video-js {
  width: 100% !important;
  height: 100% !important;
}

.lh-dash .dash-gv-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--dash-text-muted);
  word-break: break-all;
}

.lh-dash .dash-gv-links a {
  color: var(--dash-primary);
  text-decoration: none;
}

.lh-dash .dash-gv-links a:hover {
  text-decoration: underline;
}

.lh-dash .dash-gv-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--dash-text-muted);
  background: var(--dash-surface);
  border: 1px dashed var(--dash-border);
  border-radius: var(--dash-radius);
}

.lh-dash .dash-gv-debug-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
  padding: 16px;
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
}

.lh-dash .dash-gv-debug-col {
  min-width: 0;
}

.lh-dash .dash-gv-debug-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dash-text);
}

.lh-dash .dash-gv-kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--dash-border);
  font-size: 12px;
  line-height: 1.5;
}

.lh-dash .dash-gv-kv-row:last-child {
  border-bottom: none;
}

.lh-dash .dash-gv-kv-label {
  flex-shrink: 0;
  color: var(--dash-text-muted);
}

.lh-dash .dash-gv-kv-value {
  text-align: right;
  color: var(--dash-text-secondary);
  word-break: break-all;
}

@media (max-width: 640px) {
  .lh-dash .dash-gv-camera-grid {
    grid-template-columns: 1fr;
  }

  .lh-dash .dash-lhsn-qrcode img,
  .lh-dash .dash-lhsn-qrcode canvas {
    width: min(258px, 72vw);
    height: min(258px, 72vw);
  }
}
