:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #1264d8;
  --primary-dark: #0d4fae;
  --danger: #d92d20;
  --success: #15803d;
  --warning: #b45309;
  --sidebar: #101828;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, input, select { font: inherit; }
.hidden { display: none !important; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0b2c5c, #1264d8 60%, #51a2ff);
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 34px;
  box-shadow: 0 24px 70px rgba(6, 28, 61, .28);
}
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 6px; color: #475467; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd6df;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 100, 216, .12);
}

.btn {
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 650;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-default { background: #fff; color: #344054; border: 1px solid #d0d5dd; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .48; cursor: not-allowed; }

.layout { min-height: 100vh; display: flex; }
.sidebar {
  width: 230px;
  background: var(--sidebar);
  color: #fff;
  padding: 22px 14px;
  flex: 0 0 auto;
}
.brand { font-size: 18px; font-weight: 800; padding: 4px 12px 24px; }
.brand small { display: block; color: #98a2b3; font-weight: 500; margin-top: 4px; }
.nav button {
  width: 100%;
  text-align: left;
  border: 0;
  color: #98a2b3;
  background: transparent;
  border-radius: 9px;
  /* 二级菜单：缩进 + 常规字重 + 13px，明显低于一级分组标题（14px 加粗） */
  padding: 9px 12px 9px 26px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  margin-bottom: 2px;
}
.nav button:hover, .nav button.active { background: #1d2939; color: #fff; }
.nav button.active { font-weight: 600; }
.main { min-width: 0; flex: 1; }
.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}
.topbar strong { font-size: 20px; }
.user { color: var(--muted); display: flex; align-items: center; gap: 12px; }
.content { padding: 26px; max-width: 1500px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.toolbar .filters { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card {
  background: var(--panel);
  border: 1px solid rgba(16, 24, 40, .05);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .05);
  padding: 18px;
}
.stat-label { color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 8px; }

.table-wrap { overflow: auto; max-height: 72vh; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
/* 列很多的清单表（统一设备清单 / 网关清单）：给足最小宽度让它横向滚动，
   否则窄屏会把「消防水枪」「公司库存」这类中文挤成竖排。 */
table.table-wide { min-width: 1240px; }
/* 表格默认居中：表头和单元格口径一致，避免"同表三种对齐"看起来没对齐。
   长文本列由 alignTableColumns() 打 .text-left 保持左对齐（更好读）。 */
th, td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  color: var(--muted);
  font-size: 12px;
  background: #fafbfc;
  /* 长表格滚动时表头不丢 */
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}
/* 只读展示值（例如"由平台生成"的 SN）：长得像输入框但不可编辑，避免操作员误以为要手填 */
.readonly-value {
  padding: 9px 11px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}
/* 建档成功后突出显示的 SN：操作员要抄到铭牌上，做大、做醒目 */
.sn-badge {
  margin: 4px 0 2px;
  padding: 14px 10px;
  border-radius: 10px;
  background: #eef4ff;
  color: #1d4ed8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 8px;
  text-align: center;
}
/* 数值列：与整表一致居中，但保留等宽数字，多行 0/1 才能纵向比较 */
th.num, td.num { text-align: center; font-variant-numeric: tabular-nums; }
/* 长文本列（备注 / 理由 / 内容 / 说明…）：左对齐更好读 */
th.text-left, td.text-left { text-align: left; }
/* 状态/时间等短内容不换行（中文被挤成竖排的根因） */
td.nowrap, th.nowrap { white-space: nowrap; }

/* ===== 产品管理：产品线 → 产品系列 → 型号 → 硬件规格 ===== */
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.plist-card { padding: 8px; max-height: 640px; overflow: auto; }
.list-head { display: flex; align-items: center; gap: 8px; padding: 4px 10px 10px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.list-head span { font-size: 12.5px; color: var(--muted); }
.list-head .btn { margin-left: auto; }
.pgh { font-size: 11.5px; color: var(--muted); padding: 10px 12px 4px;
  border-top: 1px solid var(--line); margin-top: 4px; }
.pgh:first-child { border-top: 0; margin-top: 0; }
.sitem { display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-radius: 9px; cursor: pointer; }
.sitem:hover { background: #f6f8fc; }
.sitem.active { background: #eef4ff; box-shadow: inset 3px 0 0 var(--primary); }
.sitem .del { margin-left: auto; border: 0; background: transparent; color: #c3cad8;
  cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 5px; border-radius: 6px; opacity: 0; }
.sitem:hover .del { opacity: 1; }
.sitem .del:hover { color: var(--danger); background: #fff0ee; }
.node { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); }
.node-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.node-head h3 { margin: 0; font-size: 15.5px; }
.node-head .acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.pcard { border: 1px solid var(--line); border-radius: 11px; padding: 12px;
  margin-top: 10px; background: #fff; }
.pcard-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pcard-head h3 { margin: 0; font-size: 14.5px; }
.pcard-head .code { font-size: 12.5px; color: var(--muted); }
.pcard-head .acts { margin-left: auto; display: flex; gap: 6px; }
.tree-rail { margin-top: 8px; border-left: 2px dashed #dbe3ef; padding-left: 12px; }
.hw-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  margin-top: 8px; background: #fcfdff; }
.hw-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hw-top .hw-name { font-weight: 700; }
.hw-top .acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.hw-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px;
  font-size: 12.5px; color: var(--muted); }
.hw-meta b { color: var(--text); }

/* 页面内的视图切换（生产管理的 待办/全部/已出厂） */
.notice { display: flex; gap: 10px; align-items: center; background: #fff7e8;
  border: 1px solid #f3d9a4; border-radius: 10px; padding: 10px 12px;
  margin-bottom: 12px; font-size: 13px; color: #8a5300; }
.notice .btn { margin-left: auto; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin: 2px 0; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.subtab { border: 0; background: transparent; padding: 9px 14px; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.subtab .cnt { font-size: 12px; color: var(--muted); margin-left: 4px; }
tr:hover td { background: #f8fbff; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.spark {
  display: block;
  width: 100%;
  height: 44px;
  margin: 4px 0 2px;
  background: linear-gradient(180deg, #fbfcfe, #f4f6fa);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sn-link { color: #2563eb; text-decoration: none; font-weight: 700; cursor: pointer; }
.sn-link:hover { text-decoration: underline; }
.topo-card { margin-bottom: 14px; }
.topo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.topo-head .gw { font-weight: 750; font-size: 15px; }
.topo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.topo-device {
  border: 1px solid var(--line);
  border-left: 4px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.topo-device.is-online { border-left-color: var(--success); }
.topo-dev-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
/* "标签：值"两列的详情表不是数据列，整列左对齐（含跟在标签后面的值） */
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; padding: 4px 8px 4px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.kv td.k { color: var(--muted); width: 110px; white-space: nowrap; }
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* white-space: nowrap 是关键：否则窄列里的「离线 / 严重 / 待处理」会被挤成竖排两行 */
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tag-green { background: #eaf8ef; color: var(--success); }
.tag-gray { background: #f1f3f6; color: #667085; }
.tag-red { background: #fff0ee; color: var(--danger); }
.tag-orange { background: #fff7e8; color: var(--warning); }
.muted { color: var(--muted); }
.live-on { color: #15803d; }

/* 页面骨架统一：标题 → 子标签（下划线式，不套框） → 工具条（筛选左/动作右） → 卡片 */
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.subtab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #475467;
  padding: 9px 14px;
  margin-bottom: -1px;
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
}
.subtab:hover { color: var(--primary-dark); }
.subtab.active {
  background: transparent;
  border-bottom-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 650;
}

/* 工具条：任何页面都是"筛选在左、动作在右"，高度与控件对齐 */
.toolbar > .filters { flex: 1 1 auto; }
.toolbar .btn { height: 36px; display: inline-flex; align-items: center; }
.toolbar input, .toolbar select { height: 36px; }

/* 筛选区里的复选框：方框和文字必须连在一起，不允许换行拆散 */
.toolbar .checkline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}
.toolbar .checkline input { width: 16px; height: 16px; min-width: 0; margin: 0; }

/* 统计数字做成小胶囊，不再混在筛选控件里 */
.stat-pills { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f2f4f7;
  color: #475467;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}
.pill b { color: #101828; font-size: 13px; }

/* 页面说明文字：小一号、更浅，紧贴工具条下方 */
.hint { color: var(--muted); font-size: 12px; margin: -6px 0 14px; line-height: 1.6; }
.live-warn { color: #b45309; }
.live-on::before, .live-warn::before {
  content: "●";
  margin-right: 6px;
  font-size: 10px;
  vertical-align: 1px;
}
.error { color: var(--danger); min-height: 20px; margin-bottom: 10px; }

#toast-host {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, 80vw);
}
.toast {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
  opacity: 1;
  transition: opacity .3s ease, transform .3s ease;
  white-space: pre-wrap;
}
.toast-ok { background: #ecfdf3; color: #05603a; border: 1px solid #abefc6; }
.toast-err { background: #fef3f2; color: #912018; border: 1px solid #fecdca; }
.toast-out { opacity: 0; transform: translateY(-6px); }

.modal-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  /* 桌面：遮罩不盖左侧导航（弹窗开着时也能切页面）；窄屏在下方媒体查询里恢复全屏 */
  left: 230px;
  background: rgba(16, 24, 40, .46);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}
.modal {
  width: min(620px, 100%);
  max-height: 91vh;
  /* 头/脚固定、只有内容区滚动：长弹窗不用滚到底才能关 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 26px 70px rgba(16, 24, 40, .28);
}
.modal:focus { outline: none; }
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  border-radius: 6px;
}
.modal-close:hover { color: var(--text); background: #f1f3f6; }
.modal-body { padding: 20px 22px; overflow: auto; }
.confirm-detail {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 6px 0 2px;
  font-size: 13px;
  color: #475467;
  white-space: pre-wrap;
}
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* ---- 行内操作收纳：1 个主操作 + 「更多 ▾」（展开时在单元格内展开，不被表格滚动裁掉） ---- */
.row-actions { flex-wrap: nowrap; align-items: flex-start; }
.more { position: relative; }
.more > summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #344054;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  user-select: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary { border-color: var(--primary); color: var(--primary); }
.more-menu { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; min-width: 148px; }
.more-menu .btn { text-align: left; width: 100%; }
.btn-quiet-danger { background: #fff; color: var(--danger); border: 1px solid #fecdca; }
.btn-quiet-danger:hover { background: #fef3f2; }
td .row-actions { min-width: 132px; }

/* ---- 设备详情：分组 kv（原来的长句在窄屏会折成一片） ---- */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
.kv-cell { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fbfcfe; }
.kv-k { color: var(--muted); font-size: 12px; }
.kv-v { font-weight: 650; margin-top: 2px; }

/* 只给读屏用的表标题 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
table.retention { min-width: 760px; }

/* ---- 标题层级 / 卡片副标题 / 数量徽章 ---- */
.card h3 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 .sub { font-size: 12px; font-weight: 500; color: var(--muted); }
.count-badge {
  display: inline-block;
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.anchors { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
details.help { margin: 0 0 14px; }
details.help > summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  list-style: none;
  width: fit-content;
}
details.help > summary::-webkit-details-marker { display: none; }
details.help[open] > summary { margin-bottom: 6px; }
details.help p { margin: 0 0 10px; }

/* ---- 空状态 / 表头排序 ---- */
.empty-state { color: var(--muted); text-align: center; padding: 22px 12px; }

/* ==========================================================================
   设计规范 v2（大厂后台风格）：一套 token + 一套组件样式，全站页面统一
   —— 追加在最后，靠级联覆盖旧写法；类名不变，页面结构不用改。
   ========================================================================== */
:root {
  --bg: #f5f7fa;            /* 页面底色：中性灰，不用彩色底 */
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d0d5dd;
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-soft: #e8f2ff;
  --danger: #d92d20;
  --success: #15803d;
  --warning: #b45309;
  --sidebar: #001529;       /* 深蓝侧栏（Ant 系） */
  --radius: 8px;
  --radius-card: 10px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

body { background: var(--bg); color: var(--text); font-size: 14px; }

/* 顶栏：白底、细分割线、字重收敛（标题不再 20px 加粗堆在一起） */
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); padding: 0 20px; }
.topbar strong { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.user { color: var(--muted); gap: 14px; font-size: 13px; }
.content { padding: 20px 24px 32px; max-width: 1440px; }

/* 侧栏：分组标题橙色系弱化，选中项蓝底 */
.sidebar { background: var(--sidebar); }
.nav button { font-size: 13px; padding: 8px 12px 8px 26px; border-radius: 6px; }
.nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav button.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-group > summary { font-size: 13px; padding: 8px 12px; color: rgba(255, 255, 255, .82); }
.nav-group > summary::after { color: rgba(255, 255, 255, .45); }

/* 卡片与统计：统一圆角/描边/阴影 */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}
.stats { gap: 12px; margin-bottom: 16px; }
.stats .card { padding: 14px 16px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 24px; font-weight: 600; margin-top: 6px; color: var(--text); }

/* 工具条 / 筛选 / 说明 */
.toolbar { margin-bottom: 12px; gap: 10px; }
.toolbar input, .toolbar select { height: 34px; font-size: 13px; min-width: 140px; }
.hint { color: var(--muted); font-size: 12px; margin: -2px 0 12px; line-height: 1.7; }
.stat-pills .pill, .pill { background: #f3f4f6; color: var(--muted); padding: 5px 10px; font-size: 12px; }
.pill b { color: var(--text); font-weight: 600; }

/* 表格：只有横线，表头浅灰、行高适中、悬浮高亮 */
table { font-size: 13px; }
table th {
  background: #fafbfc;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table tbody tr:hover { background: #fafcff; }
.table-wrap { border-radius: var(--radius-card); }

/* 按钮：主按钮实心蓝、次按钮白底描边、危险按钮浅红 */
.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
}
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-default { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn-default:hover { border-color: var(--primary); color: var(--primary); }
.btn-quiet-danger { background: #fff; border-color: #fecdca; color: var(--danger); }
.btn-quiet-danger:hover { background: #fef3f2; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* 表单控件 */
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="search"], input:not([type]), select, textarea {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  line-height: normal;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}

/* 状态标签：浅底 + 同色字，圆角胶囊 */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
  background: #f3f4f6;
  color: var(--muted);
  border: 1px solid transparent;
}
.tag-green { background: #ecfdf3; color: var(--success); border-color: #abefc6; }
.tag-red { background: #fef3f2; color: var(--danger); border-color: #fecdca; }
.tag-orange { background: #fffaeb; color: var(--warning); border-color: #fedf89; }
.tag-blue { background: #eff6ff; color: var(--primary); border-color: #bfdbfe; }
.tag-click { cursor: pointer; }
.tag-click:hover { border-color: var(--warning); }
.tag-gray { background: #f2f4f7; color: var(--muted); border-color: var(--line); }

/* 分页 / 空状态 / 错误 */
.pager { color: var(--muted); font-size: 13px; gap: 10px; }
.empty-state { color: var(--muted); font-size: 13px; padding: 28px 12px; }
.error { color: var(--danger); font-size: 13px; }

/* ---- 统一页面骨架：页头 / 筛选栏 / 字段 / 复选框 / 说明 ---- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.page-head h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--text); }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.page-head .page-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.filter-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; flex: 1 1 auto; }
.filter-actions { display: flex; align-items: flex-end; gap: 8px; margin-left: auto; }

.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > label { font-size: 12px; color: var(--muted); line-height: 1; }
.fld-hint { font-size: 12px; color: var(--muted); }
.fld input, .fld select { min-width: 160px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.check input { width: 16px; height: 16px; margin: 0; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
}

/* 表格的"操作"列固定在右侧：列多、横向滚动时也能点到 */
.table-wrap table th:last-child,
.table-wrap table td:last-child {
  position: sticky;
  right: 0;
  background: #fff;
}
.table-wrap table th:last-child { background: #fafbfc; z-index: 3; }
.table-wrap table td:last-child { z-index: 2; box-shadow: -10px 0 10px -10px rgba(16, 24, 40, .12); }
.table-wrap table tbody tr:hover td:last-child { background: #fafcff; }

/* 说明文字别拉满整行，读起来更舒服 */
.hint { max-width: 1080px; }

/* 表单行：输入框占满、说明文字单独一行 */
.form-row > input, .form-row > select, .form-row > textarea { width: 100%; }
.form-row > .muted { display: block; margin-top: 6px; font-size: 12px; }

/* 表格里的"型号/类型"这类短词不折行 */
table td.nw, table th.nw { white-space: nowrap; }

/* ==========================================================================
   设计规范 v3（大疆风格）：更大的标题层级、更克制的留白、该居中的居中
   —— h1 页面级 24 / h2 区块级 18 / h3 卡片级 16；数字与状态居中，操作列右对齐。
   ========================================================================== */

/* 1) 标题层级放大 */
/* 顶栏保留"面包屑"式的轻量标题；真正的大标题在内容区（大疆风格） */
#page-title { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: .2px; }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 26px; font-weight: 700; letter-spacing: .2px; margin: 0; }
.page-head p { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.7; }
.card h3, .modal-head { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.card h3 { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card h3 .sub, .card h3 .muted { font-size: 12px; font-weight: 400; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: .4px; }
.stat-label { font-size: 13px; color: var(--muted); }

/* 2) 该居中的居中：统计卡、空状态、整张表（表头与单元格同一口径）
   长文本列由 alignTableColumns() 打 .text-left，".标签：值"详情表由 .kv 规则保持左对齐 */
.stats .card { text-align: center; padding: 18px 16px; }
.stats .stat-value { margin-top: 10px; }
.empty-state, .empty-row { text-align: center; }

/* 3) 操作列：按钮跟随整表居中（此前只有这一列右对齐，视觉上最像"没对齐"的地方）。
   操作按钮是 flex 容器，单元格的 text-align 管不到它，要单独给 justify-content。 */
table td .actions, table td .row-actions { justify-content: center; }

/* 4) 卡片与间距：更松的留白（大疆风格） */
.card { padding: 20px 22px; border-radius: 12px; }
.filter-bar { gap: 14px 18px; margin-bottom: 18px; }
.fld { gap: 7px; }
.fld > label { font-size: 12px; color: var(--muted); }
.hint { font-size: 12px; line-height: 1.75; }
.content { padding: 24px 28px 40px; }

/* 5) 控件：统一 36px 高（含日期框），圆角 6px 更接近大疆的克制风格 */
.filter-bar .fld input, .filter-bar .fld select, .filter-bar .fld .btn,
.form-grid .fld input, .form-grid .fld select, .form-grid .fld .check { height: 36px; }
.filter-bar .check, .form-grid .check { height: 36px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="search"], input:not([type]), select, textarea {
  height: 36px; border-radius: 6px; font-size: 14px;
}
.btn { height: 36px; border-radius: 6px; font-size: 14px; padding: 0 16px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 6px; }

/* 6) 表格：表头更克制、行更高、状态居中 */
table th { font-size: 13px; font-weight: 600; padding: 12px; }
table td { font-size: 14px; padding: 13px 12px; }
table td .tag { margin: 0 auto; }

/* 网关页：网关卡头部与负载小卡统一到同一套描边/圆角 */
.topo-card { border-radius: var(--radius-card); margin-bottom: 12px; }
.topo-head { gap: 8px; margin-bottom: 12px; }
.topo-head .gw { font-weight: 600; font-size: 14px; }
.topo-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.topo-device {
  background: #fcfcfd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  border-left-width: 3px;
}
.topo-device.is-online { border-left-color: var(--success); background: #fbfefc; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--primary); }
th.sort-asc::after { content: " ▴"; color: var(--primary); }
th.sort-desc::after { content: " ▾"; color: var(--primary); }

/* ---- 侧栏分组：一级=域（更大/更亮/加粗），二级=页（缩进、常规字重、略小） ---- */
.nav-group { margin-bottom: 14px; }
.nav-group + .nav-group { border-top: 1px solid #1d2939; padding-top: 8px; }
.nav-group > summary {
  cursor: pointer;
  list-style: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 8px 12px;
  border-radius: 8px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: "▾"; color: #98a2b3; font-size: 11px; font-weight: 400; }
.nav-group:not([open]) > summary::after { content: "▸"; }
.nav-group > summary:hover { background: #1d2939; }

@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar { width: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .modal-mask { left: 0; }
}

/* 网关详情页：最近命令按行排 */
.gw-cmd-line { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.gw-cmd-line:last-child { border-bottom: 0; }

/* 服务工单处理时间线：时间在左、内容在右，客户那侧的行加一条浅竖线区分 */
.tl { border-left: 2px solid var(--line); margin: 8px 0 4px 6px; padding-left: 14px; }
.tl-row { position: relative; padding: 6px 0 10px; }
.tl-row::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 11px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
}
.tl-row.tl-customer::before { background: var(--warning); }
.tl-time { color: var(--muted); font-size: 12px; }
.tl-body { font-size: 13px; margin-top: 2px; }
.tl-body b { font-weight: 600; }
