/* =============================================================
 * Msioo IMP — 主样式表
 * 设计基调：专业 / 克制 / 高信息密度 / 弱电工程蓝色调
 * ============================================================= */

/* ------------------------- 设计令牌 ------------------------- */
:root {
  /* 品牌色 */
  --brand: #1f6feb;
  --brand-600: #1a5fd0;
  --brand-700: #1548a3;
  --brand-50: #eef4ff;
  --brand-100: #dbe7ff;

  /* 语义色 */
  --ok: #16a34a;
  --ok-bg: #e8f8ee;
  --warn: #d97706;
  --warn-bg: #fef4e6;
  --danger: #dc2626;
  --danger-bg: #fdeceb;
  --info: #0891b2;
  --info-bg: #e6f7fa;
  --purple: #7c3aed;
  --purple-bg: #f2ecfe;

  /* 中性色 */
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --line: #e4e8f0;
  --line-2: #eef1f6;
  --text: #1c2333;
  --text-2: #4a5568;
  --muted: #8892a6;
  --muted-2: #aab3c4;

  /* 侧栏 */
  --side-bg: #101828;
  --side-bg-2: #172033;
  --side-text: #9aa5bb;
  --side-text-hi: #ffffff;
  --side-active: #1f6feb;
  --side-line: #232d42;

  /* 尺度 */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow: 0 4px 14px rgba(16, 24, 40, .07);
  --shadow-lg: 0 16px 48px rgba(16, 24, 40, .16);
  --side-w: 232px;
  --head-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* ------------------------- 基础重置 ------------------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; line-height: 1.35; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg.ic { flex: 0 0 auto; display: block; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd6e4; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bdd0; background-clip: content-box; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-radius: 4px; }

/* =============================================================
 * 登录页
 * ============================================================= */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--panel);
}
.login-visual {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #0b1736 0%, #123a7a 45%, #1f6feb 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 46px 52px;
}
.login-visual::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 30% 30%, #000 25%, transparent 78%);
}
.login-visual::after {
  content: ''; position: absolute; width: 620px; height: 620px; right: -220px; bottom: -280px;
  border-radius: 50%; background: radial-gradient(circle, rgba(56,189,248,.34), transparent 66%);
}
.login-visual > * { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .logo-img { display: block; height: 26px; width: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.28)); }
.login-brand b { font-size: 17px; letter-spacing: .2px; display: block; }
.login-brand span { font-size: 11.5px; color: #b9cdf0; letter-spacing: 1.4px; text-transform: uppercase; }
.login-hero h2 { font-size: 34px; line-height: 1.28; margin-bottom: 14px; letter-spacing: -.4px; }
.login-hero p { color: #c3d4f2; font-size: 14px; max-width: 400px; }
.login-feats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.login-feats span {
  font-size: 12px; padding: 6px 13px; border-radius: 20px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #dbe7ff;
}
.login-foot { font-size: 11.5px; color: #8ba3cc; display: flex; flex-direction: column; gap: 5px; }
.login-foot .lf-company { color: #a9bcdd; }
.login-foot .lf-meta { display: flex; align-items: center; gap: 6px; color: #7b93bd; }
.login-foot .lf-meta b { color: #fff; font-family: var(--mono, monospace); font-weight: 400; letter-spacing: .3px; }
.login-foot .lf-dot { color: #4b6187; }

.login-form-side { display: grid; place-items: center; padding: 40px 28px; overflow-y: auto; }
.login-box { width: 100%; max-width: 372px; }
.login-box h1 { font-size: 25px; margin-bottom: 6px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 30px; }
.login-box .field { margin-bottom: 16px; }
.login-box .btn-block { width: 100%; height: 43px; font-size: 15px; font-weight: 600; letter-spacing: 4px; }
.login-row { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 20px; font-size: 12.5px; }
.login-tip {
  margin-top: 26px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--brand-50); border: 1px solid var(--brand-100);
  font-size: 12px; color: var(--text-2); line-height: 1.75;
}
.login-tip b { color: var(--brand-700); }
.login-tip code { font-family: var(--mono); background: #fff; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--brand-100); }

/* 找回密码步骤条 */
.steps { display: flex; align-items: center; margin-bottom: 26px; }
.step { flex: 1; text-align: center; position: relative; font-size: 12px; color: var(--muted); }
.step .dot {
  width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 6px;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--line-2); color: var(--muted); border: 1.5px solid var(--line);
}
.step::before {
  content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line);
}
.step:first-child::before { display: none; }
.step.active { color: var(--brand); font-weight: 600; }
.step.active .dot { background: var(--brand); color: #fff; border-color: var(--brand); }
.step.done .dot { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.step.done::before, .step.active::before { background: var(--brand-100); }

/* =============================================================
 * 主布局
 * ============================================================= */
.app-shell { display: flex; min-height: 100vh; }

/* 侧栏 */
.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w); background: var(--side-bg);
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 60;
  transition: transform .24s ease;
}
.side-brand {
  height: var(--head-h); display: flex; align-items: center; gap: 11px;
  padding: 0 14px; border-bottom: 1px solid var(--side-line); flex: 0 0 auto;
}
/* LOGO：方形圆角红色 M（矢量 SVG，零请求抖动） */
.side-brand .logo-sq {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; display: block;
  box-shadow: 0 4px 12px rgba(230,33,41,.36);
}
.side-brand-txt { min-width: 0; flex: 1; }
.side-brand b {
  color: #fff; font-size: 12.5px; font-weight: 600; display: block; letter-spacing: .1px;
  line-height: 1.32; white-space: normal; overflow: hidden;
}
.side-brand span { color: #6d7c96; font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase; }
.side-foot { flex: 0 0 auto; padding: 12px 15px 14px; border-top: 1px solid var(--side-line);
  font-size: 11px; color: #6d7c96; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.side-foot b { color: #cfd9ea; font-weight: 400; font-family: var(--mono, monospace); letter-spacing: .3px; }
.side-foot .sf-dot { color: #3d4a63; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 24px; }
.side-nav::-webkit-scrollbar-thumb { background: #2b364d; background-clip: content-box; }
/* 栏目逐一平铺：不再使用大分类标题 */
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  color: var(--side-text); font-size: 13.2px; margin-bottom: 2px; width: 100%;
  transition: background .14s, color .14s; text-align: left; position: relative;
}
.nav-item:hover { background: var(--side-bg-2); color: var(--side-text-hi); text-decoration: none; }
.nav-item.active { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: 0 3px 12px rgba(31,111,235,.36); }
.nav-item.active .ic { color: #fff; }
.nav-item .ic { color: #7d8aa3; }
.nav-item.active .ic { color: #fff; }
.nav-item .n-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 9px;
  background: var(--danger); color: #fff; min-width: 18px; text-align: center;
}
.nav-item.active .n-badge { background: rgba(255,255,255,.26); }
/* 项目内模块：未选项目时弱化提示 */
.nav-proj-scope.no-project { opacity: .5; }

/* 顶栏项目选择器 */
.proj-chip {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; max-width: 300px; transition: border-color .15s, box-shadow .15s;
}
.proj-chip:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.proj-chip > .ic { color: var(--brand); flex: 0 0 auto; }
.proj-chip .pj-chip-txt { min-width: 0; text-align: left; line-height: 1.25; flex: 1; }
.proj-chip .pj-chip-txt em {
  display: block; font-style: normal; font-size: 12.8px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 216px;
}
.proj-chip .pj-chip-txt i {
  display: block; font-style: normal; font-size: 10.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 216px;
}
.proj-drop {
  max-height: 74vh; display: flex; flex-direction: column;
  top: auto; right: auto; left: 0; width: 380px;
  padding: 0; overflow: hidden;
}
.proj-drop .pd-loading { padding: 22px; }
.pd-search {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); color: var(--muted); flex: 0 0 auto;
  background: var(--panel-2);
}
.pd-search input {
  border: 0; outline: 0; background: transparent; flex: 1; font-size: 13px; color: var(--text);
}
.pd-search input::placeholder { color: var(--muted); }
.pd-clear {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 0;
  display: grid; place-items: center; cursor: pointer; background: var(--line-2); color: var(--muted);
}
.pd-clear:hover { background: var(--line); color: var(--text); }
.pd-body { overflow-y: auto; flex: 1; padding: 4px 0; }
.pd-sec {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px 5px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700;
}
.pd-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px; cursor: pointer;
  transition: background .12s;
}
.pd-row:hover { background: var(--panel-2); }
.pd-row.on { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.pd-row.on .pd-main b { color: var(--brand); }
.pd-pin {
  flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 6px; color: var(--muted); transition: color .14s, background .14s;
}
.pd-pin:hover { background: var(--panel-2); color: var(--warn); }
.pd-pin.on { color: var(--warn); }
.pd-pin.on .ic { fill: currentColor; }
.pd-main { flex: 1; min-width: 0; }
.pd-main b { display: block; font-size: 12.8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-main p { font-size: 11px; color: var(--muted); margin: 1px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-status { font-size: 10.5px; color: var(--muted); flex: 0 0 auto; }
.pd-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.pd-foot { border-top: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }

/* 主区 */
.main-area { flex: 1; min-width: 0; margin-left: var(--side-w); display: flex; flex-direction: column; }
.topbar {
  height: var(--head-h); flex: 0 0 auto; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; position: sticky; top: 0; z-index: 40;
}
.topbar .tb-toggle { display: none; color: var(--text-2); }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.crumb b { color: var(--text); font-size: 15.5px; font-weight: 650; }
.crumb .sep { color: var(--muted-2); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tb-search {
  display: flex; align-items: center; gap: 7px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 11px; width: 210px; color: var(--muted); transition: border-color .15s, background .15s;
}
.tb-search:focus-within { border-color: var(--brand); background: #fff; }
.tb-search input { border: none; background: none; outline: none; width: 100%; font-size: 12.5px; color: var(--text); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2);
  position: relative; transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--bg); color: var(--brand); }
.icon-btn .dot-badge {
  position: absolute; top: 4px; right: 3px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 8px; background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}
.lang-btn { display: flex; align-items: center; gap: 5px; padding: 0 10px; height: 34px; border-radius: 8px; color: var(--text-2); font-size: 12.5px; }
.lang-btn:hover { background: var(--bg); color: var(--brand); }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 22px;
  border: 1px solid var(--line); transition: border-color .14s, box-shadow .14s;
}
.user-chip:hover { border-color: var(--brand-100); box-shadow: var(--shadow-sm); }
.avatar {
  width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #38bdf8); color: #fff; font-size: 11.5px; font-weight: 700;
}
.user-chip .uname { font-size: 12.5px; font-weight: 600; }
.user-chip .urole { font-size: 10.5px; color: var(--muted); margin-top: -3px; }

/* 下拉菜单 */
.dropdown {
  position: absolute; top: calc(var(--head-h) - 6px); right: 16px; min-width: 232px; z-index: 55;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.dropdown.show { display: block; animation: ddIn .16s ease; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dd-head { padding: 10px 12px 9px; border-bottom: 1px solid var(--line-2); margin-bottom: 5px; }
.dd-head b { display: block; font-size: 13.5px; }
.dd-head span { font-size: 11.5px; color: var(--muted); }
.dd-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 7px;
  font-size: 13px; color: var(--text-2); width: 100%; text-align: left;
}
.dd-item:hover { background: var(--bg); color: var(--brand); }
.dd-item.danger:hover { background: var(--danger-bg); color: var(--danger); }
.dd-sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.dd-lang { display: flex; gap: 6px; padding: 6px 8px; }
.dd-lang button {
  flex: 1; padding: 6px 4px; border-radius: 7px; font-size: 12px; border: 1px solid var(--line); color: var(--text-2);
}
.dd-lang button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* 通知面板 */
.notif-panel {
  position: absolute; top: calc(var(--head-h) - 6px); right: 16px; width: 372px; max-height: 74vh; z-index: 55;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden;
}
.notif-panel.show { display: flex; animation: ddIn .16s ease; }
.notif-head { padding: 12px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.notif-head b { font-size: 13.5px; }
.notif-head .badge { margin-left: 8px; }
.notif-list { overflow-y: auto; }
.notif-row { display: flex; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--line-2); }
.notif-row:hover { background: var(--panel-2); }
.notif-row .n-ic { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center; }
.notif-row .n-body { flex: 1; min-width: 0; }
.notif-row .n-body b { display: block; font-size: 12.8px; font-weight: 600; }
.notif-row .n-body p { font-size: 11.8px; color: var(--muted); margin-top: 1px; }
.notif-row .n-time { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }

/* 内容区 */
.page { padding: 20px 22px 40px; flex: 1; }
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; }
.page-head .desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.page-head .ph-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* =============================================================
 * 按钮 / 徽章 / 表单
 * ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 33px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2);
  transition: all .14s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #cbd5e4; color: var(--text); background: var(--panel-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 560; box-shadow: 0 1px 3px rgba(31,111,235,.28); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #15803d; border-color: #15803d; color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.3px; border-radius: 7px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; gap: 4px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn-icon { width: 33px; padding: 0; }
.btn-outline-brand { border-color: var(--brand-100); color: var(--brand); background: var(--brand-50); }
.btn-outline-brand:hover { background: var(--brand-100); border-color: var(--brand); color: var(--brand-700); }
.btn-group { display: flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.on { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); font-weight: 600; z-index: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1.5px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; line-height: 1.6;
  color: var(--bc, var(--muted)); background: color-mix(in srgb, var(--bc, var(--muted)) 11%, #fff);
  border: 1px solid color-mix(in srgb, var(--bc, var(--muted)) 24%, #fff);
  white-space: nowrap;
}
.badge-outline { background: transparent; }
.badge-lg { font-size: 12.5px; padding: 3px 11px; }
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px;
  background: var(--bg); color: var(--text-2); border: 1px solid var(--line); font-family: var(--mono);
}

/* 表单 */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12.3px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field-label .req { color: var(--danger); font-style: normal; }
.field-hint { display: block; font-size: 11.3px; color: var(--muted); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 11px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--text); font-size: 13px;
  transition: border-color .14s, box-shadow .14s; outline: none;
}
.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.select {
  appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a6' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.input-sm, .select-sm { height: 29px; font-size: 12.3px; padding: 0 9px; }
.select-sm { padding-right: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.field-full { grid-column: 1 / -1; }
.checkbox, .radio { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.checkbox input, .radio input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { display: none; }
.switch .track { width: 38px; height: 21px; border-radius: 12px; background: #cfd6e4; position: relative; transition: background .18s; flex: 0 0 auto; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* 工具条 */
.toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.toolbar .spacer { flex: 1; }
.tb-input { position: relative; display: flex; align-items: center; }
.tb-input .ic { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.tb-input .input { padding-left: 31px; width: 218px; }

/* =============================================================
 * 卡片 / 栅格
 * ============================================================= */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g5 { grid-template-columns: repeat(5, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span4 { grid-column: span 4; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14px; }
.card-head .ch-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-head .ic { color: var(--brand); }
.card-body { padding: 15px 16px; }
.card-body.tight { padding: 10px 12px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 11px 16px; border-top: 1px solid var(--line-2); background: var(--panel-2); }

/* KPI 卡 */
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .16s, box-shadow .16s, border-color .16s; cursor: pointer;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d5e0f2; }
.kpi::after {
  content: ''; position: absolute; right: -26px; top: -26px; width: 88px; height: 88px; border-radius: 50%;
  background: color-mix(in srgb, var(--kc, var(--brand)) 9%, transparent);
}
.kpi-top { display: flex; align-items: center; gap: 9px; position: relative; }
.kpi-ic {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto;
  background: color-mix(in srgb, var(--kc, var(--brand)) 12%, #fff); color: var(--kc, var(--brand));
}
.kpi-label { font-size: 12.3px; color: var(--muted); font-weight: 500; }
.kpi-val { font-size: 26px; font-weight: 700; letter-spacing: -.6px; margin-top: 10px; position: relative; line-height: 1.15; }
.kpi-val small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; position: relative; display: flex; align-items: center; gap: 5px; }
.kpi-sub .up { color: var(--ok); font-weight: 600; }
.kpi-sub .down { color: var(--danger); font-weight: 600; }

/* 迷你统计 */
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-cell {
  flex: 1; min-width: 100px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line-2);
}
.stat-cell .s-label { font-size: 11.5px; color: var(--muted); }
.stat-cell .s-val { font-size: 19px; font-weight: 700; margin-top: 3px; letter-spacing: -.3px; }
.stat-cell .s-val small { font-size: 11.5px; font-weight: 500; color: var(--muted); }

/* 进度条 / 环 */
.bar { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--brand); transition: width .4s ease; }
.bar-thin { height: 4px; }
.ring { display: block; }

/* =============================================================
 * 表格
 * ============================================================= */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 12.9px; }
table.tb th {
  text-align: left; font-weight: 600; color: var(--text-2); font-size: 11.8px;
  text-transform: uppercase; letter-spacing: .4px;
  padding: 10px 13px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tb th.sortable { cursor: pointer; user-select: none; }
table.tb th.sortable:hover { color: var(--brand); }
table.tb td { padding: 10px 13px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb tbody tr:hover { background: var(--panel-2); }
table.tb tbody tr.clickable { cursor: pointer; }
table.tb .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tb .mono { font-family: var(--mono); font-size: 12.2px; }
table.tb .nowrap { white-space: nowrap; }
table.tb .cell-main { font-weight: 600; color: var(--text); }
table.tb .cell-sub { font-size: 11.4px; color: var(--muted); margin-top: 1px; }
table.tb .row-actions { display: flex; gap: 3px; justify-content: flex-end; }
table.tb .row-actions .btn { opacity: .72; }
table.tb tbody tr:hover .row-actions .btn { opacity: 1; }
.td-empty { text-align: center; padding: 0 !important; }

/* 批量选择条 */
.select-bar {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px;
  background: var(--brand-50); border-bottom: 1px solid var(--brand-100); font-size: 12.5px; color: var(--brand-700);
}
.select-bar .sb-actions { margin-left: auto; display: flex; gap: 7px; }

/* 分页 */
.pager {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-top: 1px solid var(--line-2); background: var(--panel); font-size: 12.3px; color: var(--muted); flex-wrap: wrap;
}
.pager .pg-btns { display: flex; gap: 4px; margin-left: auto; }
.pg-num {
  min-width: 29px; height: 29px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2); font-size: 12.3px; transition: all .13s;
}
.pg-num:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pg-num.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pg-num:disabled { opacity: .4; cursor: not-allowed; }
.pg-dots { padding: 0 3px; color: var(--muted-2); align-self: center; }
.pg-size { height: 29px; border: 1px solid var(--line); border-radius: 7px; padding: 0 6px; font-size: 12px; background: var(--panel); cursor: pointer; }

/* =============================================================
 * 空态 / 加载
 * ============================================================= */
.empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty-svg { width: 108px; height: 82px; color: var(--line); margin-bottom: 12px; }
.empty p { font-size: 13px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 46px; color: var(--muted); font-size: 13px; }
.spinner {
  width: 18px; height: 18px; border: 2.2px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--line-2) 25%, #f6f8fc 37%, var(--line-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* =============================================================
 * 模态框
 * ============================================================= */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,24,40,.44); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 52px 16px 30px;
  overflow-y: auto; opacity: 0; transition: opacity .2s; backdrop-filter: blur(1.5px);
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: var(--panel); border-radius: var(--radius-lg); width: 100%; max-width: 620px;
  box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.985); transition: transform .2s ease;
  display: flex; flex-direction: column; max-height: calc(100vh - 84px); margin: auto 0;
}
.modal-backdrop.show .modal { transform: none; }
.modal-sm { max-width: 416px; }
.modal-lg { max-width: 880px; }
.modal-xl { max-width: 1160px; }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 15px 19px; border-bottom: 1px solid var(--line-2); flex: 0 0 auto;
}
.modal-head h3 { font-size: 15.5px; flex: 1; }
.modal-x { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); font-size: 21px; line-height: 1; }
.modal-x:hover { background: var(--bg); color: var(--danger); }
.modal-body { padding: 18px 19px; overflow-y: auto; flex: 1; }
.modal-body.flush { padding: 0; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px; padding: 13px 19px;
  border-top: 1px solid var(--line-2); background: var(--panel-2); flex: 0 0 auto;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.confirm-msg { font-size: 13.3px; color: var(--text-2); line-height: 1.7; }

/* =============================================================
 * Toast
 * ============================================================= */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 17px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: 13.2px; opacity: 0; transform: translateY(-12px); transition: all .26s ease;
  max-width: 460px; pointer-events: auto;
}
.toast.show { opacity: 1; transform: none; }
.toast-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.toast-success { border-color: #b7e8c9; }
.toast-success .toast-icon { background: var(--ok); }
.toast-error { border-color: #f6c4c0; }
.toast-error .toast-icon { background: var(--danger); }
.toast-warning { border-color: #f6dcb0; }
.toast-warning .toast-icon { background: var(--warn); }
.toast-info .toast-icon { background: var(--info); }

/* =============================================================
 * 标签页
 * ============================================================= */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 9px 15px; font-size: 13.2px; color: var(--text-2); border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color .14s, border-color .14s; font-weight: 500;
}
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
.tab .cnt { font-size: 11px; color: var(--muted); margin-left: 5px; }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { padding: 5px 13px; border-radius: 6px; font-size: 12.4px; color: var(--text-2); transition: all .13s; }
.seg button.on { background: var(--panel); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm); }

/* =============================================================
 * 描述列表
 * ============================================================= */
.desc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.desc-1 { grid-template-columns: 1fr; }
.desc-3 { grid-template-columns: repeat(3, 1fr); }
.desc-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.desc-row.full { grid-column: 1 / -1; }
.desc-row .dl { width: 96px; flex: 0 0 auto; font-size: 12.3px; color: var(--muted); }
.desc-row .dv { flex: 1; font-size: 13px; color: var(--text); word-break: break-word; min-width: 0; }
.desc-row .dv.mono { font-family: var(--mono); font-size: 12.4px; }

/* =============================================================
 * 时间线
 * ============================================================= */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -21px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--panel); border: 2.4px solid var(--brand);
}
.tl-item.ok::before { border-color: var(--ok); }
.tl-item.warn::before { border-color: var(--warn); }
.tl-item.danger::before { border-color: var(--danger); }
.tl-item.dim::before { border-color: var(--line); }
.tl-head { display: flex; align-items: baseline; gap: 8px; }
.tl-head b { font-size: 13px; }
.tl-time { font-size: 11.3px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.tl-body { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* =============================================================
 * 提示条
 * ============================================================= */
.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 12.7px; margin-bottom: 13px; align-items: flex-start; }
.alert .ic { margin-top: 1px; flex: 0 0 auto; }
.alert-info { background: var(--info-bg); border: 1px solid #bfe6ee; color: #0e6478; }
.alert-warn { background: var(--warn-bg); border: 1px solid #fadfb4; color: #8a5209; }
.alert-danger { background: var(--danger-bg); border: 1px solid #f7c9c5; color: #a51f18; }
.alert-ok { background: var(--ok-bg); border: 1px solid #bce8ca; color: #12803a; }
.alert b { font-weight: 650; }

/* =============================================================
 * 拓扑画布
 * ============================================================= */
.topo-wrap { display: flex; gap: 13px; align-items: stretch; min-height: 640px; }
.topo-palette {
  width: 218px; flex: 0 0 218px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.topo-palette .pal-head { padding: 11px 13px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.topo-palette .pal-body { overflow-y: auto; padding: 8px; flex: 1; }
.pal-group { margin-bottom: 9px; }
.pal-group b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); padding: 5px 7px; }
.pal-node {
  display: flex; align-items: center; gap: 8px; padding: 6.5px 8px; border-radius: 7px;
  font-size: 12.4px; color: var(--text-2); cursor: grab; border: 1px solid transparent; transition: all .13s;
}
.pal-node:hover { background: var(--bg); border-color: var(--line); color: var(--brand); }
.pal-node:active { cursor: grabbing; }
.topo-stage {
  flex: 1; min-width: 0; position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
  background-image: radial-gradient(circle, #dfe5f0 1.1px, transparent 1.1px);
  background-size: 21px 21px;
}
.topo-stage.connect-mode { cursor: crosshair; }
.topo-stage.panning { cursor: grabbing; }
.topo-layer-label {
  position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed #e8ecf4; pointer-events: none;
}
.topo-layer-label span {
  position: absolute; left: 9px; top: -9px; font-size: 10px; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted-2); background: var(--panel); padding: 0 5px;
}
.topo-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.topo-svg path { pointer-events: stroke; }
.tn {
  position: absolute; width: 116px; background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 9px; padding: 8px 9px; cursor: move; user-select: none;
  box-shadow: var(--shadow-sm); transition: border-color .14s, box-shadow .14s; z-index: 2;
}
.tn:hover { border-color: var(--lc, var(--brand)); box-shadow: var(--shadow); z-index: 5; }
.tn.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50), var(--shadow); z-index: 6; }
.tn.dragging { z-index: 30; opacity: .93; box-shadow: var(--shadow-lg); }
.tn.head { display: flex; align-items: center; gap: 7px; }
.tn .tn-ic { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; background: color-mix(in srgb, var(--lc, var(--brand)) 13%, #fff); color: var(--lc, var(--brand)); }
.tn .tn-name { font-size: 11.8px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tn .tn-meta { font-size: 10px; color: var(--muted); margin-top: 3px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn .tn-port { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--panel); border: 2px solid var(--lc, var(--brand)); top: 50%; margin-top: -5.5px; opacity: 0; transition: opacity .14s, transform .14s; }
.tn:hover .tn-port, .tn.sel .tn-port { opacity: 1; }
.tn .tn-port:hover { transform: scale(1.4); background: var(--lc, var(--brand)); }
.tn .tn-port.p-in { left: -6px; }
.tn .tn-port.p-out { right: -6px; }
.topo-toolbar {
  position: absolute; top: 11px; left: 11px; z-index: 20; display: flex; gap: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 5px;
  box-shadow: var(--shadow);
}
.topo-hint {
  position: absolute; bottom: 11px; left: 11px; z-index: 20; font-size: 11.5px; color: var(--muted);
  background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px;
  display: flex; gap: 13px; flex-wrap: wrap; max-width: calc(100% - 22px);
}
.topo-hint kbd { font-family: var(--mono); background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; font-size: 10.5px; }
.topo-zoombar {
  position: absolute; bottom: 11px; right: 11px; z-index: 20; display: flex; flex-direction: column; gap: 3px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 4px; box-shadow: var(--shadow);
}
.edge-warn { stroke: var(--danger) !important; }

/* ---- 资产：批量录入 / 扫码入库 / 批量操作条 ---- */
.bulk-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px;
  background: var(--brand-50); border-bottom: 1px solid var(--brand-100);
}
.bulk-bar.hidden { display: none; }
.batch-table { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.batch-table table.tb { margin: 0; }
.batch-table .tb th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); }
.batch-table .tb td { padding: 4px 6px; }
.batch-table .input-sm, .batch-table .select-sm { padding: 5px 8px; font-size: 12.4px; }
.scan-box { display: flex; gap: 8px; align-items: stretch; }
.scan-box .input { flex: 1; }
.req { color: var(--danger); font-style: normal; font-weight: 700; }

/* ---- 客户：项目卡片 ---- */
.cust-proj { border-bottom: 1px solid var(--line-2); }
.cust-proj:last-child { border-bottom: 0; }
.cp-head { display: flex; align-items: center; gap: 11px; padding: 11px 14px; transition: background .13s; }
.cp-head:hover { background: var(--bg); }
.cp-contacts {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 0 14px 11px 61px; margin-top: -3px;
}

/* ---- 项目概况：快捷入口 / 状态点 ---- */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); text-decoration: none;
  color: var(--text-2); transition: all .14s; min-width: 0;
}
.quick-item:hover { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand); transform: translateY(-1px); }
.quick-item .qi-ic {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); margin-bottom: 3px;
}
.quick-item b { font-size: 12.4px; font-weight: 600; }
.quick-item .qi-sub { font-size: 10.8px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot-status {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; margin-top: 6px;
  background: var(--dc, var(--info)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dc, var(--info)) 18%, transparent);
}

/* ---- 拓扑全屏模式 ---- */
.topo-wrap.topo-full {
  position: fixed; inset: 0; z-index: 2000; margin: 0; padding: 12px;
  background: var(--bg); gap: 12px; min-height: auto;
  display: flex; align-items: stretch;
}
.topo-wrap.topo-full .topo-stage { border-radius: 10px; }
.topo-wrap.topo-full .topo-palette { max-height: 100%; }
.topo-wrap.topo-full .topo-toolbar,
.topo-wrap.topo-full .topo-hint,
.topo-wrap.topo-full .topo-zoombar { z-index: 2010; }
body.topo-full-lock { overflow: hidden; }
body.topo-full-lock .side,
body.topo-full-lock .topbar { z-index: 1; }

/* =============================================================
 * 机柜 U 位图
 * ============================================================= */
.rack-layout { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.rack-visual {
  width: 380px; flex: 0 0 auto; background: #1a1f2b; border-radius: 12px; padding: 12px;
  border: 2px solid #2b3344; box-shadow: var(--shadow-lg);
}
.rack-visual .rv-head {
  display: flex; justify-content: space-between; align-items: center; padding: 0 3px 9px;
  color: #8b97ad; font-size: 11.5px; font-family: var(--mono);
}
.rack-visual .rv-head b { color: #fff; font-size: 12.5px; font-family: var(--font); }
.rack-units { background: #0e1219; border-radius: 6px; padding: 3px; max-height: 640px; overflow-y: auto; }
.rack-units::-webkit-scrollbar-thumb { background: #333d52; background-clip: content-box; }
.ru {
  display: flex; align-items: stretch; height: 21px; margin-bottom: 1px; border-radius: 3px;
  position: relative; background: #151a24;
}
.ru:hover { background: #1c2231; }
.ru.drop-target { background: #1e2e4a; box-shadow: inset 0 0 0 1.5px var(--brand); }
/* 同一台多 U 设备的相邻行：去掉行间距，使设备块纵向连成整体 */
.ru.seg-row { margin-bottom: 0; background: transparent; border-radius: 0; }
.ru.seg-row .ru-no { border-right-color: #1b2230; }
.ru-no {
  width: 26px; flex: 0 0 26px; display: grid; place-items: center; font-size: 9.5px;
  color: #5a6880; font-family: var(--mono); border-right: 1px solid #232b3a;
}
.ru-slot { flex: 1; display: flex; gap: 2px; padding: 1.5px 2px; }
.ru.seg-row .ru-slot { padding-top: 0; padding-bottom: 0; }
.ru.has-dev .ru-no { color: #cbd5e4; }
.dev-block {
  border-radius: 3px; padding: 0 7px; display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600; color: #fff; cursor: grab; overflow: hidden;
  position: relative; min-width: 0; transition: filter .14s;
  /* 多 U 设备由多个分段拼成，各段必须用「同一份」颜色，否则衔接处会出现色差 */
  background: var(--dc, #8892a6);
  border-left: 1px solid color-mix(in srgb, var(--dc, #8892a6) 60%, #000);
  border-right: 1px solid color-mix(in srgb, var(--dc, #8892a6) 60%, #000);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
/* 多 U 设备：分段拼接成一整块。
   seg-row 已消除行间距，所以各段天然上下紧贴，无需负 margin（负 margin 会让
   块溢出到相邻空行里，露出到 U 号栏外面）。只保留首段的顶部圆角/描边与
   尾段的底部圆角/描边，中间段四角全直，视觉上即为一块完整设备。 */
.dev-block.seg-first {
  border-radius: 3px 3px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--dc) 55%, transparent);
}
.dev-block.seg-mid { border-radius: 0; }
.dev-block.seg-last {
  border-radius: 0 0 3px 3px;
  border-bottom: 1px solid color-mix(in srgb, var(--dc) 55%, transparent);
}
.dev-block.seg-first.seg-last {
  border-radius: 3px;
  border-top: 1px solid color-mix(in srgb, var(--dc) 55%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--dc) 55%, transparent);
}
/* 名称只在首段显示，其余段留白以保持整块观感 */
.dev-block.seg-first .db-name { margin-right: 4px; }
.dev-block [class^="db-"] { flex: 0 0 auto; }
.dev-block .db-name { flex: 0 1 auto; }
.dev-block:hover { filter: brightness(1.16); }
.dev-block.dragging { opacity: .5; }
.dev-block .db-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-block .db-lock { flex: 0 0 auto; opacity: .85; }
.dev-block.half { flex: 1; }
.dev-block.half.right { border-left: 1px solid rgba(0,0,0,.28); }
.ru-side { width: 44px; flex: 0 0 44px; display: grid; place-items: center; font-size: 9.5px; color: #5a6880; font-family: var(--mono); }
.rack-meta { flex: 1; min-width: 300px; }
.u-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.u-legend span { display: inline-flex; align-items: center; gap: 5px; }
.u-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---- 机柜位置调整模式 ---- */
.rack-visual.adjust-on {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-50), var(--shadow-lg);
}
.rack-visual.adjust-on .rack-units { cursor: row-resize; }
.rack-units.resizing { cursor: row-resize; }
.dev-block.adjustable {
  cursor: grab;
  outline: 1.5px dashed rgba(255,255,255,.55);
  outline-offset: -2px;
}
.dev-block.adjustable:active { cursor: grabbing; }
.dev-block.resizing { filter: brightness(1.3); z-index: 9; }
.dev-block .db-grip {
  position: absolute; left: 0; right: 0; height: 7px; cursor: ns-resize; z-index: 3;
  background: rgba(255,255,255,.35); opacity: 0; transition: opacity .13s;
}
.dev-block:hover .db-grip { opacity: 1; }
.dev-block .db-grip:hover { background: #fff; }
.dev-block .db-grip.grip-top { top: 0; border-radius: 3px 3px 0 0; }
.dev-block .db-grip.grip-bot { bottom: 0; border-radius: 0 0 3px 3px; }

/* 机柜卡片 */
.rack-card { cursor: pointer; transition: transform .16s, box-shadow .16s; }
.rack-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rack-preview { display: flex; flex-direction: column; gap: 1.5px; margin: 10px 0; }
.rack-preview .rp-u { height: 5px; border-radius: 2px; background: #1a1f2b; }
.rack-preview .rp-u.f { background: var(--brand); }

/* =============================================================
 * VLAN 条带图
 * ============================================================= */
.vlan-bar { display: flex; height: 42px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.vlan-seg {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center;
  cursor: pointer; transition: filter .14s; min-width: 2px; overflow: hidden;
}
.vlan-seg:hover { filter: brightness(1.1); }
.vlan-seg b { font-size: 11px; color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.28); }
.vlan-seg span { font-size: 9.5px; color: rgba(255,255,255,.86); }
.vlan-seg.empty { background: repeating-linear-gradient(45deg, #eef1f6, #eef1f6 6px, #e4e8f0 6px, #e4e8f0 12px); }
.vlan-legend { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 11px; font-size: 11.8px; }
.vlan-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer; }
.vlan-legend i { width: 11px; height: 11px; border-radius: 3px; }

.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(20px, 1fr)); gap: 3px; }
.ip-cell {
  aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center; font-size: 9.5px;
  background: var(--line-2); color: var(--muted); cursor: pointer; transition: transform .12s; font-family: var(--mono);
}
.ip-cell:hover { transform: scale(1.14); box-shadow: var(--shadow-sm); z-index: 2; }
.ip-cell.free { background: #eef2f8; }
.ip-cell.used { background: var(--brand); color: #fff; font-weight: 600; }
.ip-cell.reserved { background: var(--warn); color: #fff; }
.ip-cell.gw { background: var(--purple); color: #fff; font-weight: 700; }
.ip-cell.blocked { background: #dfe4ec; color: var(--muted-2); }

/* =============================================================
 * 巡检报告 / 打印
 * ============================================================= */
.report-sheet {
  background: #fff; max-width: 900px; margin: 0 auto; padding: 34px 40px;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.report-sheet h1 { font-size: 21px; text-align: center; margin-bottom: 5px; }
.report-sheet .rp-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.report-sheet h3 { font-size: 14px; margin: 20px 0 9px; padding-left: 9px; border-left: 3px solid var(--brand); }
.report-sheet .rp-sign { display: flex; gap: 46px; margin-top: 34px; padding-top: 18px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--text-2); }
.report-sheet .rp-sign div { flex: 1; }
.report-sheet .rp-sign span { display: block; height: 38px; }

/* =============================================================
 * 杂项
 * ============================================================= */
.split { display: flex; gap: 14px; align-items: flex-start; }
.split > .main-col { flex: 1; min-width: 0; }
.split > .side-col { width: 300px; flex: 0 0 300px; }
.split > .side-col.wide { width: 380px; flex: 0 0 380px; }
.hr { height: 1px; background: var(--line-2); margin: 14px 0; border: 0; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.fs11 { font-size: 11px; } .fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fs15 { font-size: 15px; } .fs17 { font-size: 17px; } .fs20 { font-size: 20px; }
.fw6 { font-weight: 600; } .fw7 { font-weight: 700; }
.tc { text-align: center; } .tr { text-align: right; }
.color-ok { color: var(--ok); } .color-warn { color: var(--warn); } .color-danger { color: var(--danger); } .color-brand { color: var(--brand); } .color-muted { color: var(--muted); }
.hidden { display: none !important; }
.clickable { cursor: pointer; }
.link-text { color: var(--brand); cursor: pointer; }
.link-text:hover { text-decoration: underline; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll-y { overflow-y: auto; }
.pw-field { display: flex; gap: 7px; align-items: center; }
.pw-field .input { font-family: var(--mono); letter-spacing: 1.2px; }
.pw-field .icon-btn { flex: 0 0 auto; border: 1px solid var(--line); width: 34px; height: 34px; }
.kv-list { font-size: 12.8px; }
.kv-list .kv { display: flex; gap: 10px; padding: 6.5px 0; border-bottom: 1px dashed var(--line-2); }
.kv-list .kv:last-child { border-bottom: none; }
.kv-list .kv span:first-child { color: var(--muted); width: 88px; flex: 0 0 auto; }
.kv-list .kv span:last-child { flex: 1; word-break: break-word; }
.pin-star { color: var(--warn); }
.chart-box { position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 7px 15px; font-size: 12px; margin-top: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.avatar-lg { width: 46px; height: 46px; border-radius: 12px; font-size: 17px; }
.list-row {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-bottom: 1px solid var(--line-2);
  transition: background .13s;
}
.list-row:hover { background: var(--panel-2); }
.list-row:last-child { border-bottom: none; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-main b { font-size: 13px; display: block; }
.list-row .lr-main p { font-size: 11.8px; color: var(--muted); margin-top: 1px; }

/* =============================================================
 * 响应式
 * ============================================================= */
@media (max-width: 1400px) { .g6 { grid-template-columns: repeat(3, 1fr); } .g5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .split { flex-direction: column; }
  .split > .side-col, .split > .side-col.wide { width: 100%; flex: 1 1 auto; }
  .topo-wrap { flex-direction: column; }
  .topo-palette { width: 100%; flex: 0 0 auto; }
  .topo-palette .pal-body { display: flex; gap: 12px; overflow-x: auto; }
  .pal-group { min-width: 128px; }
}
@media (max-width: 1000px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main-area { margin-left: 0; }
  .topbar .tb-toggle { display: grid; }
  .tb-search { display: none; }
  body.side-open::after { content: ''; position: fixed; inset: 0; background: rgba(16,24,40,.42); z-index: 55; }
  .g6, .g5, .g4, .g3 { grid-template-columns: repeat(2, 1fr); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}
@media (max-width: 700px) {
  .page { padding: 14px 13px 32px; }
  .g6, .g5, .g4, .g3, .g2, .g-auto { grid-template-columns: 1fr; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .desc, .desc-3 { grid-template-columns: 1fr; }
  .user-chip .uname, .user-chip .urole { display: none; }
  .crumb b { font-size: 14.5px; }
  .modal-backdrop { padding: 20px 10px; }
  .rack-visual { width: 100%; }
  .report-sheet { padding: 20px 16px; }
  .notif-panel { width: calc(100vw - 20px); right: 10px; }
  .dropdown { width: calc(100vw - 20px); right: 10px; }
}

/* =============================================================
 * 打印
 * ============================================================= */
@media print {
  .sidebar, .topbar, .no-print, .toolbar, .pager, .page-head .ph-actions, .modal-head, .modal-foot { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .main-area { margin-left: 0; }
  .page { padding: 0; }
  .card, .table-wrap, .report-sheet { border: none !important; box-shadow: none !important; }
  .report-sheet { padding: 0; max-width: none; }
  .modal-backdrop { position: static; background: none; padding: 0; opacity: 1; }
  .modal { max-width: none; box-shadow: none; max-height: none; transform: none; }
  .modal-body { overflow: visible; padding: 0; }
  table.tb { font-size: 11px; }
  table.tb th, table.tb td { padding: 5px 7px; }
  @page { margin: 13mm 11mm; }
}

/* =============================================================
 * 提醒中心
 * ============================================================= */
.chip-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 11px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text-2); font-size: 12.3px; font-weight: 500; cursor: pointer;
  transition: all .14s;
}
.chip:hover { border-color: var(--brand-100); color: var(--brand); }
.chip.active { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand); font-weight: 600; }
.chip .ic { flex: 0 0 auto; }
.chip em {
  font-style: normal; font-size: 10.5px; font-weight: 700; min-width: 16px; text-align: center;
  padding: 0 5px; border-radius: 9px; background: var(--line-2); color: var(--muted); line-height: 1.6;
}
.chip.active em { background: var(--brand); color: #fff; }
.tb-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* 统计格（带图标） */
.stat-cell-ic { display: flex; align-items: center; gap: 11px; }
.stat-cell-ic .s-ic {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--panel); border: 1px solid var(--line-2);
}
.stat-cell-ic .s-body { min-width: 0; }
.stat-cell-ic .s-body .s-val { margin-top: 0; line-height: 1.15; }
.rem-stats .stat-cell { flex: 1; min-width: 148px; }

/* 提醒卡片列表 */
.rem-list { display: flex; flex-direction: column; gap: 9px; }
.rem-card {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px 13px 17px; box-shadow: var(--shadow-sm);
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.rem-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-radius: var(--radius) 0 0 var(--radius); background: var(--info);
}
.rem-card.lv-0::before { background: var(--danger); }
.rem-card.lv-1::before { background: var(--warn); }
.rem-card.lv-2::before { background: var(--info); }
.rem-card.lv-3::before { background: var(--muted); }
.rem-card[data-act] { cursor: pointer; }
.rem-card[data-act]:hover { border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-1px); }
.rem-card.is-done { opacity: .5; }
.rem-card.is-done .rem-title { text-decoration: line-through; }

.rem-ic {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  flex: 0 0 auto; background: var(--panel-2); border: 1px solid var(--line-2); margin-top: 1px;
}
.rem-main { flex: 1; min-width: 0; }
.rem-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rem-title { font-size: 13.6px; font-weight: 600; color: var(--text); }
.rem-auto {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.8px; color: var(--muted);
  padding: 1px 7px; border-radius: 20px; background: var(--bg); border: 1px dashed var(--line);
}
.rem-content { font-size: 12.4px; color: var(--text-2); margin-top: 5px; line-height: 1.62; word-break: break-word; }
.rem-side {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  text-align: right; min-width: 122px;
}
.rem-date { font-size: 11.4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rem-due {
  font-size: 11.6px; font-weight: 700; color: var(--text-2);
  padding: 1px 8px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--line-2);
}
.rem-due.over { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.rem-due.today { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.rem-actions { display: flex; gap: 6px; }

/* =============================================================
 * 系统设置
 * ============================================================= */
.row-acts { display: flex; gap: 4px; align-items: center; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-bg); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn:disabled:hover { color: var(--muted); background: transparent; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

.swatch { display: inline-block; width: 15px; height: 15px; border-radius: 4px; border: 1px solid rgba(0,0,0,.1); vertical-align: -2px; margin-right: 6px; }
.swatch-hex { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.avatar-sm {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand-50); color: var(--brand); font-size: 11.5px; font-weight: 700; flex: 0 0 auto;
}
.cell-user { display: flex; align-items: center; gap: 8px; }
.link { color: var(--brand); text-decoration: none; }
.link:hover { text-decoration: underline; }

.form-actions { display: flex; gap: 9px; padding-top: 4px; }
.tip-line {
  display: flex; align-items: flex-start; gap: 7px; font-size: 12.3px; color: var(--muted);
  margin: 12px 0 0; line-height: 1.6;
}
.tip-line .ic { flex: 0 0 auto; margin-top: 2px; }
.tip-line.warn { color: var(--warn); }

/* 密码显示 */
.pwd-reveal {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  background: var(--panel-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 11px 13px;
}
.pwd-reveal code { flex: 1; font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .6px; color: var(--text); }

/* 字典库布局 */
.dict-layout { display: grid; grid-template-columns: 268px 1fr; gap: 14px; align-items: start; }
.dict-types { display: flex; flex-direction: column; gap: 3px; max-height: calc(100vh - 260px); overflow-y: auto; }
.dict-type {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 11px; border: none; background: transparent; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-2); font-size: 12.8px; transition: all .13s;
}
.dict-type:hover { background: var(--bg); }
.dict-type.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.dict-type .dt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dict-type .dt-code { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.dict-type em {
  font-style: normal; font-size: 10.5px; font-weight: 700; min-width: 18px; text-align: center;
  padding: 0 5px; border-radius: 9px; background: var(--line-2); color: var(--muted);
}
.dict-type.active em { background: var(--brand); color: #fff; }
.dict-add { justify-content: center; color: var(--brand); border: 1px dashed var(--brand-100); margin-top: 5px; }
.card-head h3 .tag { font-weight: 500; margin-left: 5px; }
.input-color { padding: 3px; height: 34px; cursor: pointer; }

/* 系统信息 */
.cnt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.cnt-cell { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.cnt-num { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.cnt-lb { font-size: 11.3px; color: var(--muted); margin-top: 2px; }

/* 备份卡片 */
.backup-card { text-align: center; padding: 28px 22px; }
.backup-card .bc-ic {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 14px;
  background: var(--brand-50); color: var(--brand);
}
.backup-card h3 { font-size: 15px; margin-bottom: 7px; }
.backup-card p { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin-bottom: 17px; min-height: 40px; }

@media (max-width: 1000px) {
  .dict-layout { grid-template-columns: 1fr; }
  .dict-types { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .dict-type { width: auto; }
  .dict-type .dt-code { display: none; }
}

/* =============================================================
 * 安防设备模块 (Security)
 * ============================================================= */
.sec-toolbar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.sec-toolbar .search-box { flex: 1; min-width: 220px; max-width: 380px; }
.sec-toolbar .spacer { flex: 1; }

.sec-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.sec-group { margin-bottom: 20px; }
.sec-group .sg-head {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
}
.sec-group .sg-head h4 { margin: 0; font-size: 13.5px; color: var(--text); }
.sec-group .sg-count {
  font-size: 11.5px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 1px 8px;
}

.sec-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: box-shadow .16s, border-color .16s, transform .16s;
}
.sec-card:hover {
  box-shadow: var(--shadow); border-color: var(--brand-100);
  transform: translateY(-1px);
}
.sc-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 9px;
}
.sc-ic {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand);
}
.sc-title { flex: 1; min-width: 0; }
.sc-title b {
  display: block; font-size: 13.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-title .desc {
  display: block; font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.sc-kv {
  display: grid; gap: 5px;
  font-size: 12px; padding-top: 8px; border-top: 1px dashed var(--line-2);
}
.sc-kv > div {
  display: flex; align-items: baseline; gap: 8px; min-width: 0;
}
.sc-kv > div > span {
  color: var(--muted); white-space: nowrap; flex: none;
  width: 62px; font-size: 11.5px;
}
.sc-kv > div > b,
.sc-kv > div > .s-val {
  color: var(--text-2); font-weight: 500; flex: 1; min-width: 0;
  text-align: right; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.sc-kv .s-label { color: var(--muted); white-space: nowrap; }
.sc-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
}

/* 录像机通道网格 */
.ch-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.ch-cell {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel-2); padding: 8px 6px; text-align: center;
  cursor: pointer; transition: all .15s;
}
.ch-cell:hover { border-color: var(--brand-100); background: var(--brand-50); }
.ch-cell.ch-used { background: #fff; border-color: var(--brand-100); }
.ch-cell .ch-no {
  font-size: 11px; color: var(--muted); font-family: var(--mono);
}
.ch-cell .ch-body {
  font-size: 12px; color: var(--text); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-cell.ch-used .ch-body { color: var(--brand-600); font-weight: 600; }
.ch-cell .ch-act { font-size: 11px; margin-top: 4px; }
.ch-cell.ch-empty .ch-body { color: var(--muted-2); }

/* 拼接屏 */
.wall-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.wall-grid {
  display: grid; gap: 6px; background: var(--side-bg);
  padding: 8px; border-radius: var(--radius-sm);
}
.wall-cell {
  aspect-ratio: 16 / 9; border-radius: 6px; cursor: pointer;
  background: #1e2a3f; border: 1px solid #2c3a53;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 2px; transition: all .15s;
  overflow: hidden; padding: 4px;
}
.wall-cell:hover { border-color: var(--brand); background: #24334d; }
.wall-cell.wc-used { background: #0e3a2e; border-color: #1c6e54; }
.wall-cell.wc-used:hover { background: #124a3a; }
.wall-cell .wc-idx {
  font-size: 10px; color: #6b7a94; font-family: var(--mono);
}
.wall-cell .wc-name {
  font-size: 11px; color: #e6ebf5; text-align: center;
  line-height: 1.25; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.wall-cell.wc-used .wc-name { color: #7ee2b8; font-weight: 600; }

/* 扫码入库 */
.scan-stage {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; background: var(--panel-2);
}
.scan-stage.on {
  border-color: var(--brand); background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(31,111,235,.08);
}
.scan-stage .st-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px;
}
.scan-stage .st-badge {
  font-size: 10.5px; font-weight: 600; padding: 1px 7px;
  border-radius: 20px; background: var(--muted); color: #fff;
}
.scan-stage.on .st-badge { background: var(--brand); }
.scan-stage .st-tip { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

.scan-list {
  margin-top: 12px; max-height: 220px; overflow: auto;
  border-top: 1px dashed var(--line); padding-top: 8px;
}
.scan-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px; font-size: 12px;
  border-bottom: 1px solid var(--line-2);
}
.scan-row:last-child { border-bottom: 0; }
.scan-row .sr-no {
  width: 26px; height: 22px; flex: none; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--muted); font-family: var(--mono);
}
.scan-row .sr-sn { flex: 1; font-family: var(--mono); color: var(--text); }
.scan-row .sr-dup { color: var(--danger); font-size: 11px; }
.scan-list .sr-count {
  font-size: 11.5px; color: var(--muted); padding: 6px 4px 0;
}

.scan-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  background: var(--ok-bg); color: var(--ok); font-weight: 600;
}
.scan-meta { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }

/* 扫码两步式：步骤序号 + 型号命中态 */
.scan-stage .step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-right: 6px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 10px; font-style: normal;
  font-weight: 700; vertical-align: 1px;
}
.scan-stage .field + .field { margin-top: 10px; }
.scan-stage.has-model .field:first-child { opacity: .55; }
.scan-stage.has-model .field:first-child .step-no { background: var(--ok); }
.scan-stage.has-model .field:last-child .step-no { box-shadow: 0 0 0 3px rgba(31,111,235,.18); }
.scan-stage .input-lg { height: 42px; font-size: 14.5px; letter-spacing: .4px; }
.scan-stage .input.scan-miss { border-color: var(--danger); animation: scanShake .32s; }
@keyframes scanShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* 批量录入 */
.batch-wrap { overflow-x: auto; }
.batch-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.batch-table th {
  background: var(--panel-2); color: var(--muted); font-weight: 600;
  font-size: 11.5px; padding: 7px 8px; text-align: left;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.batch-table td { padding: 2px; border-bottom: 1px solid var(--line-2); }
.batch-table input {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 6px 8px; font-size: 12.5px; border-radius: 6px;
  font-family: inherit; color: var(--text);
}
.batch-table input:focus {
  outline: 0; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(31,111,235,.1);
}

/* 统计 */
/* KPI 指标卡横排 */
.stat-row {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.stat-row.mb14 { margin-bottom: 14px; }
.stat-cell {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px;
  box-shadow: var(--shadow-sm);
}
.stat-cell .s-label { font-size: 11.5px; color: var(--muted); }
.stat-cell .s-val {
  font-size: 21px; font-weight: 700; color: var(--text);
  margin-top: 5px; font-family: var(--mono); line-height: 1.1;
}

/* 分布条形行：<span>标签 + .bar 进度 + <b>数值 */
.bar-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0;
}
.bar-row > span {
  flex: none; font-size: 12px; color: var(--text-2);
  width: 88px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.bar-row > .bar { flex: 1; height: 8px; border-radius: 20px; }
.bar-row > .bar > .bar-fill { border-radius: 20px; }
.bar-row > b {
  flex: none; width: 44px; text-align: right;
  font-size: 12px; color: var(--text); font-weight: 600;
}
.dot-status {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}

/* =============================================================
 * 角色权限矩阵
 * ============================================================= */
.role-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  margin-bottom: 18px;
}
.role-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 13px 14px; cursor: pointer;
  transition: all .15s; position: relative;
}
.role-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow-sm); }
.role-card.on {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.1);
}
.role-card .rc-head {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 2px;
}
.role-card .rc-head b { font-size: 13.5px; color: var(--text); }
.role-card .rc-dot {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 3px rgba(31,111,235,.1);
}
.role-card .rc-sys {
  font-size: 10px; font-weight: 600; padding: 1px 7px;
  border-radius: 20px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted);
}
.role-card .rc-desc,
.role-card p.rc-desc {
  font-size: 11.5px; color: var(--muted); margin: 7px 0 0;
  line-height: 1.5; min-height: 34px;
}
.role-card .rc-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line-2);
  font-size: 11.5px; color: var(--muted);
}
.role-card .rc-meta b { color: var(--text-2); font-family: var(--mono); }

.perm-grid {
  display: grid; gap: 4px 18px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  padding: 14px 4px;
}
.perm-cell {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 12.5px; color: var(--text-2); transition: background .12s;
  user-select: none;
}
.perm-cell:hover { background: var(--panel-2); }
.perm-cell input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.perm-cell.on { color: var(--text); font-weight: 500; }
.perm-cell.disabled { opacity: .5; cursor: not-allowed; }
.perm-group-head {
  grid-column: 1 / -1; font-size: 11.5px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 0 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px;
}

/* =============================================================
 * 版本更新记录
 * ============================================================= */
.vch-wrap { max-width: 760px; }
.vch-hero {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(120deg, #101828 0%, #1f2d47 100%);
  border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.vch-logo {
  width: 54px; height: 54px; border-radius: 14px; flex: none;
  box-shadow: 0 6px 18px rgba(230,33,41,.4);
}
.vch-hero-txt { flex: 1; min-width: 0; }
.vch-title { font-size: 16px; font-weight: 700; color: #fff; }
.vch-sub { font-size: 12px; color: #9aa5bb; margin-top: 3px; }
.vch-cur {
  text-align: right; flex: none;
}
.vch-cur .vch-ver {
  display: inline-block; font-size: 13px; font-weight: 700;
  color: #fff; background: rgba(230,33,41,.9);
  padding: 5px 13px; border-radius: 20px; font-family: var(--mono);
}
.vch-cur .vch-name { font-size: 11px; color: #9aa5bb; margin-top: 6px; }

.vch-item {
  display: flex; gap: 18px; padding: 0 0 8px;
}
.vch-item .vch-date {
  width: 92px; flex: none; text-align: right;
  font-size: 12px; color: var(--muted); font-family: var(--mono);
  padding-top: 3px;
}
.vch-item .vch-line {
  width: 2px; flex: none; background: var(--line); position: relative;
}
.vch-item .vch-line::before {
  content: ''; position: absolute; left: -4px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--brand-100);
}
.vch-item .vch-body { flex: 1; min-width: 0; padding-bottom: 18px; }
.vch-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 9px;
}
.vch-head .vch-ver {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  font-family: var(--mono);
}
.vch-badge {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px;
}
.vch-badge.major { background: #fdeceb; color: #e62129; }
.vch-badge.feature { background: var(--brand-50); color: var(--brand-600); }
.vch-badge.fix { background: var(--ok-bg); color: var(--ok); }
.vch-head .vch-name { font-size: 12.5px; color: var(--text-2); }
.vch-list { margin: 0; padding: 0; list-style: none; }
.vch-list li {
  position: relative; padding: 4px 0 4px 18px;
  font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}
.vch-list li::before {
  content: ''; position: absolute; left: 3px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2);
}

@media (max-width: 720px) {
  .vch-item .vch-date { display: none; }
  .vch-item .vch-line { display: none; }
  .vch-hero { flex-wrap: wrap; }
  .ch-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .sec-toolbar .search-box { max-width: none; }
}
