:root {
  --ink: #17201d;
  --muted: #68746f;
  --line: #dfe6e2;
  --paper: #f7faf8;
  --surface: #ffffff;
  --green: #176b58;
  --mint: #e8f5ef;
  --amber: #c59118;
  --red: #b14545;
  --shadow: 0 18px 44px rgba(28, 45, 39, 0.1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #edf7f1, var(--paper) 260px);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  letter-spacing: 0;
}
button, input { font: inherit; }
.shell { width: min(1220px, calc(100vw - 40px)); margin: 0 auto; padding: 24px 0 44px; }
.topbar {
  min-height: 76px; display: flex; justify-content: space-between; align-items: center;
  gap: 18px; border-bottom: 1px solid var(--line);
}
h1, h2, p { margin: 0; }
h1 { font-size: 27px; font-weight: 780; }
h2 { font-size: 18px; }
.topbar p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.status-pill {
  height: 36px; display: inline-flex; align-items: center; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(23,107,88,.28); color: var(--green); background: var(--mint);
}
.tabs {
  display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin: 22px 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #f0f4f2;
}
.tab { min-width: 110px; height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 5px 16px rgba(32,45,39,.08); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.workspace, .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: var(--shadow); }
.section-head { height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dropzone {
  min-height: 220px; display: grid; place-items: center; align-content: center; gap: 8px;
  border: 1px dashed #a9b8b1; border-radius: 8px; background: #f9fbfa; cursor: pointer;
}
.dropzone.dragover { border-color: var(--green); background: var(--mint); }
.dropzone input { display: none; }
.drop-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--green); border: 1px solid rgba(23,107,88,.25); font-size: 28px; }
.drop-title { font-size: 18px; font-weight: 760; }
.drop-meta, .file-meta, .job-meta, .log-line { color: var(--muted); font-size: 13px; }
.file-list, .job-list { display: grid; gap: 8px; margin: 14px 0; }
.file-item, .job-item, .active-job {
  min-height: 48px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff;
}
.active-job { grid-template-columns: 1fr; }
.active-job.empty { min-height: 96px; place-items: center; color: var(--muted); }
.file-name, .job-title { font-weight: 700; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.admin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 6px; color: #394640; font-size: 13px; font-weight: 700; }
input[type="text"], input[type="number"], input[type="password"], input:not([type]) {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; outline: none; background: #fff;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,88,.12); }
.switch-row { grid-template-columns: auto 1fr; align-items: center; min-height: 38px; margin-top: 19px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--green); }
.primary-btn, .ghost-btn, .icon-btn { border-radius: 8px; cursor: pointer; }
.primary-btn { width: 100%; height: 44px; border: 0; background: var(--green); color: #fff; font-weight: 780; margin-top: 16px; }
.primary-btn.compact { width: auto; min-width: 116px; padding: 0 16px; margin-top: 0; }
.primary-btn:disabled { opacity: .55; cursor: not-allowed; }
.ghost-btn, .icon-btn { height: 34px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.ghost-btn { padding: 0 12px; }
.icon-btn { width: 34px; font-size: 22px; color: var(--muted); }
.progress-shell { height: 8px; width: 100%; border-radius: 999px; overflow: hidden; background: #eef3f0; margin-top: 8px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--green), var(--amber)); transition: width .25s ease; }
.badge { height: 24px; display: inline-flex; align-items: center; border-radius: 999px; padding: 0 8px; background: #edf2ef; color: var(--muted); font-size: 12px; font-weight: 760; }
.badge.completed { background: var(--mint); color: var(--green); }
.badge.failed { background: #fff0f0; color: var(--red); }
.job-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.download-link { height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; background: var(--amber); color: #141008; text-decoration: none; font-weight: 780; }
.logs { display: grid; gap: 4px; max-height: 176px; overflow: auto; padding-top: 10px; margin-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 920px) {
  .workspace, .admin-grid, .form-grid, .admin-form { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; padding-bottom: 14px; }
}
