/* 照片采集网页应用 · 移动优先（现场多用手机浏览器），无内联样式依赖 */
:root {
  --brand: #b32121;
  --brand-dark: #8e1919;
  --brand-soft: #fdf1f1;
  --text: #1f2329;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f6f8;
  --card: #ffffff;
  --danger: #b32121;
  --ok: #16794a;
}

* { box-sizing: border-box; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--brand);
  color: #fff;
}

.brand { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { margin-left: 8px; font-size: 12px; font-weight: 400; opacity: .85; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-user { font-size: 13px; opacity: .95; word-break: break-all; }

.tabs {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.tabs[hidden] { display: none; }
.tabs a {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  border-bottom: 2px solid transparent;
}
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.container { max-width: 720px; margin: 0 auto; padding: 16px; padding-bottom: 48px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.card-login { margin-top: 24px; }
.card-title { margin: 0 0 6px; font-size: 20px; }
.card-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head .card-title { margin: 0; }

.field { margin-bottom: 18px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: #374151; }
.field-input {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.field-input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field-readonly {
  padding: 11px 12px;
  min-height: 44px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #374151;
  font-size: 16px;
  word-break: break-all;
}
.scan-row { display: flex; gap: 8px; }
.scan-row .field-input { flex: 1; min-width: 0; }
.scan-video-wrap { margin-top: 10px; }
.scan-video { width: 100%; max-height: 260px; background: #000; border-radius: 8px; }

.hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.hint-error { color: var(--danger); }
.muted { color: var(--muted); font-size: 14px; }
.empty { text-align: center; padding: 24px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:not(:disabled):hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: #374151; }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-block { width: 100%; margin-top: 10px; padding: 13px 16px; font-size: 16px; }
.btn-small { padding: 5px 10px; font-size: 13px; }

.file-input { width: 100%; font-size: 14px; }
.photo-preview {
  margin-top: 10px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.photo-img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; }

.notice { padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.notice[hidden] { display: none; }
.notice-error { background: var(--brand-soft); color: var(--danger); border: 1px solid #f3c9c9; }
.notice-success { background: #eefaf3; color: var(--ok); border: 1px solid #bfe8d1; }

.progress { height: 8px; background: var(--bg); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.progress[hidden] { display: none; }
.progress-bar { height: 100%; width: 0; background: var(--brand); transition: width .15s linear; }

.list-body { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: #fff;
}
.list-item:hover { border-color: var(--brand); }
.list-item-title { font-weight: 600; word-break: break-all; }
.list-item-sub { font-size: 13px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.list-item-arrow { font-size: 13px; color: var(--brand); white-space: nowrap; }
.list-footer { margin-top: 12px; text-align: center; }
.list-footer .btn { width: 100%; }

.meta-list { margin: 14px 0; }
.meta-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.meta-row dt { color: var(--muted); }
.meta-row dd { margin: 0; text-align: right; word-break: break-all; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  max-width: 86vw;
  padding: 10px 18px;
  border-radius: 8px;
  background: #1f2329;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}
.toast-visible { opacity: 1; transform: translate(-50%, 0); }
.toast-success { background: var(--ok); }
.toast-error { background: var(--danger); }

/* ===== 登录页 / 五字段确认 / 入库回执 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid #f3c9c9;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.field-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.login-scope { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.scope-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #374151; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
  color: #374151;
}

.summary-card {
  margin: 4px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfcfd;
}
.section-title { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: #374151; }
.summary-list { margin: 0; }
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.summary-row:last-child { border-bottom: none; }
.summary-row dt { color: var(--muted); white-space: nowrap; }
.summary-row dd { margin: 0; text-align: right; word-break: break-all; font-weight: 500; }

.store-result {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #bfe8d1;
  border-radius: 10px;
  background: #f2fbf6;
}
.store-result[hidden] { display: none; }
.store-result .section-title { color: var(--ok); }

.boot-placeholder .card-sub { margin-bottom: 0; }

@media (max-width: 480px) {
  .container { padding: 12px; }
  .card { padding: 14px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .brand-sub { display: none; }
  .summary-row { flex-direction: column; gap: 2px; }
  .summary-row dd { text-align: left; }
}
