* { box-sizing: border-box; margin: 0; padding: 0; }

/* 根字号按视口宽度等比缩放(小屏 14px ~ 大屏 16px),
   全文用 rem 写尺寸 → 全屏结构自动随屏幕等比缩放 */
html {
  font-size: clamp(14px, 4.27vw, 16px);
}

:root {
  --radius-card: 0.875rem;   /* 14 */
  --radius-btn:  0.75rem;    /* 12 */
  --pay-btn-h:   3.125rem;   /* 50 */
  --side-pad:    1rem;       /* 16 */
  --gap-v:       0.875rem;   /* 14 */
  --text-name:   1rem;       /* 16 */
  --text-btn:    1.0625rem;  /* 17 */
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
               "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #111;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f4;
}

/* 手机外框 —— 移动端默认全屏,占满可视区域 */
.phone {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f4f4f4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 平板 / 桌面端:居中展示 iPhone 风格外框 */
@media (min-width: 481px) {
  body {
    background: #e5e7eb;
    padding: 20px;
  }
  .phone {
    max-width: 24.375rem;           /* 390 */
    min-height: min(52.75rem, calc(100dvh - 2.5rem));
    border-radius: 2.75rem;         /* 44 */
    box-shadow: 0 1.25rem 3.75rem rgba(0, 0, 0, .15);
  }
}

/* 中间空白区域 */
.content { flex: 1; }

/* 支付方式卡片 */
.pay-methods {
  padding: 0 var(--side-pad);
  margin-bottom: 1rem;
}
.method {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fff;
  border-radius: var(--radius-card);
  padding: var(--gap-v) var(--side-pad);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  cursor: pointer;
  user-select: none;
}
.method-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.logo {
  width: 2.25rem;   /* 36 */
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo svg {
  width: 100%;
  height: 100%;
  display: block;
}
.method-name {
  font-size: var(--text-name);
  font-weight: 500;
  color: #111;
}

/* 隐藏原生 radio,使用自定义圆形 check */
.method input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.check {
  width: 1.25rem;   /* 20 */
  height: 1.25rem;
  border-radius: 50%;
  background: #d1d5db;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color .15s;
}
.method.selected .check { background: #1f7aff; }

/* 底部支付按钮 */
.pay-bar {
  padding: 0.5rem var(--side-pad) calc(6.5rem + env(safe-area-inset-bottom, 0px));
  background: #f4f4f4;
  flex-shrink: 0;
}
.pay-btn {
  width: 100%;
  height: var(--pay-btn-h);
  border: none;
  border-radius: var(--radius-btn);
  background: #2f7bff;
  color: #fff;
  font-size: var(--text-btn);
  font-weight: 500;
  letter-spacing: 0.125rem;
  cursor: pointer;
  transition: background-color .15s, transform .08s;
}
.pay-btn:hover { background: #2468e6; }
.pay-btn:active { transform: scale(.995); background: #1f5ccc; }

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.96);
  max-width: 80%;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.4;
  border-radius: 0.625rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 10;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
