﻿/* ============================================================
   前台收银台（仿 支付宝/微信 在线支付页）
   ============================================================ */

:root {
  --p-bg: #f2f3f5;
  --p-card: #ffffff;
  --p-blue: #1677ff;
  --p-blue-d: #0f62e6;
  --p-text: #1d2129;
  --p-dim: #86909c;
  --p-mute: #c9cdd4;
  --p-line: #e5e6eb;
  --p-green: #00b578;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--p-bg);
  color: var(--p-text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

input { font: inherit; }
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.hidden { display: none !important; }

.pay-wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 0 0 40px;
  min-height: 100vh;
  background: var(--p-card);
}

/* ------------------------------------------------------------ 头部 --- */

.pay-head {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 14px;
}
.pay-head .shield {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  color: var(--p-blue);
}
.pay-head .shield svg {
  width: 26px; height: 26px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.pay-head .head-txt { flex: 1; min-width: 0; }
.pay-head h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.01em; }
.pay-head p { margin: 1px 0 0; font-size: 12.5px; color: var(--p-dim); }
.pay-head .secure {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--p-dim); flex: none;
}
.pay-head .secure svg {
  width: 13px; height: 13px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.bar {
  height: 3px;
  background: linear-gradient(90deg, var(--p-blue) 0%, #4b9bff 55%, #a8ccff 100%);
  border-radius: 2px;
  margin: 0 18px 18px;
}

/* -------------------------------------------------------- 金额卡片 --- */

.amt-card {
  margin: 0 18px;
  padding: 26px 20px 22px;
  text-align: center;
  background: linear-gradient(180deg, #fafbfc 0%, #f1f3f6 100%);
  border-radius: 14px;
}
.amt-label { margin: 0 0 12px; font-size: 14px; color: #4e5969; }
.amt-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.amt-row .cur { font-size: 24px; font-weight: 500; color: var(--p-text); }
.amt-row input {
  width: 190px; border: 0; background: transparent;
  font-size: 58px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--p-text); text-align: center; outline: none;
  padding: 0; line-height: 1.05;
}
.amt-row input::placeholder { color: #d5d9e0; }
.amt-sub { margin: 14px 0 0; font-size: 13px; color: var(--p-dim); }

.amt-show {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
}
.amt-show .cur { font-size: 24px; font-weight: 500; }
.amt-show b { font-size: 58px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }

.tip-line {
  margin: 12px 18px 0; font-size: 12.5px; color: var(--p-mute);
  text-align: center;
}

/* -------------------------------------------------------- 支付方式 --- */

.sec-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 26px 18px 12px;
}
.sec-title span { font-size: 15px; font-weight: 600; }
.sec-title em { font-style: normal; font-size: 12px; color: var(--p-dim); }

.method {
  display: flex; align-items: center; gap: 12px;
  margin: 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: #fff;
}
.m-ico {
  width: 36px; height: 36px; flex: none; border-radius: 9px;
  background: var(--p-blue); color: #fff;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700;
}
.m-txt { flex: 1; min-width: 0; }
.m-txt b { display: block; font-size: 14px; font-weight: 500; }
.m-txt i { display: block; font-style: normal; font-size: 12px; color: var(--p-dim); margin-top: 2px; }
.m-cur {
  flex: none; font-size: 12px; color: var(--p-blue);
  display: inline-flex; align-items: center; gap: 3px;
}

/* ---------------------------------------------------------- 二维码 --- */

.qr-card {
  margin: 18px 18px 0;
  padding: 20px;
  border: 1px solid var(--p-line);
  border-radius: 14px;
  text-align: center;
  background: #fff;
}
.qr-box {
  position: relative;
  width: 208px; height: 208px;
  margin: 0 auto;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  border: 1px solid var(--p-line);
  display: grid; place-items: center;
  overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr-box .qr-loading {
  position: absolute; inset: 8px; border-radius: 8px;
  background: linear-gradient(100deg, #f2f3f5 30%, #fafbfc 50%, #f2f3f5 70%);
  background-size: 200% 100%;
  animation: qrsh 1.3s linear infinite;
}
@keyframes qrsh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.qr-box.ready .qr-loading { display: none; }

.qr-tip { margin: 14px 0 0; font-size: 13.5px; color: #4e5969; }
.qr-left { margin: 6px 0 0; font-size: 12.5px; color: var(--p-dim); }
.qr-left b { font-weight: 500; color: #4e5969; font-family: ui-monospace, Menlo, monospace; }

.safe-note {
  margin: 18px 18px 0;
  font-size: 12px; color: var(--p-dim);
  text-align: center;
}

/* ------------------------------------------------------------ 按钮 --- */

.pay-btn {
  display: block;
  width: calc(100% - 36px);
  margin: 20px 18px 0;
  height: 50px;
  border: 0; border-radius: 10px;
  background: linear-gradient(180deg, #2c86ff, var(--p-blue) 60%, var(--p-blue-d));
  color: #fff; font-size: 16px; font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(22, 119, 255, 0.65);
  transition: filter 0.15s, transform 0.12s;
}
.pay-btn:hover:not(:disabled) { filter: brightness(1.05); }
.pay-btn:active:not(:disabled) { transform: translateY(1px); }
.pay-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.ghost-btn {
  display: block;
  width: calc(100% - 36px);
  margin: 10px 18px 0;
  height: 46px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: #fff; color: #4e5969; font-size: 14.5px;
  cursor: pointer;
}
.ghost-btn:hover { background: #fafbfc; }

.err-line {
  margin: 12px 18px 0; font-size: 13px; color: #f53f3f; text-align: center;
  min-height: 20px;
}

/* ------------------------------------------------------ 锁定遮罩 --- */

.lock-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 26, 38, 0.58);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fadein 0.18s ease-out;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.lock-panel {
  width: 100%; max-width: 300px;
  background: #fff; border-radius: 16px;
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(10, 20, 40, 0.3);
  animation: pop 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: none; } }

.ring { position: relative; width: 64px; height: 64px; margin: 0 auto 16px; }
.ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring .ring-bg { fill: none; stroke: #eef0f3; stroke-width: 4; }
.ring .ring-fg {
  fill: none; stroke: var(--p-blue); stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 125.6;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
.ring b {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700; color: var(--p-blue);
}
.lock-panel h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.lock-panel p { margin: 0; font-size: 12.5px; color: var(--p-dim); line-height: 1.6; }

/* ---------------------------------------------------------- 响应式 --- */

@media (min-width: 461px) {
  body { padding: 24px 0; }
  .pay-wrap {
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(20, 30, 50, 0.08);
    min-height: auto;
    overflow: hidden;
  }
}

@media (max-width: 400px) {
  .amt-row input { font-size: 48px; width: 150px; }
  .amt-show b { font-size: 48px; }
  .qr-box { width: 186px; height: 186px; }
  .sec-title { margin-top: 20px; }
}

/* ============================================================
   输入页：自定义数字键盘（仿聚合支付收银台）
   ============================================================ */

#screenInput.mp {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: #f2f4f7;
}

.mp-body { flex: 1; padding: 26px 16px 0; }

.mp-logo {
  width: 54px; height: 54px; border-radius: 50%;
  background: #1677ff;
  display: grid; place-items: center;
  margin-bottom: 22px;
  box-shadow: 0 6px 16px -6px rgba(22, 119, 255, .6);
}
.mp-logo svg {
  width: 27px; height: 27px;
  fill: none; stroke: #fff; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

.mp-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 20px 24px;
  box-shadow: 0 2px 10px rgba(20, 30, 50, .04);
}
.mp-ph {
  margin: 0 0 12px;
  font-size: 17px;
  color: #b3b9c2;
  transition: opacity .15s;
}
.mp-ph.hide { display: none; }

.mp-field { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.mp-cur { font-size: 27px; font-weight: 400; color: #1d2129; }
.mp-val {
  font-size: 34px; font-weight: 500; letter-spacing: .5px;
  color: #1d2129; line-height: 1.1;
}
.mp-caret {
  width: 2px; height: 30px; background: #1677ff;
  animation: mp-blink 1.05s step-end infinite;
  margin-left: 1px;
}
@keyframes mp-blink { 50% { opacity: 0; } }


.mp-footer { margin-top: auto; }

.mp-kb { background: #fff; border-top: 1px solid #e5e6eb; }
.mp-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1px;
  background: #eceef1;
}
.mp-key {
  border: 0; background: #fff; height: 58px;
  font-size: 25px; font-weight: 400; color: #1d2129;
  cursor: pointer; user-select: none;
  display: grid; place-items: center;
  transition: background .1s;
}
.mp-key:active { background: #eef1f5; }
.mp-key.mp-del svg {
  width: 25px; height: 25px;
  fill: none; stroke: #1d2129; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.mp-key.mp-zero { grid-column: span 2; }

.mp-submit {
  grid-column: 4;
  grid-row: 2 / 5;
  border: 0;
  background: #1677ff;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s;
  display: grid; place-items: center;
}
.mp-submit:active { background: #0f62e6; }
.mp-submit:disabled { background: #a3c8ff; cursor: not-allowed; }

@media (min-width: 461px) {
  #screenInput.mp { min-height: calc(100dvh - 48px); }
}

@media (max-width: 360px) {
  .mp-key { height: 52px; font-size: 22px; }
  .mp-val { font-size: 30px; }
}

/* 扫码提示（付款页，二维码上方） */
.qr-tip {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0 0 14px;
  font-size: 15px; font-weight: 500; color: #1d2129;
}
.pay-ico {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 5px;
  font-size: 11px; font-weight: 700; color: #fff; flex: none;
}
.pay-ali { background: #1677ff; }
.pay-wx { background: #07c160; margin-right: 2px; }

/* 输入页顶部条（与付款页同款，白底） */
#screenInput.mp > .pay-head {
  background: #fff;
  padding-bottom: 16px;
}
#screenInput.mp > .bar {
  margin-left: 18px;
  margin-right: 18px;
  background: linear-gradient(90deg, #1677ff 0%, #4b9bff 55%, #a8ccff 100%);
}

/* 页面背景统一：头部/主体同色，只保留金额卡片与键盘为白色 */
#screenInput.mp {
  background: #f5f6f8;
}
#screenInput.mp > .pay-head {
  background: transparent;
  padding-bottom: 14px;
}
#screenInput.mp > .bar {
  margin: 0 18px 0;
  background: linear-gradient(90deg, #1677ff 0%, #4b9bff 55%, #a8ccff 100%);
  opacity: .9;
}
.mp-body {
  padding: 24px 16px 0;
  background: transparent;
}
.mp-card {
  box-shadow: 0 2px 12px rgba(20, 30, 50, .05);
}
.mp-kb {
  background: #fff;
}
