/* ===== 网站监测模块样式（wwwroot 版，浅色主题，复用 app.css 的 .panel/.tag/.rzwf-btn） =====
   列表以「待办卡片」(.todo-card) 为基底：
   - 正常站点：精简卡片（图标 + 标题 + 扫描时间）
   - 问题站点：完整卡片，左侧彩色边框按状态区分，含状态标签 / 详情 / 操作
*/

.monitor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.monitor-head h2 {
  margin: 0;
  font-size: 20px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}
.monitor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* 扫描进行中：按钮置灰禁用，避免重复触发 */
.rzwf-btn:disabled { opacity: .62; cursor: not-allowed; }
.rzwf-btn:disabled .fa-spin { color: inherit; }

/* 兼容两套命名：同步前后线上/本地曾用 .monitor-tabs 与 .mtabs，这里都匹配，避免样式丢失 */
.mtabs, .monitor-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid #eef0f4;
}
.mtabs .mtab, .monitor-tabs .mtab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #667085;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mtabs .mtab.active, .monitor-tabs .mtab.active {
  color: #4361ee;
  border-bottom-color: #4361ee;
  font-weight: 600;
}

.monitor-pane-head,
.monitor-geo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.monitor-pane-head h3 { margin: 0; font-size: 15px; color: #475569; display: flex; align-items: center; gap: 6px; }
.monitor-geo-head { margin-bottom: 12px; }
.monitor-meta { color: #94a3b8; font-size: 12px; }

/* 状态标签（四色 severity：正常绿 / 需关注蓝 / 需排查橙 / 异常红） */
.tag.c-normal      { background:#e6f4ea; color:#15803d; }
.tag.c-notice      { background:#e0edff; color:#1d4ed8; }
.tag.c-investigate { background:#fff1e6; color:#c2410c; }
.tag.c-abnormal    { background:#fde8e8; color:#b91c1c; }

/* ===== 站点卡片网格（与待办卡片网格一致） ===== */
.monitor-site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-content: start;
}

.monitor-site-card {
  background: #fff;
  border: 1px solid #e6e9f0;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .15s, border-color .15s;
  border-left: 4px solid #d9dee9;
}
.monitor-site-card:hover { box-shadow: 0 4px 14px rgba(67,97,238,.12); border-color: #c7d2fe; }

/* 状态色（左边框四色区分） */
.monitor-site-card.s-normal      { border-left-color: #16a34a; }
.monitor-site-card.s-notice      { border-left-color: #2563eb; }
.monitor-site-card.s-investigate { border-left-color: #ea580c; }
.monitor-site-card.s-abnormal    { border-left-color: #dc2626; }

/* 四色图标配色（总状态 + 检测项通用） */
.ico-normal      { color: #16a34a; }
.ico-notice      { color: #2563eb; }
.ico-investigate { color: #ea580c; }
.ico-abnormal    { color: #dc2626; }

/* 卡片顶部：总状态图标 + 扫描时间 + 右上角操作 */
.ms-top { display: flex; align-items: center; gap: 8px; }
.ms-status { font-size: 18px; flex-shrink: 0; cursor: default; }
.ms-time { color: #94a3b8; font-size: 12px; }
.ms-ops { position: relative; margin-left: auto; }
.ms-kebab { color: #94a3b8; font-size: 15px; padding: 2px 4px; cursor: pointer; border-radius: 6px; }
.ms-kebab:hover { color: #475569; background: #f1f5f9; }
.ms-icon-btn { color: #94a3b8; font-size: 14px; padding: 3px 5px; cursor: pointer; border-radius: 6px; transition: color .12s, background .12s; }
.ms-icon-btn:hover { color: #4361ee; background: #eef2ff; }
.ms-ops-menu {
  position: absolute; top: 100%; right: 0; margin-top: 4px; z-index: 30;
  display: none; flex-direction: column; gap: 2px; min-width: 112px;
  background: #fff; border: 1px solid #e6e9f0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px;
}
/* 透明桥接：消除图标与下拉之间的死区，鼠标悬停可顺畅进入菜单 */
.ms-ops-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.ms-ops:hover .ms-ops-menu, .ms-ops.open .ms-ops-menu { display: flex; }
.ms-op {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: transparent; border: none; border-radius: 7px; padding: 7px 10px;
  font-size: 13px; color: #334155; cursor: pointer; text-align: left;
}
.ms-op:hover { background: #f1f5f9; }

/* 标题：名称 + 域名 */
.ms-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ms-name { font-size: 14px; font-weight: 600; color: #222; }
.ms-domain { font-size: 12px; color: #94a3b8; word-break: break-all; }

/* 检测项图标行：每个维度一个图标，按各自严重度上色，悬停显示描述 */
.ms-checkrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.ms-chk {
  position: relative; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: help; background: #f1f5f9; flex-shrink: 0;
  transition: transform .12s;
}
.ms-chk:hover { transform: scale(1.08); }
.ms-chk.ico-normal      { background: #e9f7ee; }
.ms-chk.ico-notice      { background: #e6efff; }
.ms-chk.ico-investigate { background: #fff1e6; }
.ms-chk.ico-abnormal    { background: #fde8e8; }
.ms-chk::after {
  content: attr(data-tip);
  position: absolute; bottom: 122%; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; font-size: 11px; line-height: 1.45;
  padding: 6px 9px; border-radius: 6px; white-space: normal;
  width: max-content; max-width: 220px; text-align: left;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 40;
}
.ms-chk:hover::after { opacity: 1; }

/* ===== GEO 异常列表（同步浅色） ===== */
.geo-anomaly-item {
  border: 1px solid #eef1f6;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.geo-anomaly-item.flagged { border-color: #fca5a5; background: #fef2f2; }
.geo-anomaly-item.warn { border-color: #fcd34d; background: #fffbeb; }
.geo-anomaly-item.focus { border-color: #93c5fd; background: #eff6ff; }
.geo-anomaly-item .ga-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.geo-anomaly-item .ga-name { font-weight: 600; color: #222; }
.geo-anomaly-item .ga-date { color: #94a3b8; font-size: 12px; }
.geo-anomaly-item .ga-reasons { margin: 6px 0 0; padding-left: 18px; color: #b45309; font-size: 12px; }
.geo-anomaly-item.flagged .ga-reasons { color: #b91c1c; }
.geo-anomaly-item.warn .ga-reasons { color: #b45309; }
.geo-anomaly-item .ga-metrics { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; color: #475569; font-size: 12px; }
.geo-anomaly-item .ga-metrics b { color: #222; }

.empty-tip { color: #94a3b8; font-size: 13px; padding: 16px; text-align: center; }

/* 模态内按钮行 + toast 错误色（复用 modal-box 输入框样式） */
.fm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast-error { color: #f87171 !important; border-color: #7f1d1d !important; }

/* ===== 状态筛选条 ===== */
/* 兼容两套命名：.monitor-filter（同步后线上版）与 .monitor-filter-bar（旧本地版） */
.monitor-filter, .monitor-filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.mf-count { margin-left: auto; color: #94a3b8; font-size: 12px; }
.mf-chip {
  border: 1px solid #e6e9f0; background: #fff; color: #475569;
  border-radius: 999px; padding: 5px 13px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; transition: all .12s;
}
.mf-chip:hover { border-color: #c7d2fe; }
.mf-chip.active { background: #4361ee; border-color: #4361ee; color: #fff; }
.mf-chip.c-abnormal.active { background: #dc2626; border-color: #dc2626; }
.mf-chip.c-investigate.active { background: #ea580c; border-color: #ea580c; }
.mf-chip.c-notice.active { background: #2563eb; border-color: #2563eb; }
.mf-chip.c-normal.active { background: #16a34a; border-color: #16a34a; }
.mf-chip.mf-star.active { background: #f59e0b; border-color: #f59e0b; }
.mf-sep { width: 1px; height: 20px; background: #e6e9f0; margin: 0 2px; }

/* ===== 星标（重点关注）===== */
.ms-star {
  font-size: 15px; color: #cbd5e1; cursor: pointer; padding: 2px 3px; border-radius: 6px;
  flex-shrink: 0; transition: transform .12s, color .12s;
}
.ms-star:hover { transform: scale(1.15); color: #f59e0b; }
.ms-star.on { color: #f59e0b; }
.monitor-site-card.starred { box-shadow: 0 0 0 1px #fde68a, 0 2px 10px rgba(245,158,11,.15); }

/* ===== 设置弹窗 ===== */
.set-section { border-top: 1px solid #eef1f6; padding: 14px 2px; }
.set-section:first-of-type { border-top: none; padding-top: 2px; }
.set-section h4 { margin: 0 0 10px; font-size: 14px; color: #334155; display: flex; align-items: center; gap: 8px; }
.set-grid { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; align-items: center; }
.fm-label { font-size: 13px; color: #64748b; }
.fm-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; margin: 4px 0; cursor: pointer; }
.fm-input { width: 100%; padding: 8px 10px; border: 1px solid #d8dee9; border-radius: 8px; font-size: 13px; color: #222; background: #fff; }
.fm-input:focus { outline: none; border-color: #4361ee; box-shadow: 0 0 0 3px rgba(67,97,238,.12); }
.set-ch-fields { grid-column: 1 / -1; display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; align-items: center; margin-top: 4px; }

.set-channels { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.ch-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #eef1f6; border-radius: 9px; background: #fbfcfe; }
.ch-toggle { display: flex; align-items: center; gap: 7px; flex: 1; cursor: pointer; font-size: 13px; color: #334155; }
.ch-toggle input { width: 15px; height: 15px; }
.ch-type { font-size: 12px; }
.ch-ops { display: flex; gap: 6px; }
.rzwf-btn-xs { padding: 4px 9px; font-size: 12px; }

.set-add { margin-top: 8px; border: 1px dashed #d8dee9; border-radius: 9px; padding: 8px 12px; }
.set-add summary { cursor: pointer; font-size: 13px; color: #4361ee; display: flex; align-items: center; gap: 6px; }
.set-add[open] { padding-bottom: 14px; }

.settings-tip { color: #94a3b8; font-size: 12px; margin: 6px 0; }

/* GEO 按检测类型配置子分区 */
.set-sub { margin: 6px 0 2px; padding: 10px 12px; border: 1px solid #eef1f6; border-radius: 10px; background: #fbfcfe; }
.set-sub h5 { margin: 0 0 8px; font-size: 13px; color: #334155; }
.geo-type { padding: 6px 0 4px 4px; border-left: 2px solid #e2e8f0; margin-left: 2px; }
.set-inline { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px 22px; flex-wrap: wrap; }
.set-inline .fm-label { font-size: 12px; color: #64748b; white-space: nowrap; }
.fm-input.sm { width: 84px; padding: 6px 8px; }


/* ===== cs64 设置弹窗：1200px 宽 + 头/脚固定 + 中间滚动 ===== */
.ms-modal { width: 1200px; max-width: 96vw; max-height: 88vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ms-modal-head { flex: 0 0 auto; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; position: sticky; top: 0; z-index: 2; }
.ms-modal-head h3 { margin: 0; font-size: 16px; color: #1e293b; }
.ms-modal-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 18px; min-height: 0; }
.ms-modal-foot { flex: 0 0 auto; padding: 12px 18px; border-top: 1px solid #e2e8f0; background: #f8fafc; position: sticky; bottom: 0; z-index: 2; }
.ms-modal-foot .fm-actions { margin: 0; display: flex; gap: 8px; justify-content: flex-end; }

/* ===== cs66 GEO 左右布局 + 环比 + 折线图 ===== */
.monitor-geo-layout { display: flex; gap: 14px; align-items: flex-start; }
.monitor-geo-left { flex: 1 1 58%; min-width: 0; }
.monitor-geo-right { flex: 1 1 42%; min-width: 0; background: #fff; border: 1px solid #eef1f6; border-radius: 10px; padding: 12px; position: sticky; top: 10px; }
.geo-chart-head { font-size: 14px; font-weight: 600; color: #334155; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.geo-chart-client { font-size: 12px; color: #94a3b8; font-weight: 400; }
.geo-chart-wrap { position: relative; height: 320px; }
#geo-chart { width: 100% !important; height: 100% !important; }
.ga-metrics span { display: inline-flex; align-items: center; gap: 4px; }
.ga-diff { font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 8px; }
.ga-diff.up { color: #059669; background: #ecfdf5; }
.ga-diff.down { color: #dc2626; background: #fef2f2; }
.ga-diff.flat { color: #64748b; background: #f1f5f9; }
.ga-diff.na { color: #cbd5e1; background: transparent; }
.geo-anomaly-item { cursor: pointer; }
.geo-anomaly-item:hover { border-color: #4361ee; }

/* ===== cs67 增量提醒标签 ===== */
.ga-growth { margin: 6px 0 0; padding: 4px 10px; border-radius: 6px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.ga-growth.gt-remind { color: #b45309; background: #fef3c7; border: 1px solid #fcd34d; }
.ga-growth.gt-notice { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; }
.ga-growth.gt-focus { color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; }
