:root {
  color-scheme: light;
  --bg: #f5f6f7;
  --panel: #ffffff;
  --ink: #1f2528;
  --muted: #657176;
  --line: #dfe5e8;
  --accent: #136f63;
  --accent-strong: #0d574d;
  --warn: #a65f13;
  --fail: #b23b36;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 28px auto;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

.topbar p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  min-width: 112px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status.ok {
  border-color: #b7dacd;
  background: #e9f6f0;
  color: var(--accent-strong);
}

.status.warn {
  border-color: #efd49d;
  background: #fff6e3;
  color: var(--warn);
}

.status.fail {
  border-color: #e9bbb8;
  background: #fff0ef;
  color: var(--fail);
}

.notice {
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #cfe2dc;
  border-radius: 8px;
  background: #eef8f4;
  color: #2d5f56;
  font-size: 13px;
  line-height: 1.5;
}

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

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

.upload {
  min-height: 132px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  cursor: pointer;
}

.upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload strong {
  font-size: 15px;
}

.upload span:last-child {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.buttonish,
button {
  min-width: 108px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

button:hover:not(:disabled),
.buttonish:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  background: #b7c0c3;
}

.controls {
  margin-top: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 110px 120px 110px minmax(220px, 1fr) 120px;
  gap: 12px;
  align-items: end;
}

.controls label {
  display: grid;
  gap: 7px;
}

.controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.controls input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.controls input:focus {
  border-color: #78ac9f;
  box-shadow: 0 0 0 3px rgba(19, 111, 99, 0.12);
}

.result {
  margin-top: 14px;
  padding: 16px;
}

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

#resultSummary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.logs {
  height: 320px;
  min-height: 320px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-top: 14px;
  padding-right: 4px;
}

.log {
  min-height: 50px;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #94a0a4;
}

.log.running .dot {
  background: var(--warn);
}

.log.ok .dot {
  background: var(--accent);
}

.log.warn .dot {
  background: var(--warn);
}

.log.failed .dot {
  background: var(--fail);
}

.log strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.log span:not(.dot) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.log a {
  color: var(--accent-strong);
  font-weight: 700;
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 20px, 720px);
    margin: 16px auto;
  }

  .topbar,
  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }

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