*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Report modal ── */
.report-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modal-in .35s cubic-bezier(.34,1.56,.64,1) both;
}
.report-modal.hidden { display: none; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(.88); }
  to   { opacity: 1; transform: scale(1); }
}

.report-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 13, 23, .72);
  backdrop-filter: blur(6px);
}

.report-card {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

.report-header {
  padding: 32px 28px 24px;
  text-align: center;
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff;
}

.report-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 14px;
}
.report-icon.warn { color: #fbbf24; border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.1); }
.report-icon.fail { color: #f87171; border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.1); }

.report-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.report-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,.55);
}

/* Group rows */
.report-groups {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-group-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.report-group-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.report-group-label {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}

.report-group-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.rg-ok   { color: var(--success); font-weight: 600; }
.rg-fail { color: var(--failed);  font-weight: 600; }
.rg-avg  { color: var(--text-muted); }

/* Mini progress bar */
.report-rate-track {
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.report-rate-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .6s ease .1s;
}
.rate-high   { background: var(--success); }
.rate-medium { background: var(--running); }
.rate-low    { background: var(--failed);  }

/* Footer */
.report-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
}
.report-footer .btn-primary { flex: 1; }

.btn-ghost {
  flex: 1;
  padding: 8px 20px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

@media (max-width: 480px) {
  .report-header { padding: 24px 20px 18px; }
  .report-groups { padding: 12px 14px; }
  .report-footer { padding: 12px 14px 16px; }
}

/* ── Launch overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s ease, visibility .5s ease;
}
.overlay.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #0d1b2a 0%, #060d17 100%);
}

.overlay-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.overlay-title {
  color: rgba(255,255,255,.45);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Ripple rings */
.launch-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(99, 179, 237, .35);
  animation: ripple-out 3s ease-out infinite;
  pointer-events: none;
}
.r1 { width: 180px; height: 180px; animation-delay: 0s; }
.r2 { width: 180px; height: 180px; animation-delay: 1s; }
.r3 { width: 180px; height: 180px; animation-delay: 2s; }

@keyframes ripple-out {
  0%   { transform: scale(1);    opacity: .6; }
  100% { transform: scale(2.2);  opacity: 0;  }
}

/* Circle button */
.launch-btn {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: radial-gradient(circle at 40% 35%, #3b82f6, #1d4ed8 60%, #1e3a8a);
  box-shadow:
    0 0 0 6px rgba(59,130,246,.15),
    0 0 40px rgba(59,130,246,.4),
    0 8px 32px rgba(0,0,0,.5);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.launch-btn:not(:disabled):hover {
  transform: scale(1.06);
  box-shadow:
    0 0 0 8px rgba(59,130,246,.2),
    0 0 60px rgba(59,130,246,.55),
    0 12px 40px rgba(0,0,0,.5);
}
.launch-btn:not(:disabled):active {
  transform: scale(.96);
}
.launch-btn:disabled {
  background: radial-gradient(circle at 40% 35%, #4b5563, #374151);
  box-shadow: 0 0 0 6px rgba(255,255,255,.05), 0 8px 24px rgba(0,0,0,.4);
  cursor: default;
}
.launch-btn:disabled .ripple { display: none; }

:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --border: #e0e4ea;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --failed: #dc2626;
  --failed-bg: #fee2e2;
  --running: #d97706;
  --running-bg: #fef3c7;
  --pending: #9ca3af;
  --pending-bg: #f3f4f6;
  --header-h: 60px;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.status-idle  { color: var(--text-muted); font-size: 13px; }
.status-run   { color: var(--running);    font-size: 13px; font-weight: 600; }
.status-done  { color: var(--success);    font-size: 13px; font-weight: 600; }
.status-error { color: var(--failed);     font-size: 13px; }

/* ── Progress bar ── */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.progress-wrap.hidden { display: none; }

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .25s ease;
}
.progress-bar-fill.done { background: var(--success); }

.progress-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}

/* ── Main ── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Info card ── */
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 6px 0;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }

.info-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.info-label {
  font-size: 13px;
  color: var(--text-muted);
  width: 130px;
  flex-shrink: 0;
}

.info-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.info-loading {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
  font-family: inherit;
}

@media (max-width: 480px) {
  .info-label { width: 100px; }
  .info-value { font-size: 12px; word-break: break-all; }
}

/* ── Group card ── */
.group-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
}
.badge-gi { background: #dbeafe; color: #1d4ed8; }
.badge-gc { background: #d1fae5; color: #065f46; }
.badge-gs { background: #ede9fe; color: #5b21b6; }

.group-title {
  font-size: 15px;
  font-weight: 700;
}

.group-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Summary row under header ── */
.group-summary {
  display: flex;
  gap: 20px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: #f7f8fa;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.group-summary span { display: flex; align-items: center; gap: 4px; }
.sum-ok  { color: var(--success); font-weight: 600; }
.sum-fail { color: var(--failed); font-weight: 600; }

/* ── Table wrapper (scroll on mobile) ── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8faff; }

td {
  padding: 10px 12px;
  vertical-align: middle;
}

.td-url {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  max-width: 240px;
}

.td-geo-ip {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-remark {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.td-stat {
  text-align: center;
  white-space: nowrap;
}

/* ── Round cell badge ── */
.round-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.round-pending  { background: var(--pending-bg);  color: var(--pending); }
.round-running  { background: var(--running-bg);  color: var(--running); }
.round-success  { background: var(--success-bg);  color: var(--success); font-weight: 600; }
.round-failed   { background: var(--failed-bg);   color: var(--failed);  font-weight: 600; }

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-success { background: var(--success); }
.dot-failed  { background: var(--failed); }
.dot-pending { background: var(--pending); }
.dot-running { background: var(--running); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ── Stats ── */
.stat-success { color: var(--success); font-weight: 700; }
.stat-failed  { color: var(--failed);  font-weight: 700; }
.stat-time    { color: var(--text-muted); font-size: 12px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  header h1 { font-size: 15px; }
  .btn-primary { padding: 7px 14px; font-size: 13px; }
  main { padding: 12px 10px 32px; }
  .group-header { padding: 12px 14px; }
  td, thead th { padding: 9px 10px; }
  .td-url { font-size: 11px; max-width: 160px; }
}

