:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #eceef2;
  --line-2: #f3f4f6;
  --text: #12161c;
  --sub: #8b929e;
  --sub-2: #a9b0ba;
  --primary: #1d4ed8;
  --primary-2: #3b82f6;
  --primary-soft: #eaf0fe;
  --danger: #d8342b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
img { display: block; max-width: 100%; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(72px + var(--safe-b)); }
#app.no-nav { padding-bottom: 24px; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 52px; display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  background: rgba(244, 245, 247, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .title { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.topbar .spacer { flex: 1; }
.iconbtn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text); font-size: 18px; line-height: 1;
}
.iconbtn:active { background: #e9ebef; }
.iconbtn.primary { color: var(--primary); }

.page { padding: 0 14px 8px; }
.pt { padding-top: 10px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 12px;
}
.card.tight { padding: 4px 14px; }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-h h3 { font-size: 14px; font-weight: 600; }
.card-h .more { margin-left: auto; font-size: 12px; color: var(--sub); display: flex; align-items: center; gap: 2px; }

/* ---------- 首页 Hero ---------- */
.hero {
  border-radius: 18px; padding: 18px 18px 16px; margin: 6px 0 12px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 52%, #4f8bf5 100%);
  color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 6px 20px -8px rgba(29, 78, 216, .55);
}
.hero::after {
  content: ""; position: absolute; right: -46px; top: -56px;
  width: 168px; height: 168px; border-radius: 50%;
  background: rgba(255, 255, 255, .10);
}
.hero::before {
  content: ""; position: absolute; right: 18px; bottom: -70px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.hero .hi { font-size: 12px; opacity: .82; letter-spacing: .3px; }
.hero .nm { font-size: 19px; font-weight: 600; margin-top: 3px; }
.hero .dm { font-size: 12px; opacity: .82; margin-top: 2px; }
.hero .nums { display: flex; gap: 30px; margin-top: 16px; position: relative; z-index: 1; }
.hero .nums .n { font-size: 27px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero .nums .l { font-size: 11px; opacity: .8; margin-top: 3px; }
.hero .role {
  position: absolute; right: 16px; top: 16px; z-index: 1;
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .26);
}

/* ---------- 状态格 ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 10px; box-shadow: var(--shadow);
}
.stat .k { font-size: 11px; color: var(--sub); display: flex; align-items: center; gap: 4px; }
.stat .v { font-size: 20px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- 提醒条 ---------- */
.alert-row { display: flex; gap: 8px; }
.alert {
  flex: 1; border-radius: 12px; padding: 11px 10px; text-align: center;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
}
.alert .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.alert .k { font-size: 11px; color: var(--sub); margin-top: 2px; }
.alert.warn .v { color: #b34a0a; }
.alert.bad .v { color: var(--danger); }
.alert.good .v { color: #0b7a4b; }

/* ---------- 条形分布 ---------- */
.bar-row { margin-bottom: 10px; }
.bar-row:last-child { margin-bottom: 2px; }
.bar-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.bar-top .nm { color: #3b4149; }
.bar-top .vv { color: var(--sub); font-variant-numeric: tabular-nums; }
.bar-bg { height: 6px; background: #f0f2f5; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3b82f6, #60a5fa); }

/* ---------- 状态徽标 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
.tone-slate { background: #f1f5f9; color: #52637a; }
.tone-blue { background: #e8f0fe; color: #1a56db; }
.tone-green { background: #e4f6ee; color: #0b7a4b; }
.tone-amber { background: #fdf3e2; color: #a2620a; }
.tone-violet { background: #f1ebfd; color: #6b34c9; }
.tone-gray { background: #f2f3f5; color: #6b7280; }
.tone-orange { background: #fdece1; color: #b34a0a; }
.tone-dark { background: #e9ebee; color: #3f454e; }

/* ---------- 列表 ---------- */
.searchbar { display: flex; gap: 8px; padding: 4px 0 10px; }
.search {
  flex: 1; position: relative;
}
.search input {
  width: 100%; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); padding: 0 12px 0 34px; font-size: 13px; outline: none;
}
.search input:focus { border-color: #b9cdf8; box-shadow: 0 0 0 3px rgba(59, 130, 246, .10); }
.search .ico { position: absolute; left: 11px; top: 11px; color: var(--sub-2); font-size: 14px; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 12.5px;
  background: var(--card); border: 1px solid var(--line); color: #4b5260;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.chip .c { font-size: 11px; opacity: .65; }

.listmeta { font-size: 12px; color: var(--sub); padding: 0 2px 8px; display: flex; align-items: center; }
.listmeta .r { margin-left: auto; }

.item {
  display: flex; gap: 11px; background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; padding: 11px; margin-bottom: 9px; box-shadow: var(--shadow);
  align-items: flex-start;
}
.item:active { background: #fafbfc; }
.thumb {
  width: 52px; height: 52px; border-radius: 10px; flex: none; overflow: hidden;
  background: #f2f4f7; display: grid; place-items: center; color: #c3c9d2; font-size: 18px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .body { flex: 1; min-width: 0; }
.item .nm { font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .no { font-size: 11.5px; color: var(--sub); margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.item .tags { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.item .meta { font-size: 11.5px; color: var(--sub); display: flex; align-items: center; gap: 4px; }
.item .arrow { color: #cdd2da; font-size: 15px; align-self: center; }

.empty { text-align: center; padding: 56px 20px; color: var(--sub); }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .35; }
.empty .t { font-size: 13px; }

/* ---------- 详情 ---------- */
.detail-hd { padding: 6px 0 12px; }
.detail-hd .nm { font-size: 19px; font-weight: 650; letter-spacing: -.2px; line-height: 1.35; }
.detail-hd .row2 { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.detail-hd .no { font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.copybtn { font-size: 11px; color: var(--primary); padding: 2px 6px; border-radius: 5px; background: var(--primary-soft); }

.parentbar {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 6px 0 12px;
  border-radius: 13px; background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa;
}
.parentbar .lab { font-size: 11px; color: #b45309; font-weight: 500; letter-spacing: .3px; }
.parentbar .nm { font-size: 14px; font-weight: 600; color: #7c2d12; margin-top: 3px; }
.parentbar .no { font-size: 11px; color: #b45309; font-variant-numeric: tabular-nums; }
.parentbar .go {
  margin-left: auto; flex: none; font-size: 12px; color: #fff; background: #ea8a2f;
  padding: 6px 11px; border-radius: 8px; font-weight: 500;
}

.kv { display: flex; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; align-items: flex-start; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 82px; flex: none; color: var(--sub); font-size: 12.5px; }
.kv .v { flex: 1; text-align: right; word-break: break-all; white-space: pre-wrap; }
.kv .v.mono { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.kv .v.empty-v { color: #c6ccd5; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.photo {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #f2f4f7;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .del {
  position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0, 0, 0, .5); color: #fff; font-size: 12px; display: grid; place-items: center;
}
.photo.add { display: grid; place-items: center; border: 1.5px dashed #d3d8e0; color: #a9b0ba; font-size: 22px; background: #fbfcfd; }

/* 配套清单 */
.acc { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.acc:last-child { border-bottom: none; }
.acc .idx { width: 22px; height: 22px; border-radius: 6px; background: #f1f5f9; color: #64748b; font-size: 11px; display: grid; place-items: center; flex: none; font-weight: 600; }
.acc .body { flex: 1; min-width: 0; }
.acc .nm { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .no { font-size: 11px; color: var(--sub); margin-top: 2px; font-variant-numeric: tabular-nums; }
.acc .r { display: flex; align-items: center; gap: 6px; flex: none; }

/* ---------- 表单 ---------- */
.form-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.form-sec > .h { font-size: 12px; color: var(--sub); padding: 12px 14px 0; letter-spacing: .3px; font-weight: 500; }
.frow { display: flex; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line-2); gap: 10px; }
.frow:last-child { border-bottom: none; }
.frow .lab { width: 88px; flex: none; font-size: 13px; color: #3b4149; }
.frow .lab .req { color: var(--danger); margin-left: 1px; }
.frow input, .frow select, .frow textarea {
  flex: 1; border: none; outline: none; background: transparent; font-size: 13.5px;
  text-align: right; min-width: 0; color: var(--text);
}
.frow input::placeholder, .frow textarea::placeholder { color: #c2c8d0; }
.frow select {
  flex: 1; border: none; outline: none; min-width: 0; font-size: 13.5px; color: var(--text);
  text-align: right; text-align-last: right;
  appearance: none; -webkit-appearance: none;
  background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23a9b0ba' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right center;
  padding-right: 16px;
}
.frow textarea { text-align: left; min-height: 62px; resize: vertical; }
.frow.col { flex-direction: column; align-items: stretch; gap: 6px; }
.frow.col .lab { width: auto; }
.frow.col textarea { text-align: left; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 44px; border-radius: 12px; font-size: 15px; font-weight: 500;
  background: var(--primary); color: #fff;
}
.btn:active { opacity: .88; }
.btn:disabled { background: #b9c6e4; }
.btn.ghost { background: var(--card); color: var(--primary); border: 1px solid #c7d7f5; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f3c7c4; }
.btn.sm { height: 34px; font-size: 13px; border-radius: 9px; width: auto; padding: 0 14px; }
.btnbar { display: flex; gap: 10px; padding: 6px 0 14px; }
.btnbar .btn { flex: 1; }

.acc-edit-row {
  display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2);
}
.acc-edit-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 13px; outline: none; }
.acc-edit-row select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 6px; font-size: 12px; outline: none; background: #fff; }
.acc-edit-row .rm { color: #b9c0c9; font-size: 16px; padding: 0 4px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 560px; margin: 0 auto;
  display: flex; padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; height: 54px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; color: #98a0ab; font-size: 10.5px;
}
.tab .ic { font-size: 19px; line-height: 1; }
.tab.on { color: var(--primary); font-weight: 500; }

/* ---------- 悬浮按钮 ---------- */
.fab {
  position: fixed; right: max(16px, calc(50% - 268px)); bottom: calc(72px + var(--safe-b));
  width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 25px; z-index: 35;
  box-shadow: 0 6px 18px -4px rgba(29, 78, 216, .55);
}

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: rgba(20, 24, 31, .92); color: #fff; padding: 9px 16px; border-radius: 10px;
  font-size: 13px; z-index: 90; opacity: 0; transition: all .22s; pointer-events: none; max-width: 80vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.loading { text-align: center; padding: 40px; color: var(--sub); font-size: 13px; }
.spinner {
  width: 22px; height: 22px; border: 2px solid #dde3ec; border-top-color: var(--primary);
  border-radius: 50%; margin: 0 auto 10px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .94); z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px;
}
.lightbox img { max-width: 100%; max-height: 78vh; border-radius: 8px; }
.lightbox .bar { display: flex; gap: 22px; margin-top: 18px; }
.lightbox .bar a, .lightbox .bar button { color: #fff; font-size: 13px; opacity: .9; }

/* ---------- 人员 ---------- */
.person { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.person:last-child { border-bottom: none; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 14px; font-weight: 600;
}
.person .body { flex: 1; min-width: 0; }
.person .nm { font-size: 14px; font-weight: 500; }
.person .dm { font-size: 11.5px; color: var(--sub); margin-top: 1px; }
.person select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; background: #fff; outline: none; }

.notice {
  font-size: 12px; color: #8a6a1f; background: #fdf6e7; border: 1px solid #f7e3b5;
  padding: 9px 12px; border-radius: 10px; margin-bottom: 12px; line-height: 1.6;
}
.hint { font-size: 11.5px; color: var(--sub); padding: 8px 14px 12px; line-height: 1.6; }

/* ================= P2 ================= */

/* 底部导航中间的扫码键 */
.tab.mid { position: relative; }
.tab.mid .ic {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #1e40af, #3b82f6); color: #fff;
  margin-top: -14px; box-shadow: 0 6px 16px -4px rgba(29, 78, 216, .6);
}
.tab.mid.on .ic { box-shadow: 0 8px 20px -3px rgba(29, 78, 216, .75); }

/* 扫码中心 */
.scanhero {
  background: linear-gradient(140deg, #0f2d6e 0%, #1d4ed8 55%, #3b82f6 100%);
  border-radius: 18px; padding: 20px 18px; color: #fff; margin: 6px 0 12px;
  box-shadow: 0 8px 24px -10px rgba(29, 78, 216, .7); position: relative; overflow: hidden;
}
.scanhero .t { font-size: 16px; font-weight: 600; }
.scanhero .s { font-size: 12px; opacity: .82; margin-top: 3px; }
.scanhero .go {
  margin-top: 16px; height: 46px; border-radius: 13px; background: rgba(255, 255, 255, .96);
  color: #1349c0; font-size: 15px; font-weight: 650; display: flex; align-items: center;
  justify-content: center; gap: 8px;
}
.scanhero .go:active { transform: scale(.985); }

.hub { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hub a {
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  padding: 13px 4px 11px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: var(--text); box-shadow: var(--shadow); position: relative;
}
.hub a:active { background: #fafbfc; }
.hub .ic { font-size: 20px; line-height: 1; }
.hub .lb { font-size: 11.5px; color: #3b4149; }
.hub .bd {
  position: absolute; top: 5px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: #e11d48; color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}

.manual { display: flex; gap: 8px; margin-top: 10px; }
.manual input {
  flex: 1; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  padding: 0 12px; font-size: 13px; outline: none; background: var(--card);
}
.manual button { height: 40px; padding: 0 16px; border-radius: 11px; background: var(--primary); color: #fff; font-size: 13.5px; }

/* 扫码取景 */
.scanwrap { position: fixed; inset: 0; background: #000; z-index: 120; display: flex; flex-direction: column; }
.scanwrap video { flex: 1; width: 100%; object-fit: cover; }
.scanwrap .frame {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  width: 66vw; max-width: 260px; aspect-ratio: 1; border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45);
  border: 2px solid rgba(255, 255, 255, .85);
}
.scanwrap .frame::after {
  content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px;
  background: linear-gradient(90deg, transparent, #4ade80, transparent); animation: scanline 1.8s ease-in-out infinite;
}
@keyframes scanline { 0%,100% { transform: translateY(-38px); } 50% { transform: translateY(38px); } }
.scanwrap .bar2 {
  padding: 16px 18px calc(28px + env(safe-area-inset-bottom)); display: flex; gap: 10px;
  background: #000; align-items: center;
}
.scanwrap .bar2 .tip { color: rgba(255, 255, 255, .8); font-size: 12.5px; flex: 1; line-height: 1.5; }
.scanwrap .bar2 button { height: 40px; padding: 0 16px; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 13px; }
.scanwrap .bar2 button.pri { background: #2563eb; font-weight: 600; }

/* 扫码结果动作 */
.actlist { display: flex; flex-direction: column; gap: 8px; }
.actlist button {
  height: 46px; border-radius: 12px; font-size: 14.5px; font-weight: 550;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.actlist button.t-blue { background: #eaf0fe; border-color: #cfe0fd; color: #1349c0; }
.actlist button.t-green { background: #e7f7ef; border-color: #c8ecda; color: #0b7a4b; }
.actlist button.t-violet { background: #f2ecfd; border-color: #e0d4fa; color: #6b34c9; }
.actlist button.t-orange { background: #fdece1; border-color: #fbd9c2; color: #b34a0a; }
.actlist button.t-amber { background: #fdf5e3; border-color: #f8e6bc; color: #96601a; }
.actlist button.t-gray { color: #4b5563; }
.actlist button:disabled { opacity: .5; }

/* 扫码结果卡 */
.scancard { border-radius: 16px; border: 1px solid var(--line); background: var(--card); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.scancard .role-flag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px; display: inline-block; }
.scancard .role-flag.main { background: #e7efff; color: #1349c0; }
.scancard .role-flag.acc { background: #fdf0e3; color: #a1520c; }
.scancard .nm { font-size: 18px; font-weight: 650; margin: 9px 0 6px; line-height: 1.3; }
.scancard .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.scancard .rows { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 8px; }

/* 照片必拍位 */
.shotbox {
  width: 100%; aspect-ratio: 4/3; border-radius: 13px; border: 1.5px dashed #cfd6e0;
  background: #fbfcfd; display: grid; place-items: center; color: #9aa3af; font-size: 13px;
  overflow: hidden; position: relative;
}
.shotbox img { width: 100%; height: 100%; object-fit: cover; }
.shotbox .re { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11.5px; padding: 4px 10px; border-radius: 8px; }
.shotbox.ok { border-style: solid; border-color: #bfe6d1; }

/* 采购单明细编辑 */
.poitem { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 9px; background: #fcfdfe; }
.poitem .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.poitem .hd .n { font-size: 12px; color: var(--sub); font-weight: 600; }
.poitem .hd .rm { margin-left: auto; font-size: 15px; color: #c2c8d0; }
.poitem .row { display: flex; gap: 7px; margin-bottom: 7px; }
.poitem .row input, .poitem .row select {
  flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 9px; font-size: 13px; outline: none; background: #fff;
}
.poitem .tpl { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.poitem .tpl input { flex: 1; min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 12.5px; outline: none; }
.poitem .tpl select { height: 32px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; background: #fff; outline: none; }
.poitem .tpl .rm { color: #c2c8d0; font-size: 14px; padding: 0 3px; }

/* 小号码 */
.tiny { font-size: 11px; color: var(--sub); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .3px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.codebox { background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.codebox .c { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.codebox .r { margin-left: auto; font-size: 12px; color: var(--primary); }

/* 分段控件 */
.seg { display: flex; background: #eceff3; border-radius: 11px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; height: 32px; border-radius: 9px; font-size: 13px; color: #5b6472; }
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.10); }

/* 数字对账条 */
.recon { display: flex; gap: 8px; margin-bottom: 12px; }
.recon div { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.recon .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.recon .k { font-size: 11px; color: var(--sub); margin-top: 1px; }
.recon .warn .v { color: #b34a0a; }
