/* 管理后台专属样式（复用 styles.css 的变量与账号栏/登录门禁样式） */
.admin-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 22px 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

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

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

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  background: var(--bg-2);
}

.admin-table tbody tr:hover {
  background: var(--violet-soft);
}

.admin-table td.device-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

.status-pill.active {
  background: #eaf6ee;
  border: 1px solid #cfe9d7;
  color: #2f7d46;
}

.status-pill.disabled {
  background: var(--rose-soft);
  border: 1px solid var(--rose-line);
  color: var(--rose);
}

.admin-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-btn {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.mini-btn:hover { border-color: var(--violet); color: var(--violet-deep); }
.mini-btn.danger:hover { border-color: var(--rose); color: var(--rose); }

/* 删除是不可逆的危险操作，用实心红底强调，与禁用/启用区分开。 */
.mini-btn.delete {
  border-color: var(--rose);
  background: var(--rose);
  color: #fff;
}
.mini-btn.delete:hover {
  filter: brightness(0.92);
  border-color: var(--rose);
  color: #fff;
}

.admin-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Beta 数据看板 ---------- */
.dash-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 8px;
}

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

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  padding: 14px 16px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--violet-deep);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.dash-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 720px) {
  .dash-cols { grid-template-columns: 1fr; }
}

.dash-sub {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.dash-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.dash-bar-label {
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-bar-track {
  height: 10px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}

.dash-bar-fill {
  height: 100%;
  background: var(--violet);
  border-radius: 999px;
}

.dash-bar-count {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dash-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0;
}

.err-cell {
  max-width: 320px;
  white-space: normal;
  color: var(--rose);
  font-size: 12px;
}

.rating-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}
.rating-pill.good { background: #eaf6ee; border: 1px solid #cfe9d7; color: #2f7d46; }
.rating-pill.mid { background: var(--violet-soft); border: 1px solid var(--violet-line); color: var(--violet-deep); }
.rating-pill.bad { background: var(--rose-soft); border: 1px solid var(--rose-line); color: var(--rose); }

.tag-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag-chip {
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-soft);
}

/* 复核结论来源小标（人工/自动） */
.verdict-src {
  font-size: 11px;
  color: var(--muted);
}

/* ---------- 生成记录详情弹窗 ---------- */
.job-modal {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 26, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
/* [hidden] 兜底：class 的 display:flex 会盖过 HTML hidden 属性，必须显式关闭。 */
.job-modal[hidden] { display: none !important; }
.job-modal-card {
  background: var(--panel);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 24px;
  position: relative;
}
.job-modal-card h2 { margin: 0 0 16px; font-size: 17px; }
.job-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.job-modal-close:hover { color: var(--ink); }
.job-detail-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.job-detail-row .jd-key { color: var(--muted); }
.job-detail-row .jd-val { color: var(--ink); word-break: break-word; }
.job-thumbs { display: flex; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.job-thumb { text-align: center; }
.job-thumb img {
  max-width: 220px;
  max-height: 180px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  display: block;
}
.job-thumb span { font-size: 11px; color: var(--muted); display: block; margin-top: 4px; }
.job-fb-item {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 12.5px;
}

.admin-body .auth-overlay {
  background:
    radial-gradient(1200px 520px at 78% -8%, rgba(123, 108, 246, 0.12), transparent 60%),
    var(--bg);
  backdrop-filter: none;
}
