:root {
  --primary: #2563eb; --primary-light: #dbeafe; --primary-dark: #1d4ed8;
  --teal: #0d9488; --teal-light: #ccfbf1; --teal-dark: #0f766e;
  --amber: #f59e0b; --amber-light: #fef3c7;
  --red: #ef4444; --red-light: #fee2e2;
  --green: #22c55e; --green-light: #dcfce7;
  --purple: #7c3aed; --purple-light: #ede9fe;
  --bg: #f1f5f9; --card: #ffffff; --text: #1e293b; --text-lighter: #64748b;
  --border: #e2e8f0; --sidebar: #1e293b; --sidebar-hover: #334155;
  --sidebar-active: #2563eb; --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card);
  border-radius: 16px; padding: 36px 32px; box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.login-card .sub { font-size: 13px; color: var(--text-lighter); margin-bottom: 26px; }
.login-card .brand {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; background: var(--primary-light);
  color: var(--primary); font-size: 22px; margin-bottom: 16px;
}

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; background: var(--sidebar); color: #cbd5e1;
  position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100;
  transition: transform .3s;
}
.sidebar-header { padding: 20px 18px; border-bottom: 1px solid #334155; }
.sidebar-header h1 { font-size: 16px; color: #fff; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sidebar-header .sub { font-size: 11px; color: #64748b; margin-top: 3px; }
.nav-section { padding: 14px 18px 5px; font-size: 10px; color: #475569; letter-spacing: 1px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px; cursor: pointer;
  color: #94a3b8; font-size: 13px; transition: all .15s; border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active { background: rgba(37,99,235,.2); color: #fff; border-left-color: var(--sidebar-active); }
.nav-item .ico { width: 18px; text-align: center; }

.main { flex: 1; margin-left: 232px; padding: 22px 26px 60px; min-height: 100vh; }
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 21px; font-weight: 700; }
.page-header .desc { font-size: 13px; color: var(--text-lighter); margin-top: 2px; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.who {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: var(--primary-light); color: var(--primary-dark);
  padding: 3px 10px; border-radius: 20px; font-weight: 600;
}

/* ---------- 按钮 ---------- */
.btn {
  padding: 8px 15px; border: none; border-radius: 8px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s; font-weight: 600; font-family: inherit; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); border-color: #cbd5e1; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-lighter); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; padding: 11px; font-size: 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .hint { font-size: 12px; color: var(--text-lighter); }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.kpi {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border-left: 4px solid var(--primary);
}
.kpi .label { font-size: 12px; color: var(--text-lighter); margin-bottom: 6px; }
.kpi .value { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 11px; color: var(--text-lighter); margin-top: 3px; }
.kpi.teal { border-left-color: var(--teal); }
.kpi.teal .value { color: var(--teal-dark); }
.kpi.amber { border-left-color: var(--amber); }
.kpi.amber .value { color: #b45309; }
.kpi.red { border-left-color: var(--red); }
.kpi.red .value { color: #b91c1c; }
.kpi.purple { border-left-color: var(--purple); }
.kpi.purple .value { color: #5b21b6; }
.kpi.blue { border-left-color: var(--primary); }
.kpi.blue .value { color: var(--primary-dark); }
.kpi.pink { border-left-color: #ec4899; }
.kpi.pink .value { color: #be185d; }

/* ---------- 近七天变更柱状图 ---------- */
.trend { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding: 8px 6px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.trend-col .trend-val { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; min-height: 16px; font-variant-numeric: tabular-nums; }
.trend-col .trend-bar { width: 60%; max-width: 46px; min-height: 3px; background: var(--primary); border-radius: 6px 6px 0 0; transition: height .4s; }
.trend-col .trend-bar.zero { background: #e2e8f0; }
.trend-col .trend-day { font-size: 11px; color: var(--text-lighter); margin-top: 6px; white-space: nowrap; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-lighter); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { margin-bottom: 0; min-width: 140px; flex: 1; }
.form-row .field.small { min-width: 100px; flex: 0 0 auto; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
thead th {
  background: #f8fafc; text-align: left; padding: 10px 12px; font-size: 12px;
  font-weight: 600; color: var(--text-lighter); white-space: nowrap;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-lighter); font-size: 13px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-green { background: var(--green-light); color: #15803d; }
.tag-amber { background: var(--amber-light); color: #b45309; }
.tag-red { background: var(--red-light); color: #b91c1c; }
.tag-teal { background: var(--teal-light); color: var(--teal-dark); }
.tag-gray { background: #f1f5f9; color: #475569; }
.tag-purple { background: var(--purple-light); color: #5b21b6; }
.tag-pink { background: #fce7f3; color: #be185d; }

/* ---------- 机房卡片 ---------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.room-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; cursor: pointer; transition: all .18s; border: 1.5px solid transparent;
}
.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.room-card .rc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.room-card .rc-name { font-size: 16px; font-weight: 700; }
.room-card .rc-code {
  font-size: 11px; font-weight: 700; background: var(--primary); color: #fff;
  padding: 2px 8px; border-radius: 6px;
}
.room-card .rc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.room-card .rc-stats .st { background: #f8fafc; border-radius: 8px; padding: 8px 4px; }
.room-card .rc-stats .st .n { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.room-card .rc-stats .st .l { font-size: 11px; color: var(--text-lighter); }
.room-card .rc-foot {
  margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 11px; color: var(--text-lighter); display: flex; justify-content: space-between; gap: 8px;
}

/* ---------- 进度条 / 分布 ---------- */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12px; }
.bar-row .bar-label { width: 110px; flex: 0 0 auto; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-track { flex: 1; height: 18px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--primary); border-radius: 6px; transition: width .4s; }
.bar-row .bar-val { width: 58px; text-align: right; flex: 0 0 auto; color: var(--text-lighter); font-variant-numeric: tabular-nums; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal.wide { max-width: 880px; }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head .x { cursor: pointer; color: var(--text-lighter); font-size: 22px; line-height: 1; padding: 0 4px; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap;
}

/* ---------- 提示 ---------- */
.toast-wrap {
  position: fixed; top: 16px; right: 16px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: #1e293b; color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow-lg); max-width: 340px;
  animation: slideIn .25s ease;
}
.toast.ok { background: #0f766e; }
.toast.err { background: #b91c1c; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.alert-box { border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 10px; display: flex; gap: 9px; }
.alert-box.high { background: var(--red-light); color: #7f1d1d; }
.alert-box.mid { background: var(--amber-light); color: #78350f; }
.alert-box.low { background: #f1f5f9; color: #334155; }

.notice {
  background: var(--primary-light); color: var(--primary-dark); border-radius: 10px;
  padding: 11px 14px; font-size: 12.5px; margin-bottom: 14px; line-height: 1.7;
}
.notice.warn { background: var(--amber-light); color: #78350f; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item::before {
  content: ''; position: absolute; left: -20px; top: 6px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--border);
}
.tl-item.create::before { background: var(--green); }
.tl-item.delete::before { background: var(--red); }
.tl-item.import::before { background: var(--teal); }
.tl-time { font-size: 11px; color: var(--text-lighter); }
.tl-text { font-size: 13px; margin-top: 1px; }
.tl-meta { font-size: 11px; color: var(--text-lighter); margin-top: 2px; }

/* ---------- 类别平铺切换 ---------- */
.pill-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px dashed var(--border);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px;
  border-radius: 20px; border: 1px solid var(--border); background: #fff;
  font-size: 12.5px; font-weight: 600; color: var(--text-lighter);
  cursor: pointer; transition: all .15s; font-family: inherit; white-space: nowrap;
}
.pill:hover { border-color: #cbd5e1; color: var(--text); background: var(--bg); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill .n { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; font-weight: 500; }
.pill.active .n { opacity: .9; }

/* ---------- 表格顶部工具栏 ---------- */
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid var(--border);
}
.toolbar .spacer { flex: 1; min-width: 8px; }
.toolbar .tb-info { font-size: 12.5px; color: var(--text-lighter); }
.toolbar .tb-info strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* 卡密 / 账号编号这类要一眼能核对的短码 */
.code-chip {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; font-weight: 700; letter-spacing: .4px; white-space: nowrap;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 8px; color: var(--text); cursor: pointer;
}
.code-chip:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }
.code-chip.empty { background: transparent; border-style: dashed; color: var(--text-lighter); cursor: default; font-family: inherit; font-weight: 400; }
.code-chip.bind, .code-chip.empty.bind { cursor: pointer; }
.code-chip.empty.bind:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }
/* 私人账号编号：粉色系，与业务账号一眼区分（总部私人账号库下放到机房的号） */
.code-chip.private { background: #fdf2f8; border-color: #fbcfe8; color: #be185d; }
.code-chip.private:hover { background: #fce7f3; border-color: #f9a8d4; color: #9d174d; }

/* 输入框 + 右侧「选择」按钮（网络设备号从已有列表挑选用） */
.input-picker { display: flex; align-items: center; gap: 8px; }
.input-picker > input { flex: 1 1 auto; min-width: 0; }
.input-picker > .btn { flex: 0 0 auto; white-space: nowrap; }
/* 表单内联展开的网络设备号候选面板（不能用二级弹窗：openModal 是单弹窗实现） */
.net-pick-panel {
  margin-top: 8px; padding: 10px 12px;
  border: 1px solid var(--primary); border-radius: 8px; background: var(--primary-light);
  max-height: 260px; overflow-y: auto;
}
.net-pick-panel .bind-list { max-height: none; }
.net-pick-panel .bind-item { background: #fff; }

/* 绑定手机 / 型号选项弹窗里的可点选条目 */
.bind-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.bind-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px;
}
.bind-item:hover { border-color: var(--primary); background: var(--primary-light); }
.bind-item.cur { border-color: var(--primary); background: var(--primary-light); }
/* 已被其他设备占用的账号：锁定不可点选，须先在原设备解绑 */
.bind-item.locked {
  cursor: not-allowed; opacity: .72; background: #f8fafc;
}
.bind-item.locked:hover { border-color: var(--border); background: #f1f5f9; }

/* ---------- 账号详情弹窗（点账号芯片 → 看全部资料） ---------- */
.acct-head {
  display: flex; flex-direction: column;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.info-grid { display: flex; flex-direction: column; gap: 0; }
.info-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 2px; border-bottom: 1px dashed #eef2f7;
}
.info-row:last-child { border-bottom: none; }
.info-k {
  flex: 0 0 108px; color: var(--muted); font-size: 13px;
  padding-top: 1px;
}
.info-v { flex: 1; min-width: 0; font-size: 13px; word-break: break-all; line-height: 1.7; }

/* 台账表格里的短字段不要折行，长字段收成一行省略号 */
.nowrap { white-space: nowrap; }
.ellipsis { display: block; width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 宽表格：操作列固定在右侧，横向滚动时编辑/删除始终够得着 */
.table-wrap.sticky-actions th,
.table-wrap.sticky-actions td { padding: 10px 10px; }
.table-wrap.sticky-actions table { font-size: 12.5px; }
.table-wrap.sticky-actions th:last-child,
.table-wrap.sticky-actions td:last-child {
  position: sticky; right: 0; background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 12px -10px rgba(15,23,42,.35);
}
.table-wrap.sticky-actions thead th:last-child { background: #f8fafc; z-index: 3; }
.table-wrap.sticky-actions tbody tr:hover td:last-child { background: #f8fafc; }

/* ---------- 杂项 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 9px 15px; font-size: 13px; cursor: pointer; color: var(--text-lighter);
  border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.muted { color: var(--text-lighter); }
.small { font-size: 12px; }
.mb0 { margin-bottom: 0; }
.mt12 { margin-top: 12px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.mobile-top { display: none; }

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; padding: 14px 14px 70px; }
  .mobile-top {
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
    background: var(--card); padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .page-header h2 { font-size: 18px; }
  .kpi .value { font-size: 22px; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
  .room-grid { grid-template-columns: 1fr; }
  .modal { max-height: 94vh; }
}

/* ---------- 过渡与流畅度（2026-09-27） ---------- */

/* 弹窗：轻微淡入上浮，出现不再突兀 */
.modal-mask { animation: maskIn .14s ease-out; }
.modal { animation: modalIn .18s ease-out; }
@keyframes maskIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

/* 路由切换：顶部细进度条（旧页面内容保留，新内容就绪后替换，不再闪屏） */
body.route-loading::after {
  content: '';
  position: fixed; top: 0; left: 0; height: 3px; width: 34%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 0 3px 3px 0;
  z-index: 2000; pointer-events: none;
  animation: routeBar 1s ease-in-out infinite;
}
@keyframes routeBar {
  0% { left: -34%; }
  100% { left: 100%; }
}

/* ========== 账号健康度（2026-09-27） ========== */

/* 健康度标签里的发生时间，比状态本身弱一档 */
.tag .health-at {
  margin-left: 4px; padding-left: 5px; font-weight: 500; opacity: .8;
  border-left: 1px solid currentColor; font-variant-numeric: tabular-nums;
}

/* 账号芯片：编号 + 健康度竖排（每台手机可挂多个账号） */
.acct-stack { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.acct-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.acct-row .code-chip { cursor: pointer; }

/* 健康度快速标注弹窗里的三个大按钮 */
.health-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.health-btn {
  border: 1.5px solid var(--border); border-radius: 10px; background: #fff;
  padding: 16px 8px; cursor: pointer; text-align: center; transition: all .15s;
  font-family: inherit; font-size: 14px; font-weight: 700; color: var(--text);
}
.health-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.health-btn .hb-ico { display: block; font-size: 20px; line-height: 1.3; }
.health-btn .hb-at { display: block; font-size: 11px; font-weight: 500; color: var(--text-lighter); margin-top: 3px; }
.health-btn.on.k-进行中 { border-color: var(--green); background: var(--green-light); color: #15803d; }
.health-btn.on.k-售罄 { border-color: var(--red); background: var(--red-light); color: #b91c1c; }
.health-btn.on.k-系统繁忙 { border-color: var(--amber); background: var(--amber-light); color: #b45309; }

/* ========== 手机架子视图（2026-09-27，参考机房实拍） ========== */

/* 顶部统计条：手机总台数 + 健康度分布 */
.rack-stats { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.rack-stat {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 13px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
  font-size: 12px; color: var(--text-lighter);
}
.rack-stat .n { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.rack-stat.ok .n { color: var(--teal-dark); }
.rack-stat.red .n { color: #b91c1c; }
.rack-stat.amber .n { color: #b45309; }
.rack-stat.green .n { color: #15803d; }

/* 架子本体：模拟实拍里的白色货架，横梁 + 立柱 */
.rack-frame {
  position: relative; background: linear-gradient(#eef2f7, #e2e8f0);
  border: 3px solid #cbd5e1; border-radius: 12px; padding: 10px 12px 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), var(--shadow);
}

/* 一行 = 一层横梁；每行 10 台 */
.rack-shelf { position: relative; margin-bottom: 12px; }
.rack-shelf:last-child { margin-bottom: 0; }
.rack-shelf::before {
  content: ''; position: absolute; left: -6px; right: -6px; bottom: -7px; height: 8px;
  background: linear-gradient(#f8fafc, #cbd5e1); border-radius: 4px;
  box-shadow: 0 2px 3px rgba(15,23,42,.12);
}
.rack-shelf-no {
  position: absolute; left: -2px; top: -8px; z-index: 2;
  font-size: 10px; font-weight: 700; color: #64748b;
  background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px;
}
.rack-shelf-no .shelf-real { color: var(--primary); font-variant-numeric: tabular-nums; }

/* 一层的手机（列数跟每层摆放数量走，--cols 由架子视图按层内联设置） */
.rack-grid {
  display: grid; grid-template-columns: repeat(var(--cols, 10), minmax(0, 1fr));
  gap: 8px; padding-top: 12px;
}

/* 单台手机：卡片上机位 */
.rack-slot { min-width: 0; display: flex; flex-direction: column; position: relative; }

/* 机位右上角的删除按钮：只删这一台，其他手机不动；悬停才浮现，不与网络角标打架 */
.slot-del {
  position: absolute; top: -2px; right: -2px; z-index: 3;
  width: 18px; height: 18px; line-height: 1; padding: 0;
  border: 1px solid #e2e8f0; border-radius: 5px; background: #fff;
  color: #94a3b8; font-size: 10px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.rack-slot:hover .slot-del, .slot-del:focus-visible { opacity: 1; }
.slot-del:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.slot-head {
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; padding: 4px 3px 3px; background: transparent;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  border: 1.5px solid transparent;
}
.slot-head:hover { transform: translateY(-2px); border-color: var(--primary-light); box-shadow: var(--shadow); background: #fff; }

/* 手机机身：参考实拍里的黑色机身竖排在架子上 */
.slot-phone {
  width: 100%; max-width: 46px; aspect-ratio: 9 / 17.5;
  background: linear-gradient(160deg, #1e293b, #0f172a);
  border: 2px solid #334155; border-radius: 7px; position: relative;
  display: flex; align-items: flex-start; justify-content: center; overflow: hidden;
}
/* 听筒 + 屏内状态色：健康度直接体现在机身光晕上 */
.slot-phone::before {
  content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 34%; height: 3px; border-radius: 2px; background: #475569;
}
/* 设备状态色的机身描边 */
.slot-phone.st-在用 { box-shadow: 0 0 0 2px rgba(34,197,94,.45); }
.slot-phone.st-闲置 { box-shadow: 0 0 0 2px rgba(148,163,184,.5); }
.slot-phone.st-故障 { box-shadow: 0 0 0 2px rgba(239,68,68,.55); }
.slot-phone.st-维修中 { box-shadow: 0 0 0 2px rgba(245,158,11,.55); }
.slot-phone.st-报废 { box-shadow: 0 0 0 2px rgba(120,113,108,.5); }
/* 未登记设备的空槽位：虚线占位，一眼看出架子还空着 */
.rack-slot.empty { cursor: pointer; }
.rack-slot.empty:hover .slot-phone { border-color: var(--primary); background: var(--primary-light); opacity: 1; }
.rack-slot.empty:hover .slot-code { color: var(--primary); }
.rack-slot.empty .slot-phone { background: #f8fafc; border-style: dashed; border-color: #cbd5e1; opacity: .8; }
.rack-slot.empty .slot-phone::before { background: #cbd5e1; }

/* 手机下方的编号与账号（账号跟随编号展示） */
.slot-foot { margin-top: 5px; text-align: center; }
.slot-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; font-weight: 700;
  color: var(--text); word-break: break-all; line-height: 1.35;
}
.slot-code .muted { font-weight: 500; }
.slot-model { font-size: 10px; color: var(--text-lighter); margin-top: 1px; }

/* 编号下的账号：竖排，每行一个；带健康度小点 */
.slot-accts { margin-top: 4px; display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.slot-acct {
  display: flex; align-items: center; gap: 4px; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 2.5px 5px; font-size: 11px; cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text); transition: all .13s; overflow: hidden;
}
.slot-acct:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.slot-acct .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: #cbd5e1; }
.slot-acct .dot.进行中 { background: var(--green); }
.slot-acct .dot.售罄 { background: var(--red); }
.slot-acct .dot.系统繁忙 { background: var(--amber); }
.slot-acct .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-acct.add { border-style: dashed; color: var(--text-lighter); font-family: inherit; font-weight: 600; }
.slot-acct.add:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }
/* 私人账号（总部分配的 YQ 编号）：粉色系，与业务账号一眼区分 */
.slot-acct.private { background: #fdf2f8; border-color: #fbcfe8; color: #be185d; }
.slot-acct.private:hover { background: #fce7f3; border-color: #f9a8d4; color: #9d174d; }
.slot-acct .tag-pill { font-size: 9px; line-height: 1.5; padding: 0 4px; border-radius: 4px; flex: 0 0 auto; }

/* 超过 3 个账号的手机：整机标红提示异常 */
.rack-slot.abnormal .slot-phone { box-shadow: 0 0 0 2px #ef4444, 0 0 12px rgba(239,68,68,.5); }
.rack-slot.abnormal .slot-code { color: #b91c1c; }
.abn-badge {
  display: inline-block; margin-top: 3px; padding: 1px 6px; border-radius: 20px;
  background: var(--red-light); color: #b91c1c; font-size: 9.5px; font-weight: 700;
}

/* 架子顶部的红色异常提示条 */
.abn-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  background: var(--red-light); color: #7f1d1d; border-radius: 10px;
  padding: 9px 13px; font-size: 12.5px; font-weight: 600;
}

/* 架子视图的分页 */
.rack-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; font-size: 12.5px; color: var(--text-lighter); }
.rack-pager .btn { min-width: 74px; }
.rack-pager .pg-info { font-variant-numeric: tabular-nums; }

/* 架子缩略图：多个架子时显示 A / B / C… 缩略卡，点击切换 */
.rack-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.rack-thumb {
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: 9px 11px; cursor: pointer; font-family: inherit; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rack-thumb:hover { border-color: var(--primary-light); box-shadow: var(--shadow); transform: translateY(-2px); }
.rack-thumb.on { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.18); }
.rack-thumb .rt-head { display: flex; align-items: baseline; gap: 8px; }
.rack-thumb .rt-head b { font-size: 13px; color: var(--text); }
.rack-thumb .rt-n { font-size: 11px; color: var(--text-lighter); font-variant-numeric: tabular-nums; }
.rack-thumb .rt-grid { display: flex; flex-direction: column; gap: 2px; }
.rack-thumb .rt-row { display: flex; gap: 2px; }
.rack-thumb .rt-row i { width: 7px; height: 7px; border-radius: 2px; background: #e2e8f0; }
.rack-thumb .rt-row i.f { background: var(--primary-light); }
.rack-thumb.on .rt-row i.f { background: var(--primary); }

/* 每层手机数量加减控件 */
.shelf-ctl { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; vertical-align: middle; }
.shelf-ctl button {
  width: 18px; height: 18px; line-height: 1; padding: 0; border: 1px solid #cbd5e1;
  border-radius: 5px; background: #fff; color: var(--text-light); font-size: 12px;
  cursor: pointer; font-family: inherit;
}
.shelf-ctl button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.shelf-ctl b { font-size: 11px; color: var(--text-light); min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; }

/* 顶部统计里可点击的（售罄）数字 */
.rack-stat.clickable { cursor: pointer; border: none; background: #fff; font-family: inherit; }
.rack-stat.clickable:hover { border-color: var(--red); background: #fef2f2; }

/* 手机顶部的网络设备角标：运营商分类 + 设备号
   深色标签压住手机机身上缘，像贴在手机顶部的一条标签，一眼可见 */
.slot-nets {
  /* 绝对定位悬浮层：角标贴在手机顶部（一半压在机身上），所有手机对齐整齐 */
  position: absolute; top: -6px; left: 0; right: 0; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 3px; justify-content: center;
  pointer-events: none;           /* 中空不挡住手机本体的点击 */
}
.net-chip {
  font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  max-width: none;                /* 允许略宽于格子，号码绝不截断 */
  background: #1e293b; color: #fff; border: 1px solid #0f172a;
  border-radius: 8px; padding: 1.5px 9px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .4);
  pointer-events: auto;           /* 角标本身可点（打开设备表单改网络绑定） */
  cursor: pointer;
}
.net-chip .carrier { font-weight: 700; font-style: normal; }
.net-chip .carrier.cu { color: #fca5a5; }   /* 联通 · 亮红（深底上可读） */
.net-chip .carrier.cm { color: #93c5fd; }   /* 移动 · 亮蓝 */
.net-chip .carrier.ct { color: #5eead4; }   /* 电信 · 亮青 */
.net-chip .carrier.co { color: #cbd5e1; }   /* 其他 / 未指定 · 浅灰 */
.net-chip .net-no { font-family: var(--mono, monospace); font-weight: 700; letter-spacing: .3px; }
/* 网络设备绑定/号码刚变更：角标变橙色闪两下，让「已实时更新」看得见 */
.slot-nets.just-changed .net-chip {
  animation: netChipFlash 1.1s ease-out 2;
  background: #f59e0b !important;
  border-color: #b45309 !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .5);
}
@keyframes netChipFlash {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(245, 158, 11, .75); }
  45%  { transform: scale(1.1);  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* 手机表单的「本机网络」信息卡：角标内容由绑定的网络设备决定，在这里看清楚、跳过去改 */
.net-info { display: flex; flex-direction: column; gap: 6px; }
.net-info-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.net-info-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #1e293b; color: #fff; border: 1px solid #0f172a;
  border-radius: 8px; padding: 3px 10px; font-size: 12px; font-weight: 600;
}
.net-info-chip b { color: #93c5fd; }
.net-info-tip {
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: var(--text-lighter); line-height: 1.6;
}

@media (max-width: 1100px) {
  .rack-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .rack-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slot-phone { max-width: 54px; }
}

/* 视图切换：架子 / 表格 */
.view-switch { display: inline-flex; background: #f1f5f9; border-radius: 9px; padding: 3px; gap: 3px; }
.view-switch button {
  border: none; background: transparent; padding: 5px 13px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text-lighter); cursor: pointer; font-family: inherit;
}
.view-switch button.on { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
