:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e5e7eb;
  --danger: #b91c1c;
  --warn: #b45309;
  --ok: #059669;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #eef2ff, var(--bg) 40%, #ecfeff);
  color: var(--text);
  padding: 24px 16px 48px;
}
.card {
  width: min(640px, 100%);
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px 32px;
}
.card.wide { width: min(960px, 100%); }
.card.narrow { width: min(420px, 100%); }
h1 { margin: 0 0 8px; font-size: 1.55rem; }
.subtitle { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.req { color: var(--danger); }
label {
  display: block;
  margin-bottom: 16px;
}
label > span {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
input[type="text"],
input[type="password"],
input:not([type]),
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
}
input:focus, select:focus {
  outline: 2px solid #93c5fd;
  border-color: var(--primary);
}
.hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  background: #e5e7eb;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--primary-hover); }
.btn.small { padding: 8px 12px; font-size: 0.875rem; margin-left: 8px; }
.flash { list-style: none; padding: 0; margin: 0 0 16px; }
.flash li {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fef2f2;
  color: var(--danger);
}
.flash li.ok {
  background: #ecfdf5;
  color: var(--ok);
}
.flash li.error {
  background: #fef2f2;
  color: var(--danger);
}
.results {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.results h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.empty {
  padding: 14px 16px;
  background: #fff7ed;
  color: var(--warn);
  border-radius: 10px;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; }
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.stat {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.stat .n { font-size: 1.4rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.upload-box {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 22px;
  background: #f8fafc;
}
.muted { color: var(--muted); }
.footer-note {
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 640px) {
  body { padding: 12px 10px 32px; }
  .card { padding: 20px 16px 24px; }
}
