:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #11151b;
  --panel-2: #171c23;
  --line: rgba(231, 242, 234, 0.1);
  --text: #e7f2ea;
  --muted: #c5d1cb;
  --faint: #8fa399;
  --accent: #39e58c;
  --accent-ink: #062116;
  --danger: #ff8b98;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  font-family: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    linear-gradient(180deg, rgba(57, 229, 140, 0.05), transparent 220px),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mark {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 16px rgba(57, 229, 140, 0.45);
}

.pipeline {
  margin: 0;
  color: var(--faint);
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: rgba(17, 21, 27, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login { max-width: 560px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.deck, .empty p, .hint, .summary {
  color: var(--muted);
  line-height: 1.6;
}

.deck { margin: 14px 0 22px; }

label {
  display: block;
  margin: 16px 0 8px;
  color: var(--faint);
  font-size: 13px;
  letter-spacing: 0.04em;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 12px 14px;
  outline: none;
}

textarea { resize: vertical; min-height: 88px; }

#brief {
  min-height: 240px;
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.55;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(57, 229, 140, 0.7);
  box-shadow: 0 0 0 3px rgba(57, 229, 140, 0.15);
}

button {
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer;
}

button:hover { filter: brightness(1.05); }

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.hint { margin: 8px 0 0; font-size: 13px; }

.error {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: var(--danger);
}

.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.steps {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 12px;
  padding: 4px 10px;
}

.steps li.on {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.steps li.done {
  color: var(--accent);
  border-color: rgba(57, 229, 140, 0.45);
}

.empty p:first-child {
  margin-top: 28px;
  color: var(--text);
  font-size: 18px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}

.dot.wait {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}

.dot.good { background: var(--accent); }
.dot.bad { background: var(--danger); }

.job-id {
  margin: 10px 0 0;
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--faint);
  word-break: break-all;
}

.summary {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(57, 229, 140, 0.08);
}

.wait {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.wait p { margin: 0; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(57, 229, 140, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}

#artifacts {
  margin: 0;
  padding: 0;
  list-style: none;
}

#artifacts li {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  word-break: break-all;
}

#artifacts a { color: var(--accent); }

#done-block, #brief-block { margin-top: 18px; }

.noscript { margin: 20px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  50% { opacity: 0.35; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .top { align-items: flex-start; flex-direction: column; }
  .panel { padding: 22px 18px; }
  .stage-head { flex-direction: column; }
}
