:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.link { color: var(--primary); }

/* ---------- 按钮 ---------- */
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  transition: background .15s, border-color .15s, opacity .15s;
}
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--primary); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-d); }
.secondary { background: #eef2ff; color: var(--primary-d); border-color: #dbe3ff; }
.secondary:hover:not(:disabled) { background: #e3e9ff; }
.ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.ghost:hover:not(:disabled) { background: #f3f4f6; color: var(--text); }
.block { width: 100%; }
button.small { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-logo { font-size: 40px; margin-bottom: 8px; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p { margin: 0 0 20px; }
.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  margin-bottom: 14px;
}
.login-card input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.error { color: var(--red); margin-top: 12px; font-size: 13px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { font-size: 24px; }
.brand .title { font-weight: 600; font-size: 16px; }
.brand .sub { font-size: 12px; }

/* ---------- 主体 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px; }

.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: var(--card);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--primary); outline: none; }
.dropzone.drag { border-color: var(--primary); background: #eff4ff; }
.dz-icon { font-size: 36px; }
.dz-main { font-size: 15px; margin: 8px 0 4px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.stats { font-weight: 500; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.upload-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.upload-table th, .upload-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.upload-table thead th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  background: #fafafa;
}
.upload-table tbody tr:last-child td { border-bottom: none; }
.c-thumb { width: 56px; }
.c-name { width: 28%; }
.c-size { width: 80px; white-space: nowrap; }
.c-act { width: 128px; text-align: right; white-space: nowrap; }
.c-act button { margin-left: 4px; }

/* 任务分组标题行 */
.batch-head td { background: #f1f5f9; border-bottom: 1px solid var(--border); }
.batch-head-cell { padding: 8px 12px !important; }
.batch-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.batch-title { font-weight: 600; font-size: 13px; color: #334155; }
.batch-head-btns { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.c-thumb img {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  display: block;
}
.c-name .name { word-break: break-all; }
/* 状态/URL 列吃掉剩余宽度（固定布局下其它列都定宽，这列自然最大） */
.c-status .url {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
  display: inline-block;
}
.c-status .url:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  vertical-align: middle;
}
.badge.warn { background: #fef3c7; color: var(--amber); }

/* 进度条 */
.progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
  max-width: 320px;
}
.progress .bar {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width .15s;
}
.status-done { color: var(--green); }
.status-error { color: var(--red); }

.empty { padding: 36px; text-align: center; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  z-index: 50;
  max-width: 90vw;
}
