﻿:root {
  --brand: #1367d6;
  --brand-dark: #0d4fa8;
  --danger: #d93025;
  --ok: #1e8e3e;
  --warn: #e37400;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2328;
  --text-2: #5a6472;
  --line: #e3e7ee;
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

body { padding-bottom: env(safe-area-inset-bottom); }

.wrap { max-width: 560px; margin: 0 auto; padding: 12px 14px 96px; }

h1 { font-size: 19px; margin: 6px 0 14px; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
p.sub { color: var(--text-2); font-size: 13px; margin: 4px 0 14px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

label.field { display: block; margin: 10px 0 14px; }
label.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }

input[type=text], input[type=tel], select {
  width: 100%; padding: 12px 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
  appearance: none;
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(19, 103, 214, .12); }

button {
  font: inherit; border: 0; border-radius: 10px; padding: 13px 16px;
  background: var(--brand); color: #fff; font-weight: 600; width: 100%;
  transition: opacity .15s;
}
button:active { opacity: .82; }
button[disabled] { background: #b9c3d0; }
button.ghost { background: #eef2f8; color: var(--text); }
button.danger { background: var(--danger); }
button.mini { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 8px; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.hint { font-size: 13px; color: var(--text-2); }
.hint.warn { color: var(--warn); }
.hint.err { color: var(--danger); }
.hint.ok { color: var(--ok); }

.badge {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: #eef2f8; color: var(--text-2);
}
.badge.ok { background: #e6f4ea; color: var(--ok); }
.badge.warn { background: #fef2e0; color: var(--warn); }
.badge.err { background: #fdecea; color: var(--danger); }

/* ---------------- 拍摄 ---------------- */
#stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
#video, #still { display: block; width: 100%; background: #000; }

/* 取景框：内部透明、外部半透明（需求 4.2.1） */
.frame {
  position: absolute; border: 2px solid rgba(230, 60, 60, .95);
  border-radius: 6px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.frame::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 1px; height: 40%; transform: translate(-50%, -50%);
  background: rgba(230, 60, 60, .5);
}

.shotbar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
}
.shotbar .counter { color: #fff; font-size: 14px; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.shoot {
  width: 66px; height: 66px; border-radius: 50%;
  background: #fff; border: 4px solid rgba(255, 255, 255, .6);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .25);
  flex: 0 0 auto;
}
.shoot:active { transform: scale(.94); }

/* 样本标签勾选：一行一个，点击整行都能切换（手机上勾 14px 的小方框很难命中） */
.checks { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.check {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 15px; cursor: pointer;
}
.check:active { background: #f4f6fa; }
.check input { width: 20px; height: 20px; margin: 0; }

/* 列表页筛选用紧凑横向 chip。不复用 .check 的纵向 44px 三行 ——
   筛选卡再长 132px 会把首屏列表挤到屏幕外，而列表页首屏就该看到数据。 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 18px;
  background: #fff; font-size: 14px; cursor: pointer; user-select: none;
}
.chip input { width: 16px; height: 16px; margin: 0; }
.chip.on { border-color: var(--brand); background: #eaf1fd; color: var(--brand-dark); font-weight: 600; }
.chip:active { background: #f4f6fa; }

.tips { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.tips li { margin: 3px 0; }

.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.thumb { position: relative; border-radius: 8px; overflow: hidden; background: #e9edf3; aspect-ratio: 3/4; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .del {
  position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; line-height: 26px; text-align: center; font-size: 15px;
}
.thumb .tag {
  position: absolute; left: 4px; bottom: 4px; font-size: 11px; color: #fff;
  background: rgba(0, 0, 0, .5); padding: 1px 6px; border-radius: 4px;
}
.thumb.empty { display: flex; align-items: center; justify-content: center; color: #98a2b3; font-size: 12px; }

/* ---------------- 列表 ---------------- */
.item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .main { flex: 1; min-width: 0; }
.item .code { font-weight: 600; font-family: ui-monospace, Consolas, monospace; font-size: 15px; word-break: break-all; }
.item .meta { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.item .mini-thumbs { display: flex; gap: 4px; margin-top: 8px; }
.item .mini-thumbs img { width: 46px; height: 62px; object-fit: cover; border-radius: 5px; background: #e9edf3; }
.item .missing { width: 46px; height: 62px; border-radius: 5px; border: 1px dashed #c7cfda; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #98a2b3; }

/* ---------------- 遮罩层 ---------------- */
#overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
  display: none; align-items: center; justify-content: center; z-index: 90;
}
#overlay.show { display: flex; }
#overlay .box {
  background: #fff; border-radius: 14px; padding: 20px; width: 240px; text-align: center;
}
.spinner {
  width: 30px; height: 30px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid #dde3ec; border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: rgba(16, 24, 40, .9); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; max-width: 86vw; display: none; z-index: 100; text-align: center;
}
#toast.show { display: block; }

/* ---------------- 看大图（点缩略图） ---------------- */
.lb {
  position: fixed; inset: 0; z-index: 120;
  /* 纯黑：看条码细节时不要任何背景文字干扰（半透明会被页面内容"穿透"，看起来像两套按钮叠一起） */
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
.lb .lb-img {
  max-width: 100vw; max-height: calc(100vh - 120px); object-fit: contain;
  /* 手机上看条码细节，允许双指缩放；不写这行 iOS 会当作静态层 */
  touch-action: pinch-zoom;
}
.lb .lb-count {
  position: fixed; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top));
  text-align: center; color: #fff; font-size: 13px; opacity: .75;
}
.lb .lb-bar {
  position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; justify-content: center;
}
.lb .lb-bar button {
  background: rgba(255, 255, 255, .16); color: #fff;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 10px;
  padding: 9px 18px; font-size: 14px;
}
.lb .lb-bar button[hidden] { display: none; }

/* 缩略图可点击的视觉暗示 */
.item .mini-thumbs img, .thumbs .thumb img { cursor: zoom-in; }

/* 底部固定操作条 */
.footbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
}
.footbar .wrap2 { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.footbar button { flex: 1; }

a.link { color: var(--brand); text-decoration: none; }

/* ---------------- 用户接入审核（v1.3） ---------------- */

/* 状态横幅：一眼看出"在等"还是"被驳回"，不用去读小字 */
.banner { border-radius: 10px; padding: 12px 14px; font-weight: 600; font-size: 15px; }
.banner.pending { background: #fef2e0; color: #8a4b00; }
.banner.rejected { background: #fdecea; color: #a3231c; }

/* 登记信息：左标签右值。值可能长（姓名/区域），所以值这一列用 flex 自适应 */
.kv { margin: 12px 0 0; }
.kv-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-k { flex: 0 0 76px; color: var(--text-2); }
.kv-v { flex: 1; word-break: break-all; }

/* 两个入口并排（采集 / 审核） */
.choice { display: flex; gap: 10px; }
.choice > button { flex: 1; }

/* 审核列表的一条 */
.audit-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-head { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.audit-ops { display: flex; gap: 8px; margin-top: 10px; }
/* button 默认 width:100%，这里必须写回 auto，否则两个按钮各占一行 */
.audit-ops > button { width: auto; flex: 0 0 auto; padding: 9px 16px; font-size: 14px; }

/* 理由输入用内联展开，不用 prompt：手机上 prompt 会盖住整页，且没法校验空白 */
.reason { margin-top: 10px; }
.reason textarea {
  width: 100%; min-height: 72px; padding: 10px 12px; font: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; resize: vertical;
}
.reason textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(19, 103, 214, .12); }
.reason .choice { margin-top: 8px; }

/* 状态筛选用的 chip 是 button，同样要写回 width:auto（否则每个 chip 占满一行） */
button.chip { width: auto; color: var(--text); }
button.chip.on { color: var(--brand-dark); }
