:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #66726a;
  --paper: #f5f7f5;
  --surface: #ffffff;
  --line: #d9dfda;
  --green: #16784b;
  --green-dark: #0d5d39;
  --amber: #a86408;
  --red: #b42318;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button, input, textarea { font: inherit; letter-spacing: 0; }

.topbar {
  min-height: 88px;
  padding: 18px max(24px, calc((100vw - 1080px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--ink);
  border-bottom: 4px solid #5eb77f;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; font-weight: 650; }
h2 { margin-bottom: 22px; font-size: 25px; }
h3 { margin-bottom: 0; font-size: 17px; }

.eyebrow, .section-label {
  margin-bottom: 4px;
  color: #9fc8ad;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

main { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.login-view { min-height: calc(100vh - 150px); display: grid; place-items: center; }

.login-panel {
  width: min(420px, 100%);
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 36px rgb(23 33 27 / 8%);
}

form, .command-panel { display: grid; gap: 12px; }
label { color: #354138; font-size: 14px; font-weight: 600; }

input, textarea {
  width: 100%;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
  border: 1px solid #bfc8c1;
  border-radius: 4px;
  outline: none;
}

input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(22 120 75 / 12%); }
textarea { resize: vertical; min-height: 106px; }

button { min-height: 44px; border-radius: 4px; cursor: pointer; }
.primary-button { padding: 0 18px; color: white; background: var(--green); border: 1px solid var(--green); font-weight: 650; }
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { cursor: wait; opacity: .65; }
.secondary-button { padding: 0 18px; color: var(--green-dark); background: white; border: 1px solid var(--green); font-weight: 650; }
.secondary-button:hover { background: #eef7f1; }
.secondary-button:disabled { cursor: wait; opacity: .65; }
.quiet-button { padding: 0 14px; color: white; background: transparent; border: 1px solid #647068; }
.error-text { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 14px; }

.control-view { padding: 42px 0 56px; }
.status-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.status-band h2 { margin-bottom: 0; }
.status-band .section-label { color: var(--green); }

.status-badge { min-width: 122px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 650; }
.status-badge span { width: 9px; height: 9px; flex: 0 0 auto; background: #98a29b; border-radius: 50%; }
.status-badge.running span { background: var(--amber); box-shadow: 0 0 0 4px rgb(168 100 8 / 12%); }
.status-badge.success span { background: var(--green); box-shadow: 0 0 0 4px rgb(22 120 75 / 12%); }
.status-badge.failed span { background: var(--red); box-shadow: 0 0 0 4px rgb(180 35 24 / 12%); }

.workspace { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 36px; padding-top: 32px; }
.command-panel { align-content: start; }
.result-panel { min-width: 0; padding-left: 36px; border-left: 1px solid var(--line); }
.result-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.result-heading time { color: var(--muted); font-size: 12px; }
dl { margin: 0 0 18px; }
dl div { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 13px; }
dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-family: Consolas, monospace; font-size: 13px; }
pre { min-height: 150px; margin: 0; padding: 16px; overflow: auto; color: #d7e7db; background: #202b24; border-radius: 5px; font: 13px/1.65 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
footer { padding: 18px; color: #849087; text-align: center; font-size: 12px; }

@media (max-width: 720px) {
  .topbar { min-height: 76px; padding: 14px 18px; }
  h1 { font-size: 20px; }
  main { width: min(100% - 28px, 1080px); }
  .control-view { padding-top: 28px; }
  .status-band { align-items: flex-end; }
  .status-band h2 { font-size: 21px; }
  .workspace { grid-template-columns: 1fr; gap: 28px; }
  .result-panel { padding: 28px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .login-panel { padding: 24px; }
}
