:root {
  --bg: #f5efe4;
  --bg-strong: #e7dac3;
  --panel: rgba(255, 251, 245, 0.9);
  --ink: #1f2a1f;
  --muted: #5f665c;
  --line: rgba(31, 42, 31, 0.12);
  --accent: #9b4d1f;
  --accent-soft: #d88b4e;
  --ok: #2f6a3c;
  --warn: #9a6a0d;
  --bad: #8b2c2c;
  --shadow: 0 20px 60px rgba(75, 52, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(216, 139, 78, 0.26), transparent 28%),
    radial-gradient(circle at right, rgba(155, 77, 31, 0.18), transparent 24%),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 100%);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(420px, 100%);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1, h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

h2 {
  font-size: 1.2rem;
}

.subtitle, .panel span, label {
  color: var(--muted);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  min-width: 420px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.grid.wide {
  grid-template-columns: 1.4fr 1fr;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel.compact strong {
  display: block;
  margin-top: 6px;
}

.form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

input, button {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font: inherit;
}

input {
  background: rgba(255, 255, 255, 0.82);
}

button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
  color: white;
  cursor: pointer;
  border: none;
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.ghost {
  background: rgba(31, 42, 31, 0.08);
  color: var(--ink);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 4px 10px;
  border-radius: 999px;
  color: white;
  text-transform: capitalize;
}

.badge.pending {
  background: var(--warn);
}

.badge.running {
  background: var(--accent);
}

.badge.completed {
  background: var(--ok);
}

.badge.failed, .badge.cancelled {
  background: var(--bad);
}

.path-cell {
  max-width: 320px;
  word-break: break-all;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.log-view {
  margin: 0;
  min-height: 360px;
  max-height: 520px;
  overflow: auto;
  border-radius: 18px;
  padding: 16px;
  background: #1e201f;
  color: #eff6e7;
  font-family: Consolas, Monaco, monospace;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ok);
  color: white;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--bad);
}

.toast.hidden {
  display: none;
}

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

@media (max-width: 1120px) {
  .grid,
  .grid.wide,
  .hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-meta {
    min-width: 0;
    grid-template-columns: 1fr;
  }
}

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

  .actions {
    flex-direction: column;
  }
}
