/* 单据图片智能重命名 · 在线版样式（浅色主题，适配桌面与平板） */

:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e3e8ef;
  --text: #1f2937;
  --text-dim: #6b7280;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --green: #ecfdf3;
  --green-b: #a7f3d0;
  --amber: #fffbeb;
  --amber-b: #fde68a;
  --red: #fef2f2;
  --red-b: #fecaca;
  --gray: #f3f4f6;
  --blue: #eff6ff;
  --blue-b: #bfdbfe;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 40px;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 20px 28px 16px;
}
header h1 { margin: 0; font-size: 21px; letter-spacing: .3px; }
header .sub { margin: 6px 0 0; color: var(--text-dim); font-size: 13px; }
header .badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  border: 1px solid var(--green-b); background: var(--green);
  color: #047857; border-radius: 20px; font-size: 12px; vertical-align: 2px;
}

main { max-width: 1280px; margin: 0 auto; padding: 18px 20px 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}
.card h2 .num { color: var(--accent); margin-right: 6px; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row + .row { margin-top: 10px; }

button {
  font: inherit;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 7px;
  cursor: pointer;
  transition: .15s;
}
button:hover:not(:disabled) { border-color: #c7d2e0; background: #fafbfd; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
button.ghost { color: var(--text-dim); }

label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); }
input[type="text"], select {
  font: inherit;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-width: 120px;
}
input[type="text"]:focus, select:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }

.hint { color: var(--text-dim); font-size: 12.5px; }
.hint b { color: #b45309; }

.dropzone {
  margin-top: 10px;
  padding: 20px;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-dim);
  background: #fcfdff;
  transition: .15s;
}
.dropzone.over { border-color: var(--accent); background: var(--blue); color: var(--accent); }

.progress {
  flex: 1;
  min-width: 160px;
  height: 8px;
  background: var(--gray);
  border-radius: 20px;
  overflow: hidden;
}
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.table-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f8fafc;
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}
tbody td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.ready { background: var(--green); }
tbody tr.partial { background: var(--amber); }
tbody tr.skip { background: var(--gray); color: var(--text-dim); }
tbody tr.failed { background: var(--red); }
tbody tr.same { background: #fafafa; color: var(--text-dim); }
td.editable { cursor: text; }
td.editable:hover { outline: 1px solid #cbd5e1; border-radius: 4px; }
td.editable[data-empty="1"]::after { content: "（空）"; color: #cbd5e1; }
td.editable:focus { outline: 2px solid var(--accent); background: #fff; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.status-pill {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 12px; border: 1px solid transparent; white-space: nowrap;
}
tr.ready .status-pill { background: #d1fae5; border-color: var(--green-b); color: #065f46; }
tr.partial .status-pill { background: #fef3c7; border-color: var(--amber-b); color: #92400e; }
tr.skip .status-pill { background: #e5e7eb; border-color: #d1d5db; color: #4b5563; }
tr.failed .status-pill { background: #fee2e2; border-color: var(--red-b); color: #991b1b; }
tr.same .status-pill { background: #f3f4f6; border-color: #e5e7eb; color: #4b5563; }

pre#log {
  margin: 0;
  max-height: 200px;
  overflow: auto;
  padding: 10px 12px;
  background: #fbfcfe;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  color: #374151;
  white-space: pre-wrap;
}

footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px 0;
  color: var(--text-dim);
  font-size: 12.5px;
}

.notice {
  padding: 9px 12px; border-radius: 8px; font-size: 12.5px;
  background: var(--blue); border: 1px solid var(--blue-b); color: #1e40af;
}
