:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #182024;
  --muted: #647178;
  --line: #dbe2e5;
  --primary: #0f7b6c;
  --primary-strong: #095e53;
  --danger: #b12a34;
  --warn: #986800;
  --ok-bg: #e8f6ef;
  --ok-text: #11633e;
  --bad-bg: #fbebed;
  --bad-text: #9b1c28;
  --muted-bg: #eef2f3;
  --shadow: 0 12px 32px rgba(24, 32, 36, 0.08);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(16px, 4vw, 48px);
  background: #102522;
  color: #f7fbfa;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.topbar p,
.panel-head p,
.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.topbar p {
  color: #b9cac6;
}

.status-strip,
.button-row,
.result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shell {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  padding: 18px clamp(12px, 3vw, 32px) 32px;
}

.panel {
  grid-column: span 4;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-wide {
  grid-column: span 12;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: 2fr 1fr auto;
}

.stack {
  display: grid;
  gap: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  color: #344146;
  font-size: 13px;
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 123, 108, 0.14);
}

button {
  min-height: 39px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 9px 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--primary-strong);
}

button:disabled {
  border-color: #cbd4d7;
  background: #d8e0e3;
  color: #718087;
  cursor: not-allowed;
}

button.secondary {
  border-color: #b9c6ca;
  background: #fff;
  color: #223137;
}

button.secondary:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

button.danger:hover {
  background: #8e2029;
}

.align-end {
  align-self: end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.pill-muted {
  background: var(--muted-bg);
  color: #506168;
}

.pill-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.pill-bad {
  background: var(--bad-bg);
  color: var(--bad-text);
}

.pill-warn {
  background: #fff5d9;
  color: var(--warn);
}

.topbar .pill-muted {
  background: rgba(255, 255, 255, 0.12);
  color: #e7f0ee;
}

.answer-box,
.json-box,
.log-box {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  color: #172226;
  white-space: pre-wrap;
  overflow: auto;
}

.answer-box {
  min-height: 218px;
  padding: 14px;
  line-height: 1.6;
}

.json-box {
  min-height: 140px;
  max-height: 320px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.log-box {
  min-height: 230px;
  max-height: 460px;
  padding: 12px;
  background: #101719;
  color: #dce8e5;
  font-size: 12px;
  line-height: 1.55;
}

.list-box {
  min-height: 96px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.list-box.tall {
  max-height: 430px;
}

.list-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item button {
  justify-self: start;
  min-height: 32px;
  padding: 6px 10px;
}

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

.item-meta {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mini-cell {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfc;
}

.mini-cell b {
  display: block;
  font-size: 16px;
}

.mini-cell span {
  color: var(--muted);
  font-size: 12px;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  border: 1px solid var(--line);
  border-left: 4px solid #a9b7bc;
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfc;
  color: #354348;
}

.checklist li.done {
  border-left-color: var(--primary);
  background: var(--ok-bg);
}

.checklist li.failed {
  border-left-color: var(--danger);
  background: var(--bad-bg);
}

@media (max-width: 1180px) {
  .panel {
    grid-column: span 6;
  }

  .panel-wide {
    grid-column: span 12;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .align-end {
    align-self: auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 24px;
  }

  .panel,
  .panel-wide {
    grid-column: span 12;
  }

  .grid-2,
  .split,
  .mini-grid,
  .checklist {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }
}
