/* TG 关键词自动回复平台 · 设计系统
 * 方案 A：清爽后台风
 * 无构建步骤，直接 <link> 引入。变量命名与后端配置保持一致。
 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;

  --text: #101828;
  --text-2: #475467;
  --text-3: #98a2b3;

  --brand: #2f6feb;
  --brand-hover: #1d5fd8;
  --brand-soft: #eaf1fe;

  --success: #067647;
  --success-soft: #ecfdf3;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --warning: #b54708;
  --warning-soft: #fffaeb;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局：左侧导航栏 ---------- */

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .name {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
}

.sidebar-brand .sub {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.3;
}

.sidebar-nav {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

.nav-group-title {
  font-size: 11px;
  color: var(--text-3);
  padding: 12px 12px 6px;
  letter-spacing: .04em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 2px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 500;
}

.nav-item .ico {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: .8;
  font-size: 13px;
}

.nav-item .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

.nav-item.active .count { color: var(--brand); }

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 10px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user .meta { min-width: 0; }
.sidebar-user .uname {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user .role { font-size: 11px; color: var(--text-3); }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 15;
}

.main-head .spacer { flex: 1; }
.main-head .title { font-size: 15px; font-weight: 600; }

.main-body {
  flex: 1;
  padding: 20px 24px 60px;
  min-width: 0;
}

/* 当前页面名已在顶栏显示，隐藏卡片内重复的一级标题，
   只保留副标题（如「共 5 条 · 已启用 4 条」）与右侧操作按钮。 */
.main-body .panel > .card > .card-head > div:first-child > h3 {
  display: none;
}

/* 面板内没有副标题时，避免卡片头高度塌陷 */
.main-body .panel > .card > .card-head > div:first-child:empty {
  display: none;
}

/* 旧的顶部条样式保留，避免其它页面受影响 */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.topbar .spacer { flex: 1; }

.topbar .who {
  font-size: 13px;
  color: var(--text-2);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  background: transparent;
  font-family: inherit;
}

.tab:hover { background: var(--surface-2); color: var(--text); }

.tab.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 500;
}

.tab .count {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.tab.active .count { color: var(--brand); }

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

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

.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.card-body { padding: 18px; }

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

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat .label { font-size: 12px; color: var(--text-2); }

.stat .value {
  font-size: 24px;
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: -.02em;
}

.stat .value.danger { color: var(--danger); }
.stat .value.success { color: var(--success); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}

.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-danger { color: var(--danger); border-color: #fda29b; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }

.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-lg { padding: 10px 18px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--text);
}

.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

input[type=text], input[type=password], input[type=tel],
input[type=number], input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 111, 235, .12);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2);
  color: var(--text-3);
}

textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
textarea.mono { font-family: var(--mono); font-size: 13px; }

.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox input { width: 15px; height: 15px; margin: 0; cursor: pointer; accent-color: var(--brand); }

.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 400; }
.radio-row input { accent-color: var(--brand); margin: 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- 徽标 ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-gray { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-blue { background: var(--brand-soft); color: var(--brand); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 提示条 ---------- */

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.alert-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0; margin-top: 1px;
}

.alert-warn { background: var(--warning-soft); border: 1px solid #fedf89; color: var(--warning); }
.alert-warn .alert-icon { background: var(--warning); color: #fff; }
.alert-danger { background: var(--danger-soft); border: 1px solid #fecdca; color: var(--danger); }
.alert-danger .alert-icon { background: var(--danger); color: #fff; }
.alert-info { background: var(--brand-soft); border: 1px solid #b2ccff; color: var(--brand); }
.alert-info .alert-icon { background: var(--brand); color: #fff; }
.alert-success { background: var(--success-soft); border: 1px solid #abefc6; color: var(--success); }
.alert-success .alert-icon { background: var(--success); color: #fff; }
.alert-body { flex: 1; }
.alert-body strong { display: block; margin-bottom: 2px; font-weight: 600; }

/* ---------- 列表项 ---------- */

.item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--surface);
}

.item:last-child { margin-bottom: 0; }
.item:hover { border-color: var(--border-strong); }

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.item-title { font-weight: 500; font-size: 14px; }

.item-meta {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

.item-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

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

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-weight: 500;
  color: var(--text-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

.cell-msg { max-width: 320px; word-break: break-word; }
.cell-truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sender-add-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--brand, #2563eb);
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sender-add-btn:hover { text-decoration: underline; }

.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- 日志时间筛选（按钮展开式） ----------
 * 盛哥 2026-10-13 要求：默认收起，点「按时间筛选」才展开，
 * 避免筛选控件长期占走表头宽度。 */

.date-filter-panel {
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.date-filter-panel[hidden] { display: none; }

.date-filter-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.date-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.date-filter-field label {
  font-size: 12px;
  color: var(--text-3);
}
.date-filter-field input[type="date"] {
  width: 152px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.date-filter-field input[type="date"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 111, 235, .12);
}

.date-filter-sep {
  font-size: 13px;
  color: var(--text-3);
  padding-bottom: 7px;
}

.date-filter-quick {
  display: flex;
  gap: 6px;
  margin-left: auto;
  padding-bottom: 1px;
}

/* 已选区间时，按钮本身给出反馈（蓝色 + 区间文案） */
#alllogs-date-toggle.is-active {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}

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

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  margin: auto 0;
}

.modal.wide { max-width: 880px; }

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

.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }

.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

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

#toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 11px 14px;
  font-size: 13px;
  animation: slide-in .18s ease-out;
}

.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-body { color: var(--text-2); word-break: break-word; }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

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

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
}

.login-brand .brand-logo { width: 38px; height: 38px; font-size: 15px; }
.login-brand h1 { margin: 0; font-size: 17px; font-weight: 600; }
.login-brand .sub { font-size: 12px; color: var(--text-3); }

/* ---------- 其他 ---------- */

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
  font-size: 14px;
}

.empty-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 18px;
  color: var(--text-3);
}

.loading { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }

.inline-code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.match-result {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.match-result.hit { border-color: #abefc6; background: var(--success-soft); }
.match-result.miss { background: var(--surface-2); }
.match-result.warn { border-color: #fedf89; background: var(--warning-soft); }

.preview-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  font-size: 13px;
  color: var(--text-2);
}

.step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  font-size: 13px;
}

.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
  flex-shrink: 0;
}

.step.active .step-num { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.done .step-num { background: var(--success); border-color: var(--success); color: #fff; }

.group-picker {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.group-row:last-child { border-bottom: none; }
.group-row:hover { background: var(--surface-2); }
.group-row input { width: 15px; height: 15px; accent-color: var(--brand); margin: 0; }
.group-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-meta { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .container { padding: 14px 14px 40px; }
  .item-head { flex-direction: column; }
  .item-actions { width: 100%; }
  .modal-body { padding: 16px; }
}

/* ---------- 窄屏：侧边栏改为顶部横向滚动条 ---------- */
@media (max-width: 860px) {
  .layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    flex-direction: column;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand {
    padding: 12px 14px;
    border-bottom: none;
  }

  .sidebar-brand .sub { display: none; }

  /* 导航变横向可滚动，不换行 */
  .sidebar-nav {
    display: flex;
    gap: 4px;
    padding: 0 10px 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-item {
    width: auto;
    flex-shrink: 0;
    margin-bottom: 0;
    white-space: nowrap;
  }

  .nav-item .count { margin-left: 6px; }

  .nav-group-title { display: none; }

  .sidebar-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
  }

  .sidebar-user { padding: 0; flex: 1; }

  .main-head { padding: 0 14px; height: 50px; }
  .main-body { padding: 14px 14px 40px; }
}
/* ===== 站点公告横幅 ===== */
.notice-banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--primary-soft, #eef4ff);
  border: 1px solid var(--primary, #3b7ddd);
  border-radius: var(--radius, 10px);
  padding: 12px 14px; margin: 0 0 14px;
}
.notice-icon { font-size: 18px; line-height: 1.4; flex-shrink: 0; }
.notice-body { flex: 1; min-width: 0; }
.notice-title { font-weight: 600; margin-bottom: 4px; }
.notice-content { font-size: 13px; line-height: 1.7; color: var(--text-2, #444); }
.notice-content p { margin: 0 0 6px; }
.notice-content p:last-child { margin-bottom: 0; }
.notice-content ul { margin: 4px 0; padding-left: 20px; }
.notice-content a { color: var(--primary, #3b7ddd); }
.notice-close {
  flex-shrink: 0; border: none; background: transparent; cursor: pointer;
  font-size: 16px; color: var(--text-2, #666); padding: 2px 6px; border-radius: 6px;
}
.notice-close:hover { background: rgba(0,0,0,.06); }

/* ===== 实时刷新指示灯 ===== */
.live-dot {
  font-size: 12px;
  color: #16a34a;
  white-space: nowrap;
  cursor: default;
  user-select: none;
  animation: live-pulse 2.4s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ===== 规则表单：消息类型勾选 ===== */
.checkbox-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }

/* 紫色徽标：消息类型过滤 */
.badge.badge-purple {
  background: rgba(139, 92, 246, .12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, .28);
}

/* ===== 系统公告：管理端历史列表 + 用户端合并弹窗 ===== */
.badge.badge-on { background: var(--success-soft, #e7f6ed); color: var(--success, #1a9c52); }
.badge.badge-off { background: var(--surface-2, #f2f4f7); color: var(--text-2, #666); }

.notice-hist {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 10px);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--surface, #fff);
}
.notice-hist-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.notice-hist-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-hist-meta { font-size: 12px; color: var(--text-2, #666); margin: 4px 0 6px; }
.notice-hist-body { font-size: 13px; line-height: 1.6; color: var(--text-2, #444); word-break: break-all; }
.notice-hist-actions { display: flex; gap: 8px; margin-top: 10px; }

.notice-block-title { font-weight: 600; font-size: 15px; }
.notice-block-meta { font-size: 12px; color: var(--text-2, #666); margin: 2px 0 8px; }

/* 窄屏（含手机）下两栏改单栏，避免挤压成两列细条 */
@media (max-width: 900px) {
  .notice-cols, .config-cols { grid-template-columns: 1fr !important; }
}

/* ===== 总览数据看板（替掉原来的「最近发送失败」表格） ===== */
.dgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.dcard {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 10px);
  padding: 14px 16px;
  background: var(--surface, #fff);
}
.dcard-head { font-size: 13px; color: var(--text-2, #666); margin-bottom: 6px; }
.dcard-main { font-size: 30px; font-weight: 650; line-height: 1.15; letter-spacing: -.5px; }
.dcard-sub { font-size: 13px; color: var(--text-2, #666); margin-top: 6px; }
.dcard-foot { font-size: 12px; color: var(--text-3, #999); margin-top: 8px; }

.drow { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.drow-label { font-size: 13px; color: var(--text-2, #666); }
.drow-val { display: flex; gap: 6px; flex-wrap: wrap; }

.dbar { height: 6px; border-radius: 3px; background: var(--surface-2, #f2f4f7); margin-top: 8px; overflow: hidden; }
.dbar-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }
.dbar-fill.ok { background: var(--success, #1a9c52); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.dot-ok { background: var(--success, #1a9c52); }
.dot-warn { background: var(--warning, #d98a00); }
.dot-err { background: var(--danger, #d93636); }
