:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #151922;
  --muted: #697386;
  --line: #dde2ea;
  --primary: #126f61;
  --primary-strong: #0b5d51;
  --accent: #b84a2f;
  --warn: #9b5b00;
  --ok: #147947;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.session {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.panel,
.dropzone {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) 120px 120px;
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
}

.dropzone {
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 34px;
  margin-bottom: 14px;
  border-style: dashed;
}

.selftest {
  margin-bottom: 14px;
}

.selftest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px 16px;
}

.check {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfe;
}

.check strong {
  font-size: 13px;
}

.check span,
.check small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.check span {
  color: var(--text);
  font-size: 13px;
}

.check small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.check.ok {
  border-color: rgba(20, 121, 71, 0.28);
}

.check.ok strong {
  color: var(--ok);
}

.check.bad {
  border-color: rgba(180, 35, 24, 0.28);
}

.check.bad strong {
  color: var(--bad);
}

.check.muted {
  color: var(--muted);
}

.dropzone.is-dragging {
  border-color: var(--primary);
  background: #f0faf7;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone p {
  max-width: 640px;
  margin: 10px auto 18px;
  color: var(--muted);
}

.primary,
.ghost {
  height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

.primary {
  background: var(--primary);
  color: white;
}

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

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

.hidden {
  display: none !important;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

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

.queue {
  display: grid;
}

.task {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.task:last-child {
  border-bottom: none;
}

.task-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.name {
  font-weight: 750;
  overflow-wrap: anywhere;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.status {
  min-width: 92px;
  text-align: right;
  font-weight: 800;
}

.task-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.mini-button {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

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

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

.status.warn {
  color: var(--warn);
}

.status.bad {
  color: var(--bad);
}

.status.muted {
  color: var(--muted);
}

.bar {
  height: 9px;
  overflow: hidden;
  background: #edf0f5;
  border-radius: 999px;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 160ms ease;
}

.log {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

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

  .task-side {
    width: 100%;
    justify-items: start;
  }

  .status {
    min-width: 0;
    text-align: left;
  }

  .section-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

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

  .session {
    width: 100%;
    justify-content: space-between;
  }
}
