/* 支付前台 · 手机充值样式（对齐设计稿） */
:root {
  --pri: #1677ff;
  --bg: #f5f5f5;
  --t1: #1f1f1f;
  --t2: #595959;
  --t3: #8c8c8c;
  --line: #f0f0f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body.pay-m {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #e9edf2;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 24px 12px;
  color: var(--t1);
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.phone {
  width: 100%;
  max-width: 375px;
  height: 100%;
  max-height: calc(100dvh - 48px);
  min-height: 0;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.nav {
  height: 48px;
  flex: none;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
}
.nav .back { width: 24px; height: 24px; cursor: pointer; display: flex; align-items: center; }
.nav .title {
  position: absolute; left: 0; right: 0;
  text-align: center; font-size: 17px; font-weight: 500; pointer-events: none;
}
.nav .link { font-size: 14px; color: var(--pri); text-decoration: none; z-index: 1; }
.nav .dots { font-size: 18px; letter-spacing: 1px; color: #4e5969; }
.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* 充值等内容区尽量不露出滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.main::-webkit-scrollbar { width: 0; height: 0; display: none; }
.main.pad-result { padding: 36px 16px 16px; gap: 0; }
.sec-hd { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.sec-hd h2 { font-size: 16px; font-weight: 600; }
.limit {
  margin: 8px 2px 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--t3);
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.chip {
  height: 46px; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #e6e8eb; border-radius: 8px;
  font-size: 16px; cursor: pointer; user-select: none;
}
.chip.on { background: #e6f4ff; border-color: var(--pri); color: var(--pri); font-weight: 600; }
.custom {
  margin-top: 9px; height: 56px; background: #fff; border-radius: 10px;
  display: flex; align-items: center; padding: 0 16px; gap: 6px;
  border: 1.5px solid #d6e4ff; box-shadow: 0 1px 0 rgba(22, 119, 255, 0.06);
  min-width: 0; max-width: 100%; overflow: hidden;
}
.custom:focus-within {
  border-color: var(--pri); box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
.custom .yen {
  flex: none;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 22px; font-weight: 700; color: var(--t1); line-height: 1;
}
.custom input {
  border: 0; outline: 0; flex: 1 1 auto; min-width: 0; width: 100%;
  background: transparent; color: var(--t1);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 28px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.1;
  -moz-appearance: textfield;
}
.custom input::-webkit-outer-spin-button,
.custom input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.custom input::placeholder {
  color: #bfbfbf; font-size: 18px; font-weight: 500; letter-spacing: 0;
}
.pay-card { background: #fff; border-radius: 12px; padding: 0 14px; }
.pay-row {
  display: flex; align-items: center; gap: 12px; height: 58px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.pay-row:last-child { border-bottom: 0; }
.pay-ico { width: 26px; height: 26px; border-radius: 6px; flex: none; overflow: hidden; }
.pay-name { flex: 1; min-width: 0; font-size: 15px; }
.pay-name small { display: block; font-size: 11px; color: var(--t3); margin-top: 2px; }
.radio { width: 20px; height: 20px; flex: none; }
.foot {
  flex: none; background: #fff; padding: 12px 16px 22px;
  display: flex; gap: 12px;
}
.btn {
  width: 100%; height: 46px; border: 0; border-radius: 10px;
  background: var(--pri); color: #fff; font-size: 16px; font-weight: 500; cursor: pointer;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost {
  border: 1px solid #d9d9d9; background: #fff; color: #4e5969; font-size: 15px;
}
.btn.flex { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.card { background: #fff; border-radius: 12px; padding: 16px; }
.amt-card { text-align: center; padding: 18px 16px; }
.amt-card .label { font-size: 13px; color: var(--t3); }
.amt-card .value {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 36px; font-weight: 600; margin: 6px 0 8px;
}
.badge {
  display: inline-block; background: #fff7e6; color: #d46b08;
  font-size: 11px; padding: 4px 12px; border-radius: 12px;
}
.badge.ok { background: #f6ffed; color: #389e0d; }
.badge.bad { background: #fff1f0; color: #cf1322; }
.badge.warn { background: #fff7e6; color: #d46b08; }
.merchant { display: flex; align-items: center; gap: 10px; }
.merchant .logo {
  width: 34px; height: 34px; border-radius: 50%; background: var(--pri);
  flex: none; display: flex; align-items: center; justify-content: center;
}
.merchant .name { font-size: 15px; font-weight: 500; }
.merchant .sub { font-size: 11px; color: var(--t3); margin-top: 2px; }
.qr-area { position: relative; width: 180px; height: 180px; margin: 16px auto 10px; }
.qr-area img, .qr-area canvas { width: 180px !important; height: 180px !important; display: block; }
#qrBox { position: relative; width: 180px; height: 180px; }
.qr-placeholder {
  width: 180px; height: 180px; background: #fafafa; border: 1px dashed #d9d9d9;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: var(--t3); font-size: 13px;
}
.qr-placeholder.qr-loading {
  flex-direction: column; gap: 10px; border-style: solid; border-color: #e8e8e8;
}
.qr-placeholder .spin,
.qr-refresh-mask .spin {
  width: 22px; height: 22px; border: 2px solid #d9d9d9; border-top-color: var(--pri);
  border-radius: 50%; animation: pay-spin 0.8s linear infinite;
}
.qr-refresh-mask {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(255, 255, 255, 0.78);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; border-radius: 6px; color: var(--t2); font-size: 12px;
}
.stage-tip {
  display: block;
  width: 180px;
  margin: 0 auto 6px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: var(--t2);
  min-height: 1.45em;
}
@keyframes pay-spin { to { transform: rotate(360deg); } }
.qr-tip {
  margin: 8px 4px 0; text-align: center; font-size: 12px; line-height: 1.5;
  color: #8c8c8c;
}
.alert-warn {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0; padding: 12px 14px;
  background: #fffbe6; border: 1px solid #ffe58f; border-radius: 10px;
  color: #874d00; font-size: 12px; line-height: 1.55;
}
.alert-warn .ico {
  flex: none; width: 18px; height: 18px; margin-top: 1px;
  border-radius: 50%; background: #faad14; color: #fff;
  font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
}
.alert-warn p { margin: 0; flex: 1; }
.qr-mask {
  position: absolute; inset: 0; z-index: 3;
  background: rgba(255, 255, 255, 0.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; border-radius: 6px; padding: 12px;
  box-sizing: border-box;
}
.qr-mask .t {
  font-size: 13px; line-height: 1.5; color: var(--t1, #1f1f1f);
  text-align: center; font-weight: 500;
}
/* 过期蒙版：半透明透出二维码，中央醒目提示 */
.qr-mask.ended {
  background: rgba(255, 255, 255, 0.52);
}
.qr-mask.ended .t {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #cf1322;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.95);
}
.qr-mask button {
  height: 30px; padding: 0 14px; border: 0; border-radius: 6px;
  background: #1677ff; color: #fff; font-size: 12px; cursor: pointer;
}
.countdown { text-align: center; font-size: 13px; color: var(--t2); min-height: 0; }
.countdown:empty { display: none; }
.countdown b { color: #faad14; }
.pays {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  margin-top: 10px; font-size: 11px; color: var(--t2);
}
.pays span { display: flex; align-items: center; gap: 4px; }
.pays i {
  width: 16px; height: 16px; border-radius: 4px; color: #fff; font-size: 10px;
  font-style: normal; display: inline-flex; align-items: center; justify-content: center;
}
.info {
  background: #fff; border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.info .row { display: flex; justify-content: space-between; font-size: 13px; gap: 12px; }
.info .row .k { color: var(--t3); flex: none; }
.info .row .v { color: var(--t2); text-align: right; word-break: break-all; }
.info .row .v.ok { color: #52c41a; }
.info .row .v.bad { color: #ff4d4f; }
.info .row .v.strong { color: var(--t1); font-weight: 600; }
.hero { text-align: center; margin-bottom: 26px; }
.hero .icon {
  width: 76px; height: 76px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.hero .icon .in {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.hero .icon.success { background: #e8ffea; }
.hero .icon.success .in { background: #52c41a; }
.hero .icon.error { background: #fff1f0; }
.hero .icon.error .in { background: #ff4d4f; }
.hero .icon.warning { background: #fff7e6; }
.hero .icon.warning .in { background: #faad14; }
.hero h1 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.hero .amount {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 30px; font-weight: 600; margin-bottom: 10px;
}
.hero .sub { font-size: 13px; color: var(--t3); }
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75); color: #fff; padding: 9px 16px;
  border-radius: 6px; font-size: 13px; display: none; z-index: 99;
  pointer-events: none; max-width: 80%; text-align: center;
}
@media (max-width: 420px) {
  body.pay-m {
    padding: 0;
    background: var(--bg);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  .phone {
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    height: 100%;
    max-height: 100dvh;
    min-height: 0;
  }
}
