:root {
  --bg: #f3f4fb;
  --card: #ffffff;
  --ink: #23283a;
  --muted: #7b8398;
  --line: #e9ebf4;
  --brand: #6d5bd0;
  --brand-2: #8b5cf6;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --shadow: 0 1px 2px rgba(35, 40, 58, .05), 0 8px 24px rgba(35, 40, 58, .05);
  --radius: 12px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

/* ---------------- 顶栏 ---------------- */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  box-shadow: 0 4px 12px rgba(35, 40, 58, .04);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.logo {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c5cf0, #a78bfa);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-text h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .2px; }

.brand-text p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.statusbar { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.statusbar > * { margin-right: 6px; }

.meta { white-space: nowrap; }

.ver {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fafbff;
  font-variant-numeric: tabular-nums;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: .5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #f4f6ff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.pill.ok { color: #0f766e; background: #ecfdf5; border-color: #d1fae5; }
.pill.ok .dot { background: var(--ok); }
.pill.bad { color: #b91c1c; background: #fef2f2; border-color: #fee2e2; }
.pill.bad .dot { background: var(--err); }

/* ---------------- 标签 ---------------- */
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 24px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.tab:hover { background: #e9ecfa; color: var(--ink); }

.tab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(109, 91, 208, .28);
}

/* ---------------- 视图 ---------------- */
main { padding: 14px 24px 0; }

.activity-toolbar { padding: 0 24px; }

.view { display: none; }
.view.active { display: block; }

/* ---------------- 分类筛选 ---------------- */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: #f6f7fd;
  color: #4b5266;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  cursor: pointer;
}

.chip i { width: 7px; height: 7px; border-radius: 50%; background: #b9bfd4; }

.chip.active { background: #ede9fe; border-color: #ddd6fe; color: #5b21b6; font-weight: 500; }
.chip.active i { box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }

/* ---------------- 组队横幅 ---------------- */
.banner {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 16px 60px;
  margin-bottom: 16px;
}

.banner::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 18px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c5cf0, #a78bfa);
  opacity: .15;
}

.banner h3 { margin: 0 0 6px; font-size: 15px; }

.banner p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

.banner .banner-actions {
  position: absolute;
  right: 18px;
  top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.banner .tag {
  display: inline-block;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f3f0ff;
  color: #6d28d9;
  font-size: 12px;
}

/* ---------------- 顶部操作栏 ---------------- */
.activity-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.act-stats-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.act-stats-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}

.act-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------------- 卡片网格 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}

.grid-empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--muted); }

.card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-top: 4px solid var(--accent, #3b82f6);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
  min-width: 0;
}

.card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06); }

.card-is-running {
  border-color: #c4b5fd;
  border-top-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, .12), 0 8px 20px rgba(109, 40, 217, .08);
}

.card-is-failed { border-color: #fecaca; border-top-color: var(--accent); }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  background: var(--accent, #3b82f6);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.card-title-group {
  flex: 1 1 auto;
  min-width: 0;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subname {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Switch 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
  margin-left: auto;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .2s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input:checked + .slider { background-color: #1677ff; }
input:checked + .slider:before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 3px solid #c4b5fd; outline-offset: 3px; }

/* 标签 Tags */
.card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
  border: 1px solid transparent;
}

.badge-ready { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.badge-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge-schedule { color: #64748b; }
.badge-status { margin-left: auto; font-weight: 600; }
.status-running { background: #6d28d9; color: #fff; }
.status-queued { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.status-idle { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.status-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.status-failed { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.status-canceled { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }

.badge-tag.green {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.badge-tag.blue {
  background: #eff6ff;
  color: #1677ff;
  border-color: #bae6fd;
}

.badge-tag.gray {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.card-desc {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.55;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-cron-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cron-text { color: #334155; font-weight: 600; }
.time-text { font-family: inherit; font-size: 11px; }

.card-cron-row .cron-code {
  color: #334155;
  font-weight: 500;
}

/* 统一加高、固定高度的日志框 */
.card-log-box {
  min-height: 112px;
  flex: 1 0 auto;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  padding: 0;
  font-size: 12px;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
}

/* 区分未运行状态 */
.card-log-box.is-idle {
  background: #f8fafc;
  color: #475569;
  border-style: dashed;
}

/* 区分运行中状态 */
.card-log-box.is-running {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #6d28d9;
}

.card-log-box.is-queued { background: #fffbeb; border-color: #fde68a; }
.card-log-box.is-failed { background: #fffafa; border-color: #fecaca; }
.card-log-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(148, 163, 184, .2);
  font: 600 12px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}
.execution-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: #94a3b8; }
.is-running .execution-dot { background: #7c3aed; animation: execution-pulse 1.4s ease-in-out infinite; }
.is-queued .execution-dot { background: #d97706; }
.is-success .execution-dot { background: #10b981; }
.is-failed .execution-dot { background: #ef4444; }
.card-log-content { flex: 1 1 auto; min-height: 0; padding: 9px 10px; }
.card-log-time { margin: 2px 0 7px; font-size: 11px; color: #64748b; font-variant-numeric: tabular-nums; }
.card-log-line { white-space: pre-wrap; margin-bottom: 5px; }
.card-log-line:last-child { margin-bottom: 0; }
.log-realtime:last-child { font-weight: 600; }
.summary-failed { color: #b91c1c; }
.summary-canceled { color: #64748b; }
.log-placeholder { color: #475569; font-size: 15px; font-weight: 600; margin: 12px 0 5px; }
.card-log-reason { margin-top: 12px; color: #92400e; }
@keyframes execution-pulse { 50% { box-shadow: 0 0 0 4px rgba(124, 58, 237, .13); } }

.card-footer {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.card-footer > button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.card-footer > button:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.card-footer > button:disabled { opacity: .5; cursor: not-allowed; }
.card-footer .btn-card-log { flex-grow: 1.6; }
.card-footer .btn-card-kouling { flex-grow: .8; }

.btn-card-edit {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}

.btn-card-edit:hover {
  background: #f8fafc;
  border-color: #9ca3af;
  color: #111827;
}

.btn-card-kouling {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #b45309;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}

.btn-card-kouling:hover { background: #fde68a; }

.btn-card-run {
  background: #0284c7;
  border: 1px solid #0284c7;
  color: #ffffff;
  padding: 6px 18px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.btn-card-run:hover { background: #0369a1; }
.btn-card-run:disabled { background: #94a3b8; border-color: #94a3b8; cursor: not-allowed; }

.btn-card-stop { border: 1px solid #fecaca; background: #fff5f5; color: #b91c1c; cursor: pointer; }
.btn-card-stop:hover:enabled { background: #fee2e2; border-color: #fca5a5; }
.btn-card-log { border: 1px solid #ddd6fe; background: #f5f3ff; color: #6d28d9; cursor: pointer; }
.btn-card-log:hover { background: #ede9fe; border-color: #c4b5fd; }

.card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }

.card-meta {
  margin-left: auto;
  font-size: 11.5px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #3d4356;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: filter .15s, background .15s;
  white-space: nowrap;
}

.btn:hover { background: #f7f8ff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  font-weight: 500;
}

.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn.ghost { background: #fff; }
.btn.danger { color: #b91c1c; border-color: #fee2e2; background: #fff5f5; }

/* ---------------- 面板 / 表格 ---------------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px 20px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: #1e293b; }

.hint { font-size: 12px; color: var(--muted); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 12px;
}

td { padding: 9px 10px; border-bottom: 1px solid #f3f4f9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }

td.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
td.nowrap { white-space: nowrap; }
td.result-summary { white-space: pre-wrap; }

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  background: #f3f4f6;
  color: #4b5563;
}

.badge.ok { background: #ecfdf5; color: #047857; }
.badge.err { background: #fef2f2; color: #b91c1c; }
.badge.run { background: #f5f3ff; color: #6d28d9; }
.badge.wait { background: #eff6ff; color: #1d4ed8; }

.empty { padding: 26px 10px; text-align: center; color: #9aa1b3; font-size: 12.5px; }

/* ---------------- 控制台 ---------------- */
.console {
  margin: 0;
  height: 58vh;
  overflow: auto;
  background: #0e1320;
  color: #d7dcea;
  border-radius: 10px;
  padding: 12px 14px;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------- 运行列表 ---------------- */
.run-list { display: grid; gap: 8px; }

.run-item {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
}

.run-item .name { font-weight: 500; }
.run-item .sub { color: var(--muted); font-size: 11.5px; }

/* ---------------- 表单（严整标准网格） ---------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
}

.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #4b5266; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 7px; }

.input {
  border: 1px solid #e3e6f0;
  background: #fbfcff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--ink);
  font-family: inherit;
  min-width: 0;
}

.input:focus { outline: none; border-color: #c4b5fd; background: #fff; box-shadow: 0 0 0 3px rgba(139, 92, 246, .12); }

textarea.input { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; }

.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 4px; }
.form-grid > .hint { grid-column: 1 / -1; margin: -2px 0 0; line-height: 1.7; }
.form-grid > .hint code { background: #f1f3f9; border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
.form-actions.inline { display: flex; align-items: center; gap: 8px; }

.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.form-row label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #4b5266; }

.kpi-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.kpi {
  flex: 1 1 120px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kpi span { font-size: 11px; color: var(--muted); }
.kpi b { font-size: 15px; color: #1e293b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  z-index: 2000;
}
.toast.ok { background: #047857; }
.toast.err { background: #b91c1c; }

/* ---------------- 模态弹窗 ---------------- */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  z-index: 10;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 440px;
  overflow: hidden;
  animation: modal-pop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
}

.btn-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
}

.btn-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.log-dialog {
  width: min(1040px, calc(100% - 32px));
  max-width: 1040px;
  height: min(84vh, 780px);
  display: flex;
  flex-direction: column;
}
.log-dialog .modal-body { flex: 1 1 auto; min-height: 0; }
.log-dialog .modal-foot { padding: 10px 18px; border-top: 1px solid var(--line); }
.log-history-label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #64748b; }
.log-history-label select { width: 100%; }
.log-modal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: #64748b; }
.log-detail-summary { width: 100%; color: #334155; overflow-wrap: anywhere; white-space: pre-wrap; }
#log-modal-content { flex: 1 1 auto; min-height: 120px; height: auto; max-height: none; margin: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------- 号码查询 ---------------- */
.query-page-head { align-items: center; }
.query-page-head > div { display: flex; flex-direction: column; gap: 4px; }
.query-page-head > .btn { margin-left: auto; }
.query-summary { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 14px; }
.query-summary-item { display: flex; align-items: baseline; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafaff; font-size: 12px; color: var(--muted); }
.query-summary-item b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.query-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 0 16px 18px; }

.phone-tile { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-height: 172px; background: linear-gradient(145deg, #ffffff, #f7f6ff); cursor: pointer; box-shadow: 0 3px 12px rgba(15, 23, 42, .04); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; outline: none; }
.phone-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--tile-accent, #7c3aed); }
.phone-tile:hover, .phone-tile:focus-visible { transform: translateY(-2px); border-color: #c7bfff; box-shadow: 0 12px 26px rgba(90, 70, 200, .14); }
.phone-tile.loading { cursor: progress; }
.phone-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phone-tile-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.phone-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--tile-accent, #7c3aed); box-shadow: 0 4px 10px rgba(90, 70, 200, .24); }
.phone-tile-name { font-weight: 700; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-tile-num { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.phone-status { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #e7f8f1; color: #0f9d73; white-space: nowrap; }
.phone-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.phone-status.err { background: #fdeaea; color: #d64545; }
.phone-status.wait { background: #eef0f6; color: var(--muted); }
.phone-balance { margin-top: 16px; }
.phone-balance-label { font-size: 11.5px; color: var(--muted); }
.phone-balance-value { font-size: 27px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.phone-balance-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.phone-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.phone-chip { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #f1f3f9; color: #475569; }
.phone-tile-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 11px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); }
.phone-tile-foot .go { color: var(--brand); font-weight: 600; }

/* 号码卡片内的彩色统计块（对照移动任务面板风格） */
.q-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 14px; }
.q-tile { border-radius: 12px; padding: 10px 12px 9px; background: #fff; border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 2px 8px rgba(15, 23, 42, .05); min-width: 0; }
.q-tile-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--q-accent, #7c3aed); opacity: .9; }
.q-tile-value { margin-top: 5px; font-size: 19px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-tile-value small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.q-tile-sub { margin-top: 3px; font-size: 10.5px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-tile[data-jump] { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.q-tile[data-jump]:hover, .q-tile[data-jump]:focus-visible { border-color: var(--q-accent, #7c3aed); box-shadow: 0 4px 12px rgba(90, 70, 200, .13); transform: translateY(-1px); }
.jump-links { display: inline-flex; align-items: center; gap: 8px; }
.jump-link { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 2px 8px; border-radius: 9px; background: #f1f0fa; cursor: pointer; transition: color .15s, background .15s; user-select: none; }
.jump-link:hover { color: var(--brand); background: #e9e5ff; }
.query-section.flash { animation: qsFlash 1.2s ease; }
@keyframes qsFlash { 0% { background: #f4f1ff; box-shadow: 0 0 0 2px #c7bfff inset; } 100% { background: transparent; box-shadow: none; } }

/* 弹窗内的历史快照栏 */
.query-history-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 9px 18px; border-bottom: 1px solid var(--line); background: #fafaff; }
.query-history-bar .qh-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.qh-chip { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #475569; cursor: pointer; font-variant-numeric: tabular-nums; transition: background .15s, border-color .15s; }
.qh-chip:hover { border-color: var(--brand); color: var(--brand); }
.qh-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.sk-line { height: 11px; border-radius: 6px; background: linear-gradient(90deg, #eef0f6 25%, #f8f9fc 37%, #eef0f6 63%); background-size: 400% 100%; animation: qshimmer 1.3s ease infinite; }
.sk-line.w80 { width: 80%; }
.sk-line.w50 { width: 50%; }
.sk-line.big { height: 29px; margin-top: 8px; }
@keyframes qshimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.query-dialog { max-width: 1040px; width: 94vw; height: 88vh; max-height: 88vh; display: flex; flex-direction: column; }
.query-dialog .modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 18px 18px; }
.query-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.query-head h3 { margin: 0; font-size: 17px; }
.query-head .query-meta { color: var(--muted); font-size: 12px; }
.query-toolbar { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.query-toolbar input[type=month] { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.query-section { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.query-section-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--line); background: #fafaff; }
.query-section-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.query-section-body { padding: 12px 14px; }
.query-error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 9px 12px; font-size: 12px; }
.query-empty { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; min-height: 220px; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--radius); }
.query-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.query-stat { border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; background: linear-gradient(180deg, #ffffff, #fafaff); }
.query-stat .label { font-size: 12px; color: var(--muted); }
.query-stat .value { font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.query-stat .value small { font-size: 12px; font-weight: 500; color: var(--muted); }
.query-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.query-table th, .query-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.query-table th { color: var(--muted); font-weight: 600; background: #fafaff; white-space: nowrap; }
.query-table td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.query-detail { margin: 4px 0 0; padding-left: 14px; color: var(--muted); font-size: 11.5px; }
.query-detail li { margin: 2px 0; }
.query-chip { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 10px; background: #eef0f6; color: var(--muted); margin-left: 4px; }
.query-loading { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.query-spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: qspin .8s linear infinite; }
@keyframes qspin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .query-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); padding: 0 12px 14px; gap: 10px; }
  .query-summary { padding: 0 12px 12px; }
  .phone-balance-value { font-size: 23px; }
  .phone-tile { padding: 13px; min-height: 158px; }
  .q-tiles { gap: 7px; }
  .q-tile { padding: 8px 10px 7px; }
  .q-tile-value { font-size: 16px; }
  .query-dialog { width: 96vw; height: 92vh; max-height: 92vh; }
  .query-head .query-toolbar { margin-left: 0; width: 100%; }

  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-text h1 { font-size: 15px; }
  .brand-text p { display: none; }
  .logo { width: 32px; height: 32px; flex-basis: 32px; font-size: 16px; }
  .statusbar { gap: 7px; font-size: 11px; }
  #last-ok, .statusbar .ver { display: none; }
  .clock { font-size: 12px; }
  .tabs { padding: 8px 12px; }
  .tab { padding: 6px 11px; font-size: 12.5px; }
  .activity-toolbar { padding: 0 12px; }
  .activity-top-bar { flex-wrap: wrap; gap: 7px; padding: 9px 12px; margin-bottom: 8px; }
  .act-top-actions { margin-left: auto; }
  .act-stats-sub { font-size: 11px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding: 8px 10px; margin-bottom: 8px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; padding: 5px 10px; }
  main { padding: 10px 12px 0; }
  .grid { gap: 12px; }
  .card { padding: 14px; }
  .log-dialog { width: calc(100% - 20px); height: 90vh; }
  .log-dialog .modal-body { padding: 12px; }
  .log-modal-meta { gap: 5px 10px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .is-running .execution-dot { animation: none; }
  .card, .modal-dialog { transition: none; animation: none; }
}

/* ---------------- 明细弹窗页签 ---------------- */
.query-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.query-tab { padding: 6px 13px; border-radius: 18px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.query-tab:hover { border-color: #c7bfff; color: var(--brand); }
.query-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.query-pane { display: none; }
.query-pane.active { display: block; animation: qpIn .18s ease; }
@keyframes qpIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.query-pane .q-tiles { grid-template-columns: repeat(3, 1fr); }
.table-wrap { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.table-wrap.tall { max-height: 46vh; }
.table-wrap .query-table { margin: 0; }
.table-wrap .query-table thead th { position: sticky; top: 0; z-index: 1; box-shadow: 0 1px 0 var(--line); }

/* ---------------- 收益聚合 ---------------- */
#earnings-kind-grid .q-tile { min-height: 82px; }
#earnings-groups .query-section-body { padding: 4px 14px 10px; }
