:root {
  --bg: #0b1020;
  --bg-soft: #11182d;
  --card: rgba(16, 24, 40, 0.88);
  --card-strong: #141c33;
  --text: #edf2ff;
  --muted: #aab5d6;
  --border: rgba(182, 194, 255, 0.14);
  --accent: #7c9cff;
  --accent-2: #58d0ff;
  --ok: #2ad17d;
  --warn: #ffb84d;
  --bad: #ff6b81;
  --info: #74a7ff;
  --shadow: 0 20px 60px rgba(4, 8, 20, 0.38);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 156, 255, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(88, 208, 255, 0.16), transparent 26%),
    linear-gradient(180deg, #090d1a, #10192d 48%, #080c18);
  color: var(--text);
}

button, input, textarea {
  font: inherit;
}

a { color: inherit; text-decoration: none; }

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.6;
  z-index: 0;
}
.ambient-a { top: -30px; left: -10px; width: 220px; height: 220px; background: rgba(124, 156, 255, 0.18); }
.ambient-b { right: -20px; top: 120px; width: 260px; height: 260px; background: rgba(88, 208, 255, 0.12); }

.shell, .admin-shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 60px; }

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 10px;
}

.hero h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  margin: 0 0 10px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, rgba(19, 27, 48, 0.92), rgba(13, 18, 34, 0.88));
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  min-width: 260px;
}

.hero-card .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 8px rgba(42, 209, 125, 0.12);
}

.hero-card strong { display: block; font-size: 15px; margin-bottom: 3px; }
.hero-card small { color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.94), rgba(10, 16, 30, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.field textarea,
.field input,
.copy-field input,
.inline-field input {
  width: 100%;
  border: 1px solid rgba(182, 194, 255, 0.16);
  background: rgba(11, 16, 32, 0.86);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 15px;
  outline: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.field textarea:focus,
.field input:focus,
.copy-field input:focus,
.inline-field input:focus {
  border-color: rgba(124, 156, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.12);
}

.field textarea { min-height: 180px; resize: vertical; }

.inline-field,
.copy-field {
  display: flex;
  gap: 10px;
}

.inline-field input,
.copy-field input {
  flex: 1;
}

.action-row,
.copy-row,
.meta-row,
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-row {
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 14px;
}

.mini-pill,
.badge,
.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1;
  border: 1px solid transparent;
}

.mini-pill {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border-color: rgba(255,255,255,0.08);
}

.badge.idle { background: rgba(116, 167, 255, 0.12); color: #cfe0ff; border-color: rgba(116, 167, 255, 0.24); }
.badge.ok, .status-pill.ok { background: rgba(42, 209, 125, 0.14); color: #b6ffd9; border-color: rgba(42, 209, 125, 0.28); }
.badge.warn, .status-pill.warn { background: rgba(255, 184, 77, 0.14); color: #ffe0a7; border-color: rgba(255, 184, 77, 0.24); }
.badge.bad, .status-pill.bad { background: rgba(255, 107, 129, 0.14); color: #ffced6; border-color: rgba(255, 107, 129, 0.24); }
.badge.info, .status-pill.info { background: rgba(116, 167, 255, 0.14); color: #d3e2ff; border-color: rgba(116, 167, 255, 0.24); }

.primary,
.secondary,
.ghost,
.danger,
.small-btn {
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease, border-color .16s ease, background .16s ease;
}

.primary, .secondary, .ghost, .danger {
  padding: 13px 16px;
}

.small-btn {
  padding: 8px 10px;
  border-radius: 12px;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08101d;
  font-weight: 700;
}

.secondary {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: var(--text);
}

.ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.08);
  color: var(--muted);
}

.danger {
  background: rgba(255, 107, 129, 0.16);
  color: #ffced6;
  border-color: rgba(255, 107, 129, 0.24);
}

.primary:hover, .secondary:hover, .ghost:hover, .danger:hover, .small-btn:hover {
  transform: translateY(-1px);
}

.primary:disabled, .secondary:disabled, .ghost:disabled, .danger:disabled, .small-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.error {
  margin-top: 12px;
  background: rgba(255, 107, 129, 0.14);
  color: #ffd2da;
  border: 1px solid rgba(255, 107, 129, 0.24);
  padding: 12px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
}

.hidden { display: none !important; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.summary-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 12px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.summary-card strong {
  display: block;
  font-size: 16px;
}

.result-urls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 14px;
}

.url-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(124, 156, 255, 0.12);
  border: 1px solid rgba(124, 156, 255, 0.24);
  color: #dbe4ff;
  max-width: 180px;
  cursor: pointer;
  text-align: left;
  flex: 0 1 180px;
}

.url-chip-index {
  min-width: 18px;
  text-align: center;
  color: #f5f8ff;
  opacity: 0.95;
}

.url-chip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.result-table-wrap table {
  table-layout: fixed;
}

.result-table-wrap th,
.result-table-wrap td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-preview,
.result-preview {
  max-width: 0;
}

thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
}

tbody tr:hover td {
  background: rgba(255,255,255,0.02);
}

.log-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.log-line {
  display: grid;
  grid-template-columns: 98px 130px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.log-line time {
  color: var(--muted);
  font-size: 12px;
}

.log-line b {
  font-size: 12px;
  color: #cfe0ff;
}

.log-line span {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line.ok { border-color: rgba(42, 209, 125, 0.18); }
.log-line.warn { border-color: rgba(255, 184, 77, 0.18); }
.log-line.fail { border-color: rgba(255, 107, 129, 0.18); }
.log-line.muted { color: var(--muted); display: block; }

.empty-note {
  color: var(--muted);
  padding: 18px 0;
  text-align: center;
}

.detail-stack {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.detail-row strong {
  color: var(--text);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.copy-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-inline input {
  flex: 1;
}

@media (max-width: 980px) {
  .hero, .layout {
    grid-template-columns: 1fr;
    display: grid;
  }
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-card {
    min-width: 0;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 18px;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 15px;
  }
  .log-line {
    grid-template-columns: 1fr;
  }
}
