:root {
  --bg: #080808;
  --panel: #111;
  --panel-2: #171717;
  --border: #2a2a2a;
  --text: #f6f6f6;
  --muted: #c9c9c9;
  --subtle: #8f8f8f;
  --danger: #ff9a9a;
  --success: #9af0c1;
  --warn: #ffd88a;
  --accent: #7c8aff;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.download {
  min-height: 42px;
  border: 1px solid #fff;
  border-radius: var(--radius-md);
  background: #fff;
  color: #000;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

button:hover,
.download:hover {
  background: #e8e8e8;
}

button.secondary {
  background: transparent;
  color: var(--text);
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

button:disabled,
.download.disabled {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  cursor: not-allowed;
  pointer-events: none;
}

.shell {
  width: min(960px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.auth-card {
  width: min(520px, 100%);
  margin: 12vh auto 0;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.auth-card h1,
.topbar h1 {
  margin: 8px 0;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: -0.04em;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

label {
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #050505;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #fff;
}

textarea {
  min-height: 240px;
  resize: vertical;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
}

code,
pre {
  font-family: Consolas, "Cascadia Mono", monospace;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 800;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.input-section {
  margin-bottom: 20px;
}

.mode-section {
  margin-bottom: 20px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.panel-head strong {
  color: var(--text);
  white-space: nowrap;
}

.mode-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.mode-card h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.mode-card button {
  width: fit-content;
  margin-top: 8px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}

.message {
  min-height: 28px;
  color: var(--warn);
  margin: 14px 0;
}

.error {
  color: var(--danger);
  min-height: 24px;
}

.badge {
  align-self: flex-start;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  background: var(--panel-2);
  white-space: nowrap;
}

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

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

th,
td {
  border-top: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--subtle);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td {
  color: var(--muted);
}

.row-success td {
  color: var(--success);
}

.row-failed td {
  color: var(--danger);
}

.row-running td {
  color: var(--warn);
}

.empty {
  text-align: center;
  color: var(--subtle);
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 20px, 100%);
    padding-top: 24px;
  }

  .topbar,
  .panel-head,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
}
