/* 快速盘点系统 - 公共样式（PC/H5 自适应，浅色主题） */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #2563eb; --blue-dark: #1d4ed8; --blue-bg: #eff6ff;
  --green: #16a34a; --green-bg: #f0fdf4;
  --red: #dc2626; --red-bg: #fef2f2;
  --text: #1e293b; --muted: #64748b; --line: #e2e8f0; --bg: #f1f5f9; --card: #ffffff;
}
body { font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }

.topbar { background: linear-gradient(135deg, #1e40af, #2563eb); color: #fff; padding: 14px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; box-shadow: 0 2px 8px rgba(30,64,175,.25); position: sticky; top: 0; z-index: 50; }
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.topbar .sub { font-size: 12px; opacity: .85; }
.topbar .spacer { flex: 1; }
.topbar a.navlink, .topbar button.navlink { color: #fff; text-decoration: none; font-size: 14px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35); padding: 7px 16px; border-radius: 8px; font-family: inherit; cursor: pointer; }
.topbar a.navlink:hover, .topbar button.navlink:hover { background: rgba(255,255,255,.28); }

.container { max-width: 1100px; margin: 18px auto; padding: 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.card h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2::before { content: ""; width: 4px; height: 16px; background: var(--blue); border-radius: 2px; display: inline-block; }

label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; }
input[type=text], input[type=number] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; background: #fff; color: var(--text); outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-green { background: var(--green); color: #fff; }
.btn-outline { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-outline:hover { background: var(--blue-bg); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.08); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }

table.tbl { width: 100%; border-collapse: collapse; background: #fff; }
table.tbl th { background: var(--blue-bg); color: #1e3a8a; font-size: 13px; padding: 10px 8px; text-align: left; border-bottom: 2px solid #bfdbfe; white-space: nowrap; }
table.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.tbl tr:hover td { background: #f8fafc; }
.empty { text-align: center; color: var(--muted); padding: 36px 0; font-size: 14px; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag-open { background: var(--blue-bg); color: var(--blue); }
.tag-done { background: var(--green-bg); color: var(--green); }

.mono { font-family: Consolas, "Courier New", monospace; font-weight: 600; }

/* ---------- 盘点扫码页 ---------- */
.scan-wrap { max-width: 640px; margin: 0 auto; padding: 14px; }
.sheet-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sheet-no-box { background: #1e3a8a; color: #fff; border-radius: 10px; padding: 10px 16px; }
.sheet-no-box .lbl { font-size: 12px; opacity: .75; }
.sheet-no-box .no { font-size: 20px; font-weight: 700; font-family: Consolas, monospace; letter-spacing: 1px; }

.mode-row { display: flex; gap: 8px; margin-bottom: 14px; }
.mode-btn { flex: 1; padding: 12px 8px; text-align: center; border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; user-select: none; }
.mode-btn .t { font-size: 15px; font-weight: 700; }
.mode-btn .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.mode-btn.active { border-color: var(--blue); background: var(--blue-bg); }
.mode-btn.active .t { color: var(--blue-dark); }

/* ---------- 语音播报开关 ---------- */
.voice-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; flex: 1; min-width: 210px; }
.switch input { display: none; }
.switch .slider { width: 46px; height: 26px; background: #cbd5e1; border-radius: 26px; position: relative; transition: background .2s; flex: none; }
.switch .slider::after { content: ""; position: absolute; width: 20px; height: 20px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch .txt { font-size: 13.5px; color: var(--text); }

.scan-input-wrap { position: relative; }
.scan-input-wrap input { padding: 18px 16px; font-size: 22px; font-family: Consolas, monospace; letter-spacing: 1px; text-align: center; }
.scan-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }

.stat-row { display: flex; gap: 10px; margin: 14px 0; }
.stat-box { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 12px 6px; }
.stat-box .v { font-size: 24px; font-weight: 800; color: var(--blue-dark); font-family: Consolas, monospace; }
.stat-box .k { font-size: 12px; color: var(--muted); margin-top: 2px; }

.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: #052e16; color: #4ade80; border: 1px solid #16a34a; padding: 12px 22px; border-radius: 10px; font-size: 16px; font-weight: 700; z-index: 999; box-shadow: 0 6px 20px rgba(0,0,0,.25); display: none; }
.toast.err { background: #450a0a; color: #fca5a5; border-color: var(--red); }

.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.modal .barcode-show { font-family: Consolas, monospace; font-size: 18px; font-weight: 700; background: var(--blue-bg); border-radius: 8px; padding: 10px; text-align: center; margin-bottom: 14px; word-break: break-all; }
.modal .btn-row { display: flex; gap: 10px; margin-top: 16px; }
.modal .btn-row .btn { flex: 1; }
.qty-input input { font-size: 28px; text-align: center; font-family: Consolas, monospace; }
.qty-quick { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.qty-quick .btn { padding: 6px 14px; }

.recent-list .item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px dashed var(--line); }
.recent-list .bc { flex: 1; font-family: Consolas, monospace; font-size: 14px; word-break: break-all; }
.recent-list .qt { font-size: 16px; font-weight: 800; color: var(--blue-dark); white-space: nowrap; }
.recent-list .del { color: var(--red); border: 1px solid var(--red); background: #fff; border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; }

.cam-box { margin-top: 12px; }
#camVideo { width: 100%; border-radius: 10px; background: #000; }

/* ---------- 多端协同 ---------- */
.dev-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.dev-field { flex: 1; min-width: 180px; }
.dev-field input { padding: 8px 12px; font-size: 14px; }
.dev-chip { display: flex; align-items: center; gap: 6px; background: var(--green-bg); color: #15803d; border: 1px solid #bbf7d0; border-radius: 20px; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.dev-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.18); animation: pulse 1.8s infinite; }
.dev-chip .names { color: var(--muted); font-size: 12px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 5px; animation: pulse 1.8s infinite; }
.live-n { font-weight: 700; color: var(--green); font-family: Consolas, monospace; }
.recent-list .item.flash { animation: flashBg 1.8s ease-out; }
@keyframes flashBg { 0% { background: #fef3c7; } 100% { background: transparent; } }
.recent-list .op { font-style: normal; font-size: 11px; color: var(--muted); background: #f1f5f9; border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.recent-list .op.me { color: var(--blue); background: var(--blue-bg); }

@media (max-width: 640px) {
  .container { padding: 0 10px; margin: 12px auto; }
  .topbar { padding: 10px 12px; }
  .topbar h1 { font-size: 16px; }
  .table-scroll { overflow-x: auto; }
  table.tbl th, table.tbl td { white-space: nowrap; }
  .actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
}
