/* bbt-xi H5 样式（移动端优先） */
:root {
  --primary: #1f6feb;
  --primary-dark: #1a5fd0;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #8a93a6;
  --line: #e8ebf0;
  --ok: #16a34a;
  --warn: #d97706;
  --hot: #dc2626;
  --radius: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif; font-size: 14px; }
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
#topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 10px; background: var(--card); border-bottom: 1px solid var(--line); }
#top-title { flex: 1; font-size: 16px; font-weight: 600; text-align: center; }
.icon-btn { border: none; background: none; font-size: 22px; color: var(--text); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.icon-btn:active { background: var(--bg); }
#top-right { min-width: 36px; display: flex; justify-content: flex-end; }
#view { flex: 1; padding: 12px 12px 84px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.muted { color: var(--muted); font-size: 12px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(20, 30, 60, .05); }
.card .title { font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stat .n { font-size: 18px; font-weight: 700; color: var(--primary); }
.stat .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; background: #eef2f7; color: #475069; white-space: nowrap; }
.tag.ok { background: #e8f7ee; color: var(--ok); }
.tag.warn { background: #fdf3e3; color: var(--warn); }
.tag.hot { background: #fdecec; color: var(--hot); }
.tag.blue { background: #e8f0fe; color: var(--primary); }
.btn { display: block; width: 100%; border: none; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; padding: 11px; border-radius: 10px; cursor: pointer; }
.btn:active { background: var(--primary-dark); }
.btn.ghost { background: #eef2f7; color: var(--text); }
.btn.sm { width: auto; display: inline-block; padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn.danger { background: var(--hot); }
.btn:disabled { background: #c6cdd8; cursor: not-allowed; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #fbfcfe; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; outline: none; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #fff; }
textarea { min-height: 70px; resize: vertical; }
label.fld { display: block; font-size: 12px; color: var(--muted); margin: 0 0 4px 2px; }
.tabs2 { display: flex; background: #eef2f7; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.tabs2 span { flex: 1; text-align: center; padding: 8px; border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.tabs2 span.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(20,30,60,.08); }
.entry { background: var(--card); border-radius: var(--radius); padding: 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 3px rgba(20,30,60,.05); }
.entry:active { background: #f0f4fa; }
.entry b { color: var(--primary); }
.usercard { display: flex; gap: 12px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #6ea8ff, #1f6feb); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 40px; height: 40px; font-size: 15px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 10px; background: #e8f0fe; color: var(--primary); vertical-align: middle; }
.banner { border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.banner .ph { height: 110px; background: linear-gradient(120deg, #2b5fd9, #6ea8ff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.prod { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.prod:last-child { border-bottom: none; }
.prod .img { width: 64px; height: 64px; border-radius: 10px; background: #eef2f7; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; flex: none; }
.prod .meta { flex: 1; min-width: 0; }
.price { color: var(--hot); font-weight: 700; }
/* 底部 tabbar */
#tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 720px; display: flex; background: var(--card); border-top: 1px solid var(--line); padding: 5px 0 calc(5px + env(safe-area-inset-bottom)); z-index: 40; }
#tabbar .tab { flex: 1; text-align: center; font-size: 11px; color: var(--muted); cursor: pointer; padding: 3px 0; }
#tabbar .tab .ic { display: block; font-size: 19px; margin-bottom: 1px; }
#tabbar .tab.active { color: var(--primary); font-weight: 600; }
/* toast */
#toast-root { position: fixed; top: 20%; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(20, 26, 40, .88); color: #fff; padding: 9px 16px; border-radius: 99px; font-size: 13px; max-width: 78vw; animation: tin .18s ease; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; } }
/* modal */
#modal-root .mask { position: fixed; inset: 0; background: rgba(15, 20, 35, .5); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fin .15s ease; }
@keyframes fin { from { opacity: 0; } to { opacity: 1; } }
#modal-root .modal { background: var(--card); border-radius: 16px 16px 0 0; width: 100%; max-width: 720px; max-height: 86vh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: mup .2s ease; }
@keyframes mup { from { transform: translateY(30px); } to { transform: translateY(0); } }
#modal-root .modal .title { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
/* 滑块 */
.slider-box { padding: 6px 4px 2px; }
.slider-box input[type=range] { width: 100%; margin: 6px 0 2px; -webkit-appearance: none; background: transparent; padding: 0; border: none; }
.slider-box input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--primary) var(--pct, 33%), #e3e8f0 var(--pct, 33%)); }
.slider-box input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); margin-top: -8px; box-shadow: 0 1px 4px rgba(31,111,235,.4); }
.slider-val { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.slider-val b { color: var(--hot); font-size: 16px; }
/* 团购包卡片 */
.pkg { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; cursor: pointer; position: relative; }
.pkg.sel { border-color: var(--primary); background: #f4f8ff; }
.pkg .shop { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pkg .sku-line { font-size: 12px; color: #475069; line-height: 1.7; }
.pkg .p-total { font-weight: 700; color: var(--hot); }
.pkg .chk { position: absolute; right: 10px; top: 10px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cdd5e0; }
.pkg.sel .chk { background: var(--primary); border-color: var(--primary); }
.pkg.sel .chk::after { content: '✓'; color: #fff; font-size: 12px; display: block; text-align: center; line-height: 18px; }
/* 支付步骤 */
.step { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.step .no { width: 22px; height: 22px; border-radius: 50%; background: #eef2f7; color: var(--muted); text-align: center; line-height: 22px; font-size: 12px; font-weight: 700; flex: none; }
.step.on .no { background: var(--primary); color: #fff; }
.step.done .no { background: var(--ok); color: #fff; }
.step .t { font-weight: 600; }
.step .s { font-size: 11px; color: var(--muted); }
.qr-box { text-align: center; padding: 8px 0; }
.qr-box img { width: 190px; height: 190px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr-ph { width: 190px; height: 190px; margin: 0 auto; border: 1px dashed #cdd5e0; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.pay-amount { text-align: center; font-size: 24px; font-weight: 800; color: var(--hot); margin: 6px 0 2px; }
.notice { background: #fff8e6; border: 1px solid #f5dfa8; color: #92600a; font-size: 12px; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; line-height: 1.6; }
.notice.blue { background: #eef4ff; border-color: #c9dbff; color: #2b5fd0; }
.empty { text-align: center; color: var(--muted); padding: 36px 0; font-size: 13px; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.ocr-preview img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.progress { height: 6px; background: #e8ebf0; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tb th, table.tb td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.tb th { color: var(--muted); font-weight: 500; }
.countdown { color: var(--warn); font-weight: 600; }
.closed { color: var(--hot); font-weight: 600; }
