:root {
  color-scheme: light;
  --background: #f5f7fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #667085;
  --border: #d9deea;
  --primary: #175cd3;
  --danger: #b42318;
  --success: #027a48;
  --warning: #b54708;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
}

header,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px 0 16px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 28px;
}

h2 {
  margin-bottom: 18px;
  font-size: 20px;
}

header p {
  margin-bottom: 0;
  color: var(--muted);
}

.status {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}

.status.ready {
  color: var(--success);
  border-color: #abefc6;
}

.status.error {
  color: var(--danger);
  border-color: #fecdca;
}

.panel {
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgb(16 24 40 / 5%);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

label {
  display: block;
  margin-bottom: 18px;
}

label span {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
}

input[type="file"] {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9fafb;
}

button {
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.secondary,
.icon-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.icon-button {
  padding: 5px 8px;
  font-size: 12px;
}

.file-list {
  display: grid;
  gap: 8px;
  margin: -4px 0 14px;
}

.file-row,
.job-header,
.job-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-row {
  justify-content: space-between;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9fafb;
}

.file-name {
  overflow-wrap: anywhere;
}

.hint,
.muted {
  color: var(--muted);
}

.error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--danger);
}

.jobs {
  display: grid;
  gap: 12px;
}

.job {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.job-header {
  justify-content: space-between;
}

.job-title {
  font-weight: 700;
}

.badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 13px;
}

.badge.succeeded {
  background: #dcfae6;
  color: var(--success);
}

.badge.failed {
  background: #fee4e2;
  color: var(--danger);
}

.badge.running {
  background: #fef0c7;
  color: var(--warning);
}

.progress {
  height: 9px;
  margin: 13px 0 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaecf0;
}

.progress > div {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

.job-meta,
.artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 14px;
}

.artifacts {
  margin-top: 12px;
}

.artifacts a {
  color: var(--primary);
  font-weight: 600;
}

.job-error {
  margin-top: 12px;
  padding: 10px;
  border-radius: 7px;
  background: #fff1f0;
  color: var(--danger);
}

.job-actions {
  margin-top: 13px;
}

.job-actions button {
  padding: 7px 11px;
  font-size: 13px;
}

@media (max-width: 720px) {
  header {
    align-items: flex-start;
    flex-direction: column;
  }

  .job-header,
  .file-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
