/* ============ VM 出租管理后台 - 现代高级交互设计系统 ============ */
:root {
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --panel: #ffffff;
  --panel-glass: rgba(255, 255, 255, 0.88);
  --border: #e2e8f0;
  --border-subtle: #edf2f7;
  
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-hover: #1e293b;
  --sidebar-active: rgba(99, 102, 241, 0.16);

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --accent-gradient: linear-gradient(135deg, #6366f1, #22d3ee);

  --success: #059669;
  --success-soft: #d1fae5;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --slate: #64748b;
  --slate-soft: #e2e8f0;

  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  
  --trans: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 深色模式设计系统 ---------- */
[data-theme="dark"] {
  --bg: #090d16;
  --bg-subtle: #0f172a;
  --panel: #131b2e;
  --panel-glass: rgba(19, 27, 46, 0.88);
  --border: #1e293b;
  --border-subtle: #162035;
  
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  
  --sidebar-bg: #0b1120;
  --sidebar-border: #172033;
  --sidebar-hover: #17233d;

  --primary-soft: rgba(99, 102, 241, 0.16);
  --success-soft: rgba(5, 150, 105, 0.18);
  --warn-soft: rgba(217, 119, 6, 0.18);
  --danger-soft: rgba(220, 38, 38, 0.2);
  --info-soft: rgba(37, 99, 235, 0.18);
  --slate-soft: rgba(100, 116, 139, 0.22);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html { -webkit-text-size-adjust: 100%; }
a { color: var(--primary); text-decoration: none; transition: var(--trans); }
a:hover { opacity: 0.85; }

/* 全局等宽数字类 */
.num, .tnum, .card-value, .mid, .exp, .host-pill, .cm-mid, .cm-dur, .cm-exp,
.act-time, .lease-ctrl, input[type="number"], input[type="date"], table td {
  font-variant-numeric: tabular-nums;
}

/* ---------- 骨架屏微动效 (Skeleton Shimmer) ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border-subtle) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 86px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.skeleton-text { height: 14px; margin-bottom: 6px; }
.skeleton-row { height: 32px; border-radius: 6px; margin: 4px 0; }

/* ---------- 原位复制微气泡反馈 ---------- */
.copy-bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: copyPop 0.8s ease forwards;
  white-space: nowrap;
}
[data-theme="dark"] .copy-bubble {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
}
@keyframes copyPop {
  0% { opacity: 0; transform: translate(-50%, -60%) scale(0.85); }
  25% { opacity: 1; transform: translate(-50%, -110%) scale(1); }
  75% { opacity: 1; transform: translate(-50%, -120%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(0.95); }
}

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: #94a3b8;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
  z-index: 20;
  transition: var(--trans);
}
.main {
  margin-left: 232px;
  flex: 1;
  padding: 24px 32px 48px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  color: #fff;
}
.brand .logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.brand .name { font-weight: 600; font-size: 15px; letter-spacing: 0.5px; }
.brand .sub { font-size: 11px; color: #64748b; margin-top: 1px; }

.nav { padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  margin-bottom: 3px;
  color: #94a3b8;
  transition: var(--trans);
  user-select: none;
  position: relative;
}
.nav .nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav .nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 500;
}
.nav .nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 2px;
  background: #6366f1;
}
.nav .nav-item svg {
  width: 18px; height: 18px;
  flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.nav .nav-label { flex: 1; }
.nav .nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  font-weight: 600;
  animation: pulseLight 2s infinite ease-in-out;
}

.sidebar-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-foot .mode-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.mode-tag.dry { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.mode-tag.real { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  min-height: 48px;
}
.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.topbar h1::before {
  content: "";
  width: 4px; height: 18px;
  border-radius: 2px;
  background: var(--primary-gradient);
  display: inline-block;
}
.topbar .spacer { flex: 1; }

/* 快捷键搜索触发按钮 (Ctrl+K) */
.cmd-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: var(--trans);
}
.cmd-trigger-btn:hover {
  border-color: var(--primary);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.cmd-trigger-btn kbd {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
}

/* 主题切换按钮 */
.theme-btn {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--trans);
  font-size: 14px;
}
.theme-btn:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--bg-subtle);
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--trans);
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover {
  border-color: #cbd5e1;
  background: var(--bg-subtle);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.28);
}
.btn.primary:hover {
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}
.btn.danger {
  background: var(--panel);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--danger);
}
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.warn {
  background: var(--panel);
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--warn);
}
.btn.warn:hover { background: var(--warn-soft); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; min-height: 28px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }
.btn, .nav-item, .mnav-item, .stat-num, [data-close], .bell, .m-more-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.notify-btn { position: relative; }
.notify-btn .bell-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger);
  color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.mode-banner {
  display: flex; align-items: center; gap: 8px;
  background: var(--warn-soft);
  border: 1px solid rgba(217, 119, 6, 0.25);
  color: var(--warn);
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
}
[data-theme="dark"] .mode-banner { color: #fde68a; border-color: rgba(245, 158, 11, 0.3); }
.mode-banner.real {
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.25);
  color: var(--danger);
}
[data-theme="dark"] .mode-banner.real { color: #fecaca; border-color: rgba(220, 38, 38, 0.3); }

/* ---------- 8 核心 KPI 矩阵卡片 ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
  min-width: 0;
}
@media (max-width: 1400px) {
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 768px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  transition: var(--trans);
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card.stat-card.kpi-inventory {
  border-top: 2px solid rgba(16, 185, 129, 0.45);
}
.card.stat-card.kpi-finance {
  border-top: 2px solid rgba(99, 102, 241, 0.45);
}
[data-theme="dark"] .card:hover { border-color: var(--primary); }
.card .card-title {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .card-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-head .icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.stat-head .icon svg {
  width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.stat-num { flex: 1; min-width: 0; }
.stat-num:hover .card-title { color: var(--primary); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 22px;
}
.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel-title-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.panel-title .hint,
.panel-title-text .hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.month-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  background: var(--bg-subtle);
  border-color: var(--border);
}
.month-strip .card-value { font-size: 20px; font-weight: 700; }

/* ---------- 表格与对齐系统 ---------- */
.table-wrap { overflow-x: auto; margin-top: 10px; }
.compact-table-wrap {
  overflow-y: auto;
  max-height: 380px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.compact-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px; }
th {
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  white-space: nowrap;
  user-select: none;
}
th.tnum, td.tnum { text-align: right; }
th.sortable { cursor: pointer; transition: color 0.15s; }
th.sortable:hover { color: var(--primary); }
th.sort-asc::after { content: " ▲"; font-size: 10px; color: var(--primary); }
th.sort-desc::after { content: " ▼"; font-size: 10px; color: var(--primary); }

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--text-secondary);
}
tbody tr { transition: background-color 0.15s ease; }
tbody tr:hover { background: var(--bg-subtle); }
tr:last-child td { border-bottom: none; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.skeleton{position:relative;overflow:hidden;background:#eef2f7;border-radius:6px;min-height:14px}
.skeleton::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.75),transparent);animation:sk-shimmer 1.2s infinite}
@keyframes sk-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}

/* ---------- 徽章与呼吸动效 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
}
.badge .dot {
  width: 7px; height: 7px; border-radius: 99px; background: currentColor;
}
.badge.rented .dot { animation: pulseGreen 2.2s infinite ease-in-out; }
.badge.expired_pending .dot { animation: pulseRed 1.8s infinite ease-in-out; }

@keyframes pulseGreen {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.4); opacity: 0.4; box-shadow: 0 0 6px #10b981; }
}
@keyframes pulseRed {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.4); opacity: 0.4; box-shadow: 0 0 6px #ef4444; }
}
@keyframes pulseLight {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.tag-bare {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 99px; background: var(--warn-soft); color: var(--warn);
  font-size: 11px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; vertical-align: middle;
}
[data-theme="dark"] .tag-bare { color: #fde68a; }

.tag-plan {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.tag-plan-p1 {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}
.tag-plan-p2 {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.tag-plan-bare {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}
[data-theme="dark"] .tag-plan-p1 {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.35);
}
[data-theme="dark"] .tag-plan-p2 {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}
[data-theme="dark"] .tag-plan-bare {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.25);
}
.tag-bridge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: var(--font-mono, monospace);
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted, #64748b);
  border: 1px solid rgba(100, 116, 139, 0.2);
  white-space: nowrap;
}
[data-theme="dark"] .tag-bridge {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.25);
}
.spec-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.spec-pve {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.badge.rented { background: var(--success-soft); color: var(--success); }
.badge.available { background: var(--slate-soft); color: var(--slate); }
.badge.expired_pending { background: var(--danger-soft); color: var(--danger); }
.badge.manual_override { background: var(--warn-soft); color: var(--warn); }
.badge.pending_registration { background: var(--info-soft); color: var(--info); }
.badge.protected { background: #f3e8ff; color: #7c3aed; }
[data-theme="dark"] .badge.protected { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }
.badge.not_found { background: var(--slate-soft); color: var(--muted); }
.badge.unknown { background: var(--bg-subtle); color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600;
}
.chip.red { background: var(--danger-soft); color: var(--danger); }
.chip.orange { background: #ffedd5; color: #ea580c; }
[data-theme="dark"] .chip.orange { background: rgba(234, 88, 12, 0.22); color: #fdba74; }
.chip.amber { background: var(--warn-soft); color: var(--warn); }
.chip.blue { background: var(--info-soft); color: var(--info); }

/* ---------- 进度条 ---------- */
.bar {
  height: 7px; border-radius: 99px;
  background: var(--border); overflow: hidden; margin-top: 6px;
}
.bar > div {
  height: 100%; border-radius: 99px;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}
.bar > div.warn { background: linear-gradient(90deg, #f59e0b, #f97316); }
.bar > div.danger { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* ---------- 表单与输入 (全站统一规范) ---------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--panel);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

/* 表格内输入框/选择框统一微调 (如价格表、对账表等) */
table input:not([type="checkbox"]):not([type="radio"]),
table select {
  padding: 5px 8px;
  font-size: 13px;
  border-radius: 6px;
  height: 30px;
  line-height: 1.2;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
/* 设置项网格: 用明确列数避免末字段换行后被 1fr 拉伸成整行而错位 */
.settings-grid {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1100px) { .settings-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .settings-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%;
}
.field textarea { resize: vertical; min-height: 60px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

.search-box {
  position: relative; display: flex; align-items: center;
  flex: 1 1 260px; max-width: 340px; min-width: 200px;
}
.search-box .search-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted);
  pointer-events: none; flex: none;
  z-index: 2;
}
.search-box input,
.search-box input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]) {
  width: 100%; padding: 8px 32px 8px 34px !important;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px; font-family: inherit;
  background: var(--panel);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.search-box input:focus,
.search-box input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}
.search-box input::-webkit-search-decoration,
.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-results-button,
.search-box input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}
.search-box .search-clear {
  position: absolute; right: 8px;
  width: 20px; height: 20px;
  border: none; border-radius: 99px;
  background: var(--slate-soft);
  color: var(--muted);
  font-size: 14px; line-height: 1;
  cursor: pointer; display: none;
  align-items: center; justify-content: center;
}
.search-box.has-value .search-clear { display: inline-flex; }

.sel-box { position: relative; flex: none; }
.sel-box select {
  appearance: none; -webkit-appearance: none;
  width: 100%; min-width: 140px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px; font-family: inherit;
  background: var(--panel);
  color: var(--text);
  outline: none; cursor: pointer;
  transition: border 0.15s, box-shadow 0.15s;
}
.sel-box select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}
.sel-box::after {
  content: "";
  position: absolute; right: 13px; top: 50%;
  width: 6px; height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.lease-filter { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.lease-group { display: flex; flex-direction: column; gap: 4px; }
.lease-group label { font-size: 12px; color: var(--muted); }
.lease-range { display: flex; align-items: center; gap: 6px; }
.lease-ctrl {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 13px; font-family: inherit; background: var(--panel); color: var(--text);
  outline: none; transition: border 0.15s, box-shadow 0.15s;
}
.lease-ctrl:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}
#lease-customer { width: 200px; }
#lease-machine { width: 120px; }
.lease-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }

/* 胶囊状态快捷筛选栏 */
.quick-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.qfilter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: var(--trans);
  user-select: none;
}
.qfilter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.qfilter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.qfilter-btn .qf-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.qfilter-btn.active .qf-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 6px;
  border-radius: 99px;
}

/* ---------- 页面内子选项卡 (Sub-Tabs) ---------- */
.subtabs-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s ease;
  white-space: nowrap;
  user-select: none;
}
.subtab-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}
.subtab-btn.active {
  background: var(--panel);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .subtab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .subtab-btn.active {
  background: var(--panel);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ---------- 通用分页控制条 (Pagination) ---------- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 6px 4px;
  margin-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.pagination-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.pagination-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.pagination-btn {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
/* ---------- 企业微信通知管理面板 (紧凑精巧版) ---------- */
.notify-top-bar {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.webhook-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.webhook-input-wrap input {
  flex: 1;
  min-width: 0;
  height: 32px;
  font-size: 13px;
}
.notify-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.notify-status-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notify-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
}
.notify-status-badge.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}
.notify-status-badge.paused {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}
.notify-preset-group {
  display: flex;
  gap: 5px;
  align-items: center;
}
.notify-preset-group .btn {
  padding: 3px 8px;
  font-size: 12px;
  height: 28px;
}

.notify-groups-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.notify-group-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notify-group-head {
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.notify-items-list {
  padding: 2px 6px;
  display: flex;
  flex-direction: column;
}
.notify-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
  border-bottom: 1px dashed var(--border-subtle);
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: var(--text);
  transition: background-color 0.12s ease;
}
.notify-item:last-child {
  border-bottom: none;
}
.notify-item:hover {
  background-color: var(--bg-subtle);
  border-radius: 4px;
}

/* 紧凑精巧开关 Switch */
.toggle-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 18px;
  border-radius: 99px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background-color 0.18s ease, border-color 0.18s;
  flex: none;
  border: 1px solid transparent;
  margin: 0;
}
.toggle-checkbox::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.toggle-checkbox:checked {
  background: var(--primary);
}
.toggle-checkbox:checked::after {
  transform: translateX(14px);
}
.toggle-checkbox:focus-visible {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

@media (max-width: 1100px) {
  .notify-groups-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 机器批量操作浮动栏 */
.batch-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 99px;
  box-shadow: var(--shadow-lg), 0 0 24px rgba(79, 70, 229, 0.18);
  padding: 8px 16px 8px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 80;
  animation: slideUpFloat 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 94vw;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@keyframes slideUpFloat {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.batch-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.batch-dot { color: var(--primary); font-size: 12px; }
.batch-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 900px) {
  .batch-bar {
    bottom: calc(68px + env(safe-area-inset-bottom));
    width: calc(100vw - 28px);
    border-radius: var(--radius);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 10px;
  }
  .batch-bar-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

/* ---------- 弹窗与抽屉 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-mask.show {
  display: flex;
  opacity: 1;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 480px; max-width: 92vw;
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-mask.show .modal {
  transform: scale(1);
}
.modal-wide { width: 920px; }
.modal-head {
  display: flex; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; font-weight: 600; flex: 1; color: var(--text); }
.modal-close {
  cursor: pointer; color: var(--muted);
  font-size: 20px; line-height: 1; padding: 4px;
  border-radius: 6px; transition: var(--trans);
}
.modal-close:hover { color: var(--text); background: var(--bg-subtle); }
.modal-body { padding: 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}

/* ---------- 指令速查面板 (Command Palette) ---------- */
.cmd-palette {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 580px; max-width: 92vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.cmd-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.cmd-head svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.cmd-input {
  flex: 1; border: none; background: none; font-size: 15px; font-family: inherit;
  color: var(--text); outline: none;
}
.cmd-body { max-height: 380px; overflow-y: auto; padding: 8px; }
.cmd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 13px;
  color: var(--text); transition: var(--trans);
}
.cmd-item:hover, .cmd-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.cmd-item .cmd-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 6px;
  background: var(--bg-subtle); color: var(--muted); margin-left: auto;
}

/* ---------- 主机资源与集群监控 3 列网格 ---------- */
.host-grid,
.dash-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}
.dash-subgrid {
  margin-top: 16px;
  align-items: stretch;
}
@media (max-width: 1200px) {
  .host-grid,
  .dash-subgrid {
    grid-template-columns: 1fr;
  }
}
.host-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: var(--trans);
  display: flex;
  flex-direction: column;
}
.host-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.host-card.offline {
  border-color: var(--danger);
  background: rgba(225, 29, 72, 0.03);
}
.host-card .host-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.host-card .host-name { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.host-card .host-status-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.host-card .host-status-badge.online {
  background: var(--success-soft); color: var(--success);
}
.host-card .host-status-badge.offline {
  background: var(--danger-soft); color: var(--danger);
}
.host-vm-summary {
  font-size: 12px; color: var(--muted); margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}

/* 监控子卡片头部与等高锁定 */
.dash-metric-card {
  min-height: 480px;
  height: 100%;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}
.dash-metric-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  min-height: 28px;
  flex: none;
}
.dash-metric-card .card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

/* 实时监测指示器 */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
}
.live-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* 行级快捷微操作按钮 */
.row-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--primary);
  font-size: 10px;
  cursor: pointer;
  opacity: 0.35;
  transition: all 0.15s ease;
  line-height: 1;
  vertical-align: middle;
}
tr:hover .row-mini-btn,
.row-mini-btn:hover {
  opacity: 1;
  background: var(--primary-soft);
  border-color: var(--primary);
  transform: scale(1.1);
}

/* 温度/功耗 Pill 胶囊标签栏 (3 列 × 2 行整齐网格) */
.host-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-subtle);
}
.host-pill {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; padding: 4px 2px; border-radius: 99px;
  background: var(--bg-subtle); color: var(--text-secondary);
  border: 1px solid var(--border); font-variant-numeric: tabular-nums;
  white-space: nowrap; text-align: center;
  transition: var(--trans);
}
.host-pill.good {
  background: var(--success-soft); color: var(--success); border-color: rgba(16, 185, 129, 0.2);
}
.host-pill.warn {
  background: var(--warn-soft); color: var(--warn); border-color: rgba(245, 158, 11, 0.2);
  font-weight: 600;
}
.host-pill.danger {
  background: var(--danger-soft); color: var(--danger); border-color: rgba(225, 29, 72, 0.25);
  font-weight: 700;
  animation: danger-pulse 2s infinite ease-in-out;
}
@keyframes danger-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
  50% { box-shadow: 0 0 6px 1px rgba(225, 29, 72, 0.25); }
}
.host-pill.action {
  background: var(--primary-soft); color: var(--primary); border-color: rgba(99, 102, 241, 0.2);
  cursor: pointer; text-decoration: none; font-weight: 500;
}
.host-pill.action:hover {
  background: var(--primary); color: #fff;
}

/* 进度条组 */
.host-metric-row { margin-top: 9px; }
.host-metric-row:first-of-type { margin-top: 0; }
.host-metric-info {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; margin-bottom: 4px;
}
.host-metric-info .k { color: var(--muted); }
.host-metric-info .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.panel-icon {
  font-size: 15px;
  line-height: 1;
}

/* 宿主物理机彩色微徽标 */
.host-mini-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  letter-spacing: 0.2px;
}
.host-mini-badge.pve7 {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.25);
}
.host-mini-badge.pve8 {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.25);
}
.host-mini-badge.pve9 {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.25);
}
[data-theme="dark"] .host-mini-badge.pve7 {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}
[data-theme="dark"] .host-mini-badge.pve8 {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.4);
}
[data-theme="dark"] .host-mini-badge.pve9 {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

/* 统一机器号高亮链接与客户名截断 */
.mid-link {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease;
}
.mid-link:hover {
  color: var(--primary);
  text-decoration: underline;
}
.cust-copy {
  font-size: 11.5px;
  max-width: 125px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* 流量榜与 CPU 榜精密排版与无缝 10 行对齐 */
.table-wrap.traffic,
.table-wrap.cpu {
  margin-top: 2px;
  flex: 1;
  max-height: 440px;
  overflow-y: auto;
}
.table-wrap.traffic table,
.table-wrap.cpu table {
  width: 100%;
}
.table-wrap.traffic th,
.table-wrap.cpu th {
  padding: 6.5px 8px;
  font-size: 11px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.table-wrap.traffic td,
.table-wrap.cpu td {
  padding: 6px 8px;
  font-size: 12px;
  vertical-align: middle;
}
.table-wrap.traffic tbody tr,
.table-wrap.cpu tbody tr {
  transition: background 0.15s ease;
}
.table-wrap.traffic tbody tr:hover,
.table-wrap.cpu tbody tr:hover {
  background: rgba(99, 102, 241, 0.035);
}
[data-theme="dark"] .table-wrap.traffic tbody tr:hover,
[data-theme="dark"] .table-wrap.cpu tbody tr:hover {
  background: rgba(99, 102, 241, 0.08);
}
.rate-in {
  color: var(--danger);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.rate-out {
  color: var(--info);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.traffic-bar-mini {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 3px;
  width: 100%;
  max-width: 72px;
}
.traffic-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #e11d48);
  border-radius: 99px;
  transition: width 0.3s;
}

.cpu-pct-high {
  color: var(--danger);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cpu-pct-med {
  color: #f59e0b;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cpu-pct-low {
  color: #10b981;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cpu-bar-mini {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 3px;
  width: 100%;
  max-width: 72px;
}
.cpu-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s;
}
.cpu-bar-fill.high {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}
.cpu-bar-fill.med {
  background: linear-gradient(90deg, #10b981, #f59e0b);
}
.cpu-bar-fill.low {
  background: #10b981;
}

/* 统一细滚动条 */
.table-wrap.traffic::-webkit-scrollbar,
.table-wrap.cpu::-webkit-scrollbar,
#dash-expiring::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.table-wrap.traffic::-webkit-scrollbar-thumb,
.table-wrap.cpu::-webkit-scrollbar-thumb,
#dash-expiring::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* 仪表盘即将到期精致卡片列表 (基准线对齐) */
#dash-expiring {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  margin-top: 4px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 2px;
}
.dash-exp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  min-height: 37px;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s ease;
}
.dash-exp-row:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.03);
  transform: translateX(2px);
}
.dash-exp-row.is-expired {
  border-left: 3px solid var(--danger);
  background: rgba(225, 29, 72, 0.03);
}
.dash-exp-row.is-today {
  border-left: 3px solid var(--warn);
  background: rgba(245, 158, 11, 0.03);
}
[data-theme="dark"] .dash-exp-row:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
}
.dash-exp-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.dash-exp-main .cust {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 125px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-exp-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.dash-exp-date {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 到期视图与客户卡片 ---------- */
.exp-group { margin-bottom: 20px; }
.exp-group-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; font-weight: 600; font-size: 14px;
}
.exp-group-head .count { font-size: 11px; padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.exp-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 16px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm); transition: var(--trans);
}
.exp-item:hover { border-color: #cbd5e1; box-shadow: var(--shadow); }
.exp-item .mid { font-weight: 700; min-width: 70px; font-variant-numeric: tabular-nums; }
.exp-item .cust { color: var(--text-secondary); flex: 1 1 40%; min-width: 0; }
.exp-item .cust-copy {
  cursor: pointer; transition: color 0.15s;
  position: relative;
}
.exp-item .cust-copy:hover { color: var(--primary); text-decoration: underline; }
.exp-item .exp { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cust-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; transition: var(--trans);
}
.cust-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cust-card .cust-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cust-card .cust-name { font-weight: 600; font-size: 15px; }
.cust-card .cust-nearest { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.cust-card .cm-list { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 4px; }
.cust-card .cm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 0; border-bottom: 1px dashed var(--border-subtle);
}
.cust-card .cm-row:last-child { border-bottom: none; }
.cust-card .cm-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.cust-card .cm-mid { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text); }
.cust-card .cm-dur, .cust-card .cm-exp { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cust-card .cm-chip {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: var(--info-soft); color: var(--info);
}
.cust-card .cm-chip.soon { background: var(--warn-soft); color: var(--warn); }
.cust-card .cm-chip.today { background: var(--danger-soft); color: var(--danger); }
.cust-card .cm-actions { display: flex; gap: 6px; flex-none: none; }
.cust-card .cust-foot { display: flex; gap: 5px; margin-top: 14px; }
.cust-card .cust-foot .btn { flex: 1; justify-content: center; min-height: 32px; padding: 4px 5px; font-size: 12px; white-space: nowrap; }

/* 批量续费弹窗 */
.rbm-list { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.rbm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px dashed var(--border-subtle);
  cursor: pointer; font-size: 13px; margin: 0; transition: background 0.15s;
}
.rbm-row:last-child { border-bottom: none; }
.rbm-row:hover { background: var(--bg-subtle); }
.rbm-row input { width: 17px; height: 17px; accent-color: var(--primary); flex: none; margin: 0; }
.rbm-row .mid { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.rbm-row .exp { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* 二次确认摘要 */
.confirm-summary {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; font-size: 13px; line-height: 2;
  font-variant-numeric: tabular-nums;
}
.confirm-summary .k { color: var(--muted); }
.confirm-warn {
  margin-top: 10px; padding: 10px 14px; border-radius: 8px;
  background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 600;
}
.inv-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.inv-count { font-size: 26px; font-weight: 700; color: var(--primary); }

/* 机器详情 */
.detail-head { margin-bottom: 14px; }
.detail-title { display: flex; align-items: center; gap: 10px; }
.detail-mid { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; }
.detail-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  background: var(--bg-subtle); border-radius: 10px; padding: 14px 18px; margin-bottom: 16px;
}
.d-item { display: flex; flex-direction: column; gap: 2px; }
.d-label { font-size: 12px; color: var(--muted); }
.d-value { font-size: 13.5px; font-weight: 500; }
.detail-actions {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.detail-actions .btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 500;
  justify-content: center;
}
.detail-actions .btn:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
  color: var(--text);
  transform: translateY(-1px);
}
.act-list { max-height: 220px; overflow-y: auto; margin-top: 8px; }
.act-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed var(--border-subtle); font-size: 12.5px;
}
.act-time { color: var(--muted); font-size: 12px; }
.act-name { font-weight: 600; }

/* ---------- 现代毛玻璃胶囊 Toast 消息提示系统 ---------- */
#toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: auto;
  max-width: 90vw;
}

.toast-item {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 12px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 480px;
  word-break: break-word;
}

[data-theme="dark"] .toast-item {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.toast-item.toast-leave {
  opacity: 0;
  transform: translateY(-12px) scale(0.95);
}

.toast-item:hover {
  transform: scale(1.02);
}

.toast-icon-wrap {
  width: 22px;
  height: 22px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.toast-icon-wrap svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.toast-item.ok .toast-icon-wrap {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.toast-item.ok {
  border-left: 3px solid var(--success);
}

.toast-item.err .toast-icon-wrap,
.toast-item.error .toast-icon-wrap,
.toast-item.danger .toast-icon-wrap {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}
.toast-item.err,
.toast-item.error,
.toast-item.danger {
  border-left: 3px solid var(--danger);
}

.toast-item.warn .toast-icon-wrap,
.toast-item.warning .toast-icon-wrap {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warn);
}
.toast-item.warn,
.toast-item.warning {
  border-left: 3px solid var(--warn);
}

.toast-item.info .toast-icon-wrap {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}
.toast-item.info {
  border-left: 3px solid var(--primary);
}

.toast-msg {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.toast-close-btn {
  opacity: 0.45;
  transition: opacity 0.15s;
  cursor: pointer;
  margin-left: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close-btn:hover {
  opacity: 1;
}

@keyframes toastSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  #toast-container {
    top: calc(14px + env(safe-area-inset-top));
    max-width: 92vw;
  }
  .toast-item {
    font-size: 13px;
    padding: 8px 14px 8px 10px;
  }
}

.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
  animation: inputShake 0.35s ease-in-out !important;
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.bell {
  position: fixed; top: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 30; transition: var(--trans);
}
.bell:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.bell svg { width: 19px; height: 19px; stroke: var(--text); fill: none; stroke-width: 2; }
.bell .bell-count {
  position: absolute; top: -5px; right: -5px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.bell-drop {
  position: fixed; top: 66px; right: 22px;
  width: 380px; max-width: 92vw; max-height: 72vh;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  z-index: 80; display: flex; flex-direction: column; overflow: hidden;
  animation: toastIn 0.2s ease;
}
.bell-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.bell-list { overflow-y: auto; flex: 1; }
.notif {
  padding: 12px 18px; border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px; line-height: 1.55;
}
.notif:last-child { border-bottom: none; }
.notif.unread { background: var(--primary-soft); }
.notif .n-title { font-weight: 600; font-size: 13px; display: flex; gap: 7px; align-items: center; }
.notif .n-body { color: var(--text-secondary); margin-top: 2px; }
.notif .n-ts { color: var(--muted); font-size: 11px; margin-top: 3px; }
.n-level { font-size: 10px; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.n-level.danger { background: var(--danger-soft); color: var(--danger); }
.n-level.warn { background: var(--warn-soft); color: var(--warn); }
.n-level.info { background: var(--info-soft); color: var(--info); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }

/* ---------- 订单/收款页: 现代金融概览看板与渠道徽章 ---------- */
.pay-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.pay-sum-main {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.pay-sum-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.pay-sum-amount {
  font-size: 26px;
  font-weight: 800;
  color: var(--success);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.pay-sum-count {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 99px;
  font-weight: 500;
}
.pay-sum-channels {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.pay-filter-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.pay-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.pay-chip b { font-weight: 600; color: var(--text); }
.pay-chip.sm { font-size: 11px; padding: 2px 7px; border-radius: 4px; }
.pay-chip.c-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.pay-chip.c-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pay-chip.c-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pay-chip.c-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

.badge.t-provision { background: var(--success-soft); color: var(--success); }
.badge.t-renew { background: var(--info-soft); color: var(--info); }
.badge.t-return { background: var(--danger-soft); color: var(--danger); }
.badge.t-manual { background: var(--slate-soft); color: var(--muted); }

/* 开机卡操作按钮组通用 */
.bc-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
}

/* ============ 移动端适配 (<=900px) ============ */
@media (max-width: 900px) {
  .sidebar { display: none !important; }
  .main {
    margin-left: 0 !important;
    padding: calc(56px + env(safe-area-inset-top)) 14px calc(80px + env(safe-area-inset-bottom)) !important;
  }
  body { overflow-x: hidden; }

  /* 顶部固定栏 (毛玻璃 + 安全区) */
  .m-header {
    display: flex !important;
    position: fixed !important;
    top: 0; left: 0; right: 0;
    height: calc(50px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: var(--panel-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    align-items: center; gap: 10px;
    padding-left: 16px; padding-right: 14px;
    z-index: 80;
  }
  .m-header .m-title {
    color: var(--text);
    font-size: 16px; font-weight: 700;
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-header .m-btn {
    background: var(--bg-subtle);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex: none;
  }
  .m-header .m-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; }
  .m-header .mode-tag { font-size: 10px; padding: 2px 7px; }

  .bell {
    top: calc(env(safe-area-inset-top) + 8px); right: 54px;
    width: 34px; height: 34px;
    background: var(--bg-subtle); border-color: var(--border);
  }
  .bell svg { stroke: var(--text); width: 17px; height: 17px; }
  .bell-drop {
    top: calc(56px + env(safe-area-inset-top)); right: 12px;
    width: calc(100vw - 24px);
  }

  #view-orders > .topbar { display: none !important; }

  /* 面板标题移动端防挤压折行 */
  .panel-title {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }
  .panel-title-text {
    font-size: 15px !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
  }
  .panel-title .hint,
  .panel-title-text .hint {
    display: none !important;
  }

  /* 输入框与选择控件防溢出与移动端优化 */
  .field input, .field select, .field textarea, .lease-ctrl, .search-box input, .sel-box select {
    font-size: 14px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }
  .lease-filter {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .lease-group {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .lease-range {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .lease-range .lease-ctrl,
  .lease-range input[type="date"] {
    flex: 1 1 0% !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 8px 6px !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }
  .lease-range span.muted {
    flex: 0 0 auto !important;
    font-size: 13px !important;
    color: var(--muted) !important;
  }
  .lease-ctrl,
  #lease-customer,
  #lease-machine,
  #pay-customer,
  #lease-from,
  #lease-to,
  #pay-from,
  #pay-to {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .lease-group .sel-box {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .lease-group .sel-box select {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .lease-actions {
    margin-left: 0 !important;
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 2px !important;
  }
  .lease-actions .btn {
    flex: 1 !important;
    justify-content: center !important;
    min-height: 38px !important;
    font-size: 14px !important;
  }

  /* 移动端机器管理工具栏: 紧凑两行流 (搜索框单行, 状态下拉+数量+导出同一行) */
  #view-machines .toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px 10px !important;
    margin-bottom: 10px !important;
  }
  #view-machines .toolbar .search-box {
    width: 100% !important;
    flex: 1 1 100% !important;
    margin-bottom: 2px !important;
  }
  #view-machines .toolbar .sel-box {
    flex: 0 0 auto !important;
    min-width: 100px !important;
    max-width: 130px !important;
  }
  #view-machines .toolbar .sel-box select {
    padding: 6px 8px !important;
    font-size: 13px !important;
    height: 34px !important;
  }
  #view-machines .toolbar #machine-count {
    flex: 1 1 auto !important;
    font-size: 12px !important;
    color: var(--muted) !important;
    white-space: nowrap !important;
  }
  #view-machines .toolbar .spacer {
    display: none !important;
  }
  #view-machines .toolbar #btn-export-csv {
    margin-left: auto !important;
    flex: 0 0 auto !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    height: 34px !important;
  }

  /* 移动端快捷筛选胶囊: 严格单行丝滑横向滑动吸附条 (彻底杜绝多行挤压与排版跳跃) */
  .quick-filters {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 7px !important;
    padding: 2px 2px 6px !important;
    margin-bottom: 12px !important;
    scrollbar-width: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  }
  .quick-filters::-webkit-scrollbar { display: none !important; }
  .qfilter-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 6px 12.5px !important;
    font-size: 12.5px !important;
    border-radius: 99px !important;
  }

  /* 子选项卡与分页器移动端自适应 */
  .subtabs-bar {
    width: 100% !important;
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
    padding: 3px !important;
    scrollbar-width: none;
    box-sizing: border-box !important;
    margin-bottom: 12px !important;
  }
  .subtabs-bar::-webkit-scrollbar { display: none; }
  .subtab-btn {
    flex: 1 0 auto !important;
    padding: 7px 12px !important;
    font-size: 13px !important;
    justify-content: center !important;
  }
  .pagination-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .pagination-info {
    justify-content: center !important;
  }
  .pagination-btns {
    width: 100% !important;
    margin-left: 0 !important;
    display: flex !important;
    gap: 8px !important;
  }
  .pagination-btns .pagination-btn {
    flex: 1 !important;
    justify-content: center !important;
    min-height: 36px !important;
  }

  /* 企业微信通知管理移动端适配 (紧凑版) */
  .notify-groups-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .notify-status-strip {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  .notify-preset-group {
    display: flex !important;
    gap: 4px !important;
  }
  .notify-preset-group .btn {
    padding: 3px 6px !important;
    font-size: 11.5px !important;
    height: 26px !important;
  }

  /* 移动端顶栏精简：隐藏页面内部重复标题、搜索框与月亮图标 */
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 0;
  }
  .topbar h1,
  .topbar .cmd-trigger-btn,
  .topbar .theme-btn {
    display: none !important;
  }
  .topbar .spacer {
    display: none !important;
  }
  .topbar .btn {
    padding: 7px 12px;
    font-size: 13px;
  }

  /* 底部固定导航 */
  #mobile-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--panel-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    align-items: center;
    justify-content: space-around;
    z-index: 80;
  }
  .mnav-item {
    flex: 1; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    border: none; background: none;
    color: var(--muted); font-size: 11px;
    cursor: pointer; font-family: inherit;
    transition: var(--trans);
  }
  .mnav-item svg {
    width: 21px; height: 21px;
    stroke: currentColor; fill: none; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .mnav-item.active { color: var(--primary); font-weight: 600; }
  .mnav-item.active svg { stroke-width: 2.2; }

  /* 移动端“更多”弹层 (2x2 优雅卡片布局) */
  .m-more-sheet {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 6px 0 16px;
  }
  .m-more-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 12px;
    border-radius: 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--trans);
  }
  .m-more-card:active {
    transform: scale(0.96);
    background: var(--primary-soft);
    border-color: var(--primary);
  }
  .m-more-card svg { width: 26px; height: 26px; stroke: var(--primary); fill: none; stroke-width: 1.8; }

  /* 表格 -> 卡片流 */
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }
  .table-wrap td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border-bottom: 1px dashed var(--border-subtle);
    padding: 7px 0; white-space: normal; text-align: right;
  }
  .table-wrap td:last-child { border-bottom: none; }
  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted); font-size: 12px; flex: none; font-weight: 500;
  }
  .table-wrap .actions-cell { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  .table-wrap .actions-cell .btn { flex: 1; min-width: 68px; padding: 6px 8px; font-size: 12px; justify-content: center; }

  /* 开机卡移动端专属优化 (优雅高密度卡片流) */
  .bootcard-manager-panel .panel-title-text .hint {
    display: none !important;
  }
  #bootcard-summary-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }
  #bootcard-summary-badges .notify-status-badge {
    flex: 0 0 auto !important;
    padding: 5px 10px !important;
    font-size: 11.5px !important;
    border-radius: 99px !important;
    white-space: nowrap !important;
    font-weight: 500 !important;
  }
  #bootcard-table tbody tr {
    padding: 12px 14px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    margin-bottom: 12px !important;
    background: var(--panel) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  }
  #bootcard-table td[data-label="序号"] {
    display: none !important;
  }
  #bootcard-table td {
    padding: 6px 0 !important;
    font-size: 13px !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }
  #bootcard-table td::before {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    font-weight: 500 !important;
  }
  #bootcard-table td[data-label="绑定物理机"] {
    padding: 2px 0 8px 0 !important;
    margin-bottom: 2px !important;
    border-bottom: 1px solid var(--border) !important;
  }
  #bootcard-table td[data-label="绑定物理机"]::before {
    font-weight: 600 !important;
    color: var(--text) !important;
    font-size: 13px !important;
  }
  #bootcard-table td[data-label="操作"] {
    display: block !important;
    padding-top: 10px !important;
    padding-bottom: 2px !important;
    border-bottom: none !important;
  }
  #bootcard-table td[data-label="操作"]::before {
    display: none !important;
  }
  #bootcard-table .bc-actions {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
  }
  #bootcard-table .bc-actions .btn {
    padding: 6px 0 !important;
    font-size: 12px !important;
    text-align: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    width: 100% !important;
    border-radius: 6px !important;
    margin: 0 !important;
  }
  .bootcard-manager-panel .toolbar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .bootcard-manager-panel #bc-search {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .bootcard-manager-panel select {
    max-width: 100% !important;
    width: 100% !important;
  }
  .bootcard-manager-panel #bc-count-hint {
    grid-column: 1 / -1 !important;
    text-align: right !important;
    margin-top: -2px !important;
  }

  /* 紧凑统计表格（如收款日/月统计）：移动端保持规整紧凑表格，不撑大卡片 */
  .compact-table-wrap {
    overflow-x: auto;
    max-height: 280px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    margin-top: 8px;
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
  }
  .compact-table-wrap table {
    display: table !important;
    width: 100% !important;
    min-width: 100% !important;
    border-collapse: collapse;
  }
  .compact-table-wrap thead {
    display: table-header-group !important;
    position: sticky;
    top: 0;
    background: var(--bg-subtle);
    z-index: 2;
  }
  .compact-table-wrap thead th {
    display: table-cell !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
    color: var(--muted);
    border-bottom: 1px solid var(--border) !important;
  }
  .compact-table-wrap tbody {
    display: table-row-group !important;
  }
  .compact-table-wrap tbody tr {
    display: table-row !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .compact-table-wrap td {
    display: table-cell !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    white-space: nowrap !important;
    text-align: left;
  }
  .compact-table-wrap th.tnum,
  .compact-table-wrap td.tnum {
    text-align: right !important;
  }
  .compact-table-wrap td::before {
    display: none !important;
  }
  .compact-table-wrap tbody tr:nth-child(even) {
    background: var(--bg-subtle) !important;
  }

  /* 设置页移动端响应式优化：价格表保持横向滑动紧凑表格，杜绝垂直破屏膨胀 */
  #price-rows .table-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    background: var(--bg) !important;
    margin-top: 6px !important;
    margin-bottom: 8px !important;
    box-shadow: none !important;
  }
  #price-rows .table-wrap table {
    display: table !important;
    width: 100% !important;
    min-width: 540px !important;
    border-collapse: collapse !important;
  }
  #price-rows .table-wrap thead {
    display: table-header-group !important;
    background: var(--bg-subtle) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
  }
  #price-rows .table-wrap thead th {
    display: table-cell !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
    color: var(--muted) !important;
    white-space: nowrap !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: left !important;
  }
  #price-rows .table-wrap tbody {
    display: table-row-group !important;
  }
  #price-rows .table-wrap tbody tr {
    display: table-row !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #price-rows .table-wrap tbody tr:nth-child(even) {
    background: var(--bg-subtle) !important;
  }
  #price-rows .table-wrap td {
    display: table-cell !important;
    padding: 8px 10px !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    text-align: left !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    font-size: 13px !important;
  }
  #price-rows .table-wrap td::before {
    display: none !important;
  }

  /* 收款流水与订单台账移动端金融流卡片 */
  .pay-summary-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    border: 1px solid var(--border) !important;
    background: var(--panel) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
  }
  .pay-sum-main {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
  }
  .pay-sum-label {
    font-size: 13px !important;
    color: var(--muted) !important;
  }
  .pay-sum-amount {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: var(--success) !important;
  }
  .pay-sum-count {
    font-size: 12px !important;
    color: var(--muted) !important;
    background: var(--bg-subtle) !important;
    border: 1px solid var(--border) !important;
    padding: 2px 8px !important;
    border-radius: 99px !important;
  }
  .pay-sum-channels {
    display: flex !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    width: 100% !important;
    border-top: 1px solid var(--border-subtle) !important;
    padding-top: 8px !important;
    margin-top: 2px !important;
  }
  .pay-filter-box {
    background: var(--bg-subtle) !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
  }

  /* 移动端极简双行金融流水流卡片 (WeChat/Stripe 架构) */
  .pay-table-wrap tbody tr {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 13px 15px !important;
    margin-bottom: 10px !important;
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
  }
  .pay-table-wrap tbody tr:active {
    transform: scale(0.99) !important;
    background: var(--bg-subtle) !important;
  }
  .pay-table-wrap td.col-cust {
    order: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    max-width: 60% !important;
  }
  .pay-table-wrap td.col-mid {
    order: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 0 !important;
    margin-left: 6px !important;
  }
  .pay-table-wrap td.col-amt {
    order: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
    border: none !important;
    padding: 0 !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums !important;
  }
  .pay-table-wrap td.col-channel {
    order: 4 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 6px 0 0 !important;
  }
  .pay-table-wrap td.col-type {
    order: 5 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 6px 0 0 6px !important;
  }
  .pay-table-wrap td.col-time {
    order: 6 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 6px 0 0 8px !important;
    font-size: 12px !important;
    color: var(--muted) !important;
  }
  .pay-table-wrap td.col-act {
    order: 7 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
    border: none !important;
    padding: 6px 0 0 !important;
  }
  .pay-table-wrap td.col-act .btn {
    padding: 3px 10px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
    min-height: 26px !important;
  }
  .pay-table-wrap td.col-op,
  .pay-table-wrap td.col-notes {
    display: none !important;
  }
  .pay-table-wrap td::before {
    display: none !important;
  }

  /* 订单台账移动端极简卡片流 */
  #orders-table tbody tr {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 13px 15px !important;
    margin-bottom: 10px !important;
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  }
  #orders-table td.col-cust {
    order: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    max-width: 60% !important;
  }
  #orders-table td.col-mid {
    order: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 0 !important;
    margin-left: 6px !important;
  }
  #orders-table td.col-amt {
    order: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
    border: none !important;
    padding: 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
  }
  #orders-table td.col-type {
    order: 4 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 6px 0 0 !important;
  }
  #orders-table td.col-dur {
    order: 5 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 6px 0 0 6px !important;
    font-size: 12px !important;
    color: var(--muted) !important;
  }
  #orders-table td.col-channel {
    order: 6 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 6px 0 0 6px !important;
    font-size: 12px !important;
  }
  #orders-table td.col-time {
    order: 7 !important;
    display: inline-flex !important;
    align-items: center !important;
    border: none !important;
    padding: 6px 0 0 8px !important;
    font-size: 12px !important;
    color: var(--muted) !important;
    margin-left: auto !important;
  }
  #orders-table td.col-notes {
    display: none !important;
  }
  #orders-table td::before {
    display: none !important;
  }

  /* 弹窗 -> 底部抽屉与手势 */
  .modal-mask { align-items: flex-end; z-index: 1000; }
  .modal, .modal-wide {
    width: 100%; max-width: 100vw;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .modal-mask.show .modal { transform: translateY(0); }
  .modal.dragging { transition: none !important; }
  .modal-handle-bar {
    width: 40px; height: 5px; border-radius: 99px;
    background: var(--muted); opacity: 0.4;
    margin: 10px auto 4px;
    cursor: grab;
  }

  .modal-head { padding: 14px 18px; }
  .form-grid { grid-template-columns: 1fr; }

  /* 移动端仪表盘「登记开通」2 列紧凑高效网格 */
  .register-panel {
    padding: 14px 14px !important;
  }
  .register-panel .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px 10px !important;
  }
  .register-panel .field.field-full,
  .register-panel .form-grid > .field:first-child {
    grid-column: 1 / -1 !important;
  }
  .register-panel .field label {
    font-size: 11.5px !important;
    color: var(--muted) !important;
    margin-bottom: 3px !important;
    white-space: nowrap !important;
  }
  .register-panel .field input,
  .register-panel .field select {
    padding: 6px 8px !important;
    font-size: 13.5px !important;
    height: 38px !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .register-panel .toolbar {
    margin-top: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .register-panel .toolbar .btn.reg2-btn {
    width: 100% !important;
    min-height: 42px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    justify-content: center !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25) !important;
  }
  .register-panel .toolbar .spacer {
    display: none !important;
  }
  .modal-foot .btn { flex: 1; justify-content: center; }
  .detail-actions { grid-template-columns: repeat(2, 1fr); }
  .detail-actions .btn { min-height: 42px; padding: 8px 6px; }
  .detail-grid { grid-template-columns: 1fr 1fr; padding: 14px; }
  .d-item.d-span { grid-column: 1 / -1; }
  .act-row { flex-wrap: wrap; gap: 2px 10px; }
  .act-time { flex-basis: 100%; font-size: 11px; }
  .act-detail { flex: 1 1 100%; }

  .search-box { flex: 1 1 100%; max-width: none; min-width: 0; }
  .sel-box { flex: 1 1 46%; }
  .sel-box select { min-width: 0; padding-top: 10px; padding-bottom: 10px; font-size: 16px; }

  .panel { padding: 16px; width: 100%; box-sizing: border-box; }
  .dash-subgrid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
    width: 100%;
    min-width: 0;
  }
  .table-wrap.traffic,
  .table-wrap.cpu {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap.traffic table,
  .table-wrap.cpu table {
    width: 100%;
    min-width: 100%;
  }
  .table-wrap.traffic td,
  .table-wrap.cpu td {
    padding: 8px 0;
    font-size: 13px;
  }
  .dash-exp-row {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: unset !important;
    gap: 6px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    border-radius: 9px !important;
  }
  .dash-exp-main {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
  }
  .dash-exp-main .mid-link {
    font-size: 14.5px !important;
    font-weight: 700 !important;
  }
  .dash-exp-main .cust {
    font-size: 12px !important;
    color: var(--text-secondary) !important;
    max-width: 180px !important;
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .dash-exp-right {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding-top: 5px !important;
    border-top: 1px dashed var(--border-subtle) !important;
    gap: 6px !important;
  }
  .dash-exp-date {
    font-size: 11.5px !important;
    color: var(--muted) !important;
  }
  .host-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cards .card { padding: 12px 14px; }
  .cards .card-value { font-size: 19px; }
  #customer-cards { grid-template-columns: 1fr; }
  .cust-card .cm-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .cust-card .cm-main { justify-content: space-between; }
  .cust-card .cm-actions { width: 100%; display: flex; gap: 8px; }
  .cust-card .cm-actions .btn { flex: 1; justify-content: center; min-height: 38px; }
  .stat-num { min-height: 44px; }
  .month-strip { gap: 18px; padding: 14px 16px; }
  .month-strip .card-value { font-size: 19px; }

}

@media (min-width: 901px) {
  .m-header, #mobile-nav { display: none !important; }
}

/* 返回顶部 (移动端) */
#back-top {
  display: flex; position: fixed; right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  width: 40px; height: 40px; border-radius: 99px;
  background: var(--primary); color: #fff; border: none;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
  z-index: 60; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; cursor: pointer;
}
#back-top.show { opacity: 1; pointer-events: auto; }
#back-top:active { transform: scale(0.92); }
#back-top svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }

/* ---------- 登录页设计 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 60%, #090d16 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.login-card {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 36px 32px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 30px rgba(99, 102, 241, 0.2);
  position: relative;
  z-index: 2;
}
[data-theme="dark"] .login-card {
  background: #131b2e;
  border-color: #1e293b;
}
.login-card .logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}
.login-card h1 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}
[data-theme="dark"] .login-card h1 {
  color: #f8fafc;
}
.login-card .sub {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 24px;
}
[data-theme="dark"] .login-card .sub {
  color: #94a3b8;
}
.login-card .field {
  margin-bottom: 16px;
}
.login-card .field input {
  height: 44px;
  font-size: 14.5px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  width: 100%;
}
.login-card .btn {
  width: 100%;
  height: 44px;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  margin-top: 4px;
}

/* ===== 设置页 Tab 导航 (Plan B) ===== */
.settings-tabs { margin-top: 16px; }
.tab-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px; background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: var(--radius);
  flex-wrap: wrap;
}
.tab-bar .spacer { flex: 1; }
.tab {
  border: none; background: transparent; cursor: pointer;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.tab:hover { background: var(--primary-soft); color: var(--text); }
.tab.active { background: var(--panel); color: var(--primary); box-shadow: var(--shadow-sm); }
.tab-save { margin-left: 8px; }

/* 设置面板底部保存操作条 */
.panel-save-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
}
.panel-save-footer .btn {
  min-width: 130px;
  height: 38px;
  font-size: 13.5px;
  font-weight: 600;
  justify-content: center;
}

/* ===== 宽带资源池桌面端与通用组件 ===== */
.bb-mobile-card-list {
  display: none;
}
.broadband-desktop-table-wrap {
  display: block;
}
.bb-acc-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bb-acc-text {
  font-family: monospace;
  font-weight: 700;
  font-size: 13.5px;
}
.bb-select-bridge {
  padding: 4px 6px;
  font-size: 12px;
  width: 95px;
}
.bb-input-max {
  width: 65px;
  padding: 4px 6px;
  font-size: 12px;
}
.bb-input-notes {
  width: 110px;
  padding: 4px 6px;
  font-size: 12px;
}
.bb-mids-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.bb-vm-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: monospace;
  font-weight: 700;
  font-size: 11.5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px 1px 6px;
  color: var(--primary);
  transition: all 0.15s ease;
  line-height: 1.4;
  margin: 1px;
}
.bb-chip-mid {
  cursor: pointer;
}
.bb-chip-mid:hover {
  text-decoration: underline;
}
.bb-chip-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  margin-left: 2px;
  transition: all 0.15s ease;
}
.bb-chip-del:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  font-weight: bold;
}
.bb-bind-btn {
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px dashed var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
  height: 22px;
  display: inline-flex;
  align-items: center;
}
.bb-bind-btn:hover {
  background: var(--primary);
  color: #fff;
}
.bb-status-strip {
  margin-bottom: 12px;
}
.bb-summary-grid {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  flex-wrap: wrap;
}
.bb-hint-box {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ===== 移动端设置页与宽带池现代超紧凑卡片化 (<=900px) ===== */
@media (max-width: 900px) {
  #view-settings > .topbar {
    display: none !important;
  }

  /* 设置 Tab 导航条横向单行顺滑滚动 */
  .settings-tabs {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    position: sticky !important;
    top: calc(50px + env(safe-area-inset-top)) !important;
    z-index: 35 !important;
    background: var(--bg) !important;
    padding: 4px 0 !important;
  }
  .settings-tabs .tab-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
    padding: 3px !important;
    background: var(--bg-subtle) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    scrollbar-width: none !important;
  }
  .settings-tabs .tab-bar::-webkit-scrollbar {
    display: none !important;
  }
  .settings-tabs .tab {
    flex: 0 0 auto !important;
    padding: 6px 13px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    color: var(--muted) !important;
    text-align: center !important;
  }
  .settings-tabs .tab.active {
    background: var(--panel) !important;
    color: var(--primary) !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .settings-tabs .tab-bar .spacer,
  .settings-tabs .tab-save {
    display: none !important;
  }

  /* 面板底部保存按钮自适应 */
  .panel-save-footer {
    display: flex !important;
    width: 100% !important;
    margin-top: 14px !important;
    padding-top: 12px !important;
  }
  .panel-save-footer .btn {
    width: 100% !important;
    height: 38px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    border-radius: 9px !important;
  }

  /* 宽带池面板标题与按钮 */
  .broadband-panel-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }
  .broadband-panel-header .panel-title-text {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    white-space: normal !important;
    line-height: 1.3 !important;
  }
  .broadband-actions-group {
    display: flex !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .broadband-actions-group .btn {
    flex: 1 !important;
    height: 32px !important;
    font-size: 12px !important;
    justify-content: center !important;
  }

  /* 汇总统计微型 3 列网格 */
  .bb-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .bb-summary-grid .notify-status-badge {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 2px !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
  .bb-hint-box {
    font-size: 11px !important;
    line-height: 1.35 !important;
    margin-top: 4px !important;
  }

  /* 切换桌面端表格与移动端卡片流 */
  .broadband-desktop-table-wrap {
    display: none !important;
  }
  .bb-mobile-card-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 6px !important;
  }

  /* 移动端专属高密度超紧凑卡片 (单张卡片仅 65-90px 高) */
  .bb-m-card {
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  }
  .bb-m-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-bottom: 5px !important;
    border-bottom: 1px dashed var(--border-subtle) !important;
  }
  .bb-m-acc {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }
  .bb-m-num {
    font-family: monospace !important;
    font-weight: 700 !important;
    font-size: 13.5px !important;
    color: var(--text) !important;
  }
  .bb-m-head-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .bb-m-toggle {
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
  }
  .bb-m-del-btn {
    border: none !important;
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 5px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: background 0.15s ease !important;
  }
  .bb-m-del-btn:hover {
    background: rgba(239, 68, 68, 0.25) !important;
  }

  /* 3 项微表单网格单行并排 */
  .bb-m-grid {
    display: grid !important;
    grid-template-columns: 82px 64px 1fr !important;
    gap: 5px !important;
    align-items: center !important;
  }
  .bb-m-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
  }
  .bb-m-lbl {
    font-size: 10px !important;
    color: var(--muted) !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
  }
  .bb-m-sel,
  .bb-m-inp {
    width: 100% !important;
    height: 28px !important;
    font-size: 12px !important;
    padding: 2px 5px !important;
    border-radius: 6px !important;
    background: var(--bg-subtle) !important;
    border: 1px solid var(--border) !important;
    box-sizing: border-box !important;
  }

  /* 占用机器标签气泡 */
  .bb-m-mids {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 3px 6px !important;
    background: var(--bg-subtle) !important;
    border-radius: 6px !important;
    font-size: 11px !important;
  }
  .bb-m-mids-lbl {
    color: var(--muted) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 10.5px !important;
    line-height: 1.6 !important;
  }
  .bb-m-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 3px !important;
  }
  .bb-m-add-chip {
    display: inline-flex !important;
    align-items: center !important;
    padding: 1px 5px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
    border: 1px dashed var(--primary) !important;
    cursor: pointer !important;
    line-height: 1.3 !important;
  }

  /* 占用机器标签气泡 */
  .bb-m-mids {
    display: flex !important;
    align-items: flex-start !important;
    gap: 4px !important;
    padding: 3px 6px !important;
    background: var(--bg-subtle) !important;
    border-radius: 6px !important;
    font-size: 11px !important;
  }
  .bb-m-mids-lbl {
    color: var(--muted) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 10.5px !important;
    line-height: 1.6 !important;
  }
  .bb-m-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
  }
}

/* ==================== 应急容灾接管向导样式 ==================== */
.dr-step-item {
  transition: all 0.2s ease;
  cursor: default;
}
.dr-step-item.active {
  background: var(--primary-soft, rgba(99, 102, 241, 0.1)) !important;
  color: var(--primary, #6366f1) !important;
  border-left: 4px solid var(--primary, #6366f1) !important;
  opacity: 1 !important;
}
.badge.good {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.badge.warn {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.badge.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* ===== [mixvpn] 混拨面板分组：把三段各自封成卡片，避免整页平铺成一堆控件 ===== */
.mx-section {
  margin-top: 14px;
  padding: 12px 14px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mx-section > .panel-title-text { margin: 0 0 4px; font-size: 14px; }
.mx-section .table-wrap {
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mx-section table { table-layout: fixed; }
.mx-section select, .mx-section input[type="text"] { max-width: 100%; min-width: 0; }
.mx-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.mx-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  white-space: normal;
}
/* 定宽列里放不下的长内容（机器号列表等）压成一行，别让行高忽高忽低 */
.mx-cell-sub {
  display: block;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
