:root{
  --wx-green:#07c160;
  --wx-green-dark:#06ad56;
  --bg:#f2f2f2;
  --text:#1a1a1a;
  --text-sub:#888;
}
*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
button,a,input,textarea,select,[role="button"]{-webkit-tap-highlight-color:transparent;}
button:focus,a:focus,input:focus,textarea:focus,select:focus{outline:none;}
button{background:none;border:none;color:inherit;}
html,body{height:100%;overflow:hidden;touch-action:none;-webkit-text-size-adjust:100%;}
body{
  position:fixed;left:0;top:0;width:100%;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue","Microsoft YaHei",sans-serif;
  background:var(--bg);min-height:100vh;color:var(--text);
  overscroll-behavior:none;
}

/* 页面容器：全屏铺满，直角，无外框圆角与阴影 */
.phone{
  position:relative;width:100%;max-width:100vw;height:100vh;max-height:100%;
  background:var(--bg);border-radius:0;overflow:hidden;
  display:flex;flex-direction:column;
}


/* 商品区块 */
.goods{display:flex;gap:14px;margin:22px 16px;background:#fff;border-radius:12px;padding:16px;}
.goods-thumb{width:72px;height:72px;border-radius:10px;background:#f2f2f2;display:flex;align-items:center;justify-content:center;font-size:34px;}
.goods-info{flex:1;display:flex;flex-direction:column;gap:6px;}
.goods-name{font-size:16px;font-weight:600;}
.goods-desc{font-size:13px;color:var(--text-sub);line-height:1.5;}
.goods-amount{font-size:20px;font-weight:700;color:#1a1a1a;margin-top:auto;}

/* 确认页金额 */
.pay-hero{padding:26px 20px 20px;text-align:center;}
.pay-hero .product{font-size:17px;color:#333;}
.pay-hero .amount{font-size:46px;font-weight:500;margin-top:10px;letter-spacing:-1px;}
.pay-hero .amount .yen{font-size:30px;margin-right:2px;}

.payee-row{width:100%;background:#fff;margin:0;border-radius:0;padding:16px;display:flex;justify-content:space-between;align-items:center;font-size:15px;border-top:1px solid #eee;border-bottom:1px solid #eee;}
.payee-row .label{color:var(--text-sub);}
.payee-row .value{font-weight:500;text-align:right;}

.pay-btn{margin:22px 16px;height:52px;border:none;border-radius:10px;background:var(--wx-green);color:#fff;font-size:18px;font-weight:600;cursor:pointer;}
.pay-btn:active{background:var(--wx-green-dark);}

.demo-note{margin:auto 24px 30px;text-align:center;font-size:12px;color:#999;line-height:1.7;}
.demo-note b{color:#b25a00;}

/* 遮罩 */
.mask{position:absolute;inset:0;background:rgba(0,0,0,.45);z-index:20;opacity:0;pointer-events:none;transition:opacity .25s;}
.mask.show{opacity:1;pointer-events:auto;}

/* 密码弹层 */
.pin-panel{position:absolute;left:0;right:0;bottom:0;z-index:30;background:#fff;border-radius:18px 18px 0 0;transform:translateY(100%);transition:transform .3s ease;display:flex;flex-direction:column;}
.pin-panel.show{transform:translateY(0);}
.pin-head{display:flex;justify-content:space-between;align-items:center;padding:16px 18px;}
.pin-head .close{font-size:22px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;}
.pin-summary{text-align:center;padding:4px 0 10px;}
.pin-summary .payee{font-size:16px;color:#333;}
.pin-summary .amount{font-size:34px;font-weight:700;margin-top:6px;}
.pin-summary .amount .yen{font-size:22px;margin-right:2px;}

.pay-method-head{margin:12px 12px 0;padding:11px 0;display:flex;justify-content:space-between;align-items:center;border-top:1px solid #eee;font-size:15px;}
.pay-method-head .label{color:#888;}
.pay-method-head .change{color:#999;display:flex;align-items:center;gap:4px;}
.pay-method-head .change .arr{width:9px;height:6px;}
.pay-method{margin:10px 16px;background:#fff9e9;border-radius:10px;padding:17px 14px;display:flex;align-items:center;gap:10px;}
.pay-method .wallet{width:22px;height:22px;border-radius:50%;background:#f3c974;border:1.5px solid #ddb264;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;}
.pay-method .name{flex:1;font-size:15px;color:#6b7280;}
.pay-method .check{width:22px;height:22px;display:flex;align-items:center;justify-content:center;}
.pay-method .check svg{width:22px;height:22px;}

.err-mask{position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;}
.err-dialog{width:78%;max-width:320px;background:#fff;border-radius:14px;overflow:hidden;animation:errIn .22s ease-out;}
@keyframes errIn{from{opacity:0;transform:scale(.92);}to{opacity:1;transform:scale(1);}}
.err-title{text-align:center;font-size:17px;color:#1a1a1a;padding:26px 18px;}
.err-actions{display:flex;border-top:1px solid #eee;}
.err-btn{flex:1;height:50px;border:none;background:#fff;font-size:16px;color:#1a1a1a;cursor:pointer;}
.err-btn + .err-btn{border-left:1px solid #eee;}
.err-btn.primary{color:#576b95;}
.pin-dots{display:flex;justify-content:center;gap:14px;margin:18px 0 8px;}
.pin-dots .dot{width:42px;height:42px;border:1.5px solid transparent;border-radius:8px;background:#eaf1f9;display:flex;align-items:center;justify-content:center;}
.pin-dots .dot.current{background:#fff;border-color:#1677ff;}
.pin-dots .dot i{width:11px;height:11px;border-radius:50%;background:#1a1a1a;display:none;}
.pin-dots .dot.filled i{display:block;}

.keyboard{margin-top:10px;display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:#eee;}
.key{height:44px;background:#fff;border:none;color:#1a1a1a;font-size:24px;font-weight:500;cursor:pointer;}
.key:active{background:#ececec;}
.key.del{font-size:20px;}
.key.empty{background:#eee;}

/* 结果弹层 */
.result-panel{position:absolute;left:0;right:0;bottom:0;z-index:30;background:#fff;border-radius:18px 18px 0 0;min-height:340px;display:flex;flex-direction:column;align-items:center;padding-top:26px;}

/* 支付成功：全屏白页，不保留背后付款页与遮罩 */
.success-page .pay-hero,
.success-page .payee-row,
.success-page .pay-btn,
.success-page .mask{display:none;}
.success-page .result-panel{position:absolute;inset:0;border-radius:0;min-height:100vh;padding-top:70px;animation:panelUp .4s cubic-bezier(.22,.61,.36,1) both;}
@keyframes panelUp{from{transform:translateY(100%);}to{transform:translateY(0);}}
.result-panel .payee{font-size:16px;color:#333;}
.result-panel .amount{font-size:32px;font-weight:700;margin-top:8px;}
.result-panel .amount .yen{font-size:20px;margin-right:2px;}

.result-icon{margin-top:46px;width:72px;height:72px;display:flex;align-items:center;justify-content:center;}
.bubble-svg{width:64px;height:64px;}
.bubble-shape{fill:#d8d8d8;}
.result-icon.success .bubble-shape{fill:var(--wx-green);}
.bubble-check{fill:none;stroke:#fff;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round;}
.result-text{margin-top:16px;font-size:16px;color:#888;}
.result-text.success{color:#333;font-weight:600;}

.dots-loading{display:flex;gap:6px;margin-top:18px;}
.dots-loading i{width:7px;height:7px;border-radius:50%;background:#c9c9c9;animation:blink 1.2s infinite;}
.dots-loading i:nth-child(2){animation-delay:.2s;}
.dots-loading i:nth-child(3){animation-delay:.4s;}
@keyframes blink{0%,80%,100%{opacity:.3;}40%{opacity:1;}}

.success-head{display:flex;align-items:center;gap:7px;color:var(--wx-green);font-size:17px;font-weight:600;margin-bottom:14px;}
.success-head svg{width:24px;height:24px;}
.done-btn{margin-top:auto;margin-bottom:40px;width:200px;height:48px;border:none;border-radius:10px;background:#f2f2f2;color:#1a1a1a;font-size:16px;cursor:pointer;}

/* ============ 支付宝收银台（两层：背景层 + 白色圆角卡片） ============ */
.ap-layer{
  min-height:100vh;display:flex;flex-direction:column;
  padding:14px 0 0;
  background:#232b3e;
}
.ap-sheet{
  position:relative;flex:1;display:flex;flex-direction:column;
  background:linear-gradient(180deg,#e9f1fb 0%,#f1f6fc 45%,#f6f9fc 100%);border-radius:22px 22px 0 0;overflow:hidden;
  padding:14px 0 0;
}
.ap-card{background:#fff;border-radius:14px;margin:2px 18px 0;padding:4px 14px;box-shadow:0 1px 4px rgba(35,43,62,.06);}
.ap-top{position:relative;height:0;}
.ap-close{position:absolute;left:14px;top:-8px;width:36px;height:36px;display:flex;align-items:flex-start;justify-content:center;padding-top:4px;font-size:24px;line-height:1;color:#333;cursor:pointer;}

.ap-merchant{text-align:center;font-size:17px;line-height:1.2;color:#1a1a1a;font-weight:500;margin-top:16px;}
.ap-amount{text-align:center;font-size:40px;font-weight:700;margin-top:6px;letter-spacing:-1px;}
.ap-amount .yen{font-size:24px;margin-right:2px;}
.ap-points{text-align:center;font-size:12px;color:#f5722a;margin-top:4px;}
.ap-points .coin{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border-radius:50%;background:#f7c948;color:#7a5a00;font-size:9px;margin-right:4px;}
.ap-account{display:flex;justify-content:space-between;align-items:center;padding:10px 18px 2px;font-size:14px;}
.ap-account .label{color:#888;}
.ap-account .num{color:#1a1a1a;}

.ap-wallet{display:flex;align-items:center;gap:10px;padding:8px 0 6px;}
.ap-wallet-icon{width:26px;height:26px;border-radius:8px;background:#e8f1ff;color:#1677ff;font-weight:700;display:flex;align-items:center;justify-content:center;font-size:15px;}
.ap-wallet-name{flex:1;font-size:16px;color:#1a1a1a;}
.ap-check{width:24px;height:24px;display:flex;align-items:center;justify-content:center;}
.ap-check svg{width:22px;height:22px;}

.ap-sub{display:flex;gap:12px;}
.ap-sub-item{flex:1;border:1px solid #e3e8ef;border-radius:10px;padding:9px 12px;font-size:14px;color:#1a1a1a;text-align:center;}
.ap-sub-item.active{border-color:#1677ff;background:#f0f6ff;color:#1677ff;font-weight:600;}
.ap-sub-item.dim{color:#888;border-color:#eee;background:#f7f8fa;}
.ap-sub-item.dim span{display:block;font-size:11px;color:#aaa;margin-top:3px;}

.ap-divider{height:1px;background:#f0f1f3;margin:8px 0 2px;}
.ap-tool-label{font-size:12px;color:#999;padding:5px 0;}
.ap-tool{display:flex;align-items:center;gap:10px;padding:5px 0;}
.ap-bank-icon{width:26px;height:26px;display:flex;align-items:center;justify-content:center;}
.ap-bank-icon svg{width:24px;height:24px;}
.ap-tool-name{flex:1;font-size:15px;color:#1a1a1a;}
.ap-tool-name span{display:block;font-size:12px;color:#999;margin-top:2px;}
.ap-arrow{color:#bbb;font-size:20px;}

.ap-collapse{display:flex;justify-content:center;padding:10px 0 4px;}
.ap-collapse svg{width:18px;height:11px;}

.pin-kb{margin-top:auto;display:flex;flex-direction:column;}
.ap-sheet .pin-dots{margin:0 0 16px;}
.ap-sheet .keyboard{margin-top:0;margin-left:0;margin-right:0;}

.result-payee{font-size:16px;color:#333;}
.result-amount{font-size:32px;font-weight:700;margin-top:8px;}
.result-amount .yen{font-size:20px;margin-right:2px;}

/* 支付成功：隐藏收银台元素 */
.success-page .ap-top,
.success-page .ap-merchant,
.success-page .ap-amount,
.success-page .ap-points,
.success-page .ap-account,
.success-page .ap-wallet,
.success-page .ap-sub,
.success-page .ap-divider,
.success-page .ap-tool-label,
.success-page .ap-tool,
.success-page .ap-collapse,
.success-page .pin-dots,
.success-page .keyboard{display:none;}
.success-page .result-panel{position:absolute;inset:0;border-radius:0;min-height:100vh;padding-top:70px;background:#fff;animation:panelUp .4s cubic-bezier(.22,.61,.36,1) both;}
.success-page .success-head{color:var(--wx-green);}
.channel-alipay.success-page .success-head{color:#1677ff;}
