:root {
  --ink: #16141a;
  --muted: #6b6572;
  --paper: rgba(255, 250, 245, 0.92);
  --line: rgba(40, 28, 20, 0.12);
  --accent: #c45c26;
  --accent-2: #1f6f6a;
  --ok: #1f7a4d;
  --bad: #b42318;
  --shadow: 0 18px 50px rgba(40, 24, 12, 0.14);
  --radius: 18px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Segoe UI Semibold", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #f3ebe3;
}

.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, #ffd7b8 0%, transparent 60%),
    radial-gradient(800px 480px at 100% 0%, #c8ebe4 0%, transparent 55%),
    linear-gradient(180deg, #f7f0e8 0%, #efe4d8 100%);
}

.shell {
  width: min(920px, calc(100% - 28px));
  margin: 28px auto 64px;
}

.top {
  display: flex; justify-content: space-between; gap: 16px; align-items: end;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: -0.02em;
}
.sub { margin: 8px 0 0; color: var(--muted); }
.health {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}
.health.ok { color: var(--ok); }
.health.bad { color: var(--bad); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 8px; font-size: 20px; }
.hint { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.wf-meta { margin: -6px 0 10px; color: var(--accent-2); font-size: 13px; min-height: 1.2em; }

.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: center; }
.grow { flex: 1 1 220px; }

label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
label.check {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink); font-size: 14px;
}
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
textarea { resize: vertical; min-height: 110px; }
input[type="file"] {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.65);
}

button, .ghost {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
button:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.55; cursor: wait; }
.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  background: rgba(255,255,255,0.55);
  color: var(--ink);
  border: 1px solid var(--line);
}
.tab.active {
  background: var(--accent-2);
  color: #fff;
  border-color: transparent;
}

.err { color: var(--bad); margin-top: 10px; }
.log {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #1d1a17;
  color: #f4ebe3;
  font-size: 12px;
  line-height: 1.45;
  overflow: auto;
  max-height: 280px;
  white-space: pre-wrap;
}

.jobs { display: grid; gap: 10px; }
.job {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  cursor: pointer;
}
.job:hover { border-color: rgba(31,111,106,0.45); }
.job .id { font-size: 12px; color: var(--muted); }
.job .state { font-weight: 700; }
.job .state.done { color: var(--ok); }
.job .state.error { color: var(--bad); }
.job .state.running, .job .state.queued { color: var(--accent); }

.outputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.out {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.out a {
  display: block;
  padding: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}
.out video, .out img {
  width: 100%;
  display: block;
  background: #111;
  max-height: 180px;
  object-fit: cover;
}

@media (max-width: 640px) {
  .top { flex-direction: column; align-items: start; }
  .shell { margin-top: 16px; }
}
