/* 丫丫网购 · 多门店预警系统（目录 /expiry） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F6F2EA; color: #2B2523; font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.hide { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 15px; color: #2B2523; outline: none; }

/* ---------- 登录 ---------- */
#loginScreen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; background: #652025; padding: 0 24px;
}
#loginScreen .brand {
  width: 74px; height: 74px; border-radius: 20px; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #F0D9A8; margin-bottom: 18px;
}
#loginScreen h1 { font-size: 21px; color: #fff; letter-spacing: 2px; font-weight: 500; }
#loginScreen .sub { font-size: 12px; color: rgba(255,255,255,.55); margin: 8px 0 30px; letter-spacing: 1px; }
.auth-box { width: 100%; max-width: 300px; }
.auth-box input {
  width: 100%; padding: 13px 14px; border: 1.5px solid rgba(255,255,255,.18); border-radius: 10px;
  background: rgba(255,255,255,.94); margin-bottom: 10px; text-align: center; font-size: 16px;
}
.auth-box input:focus { border-color: #E7781D; }
#loginPass { -webkit-text-security: asterisk; letter-spacing: 3px; }
.auth-box button {
  width: 100%; padding: 13px 0; border-radius: 10px; background: #E7781D; color: #fff;
  font-size: 16px; letter-spacing: 6px; margin-top: 6px;
}
.auth-box button:active { background: #C9660F; }
#loginErr { font-size: 13px; color: #FFB3AB; margin-top: 12px; min-height: 18px; text-align: center; }
.storepick {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin-top: 18px; max-width: 320px;
}
.storepick .sp {
  padding: 5px 11px; border-radius: 14px; font-size: 12px;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.14);
}
.storepick .sp:active { background: rgba(255,255,255,.22); }

/* ---------- 顶部 ---------- */
.topbar {
  background: #652025; color: #fff; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 30;
}
.topbar .tt { font-size: 16px; letter-spacing: 1px; }
.topbar .tt small { display: block; font-size: 11px; color: rgba(255,255,255,.55); letter-spacing: 0; margin-top: 3px; }
.topbar .acts { display: flex; align-items: center; gap: 8px; }
.topbar .acts button {
  color: rgba(255,255,255,.82); font-size: 13px; padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.2); border-radius: 15px;
}
.topbar .bell { position: relative; }
.badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; line-height: 17px;
  background: #E24B4A; color: #fff; border-radius: 9px; font-size: 11px; padding: 0 4px;
  text-align: center; font-weight: 500;
}

/* ---------- 标签 ---------- */
.tabs { display: flex; background: #fff; border-bottom: 1px solid #EAE6DA; position: sticky; top: 55px; z-index: 20; }
.tab {
  flex: 1; text-align: center; padding: 12px 0; font-size: 14px; color: #8A8375;
  border-bottom: 2px solid transparent;
}
.tab.on { color: #652025; border-bottom-color: #E7781D; font-weight: 500; }
.wrap { max-width: 620px; margin: 0 auto; padding: 12px 12px 90px; }

/* ---------- 面板 ---------- */
.panel { display: none; }
.panel.on { display: block; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border: 1px solid #EAE6DA; border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
}
.card h3 { font-size: 14px; font-weight: 500; color: #652025; margin-bottom: 12px; }
.fld { margin-bottom: 11px; }
.fld label { display: block; font-size: 12px; color: #8A8375; margin-bottom: 5px; }
.fld label i { color: #E24B4A; font-style: normal; }
.fld input, .fld select {
  width: 100%; padding: 10px 12px; border: 1px solid #E2DDD0; border-radius: 9px;
  background: #FDFCFA;
}
.fld input:focus, .fld select:focus { border-color: #E7781D; background: #fff; }
.grid2 { display: flex; gap: 10px; }
.grid2 > .fld { flex: 1; min-width: 0; }
.shelfrow { display: flex; gap: 6px; }
.shelfrow input { flex: 1; min-width: 0; }
.shelfrow select { width: 74px; flex: none; padding-left: 8px; padding-right: 2px; }
.hint { font-size: 11.5px; color: #9C9587; line-height: 1.6; }
.hint b { color: #652025; }

/* ---------- 按钮 ---------- */
.btn {
  padding: 11px 16px; border-radius: 9px; background: #E7781D; color: #fff;
  font-size: 15px; letter-spacing: 1px;
}
.btn:active { background: #C9660F; }
.btn.ghost { background: #fff; color: #652025; border: 1px solid #E2DDD0; }
.btn.ghost:active { background: #F6F2EA; }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn.sm { padding: 10px 14px; font-size: 13px; letter-spacing: 0; }
.btn[disabled] { opacity: .55; }

/* ---------- 统计条 ---------- */
.statbar { display: flex; gap: 8px; margin-bottom: 10px; }
.statbar .s {
  flex: 1; background: #fff; border: 1px solid #EAE6DA; border-radius: 11px;
  padding: 11px 8px; text-align: center;
}
.statbar .s b { display: block; font-size: 21px; font-weight: 500; color: #2B2523; line-height: 1.2; }
.statbar .s span { font-size: 11px; color: #9C9587; }
.statbar .s.danger b { color: #C62828; }
.statbar .s.warn b { color: #B26A00; }
.statbar .s.danger { background: #FDF5F5; border-color: #F3D9D9; }
.statbar .s.warn { background: #FEFAF1; border-color: #F0E3C6; }

/* ---------- 筛选 / 搜索 ---------- */
.filters { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.filters select, .filters input[type=date] {
  flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid #E2DDD0; border-radius: 9px;
  background: #fff; font-size: 13px; color: #2B2523;
}
.filters .clear {
  padding: 9px 13px; border: 1px solid #E2DDD0; border-radius: 9px;
  background: #fff; font-size: 13px; color: #8A8375; white-space: nowrap;
}
.searchbar { margin-bottom: 10px; }
.searchbar input {
  width: 100%; padding: 11px 13px; border: 1px solid #E2DDD0; border-radius: 10px;
  background: #fff;
}
.scanline2 { font-size: 12px; color: #8A8375; margin-bottom: 8px; }
.scanline2 b { color: #652025; }

/* ---------- 批次卡片 ---------- */
.bcard {
  background: #fff; border: 1px solid #EAE6DA; border-left-width: 4px; border-radius: 11px;
  padding: 12px 13px; margin-bottom: 9px;
}
.bcard.lv-expired { border-left-color: #C62828; background: #FEF8F8; }
.bcard.lv-near { border-left-color: #E7781D; background: #FFFCF6; }
.bcard.lv-week { border-left-color: #C9B896; }
.bcard.lv-normal { border-left-color: #CFE0CF; }
.bcard.lv-done { border-left-color: #C6C1B5; opacity: .82; }
.bcard .r1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bcard .nm { font-size: 15px; font-weight: 500; color: #2B2523; word-break: break-all; }
.bcard .sp { font-size: 12px; color: #9C9587; margin-left: 5px; font-weight: 400; }
.bcard .lv {
  font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; font-weight: 500;
}
.lv-tag-expired { background: #FCEBEB; color: #C62828; }
.lv-tag-near { background: #FAEEDA; color: #B26A00; }
.lv-tag-week { background: #F1EFE8; color: #6B6558; }
.lv-tag-normal { background: #EAF3DE; color: #3B6D11; }
.lv-tag-done { background: #F1EFE8; color: #8A8375; }
.bcard .r2 { font-size: 12.5px; color: #6B6558; margin-top: 7px; line-height: 1.75; }
.bcard .r2 em { font-style: normal; color: #B26A00; font-weight: 500; }
.bcard .r2 em.red { color: #C62828; }
.bcard .r3 { margin-top: 9px; display: flex; gap: 7px; flex-wrap: wrap; }
.bcard .r3 button {
  padding: 6px 12px; border-radius: 8px; font-size: 12.5px;
  border: 1px solid #E2DDD0; background: #fff; color: #652025;
}
.bcard .r3 button.pri { background: #E7781D; color: #fff; border-color: #E7781D; }
.bcard .r3 button:active { opacity: .75; }

/* ---------- 跨店同款（同品名 + 同生产日期） ---------- */
.sibtag {
  display: inline-block; background: #E7F0EE; color: #2A6E68;
  font-size: 10.5px; padding: 1px 5px; border-radius: 4px; margin-right: 5px;
  font-weight: 600; letter-spacing: .5px; vertical-align: 1px;
}
.sibline {
  margin-top: 8px; padding-top: 7px; border-top: 1px dashed #E6E0D4;
  font-size: 12px; color: #5C6E6B; line-height: 1.7;
}
.sibline b { color: #2A6E68; }
.sibhint {
  margin-top: 2px; padding: 9px 10px; border-radius: 9px;
  background: #EDF4F2; border: 1px solid #D5E5E1;
  font-size: 12px; color: #3F5E59; line-height: 1.8;
}
.sibhint b { color: #2A6E68; }
/* 跨店同款：每店一行，店名居左、数量居右对齐 */
.hrow {
  display: flex; align-items: baseline; gap: 8px;
  padding: 2.5px 0; font-size: 12.5px; line-height: 1.6;
}
.hrow .sn { flex: 1; min-width: 0; color: #2B2523; }
.hrow .sq { color: #2A6E68; font-weight: 600; white-space: nowrap; }
.hrow .sd { color: #8B968F; font-size: 11.5px; white-space: nowrap; }
.hrow.self { font-weight: 600; }
.hrow.self .sn { color: #2A6E68; }
.htotal {
  border-top: 1px dashed #C9DAD5; margin-top: 4px; padding-top: 5px;
  font-size: 12px; color: #4A5C59;
}
.htotal b { color: #2A6E68; }
.sibsum { font-size: 12.5px; color: #4A5C59; line-height: 1.8; margin-bottom: 6px; }
.sibsum b { color: #2A6E68; }
.sibtable { border-top: 1px solid #EFEAE0; }
.sibrow {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 2px; border-bottom: 1px solid #F6F3EC; font-size: 12.5px;
}
.sibrow.self { background: #F7FBF9; font-weight: 600; }
.sibrow .sn { flex: 1; min-width: 0; color: #2B2523; }
.sibrow .sq { color: #2A6E68; font-weight: 600; white-space: nowrap; }
.sibrow .sd { color: #9C9587; font-size: 11.5px; white-space: nowrap; }

/* 统计条是 4 格，标签字号收一点，避免手机上挤 */
.statbar .s span { font-size: 10.5px; }
.empty { text-align: center; color: #B4AE9F; font-size: 13px; padding: 40px 10px; line-height: 2; }

/* ---------- 扫码行 / 商品池 ---------- */
.scanrow { display: flex; gap: 8px; margin-bottom: 11px; }
.scanrow input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #E2DDD0; border-radius: 9px; background: #FDFCFA; }
.poolres {
  border: 1px solid #E2DDD0; border-radius: 10px; max-height: 230px; overflow-y: auto;
  margin-bottom: 11px; background: #fff;
}
.poolres .pi { padding: 10px 12px; border-bottom: 1px solid #F1EDE4; font-size: 13.5px; }
.poolres .pi:last-child { border-bottom: none; }
.poolres .pi small { display: block; color: #9C9587; font-size: 11.5px; margin-top: 2px; }
.poolres .pi:active { background: #F6F2EA; }

/* ---------- 记录 ---------- */
.logitem {
  background: #fff; border: 1px solid #EAE6DA; border-radius: 11px;
  padding: 11px 13px; margin-bottom: 9px;
}
.logitem .lr { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.logitem .lr .ty { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #F1EFE8; color: #6B6558; white-space: nowrap; }
.logitem .lr .ty.t-下架 { background: #E6F1FB; color: #185FA5; }
.logitem .lr .ty.t-折价 { background: #FAEEDA; color: #B26A00; }
.logitem .lr .ty.t-报损 { background: #FCEBEB; color: #C62828; }
.logitem .lr .ty.t-售完 { background: #EAF3DE; color: #3B6D11; }
.logitem .lm { font-size: 12px; color: #9C9587; margin-top: 5px; line-height: 1.7; }

/* ---------- 详情面板 ---------- */
.sheet {
  position: fixed; inset: 0; background: #F6F2EA; z-index: 60;
  display: flex; flex-direction: column;
}
.sheet .head {
  background: #652025; color: #fff; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.sheet .head .t { font-size: 16px; }
.sheet .head button { color: rgba(255,255,255,.85); font-size: 14px; padding: 4px 8px; }
.sheet .head #sheetDel { color: #FFB3AB; }
.sheet .body { flex: 1; overflow-y: auto; padding: 12px 12px 40px; max-width: 620px; margin: 0 auto; width: 100%; }
.grp { background: #fff; border: 1px solid #EAE6DA; border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.grp h3 { font-size: 14px; font-weight: 500; color: #652025; margin-bottom: 12px; }
.big { font-size: 17px; font-weight: 500; margin-bottom: 9px; }
.kv { font-size: 13px; color: #6B6558; line-height: 2; }
.kv b { color: #2B2523; font-weight: 500; }
.kv .red { color: #C62828; font-weight: 500; }
.kv .orange { color: #B26A00; font-weight: 500; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.chip {
  padding: 7px 14px; border-radius: 18px; border: 1px solid #E2DDD0;
  background: #FDFCFA; font-size: 13px; color: #6B6558;
}
.chip.on { background: #652025; color: #fff; border-color: #652025; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(30,20,20,.5); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modalbox {
  background: #fff; border-radius: 14px; width: 100%; max-width: 420px;
  max-height: 82vh; display: flex; flex-direction: column; overflow: hidden;
}
.mhead {
  padding: 14px 16px; font-size: 15px; font-weight: 500; color: #652025;
  border-bottom: 1px solid #F1EDE4; display: flex; align-items: center; justify-content: space-between;
}
.mhead .x { font-size: 15px; color: #B4AE9F; padding: 2px 6px; }
.mbody { padding: 12px 16px; overflow-y: auto; flex: 1; }
.mfoot { padding: 12px 16px; display: flex; gap: 10px; border-top: 1px solid #F1EDE4; }
.mfoot .btn { flex: 1; }
.aitem { padding: 10px 0; border-bottom: 1px solid #F6F3EC; font-size: 13.5px; }
.aitem:last-child { border-bottom: none; }
.aitem .an { display: flex; justify-content: space-between; gap: 8px; }
.aitem .ad { font-size: 11.5px; color: #9C9587; margin-top: 3px; line-height: 1.7; }
.aitem .le { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.aitem .le.expired { background: #FCEBEB; color: #C62828; }
.aitem .le.near { background: #FAEEDA; color: #B26A00; }
.msum { font-size: 12.5px; color: #6B6558; line-height: 1.8; margin-bottom: 8px; }

/* ---------- toast / loading ---------- */
#toastBox { position: fixed; left: 0; right: 0; bottom: 76px; z-index: 90; text-align: center; pointer-events: none; }
.toast {
  display: inline-block; background: rgba(43,37,35,.92); color: #fff;
  font-size: 13.5px; padding: 10px 18px; border-radius: 20px; margin: 4px auto;
  max-width: 84vw; line-height: 1.5;
}
.loading {
  position: fixed; inset: 0; background: rgba(246,242,234,.7); z-index: 70;
  display: flex; align-items: center; justify-content: center; color: #8A8375; font-size: 14px;
}

/* 只看我的（登记页开关） */
.recenthead { display: flex; align-items: center; justify-content: space-between; }
.recenthead h3 { margin: 0; }
.minetoggle { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #6B6558; cursor: pointer; user-select: none; }
.minetoggle input { width: 18px; height: 18px; accent-color: #C8503C; }
.minename { font-size: 12px; color: #8A8375; margin: 4px 0 2px; }
.minename b { color: #C8503C; }
.claimbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 8px; padding: 7px 10px;
  background: #FDF6E7; border: 1px solid #F0E2C4; border-radius: 8px; font-size: 12px; color: #8A6D3B; }
.claimbar b { color: #C8503C; }
.btn.ghost.sm { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
/* 各店群机器人配置行 */
.grprow { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; border-bottom: 1px dashed #E8E2D4; }
.grprow .gname { font-size: 13px; font-weight: bold; color: #4A4436; }
.grprow input { width: 100%; box-sizing: border-box; }
.grprow .gtest { align-self: flex-start; }
