/**
 * Probe 现代企业风主题（加载于 style.min.css 之后）
 * 风格：简约 · 企业化 · 靛蓝主色 · 柔和徽章
 */

:root {
  --bs-primary: #4361ee;
  --bs-primary-rgb: 67, 97, 238;
  --bs-primary-hover: #3451d1;
  --bs-success: #12b76a;
  --bs-success-rgb: 18, 183, 106;
  --bs-success-hover: #0ea15d;
  --bs-danger: #f04438;
  --bs-danger-rgb: 240, 68, 56;
  --bs-danger-hover: #d9382d;
  --bs-warning: #f79009;
  --bs-warning-rgb: 247, 144, 9;
  --bs-warning-hover: #e08308;
  --bs-info: #0ba5ec;
  --bs-info-rgb: 11, 165, 236;
  --bs-info-hover: #0994d3;
  --bs-body-bg: #f5f7fb;
  --probe-text: #344054;
  --probe-text-light: #667085;
  --probe-border: #eef0f4;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, system-ui, sans-serif;
  color: var(--probe-text);
  background-color: #f5f7fb;
}

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

/* ---------- 卡片 ---------- */
.card {
  border: 1px solid var(--probe-border);
  border-radius: 8px;
  box-shadow: none;
  margin-bottom: 24px;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #f0f2f5;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0 !important;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1d2939;
  margin: 0;
}
.card-body { padding: 20px; }

/* ---------- 表格 ---------- */
.table thead th {
  background: transparent;
  color: var(--probe-text-light);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .02em;
  border-bottom: 1px solid #eef0f3;
  padding: 10px 12px;
  white-space: nowrap;
}
.table tbody td {
  padding: 12px;
  vertical-align: middle;
  font-size: 13.5px;
  border-color: #f2f4f7;
}
.table-hover tbody tr:hover { background: #f8faff; }
.table tbody tr.row-offline { background: #fff7f7; }
.table tbody tr.row-offline:hover { background: #fff0f0; }

/* ---------- 按钮 ---------- */
.btn { border-radius: 6px; font-weight: 500; }
.btn-sm { border-radius: 5px; }
.btn-primary { box-shadow: none; }

/* ---------- 表单 ---------- */
.form-control, .form-select { border-radius: 6px; border-color: #dde1e8; }
.form-control:focus, .form-select:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, .12);
}
.form-label { font-weight: 500; color: #475467; }

/* ---------- 弹窗 / 下拉 ---------- */
.modal-content { border: none; border-radius: 10px; box-shadow: 0 20px 60px rgba(16, 24, 40, .2); }
.dropdown-menu {
  border: 1px solid var(--probe-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .1);
}

/* ---------- 徽章（软色） ---------- */
.badge {
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
}
.badge-soft-primary   { color: #3538cd; background: #eef2ff; }
.badge-soft-success   { color: #027a48; background: #ecfdf3; }
.badge-soft-danger    { color: #b42318; background: #fef3f2; }
.badge-soft-warning   { color: #b54708; background: #fffaeb; }
.badge-soft-info      { color: #026aa2; background: #f0f9ff; }
.badge-soft-secondary { color: #475467; background: #f2f4f7; }

/* 状态呼吸圆点 */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}
.dot-success { background: #12b76a; animation: pulse-success 2s ease-out infinite; }
.dot-danger  { background: #f04438; animation: pulse-danger 1.6s ease-out infinite; }
.dot-muted   { background: #98a2b3; }
@keyframes pulse-success {
  0%   { box-shadow: 0 0 0 0 rgba(18, 183, 106, .45); }
  70%  { box-shadow: 0 0 0 6px rgba(18, 183, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}
@keyframes pulse-danger {
  0%   { box-shadow: 0 0 0 0 rgba(240, 68, 56, .45); }
  70%  { box-shadow: 0 0 0 6px rgba(240, 68, 56, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 68, 56, 0); }
}

/* ---------- 侧边栏 ---------- */
.lyear-layout-sidebar {
  background: #fff;
  border-right: 1px solid var(--probe-border);
  box-shadow: none !important;
}
.sidebar-header {
  background: #fff;
  box-shadow: none !important;
  border-bottom: 1px solid var(--probe-border);
  text-align: center;
}
.sidebar-header a {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-main { padding-top: 10px; }
.nav-drawer li a { color: #475467; transition: color .15s, background .15s; }
.nav-drawer > li > a { border-right: none; margin: 2px 10px; border-radius: 6px; }
.nav-drawer > li > a:hover { background: #f5f8ff; color: var(--bs-primary); }
.nav-drawer > li > a:hover > i { color: var(--bs-primary); }
.nav-drawer > li.active > a {
  background: #eef2ff !important;
  color: var(--bs-primary);
  font-weight: 600;
}
.nav-drawer > li.active > a > i { color: var(--bs-primary); }
.nav-drawer li a > i { font-size: 17px; }

/* 菜单红色角标 */
.menu-badge {
  float: right;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #f04438;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
  margin-top: 2px;
}
.menu-badge:empty { display: none; }

/* ---------- 顶栏 ---------- */
.lyear-layout-header {
  background: #fff;
  border-bottom: 1px solid var(--probe-border);
  box-shadow: none !important;
}
.page-heading {
  font-size: 16px;
  font-weight: 600;
  color: #1d2939;
  margin-left: 14px;
}

/* 铃铛 */
.topbar-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #475467;
  font-size: 20px;
  text-decoration: none;
}
.topbar-bell:hover { background: #f5f8ff; color: var(--bs-primary); }
.topbar-bell::after { display: none; }
.topbar-bell .badge-count {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #f04438;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  border: 2px solid #fff;
}
.alert-feed { width: 330px; padding: 0; }
.alert-feed-header {
  padding: 12px 16px;
  border-bottom: 1px solid #f2f4f7;
  font-size: 14px;
}
.alert-feed-header a { font-size: 12px; font-weight: 400; }
.alert-feed .alert-feed-item {
  display: block;
  padding: 10px 16px;
  border-bottom: 1px solid #f6f7f9;
  white-space: normal;
  text-decoration: none;
  color: inherit;
}
.alert-feed .alert-feed-item:hover { background: #f8faff; }
.alert-feed .alert-feed-item:last-child { border-bottom: none; }
.alert-feed-empty { padding: 20px; text-align: center; color: var(--probe-text-light); font-size: 13px; }

/* ---------- 统计卡片 ---------- */
.stat-card .card-body { padding: 18px 20px; }
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon-primary { background: #eef2ff; color: #4361ee; }
.stat-icon-success { background: #ecfdf3; color: #12b76a; }
.stat-icon-danger  { background: #fef3f2; color: #f04438; }
.stat-icon-warning { background: #fffaeb; color: #f79009; }
.stat-icon-info    { background: #f0f9ff; color: #0ba5ec; }
.stat-value { font-size: 24px; font-weight: 700; color: #1d2939; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--probe-text-light); }
.stat-card.link-none { cursor: default; }
.stat-card a.stat-link { text-decoration: none; }
.stat-card:hover { box-shadow: 0 2px 8px rgba(16, 24, 40, .06); transition: box-shadow .2s; }

/* ---------- 离线预警横幅 ---------- */
.probe-banner {
  border-radius: 8px;
  border: none;
  background: #fef3f2;
  color: #b42318;
  padding: 14px 18px;
}
.probe-banner .banner-title { font-weight: 600; }
.probe-banner a { color: #b42318; font-weight: 600; text-decoration: underline; }

/* ---------- 预警中心 ---------- */
.alert-summary-item {
  text-align: center;
  padding: 16px 12px;
  border-radius: 8px;
  background: #f9fafc;
}
.alert-summary-item .num { font-size: 22px; font-weight: 700; line-height: 1.2; }
.alert-summary-item .lbl { font-size: 12px; color: var(--probe-text-light); }
.num-danger  { color: #f04438; }
.num-warning { color: #f79009; }
.num-primary { color: #4361ee; }
.num-success { color: #12b76a; }

.alert-item {
  display: flex;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #f2f4f7;
}
.alert-item:last-child { border-bottom: none; }
.alert-item .alert-item-body { flex: 1; min-width: 0; }
.alert-item .alert-item-title {
  font-size: 13px;
  color: var(--probe-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alert-item .alert-item-time { font-size: 12px; color: #98a2b3; white-space: nowrap; }

/* 预警中心：最近预警垂直 feed（probe-feed，与页头下拉 .alert-feed 隔离） */
.probe-feed { background: #f9fafc; border-radius: 8px; padding: 6px 14px; }
.probe-feed .alert-feed-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px; border-bottom: 1px solid #eef0f3;
  border-left: 3px solid transparent;
  border-radius: 5px;
  transition: background .15s ease;
}
.probe-feed .alert-feed-item:hover { background: #fff; border-left-color: #d0d5dd; }
.probe-feed .alert-feed-item:last-child { border-bottom: none; }
.probe-feed .alert-feed-item .badge { flex: none; min-width: 86px; justify-content: center; font-weight: 500; }
.probe-feed .alert-feed-item .feed-body { flex: 1; min-width: 0; }
.probe-feed .alert-feed-item .feed-title { font-size: 13px; color: #344054; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.probe-feed .alert-feed-item .feed-time { font-size: 12px; color: #98a2b3; white-space: nowrap; flex: none; }
.alert-summary-item { transition: transform .15s ease, box-shadow .15s ease; }
.alert-summary-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16, 24, 40, .07); }
.alert-summary-item.sum-danger  { background: #fef3f2; }
.alert-summary-item.sum-warning { background: #fffaeb; }
.alert-summary-item.sum-success { background: #ecfdf3; }

/* ---------- 登录页（极简白 + 蓝色光晕） ---------- */
body.login-page {
  min-height: 100vh;
  background: #ffffff;
  overflow: hidden;
}
/* 背景不规则蓝色光晕球 */
.login-orb {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(90px);
}
.login-orb-1 {
  width: 560px; height: 560px;
  top: -180px; right: -140px;
  background: radial-gradient(circle at 35% 35%, rgba(96, 165, 250, .5), rgba(67, 97, 238, .18) 70%);
  border-radius: 62% 38% 55% 45% / 48% 60% 40% 52%;
}
.login-orb-2 {
  width: 460px; height: 460px;
  bottom: -170px; left: -130px;
  background: radial-gradient(circle at 60% 40%, rgba(67, 97, 238, .42), rgba(11, 165, 236, .15) 72%);
  border-radius: 45% 55% 40% 60% / 55% 42% 58% 45%;
}
.login-orb-3 {
  width: 220px; height: 220px;
  top: 38%; left: 13%;
  background: radial-gradient(circle, rgba(11, 165, 236, .3), transparent 70%);
  border-radius: 55% 45% 60% 40% / 50% 55% 45% 50%;
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 24px 16px;
}
.login-card {
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(67, 97, 238, .1);
  padding: 44px 40px 30px;
}

/* 品牌头 */
.login-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.login-brand-mark .logo-ico {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 20px;
  background: linear-gradient(135deg, #4361ee, #6d8bff);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(67, 97, 238, .3);
}
.login-brand-mark .brand-name {
  font-size: 21px;
  font-weight: 700;
  color: #1d2939;
  letter-spacing: .3px;
}

/* 表单面板 */
.login-panel .panel-sub {
  font-size: 13px;
  color: var(--probe-text-light);
  text-align: center;
  margin-bottom: 28px;
}
.login-panel .alert { border-radius: 10px; font-size: 13px; border: none; }
.login-panel .alert-danger {
  background: #fef3f2;
  color: #b42318;
  display: flex; align-items: center; gap: 8px;
}

.ly-field { position: relative; margin-bottom: 16px; }
.ly-field .field-ico {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  color: #98a2b3;
  z-index: 2;
  transition: color .15s;
}
.ly-field .form-control {
  height: 44px;
  padding-left: 42px;
  border-radius: 10px;
  border: 1px solid #e4e7ec;
  background: rgba(255, 255, 255, .85);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.ly-field .form-control::placeholder { color: #98a2b3; }
.ly-field .form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, .12);
}
.ly-field:focus-within .field-ico { color: var(--bs-primary); }

.ly-field .toggle-pwd {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  border: none; background: none;
  color: #98a2b3;
  font-size: 17px;
  padding: 4px 6px;
  cursor: pointer;
  z-index: 2;
}
.ly-field .toggle-pwd:hover { color: #475467; }

.captcha-img {
  height: 44px;
  border-radius: 10px;
  border: 1px solid #e4e7ec;
  cursor: pointer;
  width: 100%;
  object-fit: cover;
}
.captcha-refresh {
  border: none; background: none;
  color: #98a2b3;
  font-size: 17px;
  padding: 4px 6px;
  cursor: pointer;
}
.captcha-refresh:hover { color: var(--bs-primary); }

.login-submit {
  height: 44px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 4px;
  color: #fff;
  background: var(--bs-primary);
  transition: background .15s, box-shadow .15s;
}
.login-submit:hover {
  background: var(--bs-primary-hover);
  color: #fff;
  box-shadow: 0 8px 20px rgba(67, 97, 238, .28);
}

.login-panel .panel-foot {
  margin-top: 28px;
  font-size: 12px;
  color: #98a2b3;
  text-align: center;
}

@media (max-width: 575.98px) {
  .login-card { padding: 36px 24px 24px; border-radius: 16px; }
}

/* ---------- 其他细节 ---------- */
.pagination .page-link { border-radius: 6px !important; margin: 0 2px; border-color: #e4e7ec; color: #475467; }
.pagination .page-item.active .page-link { background: var(--bs-primary); border-color: var(--bs-primary); }
.alert { border-radius: 8px; }
.text-muted { color: #98a2b3 !important; }
code { color: #3538cd; background: #f5f7ff; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ---------- Toast 通知 ---------- */
.probe-toast {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 2000;
  max-width: 320px;
  padding: 11px 18px;
  border-radius: 8px;
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
  opacity: 0;
  transform: translateY(-8px);
  transition: all .25s ease;
  pointer-events: none;
}
.probe-toast.show { opacity: 1; transform: none; }
.probe-toast-success { background: #12b76a; }
.probe-toast-danger  { background: #f04438; }
.probe-toast-info    { background: #4361ee; }

/* ---- SSH 资源环形图 ---- */
.resource-gauges { display: flex; gap: 22px; align-items: center; margin-top: 0; flex-wrap: wrap; }
.gauge-item { display: flex; align-items: center; gap: 9px; }
.gauge-wrap { position: relative; width: 72px; height: 72px; flex: none; }
.gauge-wrap canvas { width: 72px !important; height: 72px !important; }
.gauge-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #344054; pointer-events: none; }
/* Swap 小号环形图：叠在内存环右下角的角标 */
.gauge-swap-ring {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .18);
}
.gauge-swap-ring canvas { width: 36px !important; height: 36px !important; }
.gauge-swap-ring .gauge-val { font-size: 9px; font-weight: 700; }
.gauge-label { font-size: 14px; font-weight: 600; color: #475467; white-space: nowrap; }
.gauge-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gauge-sub { font-size: 12.5px; font-weight: 500; color: #98a2b3; white-space: nowrap; }
.gauge-disk { font-size: 12.5px; font-weight: 500; color: #98a2b3; white-space: nowrap; }
/* 实时带宽：下行/上行速率（非百分比不用环形图，宽度随内容撑开避免拥挤） */
.gauge-net-box {
  min-width: 112px; height: 72px; flex: none; border-radius: 10px; padding: 0 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: #f8fafc; border: 1px solid #eef0f3;
}
.gauge-net-box b { font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.gauge-net-box i { font-size: 14px; margin-right: 3px; vertical-align: -2px; }
.gauge-net-box .net-down { color: #12b76a; }
.gauge-net-box .net-up { color: #4361ee; }

/* ---- 服务器总览统计面板（浅色） ---- */
.probe-overview .card-body { padding: 18px 20px 14px; }
.ov-head { display: flex; justify-content: space-between; align-items: baseline; color: #667085; font-size: 13px; padding-bottom: 14px; border-bottom: 1px solid #f2f4f7; }
.ov-head strong { font-size: 26px; font-weight: 700; color: #101828; line-height: 1; }
.ov-row { display: flex; align-items: center; gap: 8px; margin-top: 15px; font-size: 13px; color: #475467; font-weight: 500; }
.ov-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ov-row .cnt { margin-left: auto; font-weight: 600; }
.ov-bar { height: 6px; background: #f2f4f7; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.ov-bar i { display: block; height: 100%; border-radius: 3px; transition: width .4s ease; }
.ov-foot { margin-top: 18px; padding-top: 12px; font-size: 12px; color: #98a2b3; border-top: 1px dashed #eaecf0; }

/* ---- 系统设置 Tab ---- */
.card-header .nav-tabs { border-bottom: none; margin-bottom: -1px; }
.card-header .nav-tabs .nav-link {
  border: none; border-bottom: 2px solid transparent;
  color: #667085; font-size: 14px; font-weight: 500;
  padding: 12px 16px; border-radius: 0;
  background: transparent;
}
.card-header .nav-tabs .nav-link:hover { color: #4361ee; border-bottom-color: #c7d2fe; }
.card-header .nav-tabs .nav-link.active {
  color: #4361ee; border-bottom-color: #4361ee; background: transparent;
}
.tab-content > .tab-pane { max-width: 1100px; }

/* ---- 系统设置：全宽卡片 + 光年原生横向 Tab ---- */
.settings-card { margin-bottom: 0; }
.settings-body { padding: 24px; }
.settings-body > .tab-pane { max-width: none; }
/* 分区标题：小图标 + 深色粗体，无下划线（贴近光年原生设置页） */
.settings-body h6.text-primary {
  display: flex; align-items: center; gap: 6px;
  color: #1d2939; font-size: 14px; font-weight: 600;
  margin-bottom: 16px;
}
.settings-body h6.text-primary .mdi { color: #667085; font-size: 16px; }
/* 表单文字层级：标签深、说明浅，字段贴满所在栅格列 */
.settings-body .form-label { font-size: 13px; color: #475467; }
.settings-body .form-text { font-size: 12px; color: #98a2b3; }
@media (max-width: 991.98px) {
  .settings-body { padding: 18px 16px; }
}

/* ---- 设置项条目卡片（系统设置各 Tab 内） ---- */
.setting-item {
  background: transparent;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 16px 18px;
  height: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.setting-item:hover { border-color: #e2e6ee; box-shadow: 0 2px 8px rgba(16, 24, 40, .04); }
.setting-item > .form-label { font-weight: 600; color: #344054; font-size: 13.5px; }
.setting-item .form-text { margin-top: 10px; margin-bottom: 0; }
.setting-item .input-group-text { background: #fff; }
/* 在线更新：升级步骤日志（纯描边，无填充底，可滚动） */
.upd-log { background: transparent; border: 1px solid #eef0f3; border-radius: 8px; max-height: 260px; overflow-y: auto; font-size: 12px; line-height: 1.7; }

/* ---- 分类模块（监控总览）：一个分类一张卡，行内自适应 ---- */
.group-card .card-body { padding: 16px; }
.node-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; grid-auto-flow: row dense; }
.node-tile { display: flex; flex-direction: column; gap: 8px; background: #f9fafc; border: 1px solid #eef0f3; border-radius: 8px; padding: 13px 14px; transition: background .15s ease, box-shadow .15s ease; }
.node-tile:hover { background: #fff; box-shadow: 0 2px 8px rgba(16, 24, 40, .06); }
.node-tile.row-offline { background: #fef3f2; border-color: #fee4e2; }
.node-tile.row-offline:hover { background: #fff5f4; }
.node-tile.node-big { grid-row: span 2; }
.node-tile .node-head strong { font-size: 14px; }
.node-tile .node-addr { font-size: 12.5px; }
.node-tile .node-foot { border-top: 1px dashed #eef0f3; margin-top: auto; flex-wrap: wrap; row-gap: 6px; }
.node-tile.row-offline .node-foot { border-top-color: #fee4e2; }
/* 小卡（PING/HTTP/TCP 等）同样防溢出：头部名称区可收缩省略，底部「延迟·时间」与按钮窄卡自动换行 */
.node-tile .node-head > .text-truncate { min-width: 0; }
.node-tile .node-foot > span:first-child { min-width: 0; flex: 1 1 auto; overflow-wrap: break-word; }
.node-tile .node-foot > div:last-child { flex: none; margin-left: auto; }
.node-tile .health-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.node-tile .btn-check-one { padding: 2px 10px; font-size: 12px; }
.node-tile .resource-gauges { margin-top: 4px; }
/* 大卡资源区：CPU+内存一行、存储一行，白底分块 */
.node-tile.node-big .resource-gauges { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.node-tile.node-big .gauge-item { width: calc(50% - 5px); background: #fff; border: 1px solid #eef0f3; border-radius: 8px; padding: 12px; gap: 10px; }
.node-tile.node-big .gauge-item:nth-child(3) { width: 100%; }
/* 有实时带宽块时，磁盘与带宽并排各占一半（与 CPU/内存模块布局一致） */
.node-tile.node-big .resource-gauges:has(.gauge-net) .gauge-item:nth-child(3),
.node-tile.node-big .gauge-item.gauge-net { width: calc(50% - 5px); }
/* 横向布局时副文本（负载值 / 内存容量）过长会撑破白框遮挡相邻卡片：统一裁剪为省略号 */
.node-tile.node-big .gauge-info { min-width: 0; overflow: hidden; }
.node-tile.node-big .gauge-sub,
.node-tile.node-big .gauge-disk { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* 大卡以自身宽度为容器：中等屏（1304px 桌面）与平板竖屏（768px，col-xl-6 未生效但
   双列网格仍把大卡压到约 340px）时，横向「环形图 + 文字」放不下会溢出遮挡。
   改用容器查询按实际卡宽自适应（阈值 360px），侧栏折叠/任意视口都能正确判断。 */
.node-tile.node-big { container-type: inline-size; }
@container (max-width: 360px) {
  .node-tile.node-big .resource-gauges { gap: 8px; }
  /* 环形图上、文字下的竖排：文字可用整块宽度，负载/内存副信息换行完整显示 */
  .node-tile.node-big .gauge-item {
    width: calc(50% - 4px);
    flex-direction: column; align-items: center; text-align: center;
    gap: 6px; padding: 10px 6px;
  }
  .node-tile.node-big .gauge-wrap { width: 60px; height: 60px; }
  .node-tile.node-big .gauge-wrap canvas { width: 60px !important; height: 60px !important; }
  .node-tile.node-big .gauge-val { font-size: 13px; }
  /* Swap 角标：竖排模式下随内存环缩小（置于 .gauge-wrap 规则之后以覆盖尺寸） */
  .node-tile.node-big .gauge-swap-ring { width: 32px; height: 32px; right: -4px; bottom: -4px; }
  .node-tile.node-big .gauge-swap-ring canvas { width: 32px !important; height: 32px !important; }
  .node-tile.node-big .gauge-swap-ring .gauge-val { font-size: 8px; }
  .node-tile.node-big .gauge-info { align-items: center; overflow: visible; }
  .node-tile.node-big .gauge-label { font-size: 12.5px; }
  .node-tile.node-big .gauge-sub,
  .node-tile.node-big .gauge-disk {
    font-size: 11.5px; white-space: normal; overflow: visible;
    text-overflow: clip; word-break: break-word; line-height: 1.4;
  }
  /* 磁盘 / 带宽：竖排（框在上、文字在下）。有带宽时两者并排各占一半（同一行），
     无带宽时磁盘独占整行；均随卡宽换行，不再横向溢出 */
  .node-tile.node-big .gauge-item:nth-child(3) { width: 100%; }
  .node-tile.node-big .resource-gauges:has(.gauge-net) .gauge-item:nth-child(3),
  .node-tile.node-big .gauge-item.gauge-net { width: calc(50% - 4px); }
  .node-tile.node-big .gauge-net-box {
    min-width: 0; width: 100%; height: auto; padding: 8px 6px;
    flex-direction: column; align-items: center; gap: 4px;
  }
  /* 底部按钮较多（质量/趋势/探测）窄卡时换行，避免横向溢出遮挡 */
  .node-tile.node-big .node-foot { flex-wrap: wrap; row-gap: 6px; }
}
/* ===== 平板端适配（侧栏抽屉化、内容全宽）===== */
/* 节点状态区头部工具栏：下拉/按钮放不下时整齐换行，不写死宽度导致溢出 */
@media (max-width: 1199.98px) {
  #node-toolbar { row-gap: 10px; }
  #node-toolbar .node-toolbar-actions { flex-wrap: wrap; justify-content: flex-start; row-gap: 8px; }
  #node-toolbar #group-filter     { width: auto; flex: 1 1 130px; min-width: 118px; max-width: 190px; }
  #node-toolbar #refresh-interval { width: auto; flex: 1 1 112px; min-width: 112px; max-width: 160px; }
}
@media (max-width: 991.98px) {
  .node-grid { grid-template-columns: 1fr 1fr; }
  /* 平板竖屏：标题独占一行，工具组占满整行并允许内部换行 */
  #node-toolbar { justify-content: flex-start; }
  #node-toolbar .card-title { margin-left: 0 !important; }
  #node-toolbar .node-toolbar-actions { width: 100%; }
}
@media (max-width: 575.98px) {
  .node-grid { grid-template-columns: 1fr; }
  .node-tile.node-big { grid-row: auto; }
  /* 手机：工具组按钮等宽铺满、自动换行，下拉各占一行 */
  #node-toolbar .node-toolbar-actions { gap: 8px; }
  #node-toolbar .node-toolbar-actions .btn { flex: 1 1 auto; }
  #node-toolbar #group-filter,
  #node-toolbar #refresh-interval { flex: 1 1 100%; max-width: none; }
}

/* ---- 分类模块拖动排序 ---- */
.drag-handle { color: #c3c9d5; font-size: 20px; cursor: grab; margin-right: 6px; margin-left: -4px; transition: color .15s ease; }
.drag-handle:hover { color: #4361ee; }
.group-card { transition: box-shadow .15s ease, border-color .15s ease; }
.group-card:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .06); }
.group-col.dragging { opacity: .55; }
.group-col.dragging .group-card { border: 1.5px dashed #4361ee; box-shadow: 0 8px 24px rgba(67, 97, 238, .18); }
body.drag-sorting { user-select: none; -webkit-user-select: none; cursor: grabbing; }
body.drag-sorting .group-col { transition: transform .15s ease; }

/* ---- 节点卡片拖动 ---- */
.node-handle { color: #d0d5dd; font-size: 16px; cursor: grab; margin-right: 4px; vertical-align: -2px; transition: color .15s ease; }
.node-handle:hover { color: #4361ee; }
.node-tile.dragging { opacity: .55; border: 1.5px dashed #4361ee; box-shadow: 0 6px 18px rgba(67, 97, 238, .18); background: #fff; }
.node-grid.drop-over { outline: 2px dashed #4361ee; outline-offset: 4px; border-radius: 8px; background: rgba(67, 97, 238, .05); }

/* ---- 系统设置：站点标识预览 ---- */
.brand-preview { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: #f2f4f7; border: 1px solid #e4e7ec; border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.brand-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---- 监控总览：刷新倒计时圆环 ---- */
.refresh-ring {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: conic-gradient(#4361ee 100%, #e4e7ec 0);
  flex: 0 0 auto;
  animation: ringBreath 2.6s ease-in-out infinite;
}
.refresh-ring .ring-inner {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.refresh-ring .ring-inner b { font-size: 11px; font-weight: 700; color: #4361ee; line-height: 1; transition: transform .18s ease; }
.refresh-ring.tick .ring-inner b { transform: scale(1.3); } /* 秒数切换小弹跳 */
.refresh-ring.flash { animation: ringFlash .55s ease; }     /* 刷新瞬间扩散闪光 */
@keyframes ringBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(67, 97, 238, .16); }
  50% { box-shadow: 0 0 0 4px rgba(67, 97, 238, .05); }
}
@keyframes ringFlash {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(67, 97, 238, .45); }
  45% { transform: scale(1.18); box-shadow: 0 0 0 9px rgba(67, 97, 238, .12); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(67, 97, 238, 0); }
}

/* ---- 趋势图交互 ---- */
.trend-canvas { cursor: grab; }
body.chart-panning { user-select: none; -webkit-user-select: none; cursor: grabbing; }
body.chart-panning * { user-select: none; -webkit-user-select: none; }

/* ===== 后台服务器管理：前台同款分类 Tab ===== */
.srv-tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px 0; }
.srv-tab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: #475467;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid #e4e7ec; background: #fff;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.srv-tab:hover { border-color: #c7d2fe; color: #4361ee; }
.srv-tab.active {
  color: #2563eb; border-color: rgba(147, 197, 253, .55);
  background: linear-gradient(135deg, #e0f2fe, #dbeafe 55%, #e0e7ff);
}
.srv-tab .tcnt { font-size: 11px; background: #f2f4f7; color: #667085; border-radius: 999px; padding: 0 7px; line-height: 16px; }
.srv-tab.active .tcnt { background: rgba(37, 99, 235, .12); color: #2563eb; }

/* ===== 登录页：Favicon 头像 ===== */
.login-brand-mark .logo-ico img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.login-brand-mark .logo-ico.logo-ico-img { background: #fff; box-shadow: 0 4px 12px rgba(16, 24, 40, .12); border: 1px solid #eef0f3; }
.login-brand-mark .logo-ico .mdi-cat { font-size: 20px; }

/* ===== 服务器管理：快速采集结果弹窗 ===== */
.res-slot:empty { display: none; }
.qk-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
  padding: 12px 14px; margin-bottom: 14px;
  background: #f8fafc; border: 1px solid #eef0f3; border-radius: 8px;
}
.qk-head .badge { font-size: 12px; padding: 5px 12px; }
.qk-metric { font-size: 12.5px; color: #667085; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.qk-metric .mdi { font-size: 14px; color: #98a2b3; }
.qk-metric b { font-size: 13.5px; font-weight: 700; color: #344054; }
.qk-msg { font-size: 13px; line-height: 1.65; border-radius: 8px; margin-bottom: 0; word-break: break-all; }
.qk-res-title {
  font-size: 12.5px; font-weight: 700; color: #475467;
  margin: 16px 0 2px; padding-bottom: 8px; border-bottom: 1px solid #eef0f3;
}
.qk-res-title .mdi { color: #4361ee; font-size: 15px; }
/* 快速采集弹窗：质量历史色块（与前台首页同款样式） */
.qk-hist-stat { margin-left: 8px; font-size: 12px; font-weight: 400; color: #98a2b3; }
.qk-hist-stat b { font-size: 13px; font-weight: 700; color: #1d2939; }
.qk-hist-bars { display: flex; gap: 3px; align-items: stretch; min-height: 26px; margin-top: 10px; }
.qk-hist-bar { flex: 1; height: 26px; border-radius: 4px; background: #eef0f4; min-width: 4px; transition: transform .12s; }
.qk-hist-bar:hover { transform: scaleY(1.15); }
.qk-hist-bar.g { background: #12b76a; }
.qk-hist-bar.y { background: #f79009; }
.qk-hist-bar.r { background: #f04438; }
#quickModal .resource-gauges { gap: 18px; margin-top: 12px; }
.qk-err {
  font-size: 12.5px; line-height: 1.7; color: #b42318;
  white-space: pre-wrap; word-break: break-all;
  max-height: 260px; overflow-y: auto;
}

/* ===== 服务器管理：列表内快速开关（监控 / 资源采集 / 前台显示） ===== */
td .form-check.form-switch.switch-cell { padding-left: 2.2em; margin: 0; min-height: 0; }
td .switch-cell .form-check-input {
  width: 1.95em; height: 1.1em; margin-left: -2.2em; margin-top: .18em;
  cursor: pointer; border-color: rgba(0, 0, 0, .18);
}
td .switch-cell .form-check-input:checked { background-color: #12b76a; border-color: #12b76a; }
td .switch-cell .form-check-input:focus { box-shadow: 0 0 0 3px rgba(18, 183, 106, .14); border-color: #6ce9a6; }
td .switch-cell .form-check-input:disabled { opacity: .55; cursor: default; }
/* 采集弹窗内的服务端告警块（黄色语义，复用 .qk-err 排版） */
#quickModal .alert-warning .qk-err { color: #b54708; }

/* 多盘列表沿用资源卡片，盘多时滚动，不限制采集数量。 */
.gauge-item.gauge-disk-group { display: grid; grid-template-columns: auto minmax(0, 1fr); width: 240px; max-width: 100%; min-width: 0; }
.gauge-disk-group > .disk-list { grid-column: 1 / -1; }
/* 单盘只展示环形图和容量信息，避免重复显示进度条。 */
.gauge-disk-group > .disk-list:has(> .disk-row:only-child) { display: none; }
/* 按过滤后的列表判断多盘，首屏、轮询和弹窗统一只展示进度条。 */
.gauge-disk-group:has(> .disk-list > .disk-row:nth-child(2)) > .gauge-wrap,
.gauge-disk-group:has(> .disk-list > .disk-row:nth-child(2)) > .gauge-info { display: none; }
.disk-list { width: 100%; min-width: 0; max-height: 320px; overflow: auto; text-align: left; }
.disk-row { padding: 7px 0; border-top: 1px solid #eef0f3; }
.gauge-item.gauge-disk-group > .disk-list > .disk-row:first-child { border-top: 0; }
.disk-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: #344054; }
.disk-row-head > span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.disk-mount { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.disk-capacity { font-size: 11.5px; color: #667085; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.disk-track { height: 5px; border-radius: 4px; overflow: hidden; background: #eef0f4; margin-top: 4px; }
.disk-track > i { display: block; height: 100%; border-radius: inherit; }
.resource-gauges:has(.disk-list) { align-items: flex-start; }
.metrics-disk-current .disk-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0 24px; }
/* ===== 服务器管理页资源卡片（表格 .res-slot / 快速采集弹窗）多盘适配 =====
   单盘：磁盘卡片回归与 CPU/内存一致的紧凑横排，不再被 240px 网格撑宽；
   多盘：磁盘卡片独占一行、列表按可用宽度多列铺开，避免表格行被单个高列表撑变形。 */
:is(.res-slot, #quickModal) .gauge-item.gauge-disk-group { width: auto; }
:is(.res-slot, #quickModal) .gauge-item.gauge-disk-group:not(:has(> .disk-list > .disk-row:nth-child(2))) {
  display: flex; align-items: center; gap: 9px;
}
:is(.res-slot, #quickModal) .gauge-item.gauge-disk-group:has(> .disk-list > .disk-row:nth-child(2)) { order: 10; width: 100%; margin: 10px 0 0; }
:is(.res-slot, #quickModal) .resource-gauges:has(.gauge-disk-group > .disk-list > .disk-row:nth-child(2)) { row-gap: 0; }
/* 服务器管理页：磁盘组不要顶部边框线（多列铺开时各行 border-top 会在顶部形成断线） */
:is(.res-slot, #quickModal) .gauge-disk-group > .disk-list .disk-row { border-top: 0; }
:is(.res-slot, #quickModal) .gauge-disk-group > .disk-list:has(> .disk-row:nth-child(2)) {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 22px; max-height: 168px;
}
@container (max-width: 360px) {
  .node-tile.node-big .gauge-item.gauge-disk-group { grid-template-columns: minmax(0, 1fr); justify-items: center; }
}
