:root {
  color-scheme: light;
  --ink: #121619;
  --muted: #66707a;
  --line: #d8dee4;
  --panel: #ffffff;
  --soft: #f3f6f8;
  --accent: #0f8b8d;
  --accent-strong: #0a6e70;
  --danger: #b42318;
  --ok: #287d3c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f7faf9 0%, #eaf0ef 100%);
}

button,
input,
select {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  display: grid;
  gap: 20px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: 28px;
  align-items: center;
}

.intro img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 1.12;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.account-panel,
.upload,
.status-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.account-info,
.auth-form {
  display: grid;
  gap: 14px;
}

.account-info {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.account-info h2,
.auth-form h2 {
  margin-bottom: 6px;
}

.account-actions,
.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-form {
  grid-template-columns: 1fr minmax(220px, 320px) auto;
  align-items: end;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.upload {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr auto;
  gap: 14px;
  align-items: stretch;
}

.language-picker {
  display: grid;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.dropzone {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #9aa8b3;
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.dropzone.locked {
  color: #8a949e;
  background: #eef1f3;
  border-color: #c8d0d7;
  cursor: not-allowed;
}

.dropzone.locked small {
  color: #9aa3ab;
}

.dropzone.authorized {
  border-color: var(--danger);
  background: #fff7f6;
}

.dropzone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dropzone span {
  font-size: 18px;
  font-weight: 700;
}

.dropzone span.ready {
  color: var(--danger);
}

.dropzone small,
.job p {
  color: var(--muted);
}

button,
.actions a {
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.actions a:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: #a8b3bd;
}

.panel-head,
.job-top,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  margin: 0;
}

#refreshBtn,
.actions button,
#logoutBtn {
  color: var(--ink);
  background: #e6eceb;
}

#refreshBtn:hover,
.actions button:hover,
#logoutBtn:hover {
  background: #d4dedc;
}

.jobs {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.job {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfd;
}

.job h3 {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.badge {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  background: #dfe8ee;
}

.badge.completed {
  color: var(--ok);
  background: #e3f1e5;
}

.badge.failed {
  color: var(--danger);
  background: #fde8e7;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8ee;
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 240ms ease;
}

pre {
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  border-radius: 8px;
  background: #111827;
  color: #f9fafb;
  line-height: 1.7;
}

.text-label {
  margin: 12px 0 6px;
  color: var(--muted);
  font-weight: 700;
}

details {
  margin-top: 10px;
}

summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.actions {
  justify-content: flex-start;
}

.actions[hidden],
pre:empty,
.error:empty {
  display: none;
}

.error {
  color: var(--danger);
  margin-bottom: 0;
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-strong);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 16px, 1120px);
    padding: 10px 0 16px;
  }

  .workspace {
    gap: 12px;
  }

  .intro,
  .upload,
  .account-info,
  .auth-form {
    grid-template-columns: 1fr;
  }

  .intro {
    gap: 10px;
  }

  .intro img {
    aspect-ratio: 21 / 8;
  }

  h1 {
    margin-bottom: 0;
    font-size: 30px;
  }

  h2 {
    font-size: 20px;
  }

  .account-panel,
  .upload,
  .status-panel {
    padding: 14px;
  }

  .auth-form {
    gap: 10px;
  }

  .auth-form h2 {
    margin-bottom: 0;
  }

  .dropzone {
    min-height: 82px;
    padding: 14px;
  }

  .dropzone span {
    font-size: 17px;
  }

  .dropzone small {
    line-height: 1.5;
  }

  .panel-head,
  .job-top,
  .actions,
  .account-actions,
  .auth-actions {
    align-items: stretch;
    flex-direction: column;
  }

  button,
  .actions a {
    width: 100%;
  }

  pre {
    max-height: 240px;
    padding: 12px;
  }

  .site-footer {
    width: min(100% - 16px, 1120px);
    padding-bottom: 16px;
  }
}

@media (max-width: 420px) {
  .intro {
    grid-template-columns: 92px 1fr;
  }

  .intro img {
    height: 64px;
    aspect-ratio: auto;
  }

  h1 {
    font-size: 26px;
  }
}
