:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f5f7;
  --ink: #172033;
  --muted: #667085;
  --line: #dce4ea;
  --line-strong: #bdcbd5;
  --teal: #0f6f7a;
  --teal-strong: #0b5963;
  --teal-soft: #e5f4f6;
  --amber: #b7791f;
  --green: #168056;
  --red: #b91c1c;
  --shadow: 0 20px 60px rgba(29, 43, 58, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, 0) 260px),
    var(--bg);
  color: var(--ink);
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 42px; }
.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.token-input {
  width: min(310px, 42vw);
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
}
.token-input:focus, .dv-grid input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 111, 122, .14); }

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.button.primary { border-color: var(--teal); background: var(--teal); color: #fff; }
.button.primary:hover { background: var(--teal-strong); }
.button.secondary { background: var(--teal-soft); color: var(--teal-strong); border-color: #c5e5e9; }
.button:disabled { opacity: .5; cursor: not-allowed; }

.status-strip {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: 0 12px 28px rgba(29, 43, 58, .05);
}
.status-strip strong { color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.dot.ok { background: var(--green); }
.dot.bad { background: var(--red); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 16px; align-items: start; }
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.upload-panel { padding: 18px; }
.jobs-panel { padding: 16px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head.compact { margin-bottom: 12px; }
.step {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}
h1, h2 { margin: 0; line-height: 1.1; }
h1 { font-size: 25px; }
h2 { font-size: 18px; }

.file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.file-tile {
  min-height: 106px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
}
.file-tile:hover { border-color: var(--teal); background: #edf7f8; }
.file-tile span { font-size: 12px; font-weight: 800; color: var(--ink); }
.file-tile strong {
  overflow: hidden;
  color: var(--teal-strong);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.file-tile input { width: 1px; height: 1px; opacity: 0; position: absolute; pointer-events: none; }

.dv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dv-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.dv-grid input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  outline: none;
  color: var(--ink);
}

.jobs-list { display: grid; gap: 10px; }
.empty {
  min-height: 140px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}
.job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.job-title { display: flex; align-items: center; gap: 8px; }
.job-title strong { font-size: 13px; }
.job-card p { margin: 7px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.status-pill.pending { background: #fff4d7; color: #8a5a00; }
.status-pill.running { background: var(--teal-soft); color: var(--teal-strong); }
.status-pill.completed { background: #e8f5ee; color: var(--green); }
.status-pill.failed { background: #feecec; color: var(--red); }
.progress-line { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.progress-line span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--teal); transition: width .25s ease; }
.job-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.download-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 880px) {
  .workspace { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 1180px); padding-top: 10px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions { width: 100%; }
  .token-input { width: 100%; }
  .panel-head { align-items: stretch; flex-direction: column; }
  .panel-head .button { width: 100%; }
  .file-grid, .dv-grid { grid-template-columns: 1fr; }
  .job-card { grid-template-columns: 1fr; }
  .job-actions { justify-content: flex-start; }
}
