:root {
  --brand: #2f6df6;
  --brand-dark: #1f52c9;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1c2434;
  --muted: #7a869a;
  --line: #e6eaf2;
  --green: #12a45c;
  --red: #e2483c;
  --orange: #ef8a20;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(28, 36, 52, .07);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(135deg, var(--brand), #4b8bff);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(47, 109, 246, .25);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; }
.topbar .sub { font-size: 12px; opacity: .85; }
.topbar button {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
}
.topbar button:hover { background: rgba(255,255,255,.32); }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px 14px 40px; }
.wrap.wide { max-width: 1240px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 { font-size: 16px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }

/* ---------- 统计格 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat .label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.total .num  { color: var(--text); }
.stat.valid .num  { color: var(--green); }
.stat.pending .num{ color: var(--orange); }
.stat.invalid .num{ color: var(--red); }

/* ---------- 表单 ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fbfcfe;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, .12);
}
.field { margin-bottom: 16px; }

/* ---------- 拍照区 ---------- */
.photo-box {
  border: 2px dashed #c9d3e6;
  border-radius: 12px;
  background: #f8faff;
  padding: 26px 14px;
  text-align: center;
  cursor: pointer;
  transition: .18s;
}
.photo-box:hover { border-color: var(--brand); background: #f0f6ff; }
.photo-box .icon { font-size: 34px; }
.photo-box .t { font-size: 14px; font-weight: 600; margin-top: 8px; }
.photo-box .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.preview {
  margin-top: 12px;
  position: relative;
  display: none;
}
.preview img { width: 100%; border-radius: 10px; display: block; }
.preview .del {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.6); color: #fff; border: none;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 16px; cursor: pointer; line-height: 1;
}

/* ---------- 按钮 ---------- */
.btn {
  width: 100%;
  padding: 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { background: #b9c6e0; cursor: not-allowed; }
.btn.sm { width: auto; padding: 8px 16px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.grey { background: #eef1f7; color: var(--text); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f3c4c0; }

/* ---------- 提示 ---------- */
.msg {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
  display: none;
}
.msg.show { display: block; }
.msg.ok  { background: #e8f7ef; color: #0d7a43; }
.msg.err { background: #fdecea; color: #b32b1f; }
.msg.warn{ background: #fff5e6; color: #9a5b08; }

/* ---------- 列表 ---------- */
.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}
.item .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.item .phone { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.item .meta { font-size: 12px; color: var(--muted); }
.item img.thumb {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #f0f2f7;
}
.tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.tag.pending { background: #fff3e0; color: #b96f10; }
.tag.valid   { background: #e6f7ee; color: #0d8a4d; }
.tag.invalid { background: #fdecea; color: #c33a2c; }
.reason { font-size: 13px; color: var(--red); background: #fdecea; padding: 8px 10px; border-radius: 8px; margin-top: 8px; }
.remark { font-size: 13px; color: #4d5a70; background: #f5f7fb; padding: 8px 10px; border-radius: 8px; margin-top: 8px; }
.actions { display: flex; gap: 10px; margin-top: 10px; }
.actions .btn { flex: 1; }

.empty { text-align: center; padding: 40px 10px; color: var(--muted); font-size: 14px; }
.empty .icon { font-size: 44px; display: block; margin-bottom: 10px; opacity: .5; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #2f6df6, #4b8bff 55%, #6aa4ff);
  padding: 20px;
}
.login-box {
  background: #fff;
  border-radius: 18px;
  padding: 30px 26px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 40px rgba(20, 40, 90, .22);
}
.login-box .logo { text-align: center; margin-bottom: 22px; }
.login-box .logo .ic { font-size: 40px; }
.login-box .logo h1 { font-size: 20px; margin: 8px 0 4px; }
.login-box .logo p { margin: 0; font-size: 13px; color: var(--muted); }
.link { text-align: center; margin-top: 14px; font-size: 13px; }
.link a { color: var(--brand); text-decoration: none; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.7; }

/* ---------- 弹窗 ---------- */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20, 28, 44, .55);
  z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal.show { display: flex; }
.modal .box {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow: auto;
}
.modal .box h3 { margin: 0 0 16px; font-size: 17px; }
.modal img { width: 100%; border-radius: 10px; }
.modal-foot { display: flex; gap: 10px; margin-top: 16px; }
.modal-foot .btn { flex: 1; }

/* ---------- 后台 ---------- */
.admin-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  position: sticky; top: 0; z-index: 15;
}
.admin-bar button {
  background: none; border: none;
  padding: 15px 16px;
  font-size: 14.5px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.admin-bar button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab { display: none; }
.tab.active { display: block; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 11px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #fafbfe; }
tbody tr:hover { background: #fafbff; }
.table-scroll { overflow-x: auto; }
.tiny-img { width: 56px; height: 44px; object-fit: cover; border-radius: 6px; cursor: pointer; vertical-align: middle; }

.bar {
  height: 7px;
  background: #eef1f7;
  border-radius: 4px;
  overflow: hidden;
  min-width: 90px;
  margin-top: 5px;
}
.bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar select, .toolbar input { width: auto; min-width: 140px; padding: 9px 12px; font-size: 14px; }

.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.checkbox { width: auto; margin-right: 6px; vertical-align: middle; }

.modal-actions-inline { display: flex; gap: 6px; }

/* ---------- 自绘对话框（替代原生 alert/confirm/prompt） ---------- */
.dlg-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20, 28, 44, .55);
  z-index: 200;
  align-items: center; justify-content: center;
  padding: 24px;
}
.dlg-mask.show { display: flex; }
.dlg {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 40px rgba(20, 40, 90, .25);
  animation: dlgIn .18s ease;
}
@keyframes dlgIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dlg-title { font-size: 16.5px; font-weight: 600; margin-bottom: 10px; }
.dlg-body { font-size: 14.5px; color: #4d5a70; margin-bottom: 16px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.dlg-input input { width: 100%; }
.dlg-foot { display: flex; gap: 10px; margin-top: 18px; }
.dlg-foot .btn { flex: 1; }