/* ==========================================================================
   UBT 在线客户端管理平台 — 设计系统
   深色科技感风格：深海军蓝背景 + 蓝青渐变主色 + 卡片 + 圆角 + 轻阴影
   纯本地实现，无外部字体/图片/CDN 依赖。
   ========================================================================== */

:root {
  --bg: #060b18;
  --bg-2: #081020;
  --panel: #0e1830;
  --panel-2: #122040;
  --panel-3: #16264a;
  --panel-hover: #172c50;
  --border: rgba(125, 165, 255, 0.14);
  --border-strong: rgba(125, 165, 255, 0.3);

  --text: #e8eefc;
  --text-2: #b9c8e2;
  --muted: #8296ba;
  --muted-2: #64789c;

  --primary: #38bdf8;
  --primary-2: #22d3ee;
  --primary-strong: #0ea5e9;
  --gradient: linear-gradient(135deg, #3b82f6 0%, #22d3ee 100%);
  --gradient-soft: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(34, 211, 238, 0.14) 100%);

  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --yellow: #fbbf24;
  --yellow-soft: rgba(251, 191, 36, 0.14);
  --purple: #a78bfa;

  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --shadow: 0 10px 30px rgba(2, 8, 23, 0.45);
  --shadow-lg: 0 24px 80px rgba(2, 8, 23, 0.65);
  --shadow-glow: 0 0 0 1px rgba(56, 189, 248, 0.18), 0 12px 40px rgba(14, 165, 233, 0.12);

  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono",
    "Courier New", monospace;

  --topbar-h: 62px;
}

/* ------------------------------- 基础重置 -------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(37, 99, 235, 0.22), transparent 62%),
    radial-gradient(760px 460px at 92% -12%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(820px 620px at 50% 118%, rgba(37, 99, 235, 0.1), transparent 62%),
    var(--bg);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-2);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

code,
pre,
.mono {
  font-family: var(--mono);
}

::selection {
  background: rgba(56, 189, 248, 0.32);
  color: #fff;
}

:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.7);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.muted {
  color: var(--muted);
}

.text-right {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 130, 185, 0.45) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 130, 185, 0.4);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(130, 160, 220, 0.6);
  background-clip: content-box;
}

/* ------------------------------- 布局容器 -------------------------------- */

.container {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 26px 40px;
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
}

.section-gap {
  margin-top: 18px;
}

/* -------------------------------- 顶栏 ---------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: rgba(7, 13, 28, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-inner {
  height: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 26px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--gradient);
  color: #04101f;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-spacer {
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-right: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(18, 32, 64, 0.6);
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
}

.admin-chip .avatar {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient);
  color: #06121f;
  font-size: 12px;
  font-weight: 700;
}

/* -------------------------------- 按钮 ---------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    box-shadow 0.16s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--gradient);
  color: #041220;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.28);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  color: #041220;
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.36);
}

.btn-ghost {
  border-color: var(--border);
  background: rgba(18, 32, 64, 0.45);
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: rgba(24, 44, 82, 0.72);
  color: var(--text);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.24);
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.07);
  color: #fff;
}

.btn-danger-ghost {
  border-color: rgba(248, 113, 113, 0.36);
  background: var(--red-soft);
  color: #fca5a5;
}

.btn-danger-ghost:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.22);
  color: #fecaca;
}

.btn-sm {
  min-height: 30px;
  padding: 5px 11px;
  font-size: 12.5px;
  border-radius: var(--radius-xs);
}

.btn-xs {
  min-height: 26px;
  padding: 3px 9px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

.btn-block {
  width: 100%;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.8;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: ubt-spin 0.7s linear infinite;
  vertical-align: -2px;
}

@keyframes ubt-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------- 统计卡片 -------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(19, 34, 66, 0.92), rgba(12, 22, 44, 0.92));
  box-shadow: var(--shadow);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -52px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--gradient-soft);
  filter: blur(2px);
  pointer-events: none;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gradient);
  opacity: 0.9;
}

.stat-card.tone-green::before {
  background: linear-gradient(180deg, #34d399, #10b981);
}

.stat-card.tone-red::before {
  background: linear-gradient(180deg, #f87171, #ef4444);
}

.stat-card.tone-purple::before {
  background: linear-gradient(180deg, #a78bfa, #6366f1);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.stat-icon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.stat-card.tone-green .stat-icon {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14);
}

.stat-card.tone-red .stat-icon {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
}

.stat-card.tone-purple .stat-icon {
  background: var(--purple);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.14);
}

.stat-value {
  margin-top: 9px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}

.stat-card.tone-green .stat-value {
  color: #6ee7b7;
}

.stat-card.tone-red .stat-value {
  color: #fca5a5;
}

.stat-card.tone-purple .stat-value {
  color: #c4b5fd;
}

.stat-value.is-online {
  color: #6ee7b7;
}

.stat-value.is-offline {
  color: #94a3b8;
}

.modal-note code,
.field-hint code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(125, 165, 255, 0.1);
  color: #7dd3fc;
  font-family: var(--mono);
  font-size: 11.5px;
}

.stat-foot {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 12px;
}

/* -------------------------------- 工具栏 --------------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(14, 24, 48, 0.72);
  box-shadow: var(--shadow);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-spacer {
  flex: 1;
  min-width: 8px;
}

.toolbar .search-box {
  flex: 1 1 260px;
  max-width: 380px;
  min-width: 200px;
}

.last-updated {
  color: var(--muted-2);
  font-size: 12px;
  white-space: nowrap;
}

/* ------------------------------ 表单控件 --------------------------------- */

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 12px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(8, 16, 34, 0.82);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.62);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
  background: rgba(9, 18, 38, 0.95);
}

.input[readonly] {
  color: var(--text-2);
  background: rgba(8, 14, 28, 0.6);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.select option {
  background: #0d1932;
  color: var(--text);
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label,
.field-label {
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.field .required {
  color: var(--red);
  margin-left: 2px;
}

.field .field-hint {
  color: var(--muted-2);
  font-size: 11.5px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .field-full {
  grid-column: 1 / -1;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: #fecaca;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.form-error::before {
  content: "!";
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.85);
  color: #2a0606;
  font-size: 11px;
  font-weight: 800;
}

.copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.copy-row .input {
  flex: 1;
  font-family: var(--mono);
  font-size: 12.5px;
}

.copy-row .btn {
  flex: 0 0 auto;
}

/* -------------------------------- 卡片 ---------------------------------- */

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(14, 24, 48, 0.72);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.card-title::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: var(--gradient);
}

.card-sub {
  color: var(--muted);
  font-size: 12.5px;
}

.card-body {
  padding: 18px;
}

/* -------------------------------- 表格 ---------------------------------- */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(12, 21, 42, 0.78);
  box-shadow: var(--shadow);
  overflow: auto;
}

.table-wrap.is-refreshing {
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.table-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
}

.table-title .count-badge {
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1020px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 29, 56, 0.96);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-align: left;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(125, 165, 255, 0.08);
  color: var(--text-2);
  font-size: 13px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.14s ease;
}

.data-table tbody tr:hover {
  background: rgba(24, 44, 82, 0.5);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr.is-offline {
  background: rgba(10, 17, 34, 0.28);
}

.data-table tbody tr.is-offline:hover {
  background: rgba(20, 36, 68, 0.5);
}

.cell-no {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.cell-no .no-label {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 400;
}

.cell-name {
  color: var(--text);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-region {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-host {
  min-width: 190px;
  max-width: 260px;
  font-size: 12px;
  line-height: 1.5;
}

.host-line {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-line + .host-line {
  margin-top: 2px;
  color: var(--muted-2);
}

.host-line .host-key {
  color: var(--muted-2);
  flex: 0 0 auto;
}

.host-line .host-val {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-heartbeat {
  min-width: 150px;
  font-size: 12px;
  line-height: 1.55;
}

.hb-line {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.hb-relative {
  color: var(--text-2);
}

.hb-duration {
  color: var(--muted-2);
}

.hb-duration strong {
  color: var(--green);
  font-weight: 600;
}

tr.is-offline .hb-duration strong {
  color: var(--muted);
}

.cell-remark {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.cell-actions {
  white-space: nowrap;
  text-align: right;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

tr.is-offline [data-testid="btn-terminal"] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 状态点 */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-2);
  vertical-align: middle;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: ubt-pulse 2.1s ease-out infinite;
}

.status-dot.offline {
  background: #5b6b88;
}

.status-text {
  font-size: 13px;
  font-weight: 600;
}

.status-text.online {
  color: #6ee7b7;
}

.status-text.offline {
  color: var(--muted);
}

@keyframes ubt-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

/* 线路标签 */
.line-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(125, 165, 255, 0.08);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.line-tag.line-dianxin {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.line-tag.line-liantong {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.line-tag.line-yidong {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.line-tag.line-haiwai {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.12);
  color: #c4b5fd;
}

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-online {
  border-color: rgba(52, 211, 153, 0.32);
  background: var(--green-soft);
  color: #6ee7b7;
}

.badge-offline {
  border-color: var(--border);
  background: rgba(125, 165, 255, 0.07);
  color: var(--muted);
}

.badge-current {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.badge-warn {
  border-color: rgba(251, 191, 36, 0.34);
  background: var(--yellow-soft);
  color: #fcd34d;
}

/* 空状态 / 加载态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 52px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state .empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px dashed var(--border-strong);
  background: rgba(125, 165, 255, 0.06);
  color: var(--muted);
  font-size: 22px;
}

.empty-state .empty-title {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

.empty-state .empty-desc {
  font-size: 12.5px;
  color: var(--muted-2);
}

.empty-row td {
  padding: 0 !important;
  border-bottom: none !important;
}

.loading-row td {
  padding: 34px 16px !important;
  text-align: center;
  color: var(--muted);
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.loading-inline .spinner {
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.25);
  border-top-color: var(--primary);
}

/* -------------------------------- 分页 ---------------------------------- */

.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  color: var(--muted);
  font-size: 12.5px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: rgba(18, 32, 64, 0.5);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--border-strong);
  background: rgba(24, 44, 82, 0.8);
  color: var(--text);
}

.page-btn.active {
  border-color: transparent;
  background: var(--gradient);
  color: #041220;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--muted-2);
  padding: 0 2px;
}

/* -------------------------------- 弹窗 ---------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
  animation: ubt-fade-in 0.16s ease;
}

.modal {
  width: 100%;
  max-width: 560px;
  margin: auto;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, #101c36 0%, #0c1529 100%);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(56, 189, 248, 0.06);
  animation: ubt-slide-up 0.2s ease;
}

.modal.modal-sm {
  max-width: 430px;
}

.modal.modal-lg {
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.modal-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--gradient);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close:hover {
  border-color: var(--border);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.modal-footer .footer-left {
  margin-right: auto;
}

.modal-note {
  margin-top: 14px;
  padding: 10px 13px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.08);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.6;
}

.modal-note.warn {
  border-color: rgba(251, 191, 36, 0.28);
  background: var(--yellow-soft);
  color: #fde68a;
}

.danger-zone {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.danger-zone .danger-text {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.danger-zone .danger-text strong {
  display: block;
  color: #fca5a5;
  font-size: 13px;
  margin-bottom: 2px;
}

/* 密钥/明文结果 */
.secret-value {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed rgba(52, 211, 153, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.07);
  color: #a7f3d0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
  user-select: all;
}

.code-block {
  margin: 0;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(4, 10, 22, 0.85);
  color: #cbd5f5;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

.code-block .code-var {
  color: #7dd3fc;
}

.copy-block {
  position: relative;
}

.copy-block .code-block {
  padding-right: 76px;
  padding-top: 14px;
}

.copy-block .code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* 一键安装命令：单行显示、可横向滚动、可整段选中 */
.install-command-text {
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  user-select: all;
  font-size: 12.5px;
  line-height: 1.7;
}

.install-command-text:empty::before {
  content: "（命令生成中…）";
  color: var(--muted-2);
}

.info-list {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}

.info-list dt {
  color: var(--muted);
  font-size: 12.5px;
}

.info-list dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-family: var(--mono);
  word-break: break-all;
}

.info-list dd.plain {
  font-family: var(--font);
}

/* 客户端密码提示 pill */
.terminal-password-tip {
  margin-bottom: 14px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.7;
}

.client-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
}

/* 确认弹窗 */
.confirm-overlay {
  z-index: 200;
}

.confirm-body {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-line;
  word-break: break-word;
}

.confirm-body strong {
  color: var(--text);
}

/* -------------------------------- Toast --------------------------------- */

.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(14, 26, 50, 0.96);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: ubt-toast-in 0.22s ease;
  word-break: break-word;
}

.toast::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.4);
}

.toast.success::before {
  background: var(--green);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.42);
}

.toast.error::before {
  background: var(--red);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.7);
}

.toast.info::before {
  background: var(--primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

.toast.is-leaving {
  animation: ubt-toast-out 0.18s ease forwards;
}

@keyframes ubt-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes ubt-slide-up {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ubt-toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ubt-toast-out {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

/* ------------------------------ 页面标题区 ------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-head-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.back-link:hover {
  color: var(--primary);
}

.page-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.25;
}

.page-sub {
  color: var(--muted);
  font-size: 12.5px;
}

/* ------------------------------ 登录页面 -------------------------------- */

body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.login-main::before,
.login-main::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(10px);
}

.login-main::before {
  width: 560px;
  height: 560px;
  left: -160px;
  top: -180px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 68%);
}

.login-main::after {
  width: 620px;
  height: 620px;
  right: -200px;
  bottom: -260px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 68%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 408px;
  padding: 34px 34px 26px;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: linear-gradient(170deg, rgba(19, 34, 66, 0.96), rgba(10, 18, 36, 0.97));
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(56, 189, 248, 0.05);
}

.login-card::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--primary-2), transparent);
  opacity: 0.9;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.login-logo {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--gradient);
  color: #04101f;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 14px 34px rgba(14, 165, 233, 0.4);
}

.login-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.login-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.login-form {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-form .input {
  min-height: 44px;
  font-size: 14px;
  background: rgba(7, 14, 30, 0.9);
}

.login-submit {
  min-height: 44px;
  margin-top: 4px;
  font-size: 14.5px;
  letter-spacing: 1px;
}

.login-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 11.5px;
}

.login-version {
  font-family: var(--mono);
}

/* ------------------------------- 终端页面 -------------------------------- */

.terminal-overlay {
  padding: 0;
  background: rgba(2, 6, 16, 0.9);
  z-index: 150;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

.terminal-overlay.open {
  display: flex;
}

.terminal-window {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #050a14;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17, 29, 56, 0.98), rgba(12, 21, 42, 0.98));
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.terminal-client-label {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.terminal-client-name {
  color: var(--muted);
  font-size: 12.5px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-conn-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(125, 165, 255, 0.08);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.terminal-conn-state.connecting {
  border-color: rgba(251, 191, 36, 0.34);
  background: var(--yellow-soft);
  color: #fcd34d;
}

.terminal-conn-state.connected {
  border-color: rgba(52, 211, 153, 0.4);
  background: var(--green-soft);
  color: #6ee7b7;
}

.terminal-conn-state.disconnected {
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--red-soft);
  color: #fca5a5;
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.terminal-hint {
  color: var(--muted-2);
  font-size: 11.5px;
  margin-right: 4px;
}

.terminal-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 10px 8px 8px 14px;
  background: #050a14;
}

.terminal-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.terminal-container .xterm {
  height: 100%;
  padding: 2px 0;
}

.terminal-container .xterm-viewport {
  background: transparent !important;
}

.terminal-container .xterm-screen {
  height: 100%;
}

.terminal-overlay-msg {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: rgba(4, 9, 20, 0.82);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  text-align: center;
}

.terminal-overlay-msg .msg-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.terminal-overlay-msg .msg-desc {
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
}

.terminal-overlay-msg .msg-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ------------------------------ 记录页/密钥页 ---------------------------- */

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

.summary-card .stat-value {
  font-size: 24px;
}

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(14, 24, 48, 0.72);
  box-shadow: var(--shadow);
}

.filter-bar .field {
  min-width: 150px;
  flex: 0 1 190px;
}

.filter-bar .field.field-wide {
  flex: 0 1 260px;
}

.filter-bar .filter-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  flex-wrap: wrap;
}

.keys-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.keys-info-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.keys-info-card .card-title::before {
  background: linear-gradient(180deg, #a78bfa, #6366f1);
}

.kv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.kv-row .kv-key {
  color: var(--muted);
  min-width: 88px;
}

.kv-row .kv-val {
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  word-break: break-all;
}

.hint-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.hint-list li {
  position: relative;
  padding-left: 16px;
}

.hint-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.key-prefix {
  font-family: var(--mono);
  color: var(--text-2);
  font-size: 12.5px;
}

/* ------------------------------- 页脚 ---------------------------------- */

.page-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: 11.5px;
}

.page-footer .mono {
  color: var(--muted);
}

/* ------------------------------- 响应式 --------------------------------- */

@media (max-width: 1180px) {
  .stats-grid,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .keys-info-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .container {
    padding: 16px 14px 30px;
  }

  .topbar {
    height: auto;
    min-height: var(--topbar-h);
  }

  .topbar-inner {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-chip {
    display: none;
  }

  .page-title {
    font-size: 20px;
  }

  .filter-bar,
  .toolbar {
    align-items: stretch;
  }

  .filter-bar .field,
  .toolbar .search-box {
    flex: 1 1 100%;
    max-width: none;
  }

  .filter-bar .filter-actions {
    margin-left: 0;
    width: 100%;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal {
    max-width: none;
  }

  .terminal-hint {
    display: none;
  }
}

@media (max-width: 620px) {
  .stats-grid,
  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-value {
    font-size: 26px;
  }

  .login-card {
    padding: 26px 22px 20px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .info-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px 0;
  }

  .info-list dd {
    margin-bottom: 8px;
  }

  .terminal-actions .btn {
    padding: 5px 9px;
    font-size: 12px;
  }

  .terminal-client-name {
    display: none;
  }

  .copy-row {
    flex-direction: column;
  }
}

/* ---------------------------- 闲置带宽（v1.2） ---------------------------- */

.idle-status-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.idle-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 12px;
}

.idle-status-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(8, 16, 34, 0.55);
}

.idle-status-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.idle-status-value {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.idle-status-value.mono {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

.idle-status-sub {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.idle-disabled-hint {
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(251, 191, 36, 0.32);
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  color: #fde68a;
  font-size: 12.5px;
  line-height: 1.65;
}

.modal-body .idle-disabled-hint {
  margin-top: 0;
  margin-bottom: 14px;
}

.idle-config-guide {
  margin-top: 16px;
  padding: 15px 17px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.05);
}

.idle-guide-title {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
}

.idle-config-guide .code-block {
  max-height: 260px;
  overflow: auto;
}

.idle-config-guide .hint-list {
  margin-top: 12px;
}

.mode-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(8, 16, 34, 0.55);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.mode-option input {
  margin: 0;
  accent-color: #22d3ee;
  flex: 0 0 auto;
}

.mode-option:hover {
  border-color: var(--border-strong);
}

.mode-option.is-active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.1);
  color: var(--text);
}

.idle-table {
  min-width: 1320px;
}

.idle-node-name {
  color: var(--text);
  font-weight: 600;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idle-device-id {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}

.idle-report-state {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.4;
}

.idle-report-fail {
  color: #fca5a5;
  font-weight: 700;
  cursor: help;
}

.idle-row-off {
  background: rgba(10, 17, 34, 0.3);
}

.idle-row-off .cell-no,
.idle-row-off .cell-name {
  color: var(--text-2);
}

@media (max-width: 900px) {
  .idle-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-switch {
    flex-direction: column;
  }

  .idle-table {
    min-width: 1180px;
  }
}

@media (max-width: 620px) {
  .idle-status-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

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