:root {
  --primary: #1677ff;
  --primary-deep: #0f5fd6;
  --bg: #f5f6f7;
  --card: #ffffff;
  --text-main: #111827;
  --text-sub: #6b7280;
  --text-mute: #9ca3af;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
  --font: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

/* ---------- 顶部商户信息条 ---------- */
.merchant-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 6px;
  margin-bottom: 12px;
}

.avatar {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d9bff 0%, #4a5cff 55%, #8b5cf6 100%);
  overflow: hidden;
}

.avatar-fill {
  position: absolute;
  inset: -10%;
  background: conic-gradient(from 210deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.02) 30%, rgba(255, 255, 255, 0.4) 55%, transparent 80%, rgba(255, 255, 255, 0.5));
  filter: blur(1px);
}

.badge-check {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #1677ff;
  border: 1.5px solid #fff;
}
.badge-check::after {
  content: "";
  position: absolute;
  left: 3.2px;
  top: 3.6px;
  width: 4.6px;
  height: 2.6px;
  border-left: 1.6px solid #fff;
  border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg);
}

.merchant-info {
  flex: 1;
  min-width: 0;
}

.merchant-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.2px;
}

.merchant-account {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 3px;
}

.chevron {
  color: #c4c9d0;
  display: flex;
  align-items: center;
  padding: 4px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.cashier-main {
  padding: 0 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- 金额卡片 ---------- */
.amount-card {
  padding-bottom: 18px;
}

.card-label {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.amount-input,
.transfer-amount-input {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.currency {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
}

.amount-value {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 42px;
  font-weight: 700;
  color: var(--text-main);
  width: 100%;
  letter-spacing: 0.5px;
}
.amount-value::placeholder {
  color: #d3d6db;
}

.quick-amounts {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  flex: 1;
  padding: 7px 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--primary);
  background: #f0f6ff;
  border: 1px solid #d6e7ff;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.chip:active {
  transform: scale(0.95);
  background: #e2efff;
}
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- 收款码卡片 ---------- */
.qr-card {
  text-align: center;
}

.qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.qr-title {
  font-size: 15px;
  font-weight: 600;
}

.qr-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #16a34a;
  background: #ecfdf3;
  border: 1px solid #c9f2d6;
  padding: 3px 9px;
  border-radius: 12px;
}
.qr-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.qr-box {
  width: 244px;
  height: 244px;
  margin: 0 auto;
  position: relative;
  cursor: pointer;
  border: 1px solid #f0f1f3;
  border-radius: 10px;
  padding: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.qr-box:active {
  transform: scale(0.97);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.qr-img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  display: block;
  object-fit: cover;
}

.qr-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.qr-tip {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 14px;
  line-height: 1.6;
}

/* ---------- 支付按钮 ---------- */
.pay-actions {
  padding: 4px 0 10px;
}

.btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.28);
}

.pay-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 10px;
}

/* ---------- 转账页 ---------- */
.view-transfer {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.transfer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}
.spacer {
  visibility: hidden;
}

.transfer-title {
  font-size: 16px;
  font-weight: 600;
}

.transfer-main {
  padding: 8px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.transfer-receiver {
  padding: 22px 20px;
  text-align: center;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  margin: 0 auto;
}

.receiver-name {
  font-size: 16px;
  font-weight: 700;
  margin-top: 10px;
}

.receiver-account {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
}

.transfer-amount-card {
  padding-bottom: 18px;
}

.btn-transfer {
  margin-top: 4px;
  background: var(--primary-deep);
  box-shadow: 0 8px 20px rgba(15, 95, 214, 0.28);
}

/* ---------- 右下角转账悬浮按钮 ---------- */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border: none;
  border-radius: 30px;
  background: #1a2437;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.fab:active {
  transform: scale(0.94);
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.32);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 14%;
  transform: translateX(-50%);
  z-index: 99;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 16px;
  border-radius: 10px;
  max-width: 82%;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.view {
  animation: view-in 0.25s ease;
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 340px) {
  .qr-box { width: 220px; height: 220px; }
}