* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f7; color: #1c2430; font-size: 15px; line-height: 1.5;
}
a { color: #3E9BEE; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* 顶栏 */
.topbar {
  background: #3E9BEE; color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 600; }
.topbar .sub { font-size: 12px; opacity: .85; }
.topbar a, .topbar button.link { color: #fff; background: none; border: none; font-size: 13px; padding: 4px 8px; border-radius: 6px; }
.topbar button.link:hover, .topbar a:hover { background: rgba(255,255,255,.15); }

/* 卡片与布局 */
.wrap { max-width: 960px; margin: 0 auto; padding: 14px; }
.card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.muted { color: #8a94a3; font-size: 13px; }
.mt { margin-top: 10px; }

/* 表单 */
input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d5dae2; border-radius: 10px;
  background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #3E9BEE; box-shadow: 0 0 0 3px rgba(62,155,238,.15); }
label.fld { display: block; margin-bottom: 10px; }
label.fld span { display: block; font-size: 13px; color: #5b6572; margin-bottom: 4px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #3E9BEE; color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 15px; min-height: 42px;
}
.btn:active { transform: scale(.97); }
.btn.gray { background: #e8ecf1; color: #1c2430; }
.btn.red { background: #dc2626; }
.btn.green { background: #16a34a; }
.btn.small { padding: 6px 12px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }

/* 进度条 */
.progress { background: #e5e9ef; border-radius: 99px; height: 10px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg,#3E9BEE,#35c46f); border-radius: 99px; transition: width .3s; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef1f5; }
th { color: #5b6572; font-weight: 600; font-size: 13px; white-space: nowrap; }
tr:hover td { background: #f8fafc; }

/* 徽标 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.badge.ok { background: #dcfce7; color: #15803d; }
.badge.no { background: #f1f5f9; color: #64748b; }
.badge.diff { background: #fef3c7; color: #b45309; }
.badge.extra { background: #ede9fe; color: #7c3aed; }

/* ---------- 手机盘点页 ---------- */
.msearch { position: sticky; top: 54px; z-index: 15; background: #f2f4f7; padding: 10px 14px; }
.msearch input { border-radius: 99px; padding: 12px 16px; font-size: 16px; }
.chips { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  border: 1px solid #d5dae2; background: #fff; border-radius: 99px;
  padding: 5px 14px; font-size: 13px; white-space: nowrap; color: #4b5563;
}
.chip.on { background: #3E9BEE; color: #fff; border-color: #3E9BEE; }

.ilist { padding: 4px 14px 90px; }
.item {
  background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  border: 2px solid transparent; cursor: pointer;
}
.item.done { border-color: #16a34a; background: #f0fdf4; }
.item .m { font-weight: 600; font-size: 16px; word-break: break-all; }
.item .n { color: #5b6572; font-size: 13px; margin-top: 2px; word-break: break-all; }
.item .q { text-align: right; flex-shrink: 0; }
.item .q b { font-size: 17px; }
.item .q .cnt { color: #16a34a; }

/* 底部弹层 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: none; }
.mask.show { display: block; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: #fff; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  display: none; max-height: 88vh; overflow-y: auto;
}
.sheet.show { display: block; }
.sheet h3 { font-size: 16px; margin-bottom: 4px; }
.sheet .headinfo { color: #5b6572; font-size: 13px; margin-bottom: 12px; }
.qtyrow { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.qtyrow input { font-size: 28px; font-weight: 700; text-align: center; height: 64px; }
.qtyrow .book { flex-shrink: 0; text-align: center; background: #f1f5f9; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.qtyrow .book b { display: block; font-size: 20px; }
.quick { display: flex; gap: 8px; margin-bottom: 12px; }
.quick button { flex: 1; border: 1px solid #d5dae2; background: #fff; border-radius: 8px; padding: 8px 0; font-size: 14px; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.photos .ph { position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; background: #eef1f5; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph .x {
  position: absolute; top: 0; right: 0; width: 22px; height: 22px;
  background: rgba(220,38,38,.9); color: #fff; border: none; border-radius: 0 0 0 8px; font-size: 13px; line-height: 22px; padding: 0;
}
.photobtns { display: flex; gap: 10px; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: rgba(20,30,45,.92); color: #fff; padding: 10px 22px; border-radius: 99px;
  font-size: 14px; z-index: 99; display: none; max-width: 80vw; text-align: center;
}

/* 登录页 */
.login-box { max-width: 360px; margin: 14vh auto 0; padding: 0 20px; }
.login-box .card { padding: 28px 24px; }
.login-box h1 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-box .muted { text-align: center; display: block; margin-bottom: 18px; }

/* PC 会话卡片 */
.sess { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid #eef1f5; flex-wrap: wrap; }
.sess:last-child { border-bottom: none; }
.sess .info { flex: 1; min-width: 220px; }
.sess .name { font-weight: 600; font-size: 15px; }
.sess .ops { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { background: #eaf5ff; border: 1px solid #b5dcff; color: #3E9BEE; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
@media (max-width: 520px) { .wrap { padding: 10px; } .card { padding: 12px; } }

/* 筛选下拉与标签 */
select.mini {
  width: auto; border-radius: 99px; padding: 6px 12px; font-size: 13px;
  border: 1px solid #d5dae2; background: #fff; color: #4b5563; max-width: 46vw; outline: none;
}
.meta { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; background: #eaf5ff; color: #2b6cb0; border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.tag.money { background: #fff7e6; color: #a05a00; font-weight: 600; }
.star { color: #f59e0b; }

/* 电脑端汇总 */
.sumtbl { margin-top: 8px; }
.sumtbl h3 { font-size: 14px; margin: 10px 0 4px; }
.ratioBox { display: flex; gap: 6px; align-items: center; }
.ratioBox input { width: 74px; padding: 6px 8px; font-size: 14px; border: 1px solid #d5dae2; border-radius: 8px; }

/* 长按快速一致：防止长按弹出选择菜单 */
.item { -webkit-user-select: none; user-select: none; }
