/* 会议聊天室 · 中后台样式（无框架 / 无 CDN / 无外部字体）
   视觉口径：腾讯会议管理后台式浅色中后台。
   主色 #006EFF / 页面底 #F5F7FA / 正文 #1F2329 / 次级 #646A73 / 边框 #E5E7EB
   间距 8px 基准，圆角 8–12px，轻阴影；侧栏 220px 固定；移动端收抽屉。 */

:root {
  --primary: #006EFF;
  --primary-hover: #0057D9;
  --primary-soft: #EAF3FF;
  --primary-soft-2: #F3F8FF;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-soft: #FAFBFC;
  --surface-hover: #F5F9FF;
  --line: #E5E7EB;
  --line-soft: #EFF1F4;
  --line-strong: #D7DBE2;
  --fg: #1F2329;
  --fg-2: #646A73;
  --fg-3: #8F959E;
  --ok: #00A870;
  --ok-soft: #E8F8F2;
  --ok-line: #B7EBD8;
  --warn: #E37318;
  --warn-soft: #FFF7E8;
  --warn-line: #FBE0B5;
  --danger: #E5484D;
  --danger-soft: #FFF2F1;
  --danger-line: #FBD4D1;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(31, 35, 41, .04);
  --shadow-md: 0 8px 24px rgba(31, 35, 41, .08);
  --shadow-lg: 0 20px 56px rgba(31, 35, 41, .16);
  --sidebar-w: 220px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.57;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { min-width: 320px; overflow-x: clip; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p { margin-top: 0; }
::selection { background: rgba(0, 110, 255, .16); }
.hint { color: var(--fg-3); font-size: 12.5px; line-height: 1.6; }

/* ── 整体骨架 ─────────────────────────────────────────── */
#shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.content {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── 侧栏品牌区 ───────────────────────────────────────── */
.brand {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
}
.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, #2F8BFF 0%, #006EFF 62%, #0057D9 100%);
  box-shadow: 0 2px 6px rgba(0, 110, 255, .24);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--fg);
  white-space: nowrap;
}
.brand-text small { font-size: 11px; color: var(--fg-3); letter-spacing: .4px; }

/* ── 侧栏导航：8 块 ───────────────────────────────────── */
.tabs {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tabs button {
  position: relative;
  appearance: none;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease;
}
.tabs button:hover { background: #F2F4F7; color: var(--fg); }
.tabs button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(0, 110, 255, .32); }
.tabs button[aria-selected="true"] {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.tabs button[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.tabs button .nav-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}
.tabs button .nav-ico svg { width: 18px; height: 18px; display: block; }
.tabs button .nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tabs button .dot {
  flex: 0 0 auto;
  display: inline-block;
  min-width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, .12);
}
.tabs button .dot[data-empty="1"] { display: none; }

.sidebar-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--fg-3);
  font-size: 11.5px;
  white-space: nowrap;
}
.sidebar-foot .mono { font-size: 11px; color: var(--fg-2); }
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 110, 255, .12);
}
.nav-mask { display: none; }

/* ── 顶栏 ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  /* 宽屏时与主内容（max-width 1440）左对齐，不让标题和右操作飞到两头 */
  padding-left: max(24px, calc((100% - 1440px) / 2 + 24px));
  padding-right: max(24px, calc((100% - 1440px) / 2 + 24px));
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.page-head {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-head h1 {
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-build {
  flex: 0 0 auto;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--fg-3);
  font-size: 10.5px;
  line-height: 18px;
}
.top-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.conn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #F2F4F7;
  color: var(--fg-2);
  font-size: 12px;
  white-space: nowrap;
}
.conn::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--fg-3);
}
.conn[data-state="ok"] { background: var(--ok-soft); color: #00875A; }
.conn[data-state="ok"]::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(0, 168, 112, .13); }
.conn[data-state="warn"] { background: var(--warn-soft); color: #A85A0C; }
.conn[data-state="warn"]::before { background: var(--warn); box-shadow: 0 0 0 3px rgba(227, 115, 24, .13); }
.conn[data-state="bad"] { background: var(--danger-soft); color: #B42B30; }
.conn[data-state="bad"]::before { background: var(--danger); box-shadow: 0 0 0 3px rgba(229, 72, 77, .13); }
.conn[data-state="wait"]::before { animation: pulse 1.2s ease-in-out infinite; }

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 4px;
  border-radius: 999px;
  background: #F7F8FA;
  min-width: 0;
}
.admin-chip .avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}
.admin-chip .avatar svg { width: 17px; height: 17px; }
#who-name {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-2);
  font-size: 12.5px;
}
.menu-btn { display: none !important; }
.icon-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: #F2F4F7; color: var(--fg); }
.icon-btn-text { padding: 0 12px; }
.icon-btn-text svg { width: 16px; height: 16px; }

/* ── 主内容区 ─────────────────────────────────────────── */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  min-width: 0;
}
.pane { display: none; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.pane.on { display: grid; }

/* ── 卡片面板 ─────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 0;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h2,
.panel > h2 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fg);
  letter-spacing: 0;
  text-transform: none;
}
.panel-head h2 { margin: 0; }
.panel-desc { color: var(--fg-3); font-size: 12px; white-space: nowrap; }
.panel .hint { color: var(--fg-3); font-size: 12px; margin: 10px 0 0; line-height: 1.6; }
.panel .hint:first-child { margin-top: 0; }
.panel > h2 + .hint { margin-top: -8px; margin-bottom: 14px; }

/* 总览数字格 */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
/* 统计页是整行四张卡：宽屏铺满一行，窄屏两列/单列 */
#st-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#st-peak { margin-top: 16px !important; }
@media (max-width: 1199px) {
  #st-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.card {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: linear-gradient(180deg, #FBFCFE 0%, #F7F9FC 100%);
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 110, 255, .035);
  pointer-events: none;
}
.card .k {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-2);
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .v {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.22;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .u { margin-left: 4px; color: var(--fg-3); font-size: 12px; font-weight: 400; }
.card.bad .v { color: var(--danger); }
.card.warn .v { color: var(--warn); }
.card.nodata .v { color: var(--fg-3); font-size: 16px; font-weight: 500; }

/* ── 表格 ─────────────────────────────────────────────── */
.tbl-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.tbl-wrap::-webkit-scrollbar { height: 8px; }
.tbl-wrap::-webkit-scrollbar-thumb { background: #D9DDE3; border-radius: 8px; }
.tbl-wrap::-webkit-scrollbar-track { background: transparent; }
table {
  width: 100%;
  min-width: 600px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  color: var(--fg);
}
thead th {
  padding: 11px 14px;
  background: #F7F8FA;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
thead th:first-child { border-top-left-radius: 9px; }
thead th:last-child { border-top-right-radius: 9px; }
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .14s ease, box-shadow .14s ease; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:focus-within { background: var(--primary-soft-2); }
tbody tr.is-selected { background: var(--primary-soft); }
tbody tr.is-selected td { background: transparent; }
tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
td .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
td .mono, th .mono { color: var(--fg-2); }
td.empty-cell {
  padding: 46px 16px;
  text-align: center;
  color: var(--fg-3);
  border-bottom: 0;
  background: linear-gradient(180deg, #FCFDFE, #F9FAFC);
}
.empty-state { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-ico { color: #C4C9D1; display: inline-flex; }
.empty-ico svg { width: 44px; height: 44px; display: block; }
.empty-text { font-size: 13px; color: var(--fg-3); }

/* 面板内"没有记录"的空态：只在它确实是唯一内容时居中，加载中不套这个壳 */
#rm-table > .hint:only-child:not(.is-loading),
#us-list > .hint:only-child:not(.is-loading),
#al-list > .hint:only-child:not(.is-loading),
#al-list > .tag.off:only-child {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  margin: 0;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--fg-3);
  font-size: 13px;
  text-align: center;
}
#al-list > .tag.off:only-child { width: 100%; height: auto; }
#rm-table > .hint:only-child:not(.is-loading)::before,
#us-list > .hint:only-child:not(.is-loading)::before,
#al-list > .hint:only-child:not(.is-loading)::before,
#al-list > .tag.off:only-child::before {
  content: "";
  width: 44px;
  height: 34px;
  border: 2px solid #D6DAE1;
  border-radius: 7px;
  background:
    linear-gradient(#E7EAEF, #E7EAEF) 50% 12px / 18px 2px no-repeat,
    linear-gradient(#E7EAEF, #E7EAEF) 50% 19px / 26px 2px no-repeat;
}

/* ── 标签 / 数字 ──────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #F7F8FA;
  color: var(--fg-2);
  font-size: 12px;
  font-family: var(--font);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  max-width: 100%;
}
.tag.on { background: var(--ok-soft); border-color: var(--ok-line); color: #00875A; }
.tag.off { background: #F5F6F8; border-color: var(--line); color: var(--fg-3); }
.tag.warn { background: var(--warn-soft); border-color: var(--warn-line); color: #A85A0C; }
.tag.danger { background: var(--danger-soft); border-color: var(--danger-line); color: #B42B30; }

/* ── 明细折叠 ─────────────────────────────────────────── */
details.detail {
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}
details.detail > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--fg-2);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
details.detail > summary::-webkit-details-marker { display: none; }
details.detail > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  opacity: .55;
  transition: transform .15s ease;
}
details.detail[open] > summary { color: var(--fg); }
details.detail[open] > summary::before { transform: rotate(90deg); }
details.detail .body { padding: 0 10px 10px; }
details.detail .body .tbl-wrap { border-color: var(--line); }

/* ── 按钮 / 表单控件 ──────────────────────────────────── */
.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.btn:hover:not(:disabled) { background: #F7F9FC; border-color: #C9D0DA; }
.btn:active:not(:disabled) { background: #EEF2F7; }
.btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 110, 255, .14);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
}
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.primary:active:not(:disabled) { background: #004DC2; }
.btn.danger {
  background: var(--surface);
  border-color: var(--danger-line);
  color: #C0272D;
}
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: #F5B9B4; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover:not(:disabled) { background: #F2F4F7; border-color: transparent; color: var(--fg); }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

input, select, textarea {
  font: inherit;
  font-size: 13.5px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  height: 36px;
  padding: 0 11px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { height: auto; padding: 9px 11px; }
input::placeholder { color: #AEB4BD; }
input:hover, select:hover, textarea:hover { border-color: #C3C9D2; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 110, 255, .12);
}
input[type="checkbox"], input[type="radio"] {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
select { padding-right: 30px; cursor: pointer; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.filters .btn { flex: 0 0 auto; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { color: var(--fg-2); font-size: 12px; line-height: 1.4; }
.field input, .field select { min-width: 120px; }
.field input[type="checkbox"] { min-width: 0; }
.field:has(> input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.field:has(> input[type="checkbox"]) label {
  order: 2;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--fg-2);
  cursor: pointer;
}
.field:has(> input[type="checkbox"]) input[type="checkbox"] {
  order: 1;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.field.grow { flex: 1 1 220px; }
.grow { flex: 1 1 220px; }
.filters > .hint { align-self: center; margin: 0; }
/* 审计的筛选字段较多：固定三列（窄屏两列、手机一列），避免最后两个控件被甩到第二行两端 */
#pane-audit .filters:has(.field) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}
#pane-audit .filters:has(.field) .field { min-width: 0; }
@media (max-width: 1100px) {
  #pane-audit .filters:has(.field) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.err, .missing {
  display: block;
  margin: 8px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--danger-line);
  border-radius: 8px;
  background: var(--danger-soft);
  color: #A21B11;
  font-size: 12.5px;
  line-height: 1.6;
}
.missing { border-color: var(--warn-line); background: var(--warn-soft); color: #8A4B00; }
.err:empty { display: none; }
.panel > .err:first-child, .panel > .missing:first-child { margin-top: 0; }

/* ── 开关中心 ─────────────────────────────────────────── */
.switch-grid { display: grid; gap: 12px; }
.sw {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto;
  gap: 10px 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.sw:hover { border-color: #D3D8E0; box-shadow: 0 2px 10px rgba(31, 35, 41, .05); }
.sw .key {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg);
  word-break: break-all;
}
.sw .type { margin-top: 2px; color: var(--fg-3); font-size: 11.5px; }
.sw .vals { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.sw > .seg, .sw > .num-in { justify-self: end; }
.sw .impact {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px dashed var(--line-soft);
  color: var(--fg-2);
  font-size: 12.5px;
  line-height: 1.6;
}
.sw .meta { grid-column: 1 / -1; color: var(--fg-3); font-size: 11.5px; line-height: 1.5; }
.sw.pending { border-color: var(--warn-line); background: #FFFCF5; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: #F2F4F7;
}
.seg label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 13px;
  border-radius: 8px;
  color: var(--fg-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
  user-select: none;
}
.seg label:hover { color: var(--fg); }
.seg label.sel {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(31, 35, 41, .12);
}
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label:focus-within { box-shadow: 0 0 0 3px rgba(0, 110, 255, .16); }

.num-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.num-in input { width: 112px; font-family: var(--mono); font-size: 12.5px; }
.num-in .range { color: var(--fg-3); font-size: 11.5px; }
.num-in .err { flex-basis: 100%; margin: 0; }

/* ── 弹窗 ─────────────────────────────────────────────── */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-root[hidden] { display: none; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  animation: fade-in .16s ease-out;
}
.modal {
  position: relative;
  width: min(640px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in .18s cubic-bezier(.2, .8, .3, 1);
}
.modal .m-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}
.modal .m-head strong {
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.modal .m-body { flex: 1 1 auto; overflow: auto; padding: 20px; }
.modal .m-body > :last-child { margin-bottom: 0; }
.modal .m-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-soft);
}
/* 危险动作的最终确认：实心红，和表格里的浅红"强关房"区分开 */
.modal .m-foot .btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  font-weight: 500;
}
.modal .m-foot .btn.danger:hover:not(:disabled) { background: #C93A3F; border-color: #C93A3F; }
.modal .m-foot .btn.danger:active:not(:disabled) { background: #B73035; }
.m-x {
  width: 32px;
  height: 32px;
  margin-left: auto;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}
.m-x:hover { background: #F2F4F7; color: var(--fg); }
.m-x svg { width: 18px; height: 18px; }

.impact-box {
  margin: 8px 0;
  padding: 12px 14px;
  border: 1px solid var(--warn-line);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  background: var(--warn-soft);
  color: #7A4500;
  font-size: 13px;
  line-height: 1.65;
}
.impact-box.danger {
  border-color: var(--danger-line);
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: #9B2025;
}
.impact-k { font-size: 11.5px; font-weight: 600; opacity: .72; margin-bottom: 2px; }
.kv {
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
  gap: 9px 16px;
  font-size: 13px;
  line-height: 1.55;
}
.kv .kk { color: var(--fg-2); }
.kv .mono { color: var(--fg); word-break: break-all; }
pre.dump {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #F7F8FA;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  overflow: auto;
  max-height: 320px;
}

/* ── 登录页 ───────────────────────────────────────────── */
.login {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 20px;
  background:
    radial-gradient(1200px 560px at 50% -12%, #E7F1FF 0%, rgba(245, 247, 250, 0) 62%),
    var(--bg);
}
.login-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 420px at 10% 18%, rgba(0, 110, 255, .06), transparent 66%),
    radial-gradient(520px 520px at 92% 86%, rgba(0, 110, 255, .05), transparent 70%);
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 52px rgba(31, 35, 41, .10);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.brand-mark-lg { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; }
.brand-mark-lg svg { width: 23px; height: 23px; }
.login-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.login-brand-text strong { font-size: 15px; font-weight: 600; color: var(--fg); }
.login-brand-text small { font-size: 11.5px; color: var(--fg-3); letter-spacing: .4px; }
.login h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; color: var(--fg); }
.login .sub { margin: 0 0 20px; color: var(--fg-3); font-size: 12.5px; line-height: 1.6; }
.login .field { margin-bottom: 14px; gap: 7px; }
.login .field label { font-size: 12.5px; color: var(--fg-2); }
.login .field input { width: 100%; height: 44px; font-size: 14px; }
.login .btn.block { height: 44px; margin-top: 6px; font-size: 14.5px; }
.login-hint {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.65;
}
.login-copy { position: relative; z-index: 1; margin: 0; color: var(--fg-3); font-size: 11.5px; letter-spacing: .3px; }
.login #login-msg:empty { display: none; }

/* ── 提示条 / toast / 启动态 ─────────────────────────── */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  animation: fade-in .16s ease-out;
}
.banner::before {
  content: "i";
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
}
.banner > span { flex: 1 1 auto; min-width: 0; }
.banner.info { background: #F0F7FF; border-color: #CFE4FF; color: #0B57C2; }
.banner.info::before { content: "i"; background: var(--primary); }
.banner.warn { background: var(--warn-soft); border-color: var(--warn-line); color: #8A4B00; }
.banner.warn::before { content: "!"; background: var(--warn); }
.banner.bad { background: var(--danger-soft); border-color: var(--danger-line); color: #A21B11; }
.banner.bad::before { content: "!"; background: var(--danger); }

.toasts {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 90;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 10px 30px rgba(31, 35, 41, .12);
  pointer-events: auto;
  animation: toast-in .18s ease-out;
}
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--danger); color: #8F2227; }

.boot {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--fg-3);
  font-size: 13px;
}
.boot::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 110, 255, .18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.boot.err { color: #C0272D; }
.boot.err::before { display: none; }

/* 加载中的 hint：统一小转圈（由 admin.js 只加 class，不改文案） */
.hint.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-2);
}
.hint.is-loading::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 2px solid rgba(0, 110, 255, .18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── 趋势图 ───────────────────────────────────────────── */
.chart-box {
  padding: 10px 10px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #FCFDFE;
}
.chart-box canvas {
  display: block;
  width: 100%;
  height: 240px;
  /* 画布内部的分隔线是浅白色：轻度压暗后仍能在浅底上看出三条带的分界 */
  filter: brightness(.94) saturate(1.06);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  padding: 0 4px;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.5;
}
.legend span { display: inline-flex; align-items: center; }
.legend i {
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-right: 6px;
  border-radius: 2px;
}

/* ── 分页 ─────────────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--fg-3);
  font-size: 12.5px;
}
.pager-info { min-width: 0; }
.pager-actions { display: inline-flex; align-items: center; gap: 8px; }
.pager-cur { color: var(--fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.foot {
  flex: 0 0 auto;
  padding: 20px 24px 26px;
  color: var(--fg-3);
  font-size: 11.5px;
  text-align: center;
}

/* ── 动效 ─────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ── ≥1200：总览双栏 ─────────────────────────────────── */
@media (min-width: 1200px) {
  #pane-overview.on {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    align-items: start;
  }
  #pane-overview .panel { min-height: 100%; }
}

/* ── 768–1199：收窄 ──────────────────────────────────── */
@media (max-width: 1199px) {
  main { padding: 20px; }
  .topbar { padding: 0 20px; }
  .panel { padding: 18px; }
  .top-build { display: none; }
  #who-name { max-width: 150px; }
  .sw { grid-template-columns: minmax(180px, 1fr) auto auto; }
}

@media (max-width: 1024px) {
  .icon-btn-text { width: 38px; padding: 0; }
  .icon-btn-text .btn-label { display: none; }
}

@media (max-width: 900px) {
  .admin-chip { padding: 0; background: transparent; }
  #who-name { display: none; }
  .sw { grid-template-columns: minmax(0, 1fr); }
  .sw .vals, .sw .impact, .sw .meta { grid-column: 1 / -1; }
  .sw .vals { justify-content: flex-start; }
  .sw > .seg, .sw > .num-in { justify-self: start; }
  /* bool/enum 行在窄屏上把"当前值"和开/关放在同一行；int 行仍上下排（输入框太宽） */
  .sw:has(> .seg) { grid-template-columns: minmax(0, 1fr) auto; }
  .sw:has(> .seg) > div:first-child { grid-column: 1 / -1; }
  .sw:has(> .seg) .vals { grid-column: 1; }
  .sw:has(> .seg) > .seg { grid-column: 2; grid-row: 2; justify-self: end; }
  .sw:has(> .seg) .impact, .sw:has(> .seg) .meta { grid-column: 1 / -1; }
}

/* ── ＜768：侧栏抽屉 + 单列 + 表格横向滚动 ──────────── */
@media (max-width: 767px) {
  .sidebar {
    width: min(272px, 86vw);
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.2, .8, .3, 1);
    box-shadow: 0 0 0 rgba(15, 23, 42, 0);
    border-right: 0;
  }
  #shell.nav-open .sidebar {
    transform: none;
    box-shadow: 24px 0 60px rgba(15, 23, 42, .18);
  }
  .nav-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, .38);
    animation: fade-in .16s ease-out;
  }
  body.nav-open { overflow: hidden; }
  .content { margin-left: 0; }
  .topbar {
    min-height: 56px;
    gap: 8px;
    padding: 0 12px;
  }
  .menu-btn { display: inline-flex !important; }
  .page-head { gap: 6px; }
  .page-head h1 { font-size: 16px; }
  .top-actions { gap: 6px; }
  .admin-chip { padding: 0; background: transparent; }
  #who-name { display: none; }
  .icon-btn-text { width: 38px; padding: 0; }
  .icon-btn-text .btn-label { display: none; }
  .conn { height: 26px; padding: 0 8px; font-size: 11.5px; }
  main { padding: 12px; }
  .panel { padding: 16px; border-radius: 10px; }
  .panel-head { margin-bottom: 14px; }
  .panel-head h2, .panel > h2 { font-size: 15px; }
  .panel-desc { font-size: 11.5px; }
  .cards { gap: 10px; }
  .card { padding: 14px; }
  .card .v { font-size: 23px; }
  .filters { gap: 10px; margin-bottom: 12px; align-items: stretch; }
  .field, .field.grow, .grow { flex: 1 1 100%; }
  .field input, .field select { width: 100%; min-width: 0; }
  .field:has(> input[type="checkbox"]) { min-height: 44px; }
  .field:has(> input[type="checkbox"]) label { min-height: 40px; }
  .filters > .btn, .filters > .field { flex: 1 1 100%; }
  .filters > .btn { justify-content: center; }
  .filters > .hint { text-align: left; }
  #pane-audit .filters:has(.field) { grid-template-columns: minmax(0, 1fr); }
  .btn { min-height: 40px; }
  .btn.small { min-height: 40px; height: 40px; }
  .icon-btn { height: 40px; width: 40px; flex-basis: 40px; }
  .icon-btn-text { width: 40px; }
  input, select, textarea { height: 40px; }
  .login .field input { height: 44px; }
  .sw { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .sw .vals { grid-column: 1 / -1; }
  .sw .impact, .sw .meta { grid-column: 1 / -1; }
  .seg label { min-height: 40px; }
  details.detail > summary { min-height: 40px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 3px 0; }
  .kv .kk { margin-top: 8px; color: var(--fg-3); font-size: 11.5px; }
  .modal-root { padding: 12px; }
  .modal { max-height: 90vh; border-radius: 12px; }
  .modal .m-head { padding: 15px 16px; }
  .modal .m-body { padding: 16px; }
  .modal .m-foot { padding: 12px 16px; }
  .m-x { width: 40px; height: 40px; flex-basis: 40px; }
  .toasts { top: 68px; right: 16px; }
  .login { padding: 24px 16px; }
  .login-card { padding: 26px 22px; border-radius: 14px; }
  .login h2 { font-size: 20px; }
  .chart-box canvas { height: 200px; }
  .pager { align-items: flex-start; }
  .pager-actions { width: 100%; justify-content: space-between; }
  .pager-actions .btn { flex: 1 1 auto; }
  .foot { padding: 16px 16px 22px; }
}

@media (max-width: 560px) {
  .conn { width: 28px; padding: 0; font-size: 0; gap: 0; }
  .conn::before { width: 7px; height: 7px; flex-basis: 7px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  #st-cards { grid-template-columns: minmax(0, 1fr); }
  .card .v { font-size: 24px; }
  .top-actions { gap: 4px; }
  #login-submit { width: 100%; }
  table { min-width: 680px; }
}

/* 触控优先：加大命中区 */
@media (pointer: coarse) {
  .tabs button { min-height: 46px; }
  .btn, .btn.small { min-height: 40px; }
  .seg label { min-height: 40px; }
  input, select { height: 40px; }
  details.detail > summary { min-height: 40px; }
  .field:has(> input[type="checkbox"]) label { min-height: 40px; }
  .m-x { width: 40px; height: 40px; flex-basis: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── 会员 / 设备画像（仅总管理员后台显示）────────────── */
/* 用户列表列多：宽表在壳里横向滚动，不挤压其它面板；列内不拆 IP/手机号/时间 */
.tbl-wrap.tbl-wide table { min-width: 1540px; }
.tbl-wrap.tbl-wide tbody td { white-space: nowrap; overflow-wrap: normal; }
.tbl-wrap.tbl-wide .cell-stack { white-space: nowrap; }
.tbl-wrap.tbl-wide thead th:last-child { position: sticky; right: 0; z-index: 3; background: #F7F8FA; box-shadow: -8px 0 10px -10px rgba(15,23,42,.35); }
.tbl-wrap.tbl-wide tbody td:last-child { position: sticky; right: 0; z-index: 2; background: var(--surface); box-shadow: -8px 0 10px -10px rgba(15,23,42,.28); }
.tbl-wrap.tbl-wide tbody tr:hover td:last-child { background: var(--surface-hover); }
.tbl-wrap.tbl-devices table { min-width: 1240px; }
.tbl-wrap.tbl-location table { min-width: 1420px; }
.tbl-wrap.tbl-members table { min-width: 860px; }
.row-click { cursor: pointer; }
.row-click:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-main { color: var(--fg); }
.cell-sub { color: var(--fg-3); font-size: 12px; line-height: 1.45; }
.mute { color: var(--fg-3); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 用户详情弹层：分段圆角卡片，沿用腾讯会议浅色模板 */
.user-detail { display: block; }
.detail-sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.detail-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.detail-sec > h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--fg); }
.detail-sec > .hint { margin-top: 8px; }
.detail-sec .tbl-wrap { margin-top: 10px; }
.ms-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ms-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 12px; }
.ms-form .field { margin: 0; }
.ms-form .field label { margin-bottom: 6px; }
.ms-form .field input[type="date"] { min-width: 150px; }
.ms-form .btn { min-height: 34px; }
.ms-perm { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding-bottom: 2px; color: var(--fg-2); font-size: 13px; cursor: pointer; user-select: none; }
.ms-perm input { width: 16px; height: 16px; min-width: 0; }
.ms-perm:has(input:disabled) { opacity: .55; cursor: not-allowed; }

@media (max-width: 767px) {
  .ms-form .field { flex: 1 1 100%; }
  .ms-form .btn { flex: 1 1 100%; }
  .ms-perm { min-height: 40px; }
  .detail-sec { margin-top: 14px; padding-top: 12px; }
}
