:root {
  --bg: #f8f4eb;
  --surface: #fffdf8;
  --ink: #191919;
  --muted: #595959;
  --line: #1e1e1e;
  --brand: #f05a28;
  --brand-dark: #c84214;
  --accent: #0e7a71;
  --accent-soft: #c3f3ee;
  --danger: #a11f1f;
  --ok: #0c7b46;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Outfit", "IBM Plex Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--display);
  background: radial-gradient(circle at 6% 9%, #ffdcbf 0%, transparent 36%),
    radial-gradient(circle at 90% 2%, #b9efe8 0%, transparent 34%),
    linear-gradient(150deg, #f8f4eb 0%, #efe8dc 100%);
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: linear-gradient(to right, #000 1px, transparent 1px),
    linear-gradient(to bottom, #000 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 80%);
}

.page {
  width: min(980px, 92vw);
  margin: 30px auto 44px;
  display: grid;
  gap: 14px;
}

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

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

h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.lang-btn {
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  min-width: 72px;
  height: 38px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}

.lang-btn:hover {
  transform: translateY(-1px);
  background: #fff7ec;
}

.card {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--surface);
  box-shadow: 5px 5px 0 #00000020;
}

.intro p {
  margin: 0;
  color: #333;
  font-weight: 500;
}

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

h2 {
  margin: 0;
  font-size: 1.08rem;
}

.pill {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #ffd3bf;
}

.pill.alt {
  background: var(--accent-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
button {
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 600 14px var(--display);
  padding: 10px 12px;
}

input,
select {
  font-family: var(--mono);
  font-weight: 600;
}

button {
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}

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

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

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

.full {
  grid-column: 1 / -1;
}

.primary {
  background: var(--brand);
  color: #fff;
  border-color: #000;
}

.primary:hover {
  background: var(--brand-dark);
}

.ghost {
  background: #fff7ef;
}

.danger {
  background: #ffe1de;
  color: var(--danger);
}

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

.step-item {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.step-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.step-title {
  font-weight: 700;
}

.step-state {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 12px;
  font-weight: 800;
}

.step-detail {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.step-item.pending .step-state {
  background: #ececec;
}

.step-item.loading .step-state {
  background: #ffe39d;
}

.step-item.success {
  border-color: #138250;
}

.step-item.success .step-state {
  background: #c9f5df;
  color: #0c7b46;
}

.step-item.error {
  border-color: #b83333;
}

.step-item.error .step-state {
  background: #ffe1de;
  color: #a11f1f;
}

.output .section-head {
  margin-bottom: 8px;
}

.badge {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge.idle {
  background: #ececec;
}

.badge.loading {
  background: #ffe39d;
}

.badge.success {
  background: #c9f5df;
  color: var(--ok);
}

.badge.error {
  background: #ffe1de;
  color: var(--danger);
}

.summary {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
  font-weight: 700;
}

.logs {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 7px;
}

.logs li {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.logs .ok {
  color: var(--ok);
}

.logs .err {
  color: var(--danger);
}

@media (max-width: 850px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .page {
    margin-top: 20px;
  }

  .topbar {
    align-items: center;
  }
}
