/* ============ FormPro H5 表单页样式（主题色 --theme 由JS注入） ============ */
:root { --theme: #2563eb; --ink: #1b2a44; --sub: #7a8699; --line: #e8edf5; --bg: #eef2f8; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 14px 14px 30px; }
.h5-loading { text-align: center; color: var(--sub); padding: 100px 0; }

.h5-head { padding: 18px 4px 6px; }
.h5-title { font-size: 21px; font-weight: 700; line-height: 1.4; }
.h5-desc { font-size: 13px; color: var(--sub); margin-top: 6px; line-height: 1.7; white-space: pre-wrap; }
.h5-count { font-size: 12px; color: #a8b4c4; margin-top: 8px; }

.blk { background: #fff; border-radius: 14px; padding: 14px; margin-top: 12px; box-shadow: 0 1px 6px rgba(15,43,82,.05); }
.blk[hidden] { display: none !important; }
.blk.nopad { padding: 0; overflow: hidden; }
.f-label { font-size: 15px; font-weight: 600; line-height: 1.5; }
.f-label .req { color: #e5484d; margin-left: 2px; }
.f-sub { font-size: 12px; color: var(--sub); margin: 4px 0 8px; line-height: 1.6; }
.f-body { margin-top: 8px; }

.f-ipt, .f-ta, .f-sel { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 15px; color: var(--ink); background: #f8fafd; outline: none; font-family: inherit; }
.f-ipt:focus, .f-ta:focus, .f-sel:focus { border-color: var(--theme); background: #fff; }
.f-ipt.err, .f-ta.err, .f-sel.err { border-color: #e5484d; }
.f-ta { min-height: 90px; resize: vertical; }
.f-hd { font-size: 13px; padding: 10px 12px; border-radius: 8px; background: #fdf0f0; color: #c03535; margin-bottom: 8px; display: none; }
.f-hd.show { display: block; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 20px; padding: 8px 16px; font-size: 14px; color: #4a5872; cursor: pointer; background: #fff; }
.chip.on { border-color: var(--theme); color: var(--theme); background: rgba(37,99,235,.06); font-weight: 600; }

.stars { display: flex; gap: 6px; font-size: 30px; color: #dde4ee; cursor: pointer; user-select: none; }
.stars .on { color: #f7b500; }

.up-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.up-item { position: relative; border-radius: 10px; overflow: hidden; background: #f1f5fb; aspect-ratio: 1; }
.up-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-item .x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: none; font-size: 11px; }
.up-add { border: 1px dashed #c9d6ea; border-radius: 10px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #a8b4c4; background: #f8fafd; cursor: pointer; }
.up-prog { position: absolute; inset: 0; background: rgba(255,255,255,.75); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--theme); }
.file-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f8fafd; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.file-row a { color: var(--theme); text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sig-box { border: 1px dashed #c9d6ea; border-radius: 10px; min-height: 110px; display: flex; align-items: center; justify-content: center; color: #a8b4c4; font-size: 13px; cursor: pointer; background: #f8fafd; }
.sig-box img { max-height: 140px; display: block; }

.goods-name { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.spec-chip { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; cursor: pointer; margin: 0 8px 8px 0; display: inline-block; background: #fff; }
.spec-chip.on { border-color: var(--theme); color: var(--theme); background: rgba(37,99,235,.06); }
.spec-chip s { color: #b0bacc; }
.qty-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.qty-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 16px; cursor: pointer; }
.qty-num { font-size: 16px; font-weight: 700; min-width: 24px; text-align: center; }
.pay-total { margin-top: 10px; font-size: 13px; color: var(--sub); }
.pay-total b { color: #e5484d; font-size: 20px; }

.cap-row { display: flex; gap: 8px; align-items: center; }
.cap-q { background: rgba(37,99,235,.07); color: var(--theme); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.cap-ref { border: none; background: none; color: var(--sub); font-size: 12px; cursor: pointer; }

.agree-row { display: flex; gap: 8px; font-size: 13px; color: #4a5872; line-height: 1.6; align-items: flex-start; }
.agree-row input { margin-top: 3px; }

.calc-view { background: #f8fafd; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 20px; font-weight: 700; color: var(--theme); text-align: right; }

.btn-submit { display: block; width: 100%; border: none; border-radius: 12px; padding: 14px; margin-top: 16px; font-size: 16px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--theme), #4f8cff); box-shadow: 0 6px 18px rgba(37,99,235,.3); cursor: pointer; }
.btn-ghost { display: block; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; font-size: 14px; color: var(--sub); background: #fff; cursor: pointer; }

.h5-foot { text-align: center; color: #b6c2d4; font-size: 11px; margin-top: 22px; line-height: 1.8; }
.h5-foot a { color: inherit; }

.scan-wrap { display: flex; gap: 8px; }
.scan-wrap .f-ipt { flex: 1; }
.scan-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 0 14px; font-size: 18px; cursor: pointer; }

.float-btn { position: fixed; right: 16px; bottom: 26px; background: linear-gradient(135deg, var(--theme), #4f8cff); color: #fff; border-radius: 50px; padding: 10px 16px; font-size: 13px; box-shadow: 0 6px 18px rgba(37,99,235,.35); text-decoration: none; z-index: 50; }
.bgm-btn { position: fixed; left: 14px; top: 14px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.9); border: 1px solid var(--line); font-size: 16px; z-index: 60; cursor: pointer; }
.bgm-btn.playing { animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 全屏轮播 */
.fs-mask { position: fixed; inset: 0; background: #000; z-index: 100; }
.fs-mask img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s; position: absolute; inset: 0; }
.fs-mask img.show { opacity: 1; }
.fs-enter { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); border: none; background: rgba(255,255,255,.92); color: #1b2a44; border-radius: 50px; padding: 11px 34px; font-size: 15px; font-weight: 600; z-index: 2; }

/* 签名弹窗 */
.mask { position: fixed; inset: 0; background: rgba(10,20,40,.5); z-index: 90; display: none; align-items: flex-end; justify-content: center; }
.mask.show { display: flex; }
.sheet { background: #fff; width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 16px; }
.sheet-hd { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.sig-canvas { width: 100%; height: 220px; border: 1px dashed #c9d6ea; border-radius: 10px; background: #f8fafd; touch-action: none; display: block; }
.sheet-btns { display: flex; gap: 10px; margin-top: 12px; }
.sheet-btns button { flex: 1; border-radius: 10px; padding: 12px; font-size: 15px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.sheet-btns .pri { background: var(--theme); color: #fff; border-color: var(--theme); font-weight: 600; }

/* 扫码弹窗 */
.scan-video { width: 100%; border-radius: 10px; background: #000; }

/* 成功页 */
.ok-view { text-align: center; padding: 60px 10px; }
.ok-ic { width: 74px; height: 74px; margin: 0 auto; border-radius: 50%; background: #e8f7ee; color: #22a05c; font-size: 38px; line-height: 74px; }
.ok-tip { font-size: 18px; font-weight: 700; margin-top: 18px; }
.cert-card { border: 2px solid #d9b45c; border-radius: 14px; background: linear-gradient(180deg, #fffdf5, #fdf6e3); padding: 26px 18px; margin-top: 22px; text-align: center; }
.cert-card b { color: #a8791d; font-size: 20px; letter-spacing: 4px; }
.cert-card p { color: #8a6d2f; font-size: 13px; line-height: 1.8; margin: 10px 0 0; }
.ok-actions { margin-top: 26px; }

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

/* 收银台 */
.pay-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.pay-box { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 30px 22px; box-shadow: 0 8px 30px rgba(15,43,82,.12); text-align: center; }
.pay-hd { font-size: 15px; font-weight: 700; }
.pay-amount { font-size: 44px; font-weight: 800; color: var(--ink); margin: 18px 0 6px; }
.pay-meta { font-size: 12px; color: var(--sub); line-height: 2; margin: 0 0 18px; }
.pay-ok { color: #22a05c; font-size: 20px; font-weight: 700; margin: 20px 0; }
.pay-tip { font-size: 12px; color: #b6c2d4; margin-top: 12px; }
