/* ============================================================
   Ping监控系统 - 统一样式
   深色左侧菜单 + 浅色内容区 + 顶部banner + 右上角通知抽屉
   ============================================================ */

:root {
  --sidebar-w: 220px;
  --banner-h: 56px;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warn: #d97706;
  --warn-light: #fffbeb;
  --gray-900: #0f172a;
  --gray-800: #1e293b;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50: #f8fafc;
  --border: #e5e7eb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 登录页 ============ */
.login-body { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 400px; max-width: 92vw; }
.login-card { background: #fff; border-radius: 16px; padding: 40px 36px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 16px; background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; letter-spacing: 1px; }
.login-brand h1 { font-size: 20px; color: var(--gray-900); }
.login-brand p { color: var(--gray-500); font-size: 13px; margin-top: 4px; }
.login-beian { text-align: center; color: rgba(255,255,255,.55); font-size: 12px; margin-top: 18px; }
.login-foot { text-align: center; color: var(--gray-400); font-size: 12px; margin-top: 18px; }

/* 登录页右上角消息（与通知抽屉未读消息样式完全一致：浅蓝底 + 蓝色左边条 + 圆点 + 圆角阴影） */
.login-body .toast-wrap { top: 24px; right: 24px; left: auto; transform: none; align-items: flex-end; }
.login-body .toast {
  position: relative; background: var(--primary-light); color: var(--gray-800); min-width: 280px; max-width: 70vw;
  border: 1px solid #bfdbfe; border-left: 3px solid var(--primary);
  border-radius: 10px; padding: 13px 18px 13px 40px; font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.login-body .toast::before {
  content: ''; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
}
.login-body .toast.error { border-left-color: var(--primary); background: var(--primary-light); }
.login-body .toast.error::before { background: var(--primary); }
.login-body .toast.success { border-left-color: var(--success); background: var(--primary-light); }
.login-body .toast.success::before { background: var(--success); }
.login-body .toast.warning { border-left-color: var(--primary); background: var(--primary-light); }
.login-body .toast.warning::before { background: var(--primary); }

/* ============ 表单 ============ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--gray-600); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--gray-800); outline: none; transition: border .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-error { background: var(--danger-light); color: var(--danger); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; display: none; }
.form-error.show { display: block; }
.form-tip { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.field-err { font-size: 12px; color: var(--danger); margin-top: 4px; }
.is-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 2px var(--danger-light); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ============ 按钮 ============ */
.btn {
  display: inline-block; padding: 9px 18px; border: 1px solid transparent; border-radius: 8px;
  font-size: 14px; cursor: pointer; font-weight: 500; transition: all .15s; text-align: center; line-height: 1.4;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: var(--danger-light); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: #b91c1c; }
.btn-ghost { background: #fff; color: var(--gray-600); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-50); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }

/* ============ SPA 框架布局 ============ */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* 左侧菜单 */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w); background: var(--gray-900);
  color: #cbd5e1; display: flex; flex-direction: column; transition: margin .25s ease;
}
.sidebar-logo { height: var(--banner-h); display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar-logo .logo-box { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2563eb, #06b6d4); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; }
.sidebar-logo .logo-text { font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; }
.menu { flex: 1; padding: 12px 0; overflow-y: auto; }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; cursor: pointer;
  color: #94a3b8; transition: all .15s; border-left: 3px solid transparent; user-select: none;
}
.menu-item:hover { background: rgba(255,255,255,.05); color: #e2e8f0; }
.menu-item.active { background: rgba(37,99,235,.15); color: #fff; border-left-color: var(--primary); }
.menu-item .icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.menu-item .label { font-size: 14px; }
.sidebar-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; color: var(--gray-500); }
.sidebar-foot .foot-copy { white-space: nowrap; letter-spacing: .2px; overflow: hidden; text-overflow: ellipsis; }

/* 右侧主区域 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* 顶部 banner */
.banner {
  height: var(--banner-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; z-index: 10; box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.banner-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.banner-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.banner-right { display: flex; align-items: center; gap: 16px; }

/* 移动端汉堡菜单按钮（≤768px 显示） */
.menu-toggle {
  display: none; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  width: 34px; height: 34px; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: all .15s;
}
.menu-toggle:hover { border-color: var(--primary); background: var(--primary-light); }
.menu-toggle svg { width: 18px; height: 18px; stroke: var(--gray-600); }

/* 告警声音开关按钮 */
.sound-btn {
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: all .15s;
}
.sound-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.sound-btn svg { width: 18px; height: 18px; stroke: var(--gray-600); }
.sound-btn.off svg { stroke: var(--gray-400); }
.sound-btn.off { background: var(--gray-100); }

/* 内容区：唯一纵向滚动条，子页面 iframe 高度由 JS 自适应内容 */
.content { flex: 1; overflow-y: auto; background: var(--gray-100); padding: 20px; position: relative; }
#contentFrame { display: block; width: 100%; height: 100%; border: 0; background: transparent; }

/* ============ 通知抽屉（右上角） ============ */
.notif-wrap { position: relative; }
.notif-btn {
  position: relative; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s;
}
.notif-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.notif-btn svg { width: 20px; height: 20px; stroke: var(--gray-600); }
.notif-badge {
  position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff;
  min-width: 17px; height: 17px; border-radius: 9px; font-size: 10px; display: flex; align-items: center;
  justify-content: center; padding: 0 4px; font-weight: 600; border: 2px solid #fff;
}
.notif-panel {
  position: absolute; top: 46px; right: 0; width: 360px; max-width: 92vw; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.15);
  overflow: hidden; z-index: 100;
  opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.notif-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--gray-50); }
.notif-head b { font-size: 14px; color: var(--gray-800); }
.notif-head a { font-size: 12px; color: var(--primary); cursor: pointer; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); cursor: pointer; transition: background .12s; }
.notif-item:hover { background: var(--gray-50); }
/* 未读：浅蓝背景 + 标题加粗 + 左边框 + 圆点实心 */
.notif-item.unread {
  background: #eff6ff !important;
}
.notif-item.unread:hover {
  background: #dbeafe !important;
}
.notif-item .n-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 6px;
}
/* 未读时标题加粗、颜色加深，圆点实心 */
.notif-item.unread .n-title {
  font-weight: 700 !important;
  color: #1e3a8a !important;
}
.notif-item .n-title .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: .28;
}
.notif-item.unread .n-title .dot {
  opacity: 1;
  background: var(--primary) !important;
}
.notif-item .n-time { font-size: 11px; color: var(--gray-400); margin-top: 3px; }
.notif-item .n-content { font-size: 12px; color: var(--gray-600); margin-top: 4px; line-height: 1.5; word-break: break-all; }
.notif-empty { padding: 40px 16px; text-align: center; color: var(--gray-400); font-size: 13px; }
.type-alert .dot { background: var(--danger); }
.type-alert { border-left: 3px solid var(--danger); }
.type-recover .dot { background: var(--success); }
.type-recover { border-left: 3px solid var(--success); }
.type-notice .dot { background: var(--primary); }
.type-notice { border-left: 3px solid var(--primary); }
.type-system .dot { background: var(--warn); }
.type-system { border-left: 3px solid var(--warn); }

/* ============ 卡片与统计 ============ */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-head h3 { font-size: 15px; color: var(--gray-900); }

/* ============ 问号图标 + 悬浮提示 ============ */
.tip-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px; border-radius: 50%;
  background: var(--gray-300); color: #fff; font-size: 11px; font-weight: 700;
  cursor: help; vertical-align: 2px; line-height: 1;
}
.tip-icon:hover { background: var(--primary); }
.tip-icon .tip-text {
  position: absolute; left: -6px; top: calc(100% + 8px); transform: translateY(-4px);
  width: 300px; max-width: 70vw; background: rgba(51, 65, 85, .9); color: #fff;
  padding: 10px 12px; border-radius: 8px; font-size: 12px; font-weight: 400;
  line-height: 1.6; text-align: left; white-space: normal; box-shadow: 0 6px 20px rgba(0,0,0,.3);
  opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease; z-index: 50;
}
.tip-icon .tip-text::after {
  content: ''; position: absolute; left: 14px; bottom: calc(100% - 1px); transform: translateX(-50%);
  border: 6px solid transparent; border-bottom-color: rgba(51, 65, 85, .9);
}
.tip-icon:hover .tip-text { opacity: 1; visibility: visible; transform: translateY(0); }
.card-body { padding: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { padding: 20px; border-radius: var(--radius); color: #fff; position: relative; overflow: hidden; }
.stat-card .num { font-size: 32px; font-weight: 700; line-height: 1.1; }
.stat-card .lbl { font-size: 13px; opacity: .9; margin-top: 6px; }
.stat-card .icon-bg { position: absolute; right: -12px; bottom: -12px; font-size: 70px; opacity: .15; }
.stat-green { background: linear-gradient(135deg, #16a34a, #15803d); }
.stat-red { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.stat-gray { background: linear-gradient(135deg, #64748b, #475569); }
.stat-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat-amber { background: linear-gradient(135deg, #d97706, #b45309); }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: var(--gray-50); color: var(--gray-500); font-weight: 600; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px; }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: 0; }
/* ===== 告警表格：告警记录页 与 总览统计页「最近告警」共用同一套列宽 =====
   两处必须「table-layout:fixed + 完全相同的 <colgroup>」，否则 auto 布局会按各自
   内容分配列宽 —— 实测两页同列能差 10~20px，看起来就不像同一张表。
   ⚠️ 固定列宽会静默裁切内容，所以只对「目标 / 告警内容」两列做省略号，
      其余列宁可换行也不裁；全文一律用 title 兜底。 */
.tbl-alerts { table-layout: fixed; }
/* 目标列（域名可能很长）：单行省略 + 悬浮 title 看全文 */
.tbl-alerts .cell-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 告警内容列：宽度跟着列走（不再写死 380px，否则列变窄时会溢出到下一列） */
.msg-cell { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-cell:hover { white-space: normal; word-break: break-all; }
/* 窄屏放不下固定列宽：退回 auto 由内容决定（table-wrap 负责横向滚动） */
@media (max-width: 900px) { .tbl-alerts { table-layout: auto; } }

/* 新告警行：淡红背景 3 秒渐隐 */
tbody tr.alert-new { animation: alert-flash 3s ease-out forwards; }
@keyframes alert-flash {
    0% { background: #fecaca; }
    60% { background: #fecaca; }
    100% { background: transparent; }
}

/* ============ 状态点 ============ */
.status-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-green { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.dot-red { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.18); }

/* 监控大屏卡片顶部条：红色状态点呼吸动画（仅限监控卡片内，不影响图例/其他页面红点） */
.monitor-card .mc-name .dot-red {
  position: relative;
}
.monitor-card .mc-name .dot-red::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(239, 68, 68, .5);
  animation: dot-breathe 2.4s ease-out infinite;
}
@keyframes dot-breathe {
  0%   { transform: scale(1); opacity: .8; }
  70%  { transform: scale(3); opacity: 0; }
  100% { transform: scale(3); opacity: 0; }
}
.dot-gray { background: #9ca3af; }
.dot-amber { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }

/* 状态徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-amber { background: var(--warn-light); color: var(--warn); }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-teal { background: #ccfbf1; color: #0d9488; }

/* ============ 监控大屏样式已内置于 pages/monitor.php（深色数据看板） ============ */

/* ============ 其他 ============ */
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-12 { gap: 12px; }
.muted { color: var(--gray-500); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state .big { font-size: 40px; margin-bottom: 12px; }
.search-box input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; width: 220px; font-size: 13px; outline: none; }
.search-box input:focus { border-color: var(--primary); }

/* toast */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--gray-900); color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: toastIn .25s ease; }
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.warning { background: #d97706; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* 加载遮罩 */
.loading-mask { position: absolute; inset: 0; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.loading-mask .lds { width: 36px; height: 36px; border: 3px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-mask.show { opacity: 1; pointer-events: auto; }
/* ⭐ 滚动条只给「内容区」，不给整个弹窗 —— 2026-09-25 实测修（无头 Chrome，1280×720，视口高 620）：
   改前 .modal 自己带 overflow-y:auto，供应商弹窗（9 个字段）实测 modal.scrollHeight=849 > clientHeight=558，
   于是：① 滚动条画在 .modal 上（modal.sbW=8）→ 它压在右侧圆角上，圆角看着"没了"；
   ② 标题栏和底部按钮跟着一起滚 —— foot.top=811 已经**超出视口 620**，「保存」按钮看不见了。
   改后（外框 flex 分三区、只有 .modal-body 滚）：modal.scrollH 558 = clientH、modal.sbW=0、
   modalBody.sbW=8/溢出 291px、foot.top=520 回到视口内；滚到底时 head.top/foot.top 均不变（标题与按钮固定）。
   ⚠️ min-height:0 不能省 —— flex 子项默认不收缩，省了 body 不滚、弹窗自己又长出滚动条（回到改前）。
   config.php 的 .modal-stable 是同一套做法的"固定高"变体（证书详情弹窗），改这里不会影响它。 */
.modal { background: #fff; border-radius: 12px; width: 480px; max-width: 94vw; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); transform: translateY(12px); transition: transform .2s; }
.modal-mask.show .modal { transform: translateY(0); }
.modal-head { flex: 0 0 auto; padding: 18px 22px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; color: var(--gray-900); }
.modal-head .close { cursor: pointer; color: var(--gray-400); font-size: 22px; line-height: 1; background: none; border: 0; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px; }
.modal-foot { flex: 0 0 auto; padding: 14px 22px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; }

/* 用户管理 */
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }

/* ============ 人员选择卡片（消息配置-全局默认推送） ============ */
.person-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.person-card {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  cursor: pointer; font-size: 14px; color: var(--gray-700);
  transition: all .15s; user-select: none; line-height: 1.4;
}
.person-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,.08); }
.person-card.selected {
  background: var(--primary-light); border-color: var(--primary);
  color: var(--primary); font-weight: 600;
}
.person-card.disabled { opacity: .45; cursor: not-allowed; }
.person-card.disabled:hover { border-color: var(--border); box-shadow: none; }
.person-card .pc-check {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; flex-shrink: 0; transition: all .15s;
}
.person-card.selected .pc-check { background: var(--primary); border-color: var(--primary); }
.person-card.selected .pc-check::after { content: "✓"; }
.person-card .pc-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 推送人员多选窗口（监控目标-渠道勾选） ============ */
/* 选择窗口内人员行 */
.contact-pick { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding: 2px; }
.contact-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; transition: all .15s;
}
.contact-row:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,.08); }
.contact-row.selected { background: var(--primary-light); border-color: var(--primary); }
.contact-row .cr-name { font-weight: 600; font-size: 14px; color: var(--gray-800); }
.contact-row .cr-email { font-size: 12px; color: var(--gray-500); margin-top: 2px; word-break: break-all; }
.contact-row .cr-chans { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.chan-item { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--gray-600); cursor: pointer; user-select: none; }
.chan-item input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.chan-item.disabled { opacity: .4; cursor: not-allowed; }
.chan-item.disabled input { cursor: not-allowed; }

/* 已选人员卡片（弹窗内底部展示，可点击取消） */
.picked-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.picked-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: var(--primary-light); border: 1px solid var(--primary); border-radius: 20px;
  color: var(--primary); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .15s; user-select: none;
}
.picked-tag:hover { background: #fee2e2; border-color: var(--danger); color: var(--danger); }
.picked-tag .pt-chan { font-size: 11px; opacity: .85; }
.picked-tag .pt-x { font-weight: 700; margin-left: 2px; }

/* 列表「配置人员」数量徽标 */
.person-count {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary);
  font-size: 12px; font-weight: 500; cursor: default;
}

/* ============ 开关（switch） ============ */
.switch-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.switch {
  position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 24px;
  background: var(--gray-300); transition: background .25s ease;
}
.switch-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform .25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-slider { box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
.switch-text { font-size: 13px; color: var(--gray-600); font-weight: 500; }
.switch-text.on { color: var(--success); }

/* 列表内小号开关 */
.switch-sm { width: 36px; height: 20px; vertical-align: middle; }
.switch-sm .switch-slider::before { width: 14px; height: 14px; left: 3px; top: 3px; }
.switch-sm input:checked + .switch-slider::before { transform: translateX(16px); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
::-webkit-scrollbar-track { background: transparent; }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 300; margin-left: calc(-1 * var(--sidebar-w)); box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  .sidebar.open { margin-left: 0; }
  .notif-panel { width: 90vw; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-toggle { display: flex; }
  .banner { padding: 0 12px; }
  .banner-right { gap: 8px; }
  .banner-right .script-status { display: none !important; }  /* 手机端顶部收起脚本状态，看板内仍可见 */
  .content { padding: 12px; }
  .modal { width: 96vw; }
  .modal-body { padding: 16px; }
  .form-row { flex-direction: column; gap: 0; }
  table { font-size: 12px; }
  thead th, tbody td { padding: 9px 10px; }
}
