/* ── 银联收银台 Demo - 风格 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#app { width: 100%; max-width: 440px; }

/* ── 页面切换 ── */
.page { display: none; }
.page.active { display: block; }

/* ── 主卡片 ── */
.cashier-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  padding: 32px 28px;
  animation: slideUp 0.35s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 页头 ── */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.unionpay-logo { height: 28px; }
.secure-badge {
  font-size: 12px; color: #666;
  background: #f5f5f5; padding: 3px 10px; border-radius: 12px;
}
.step-badge {
  font-size: 12px; color: #E60012;
  background: #fff0f0; padding: 3px 10px; border-radius: 12px;
  font-weight: 600;
}

/* ── 商户信息 ── */
.merchant-info {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; background: #fafafa; border-radius: 12px;
  margin-bottom: 20px;
}
.merchant-icon { font-size: 28px; }
.merchant-name { font-size: 16px; font-weight: 600; color: #222; }
.merchant-desc { font-size: 12px; color: #888; margin-top: 2px; }

/* ── 金额 ── */
.amount-section { text-align: center; padding: 16px 0; }
.amount-label { font-size: 13px; color: #888; margin-bottom: 8px; }
.amount-value {
  font-size: 40px; font-weight: 700; color: #222;
  letter-spacing: -1px;
}
.amount-value span { display: inline-block; min-width: 60px; }

.divider { height: 1px; background: #eee; margin: 8px 0 20px; }

/* ── 支付方式 ── */
.method-label { font-size: 13px; color: #666; margin-bottom: 10px; }
.method-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 2px solid #eee; border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.method-card.selected {
  border-color: #E60012; background: #fff5f5;
}
.method-card .method-check {
  margin-left: auto; width: 22px; height: 22px;
  border-radius: 50%; background: #E60012; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: bold; opacity: 0;
  transition: opacity 0.2s;
}
.method-card.selected .method-check { opacity: 1; }
.method-card.selected { border-color: #E60012; background: #fff5f5; }
.method-card .method-name { font-size: 13px; font-weight: 600; color: #222; }
.method-card .method-desc { font-size: 11px; color: #888; margin-top: 2px; }

/* ── 同行双卡 ── */
.method-row-inline {
  display: flex; gap: 10px; margin-top: 8px;
}
.method-row-inline .method-card {
  flex: 1; padding: 14px 12px; gap: 10px;
}
.method-row-inline .method-text { flex: 1; }

/* ── 商户陈列标志 ── */
.merchant-badge {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 80px;
}
.merchant-badge span {
  font-size: 11px; color: #888; font-weight: 500;
}

/* ── 安全信息 ── */
.security-info {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11px; color: #999; margin: 18px 0;
}
.security-info .dot { color: #ddd; }

/* ── 按钮 ── */
.btn-pay {
  width: 100%; padding: 16px; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  background: linear-gradient(135deg, #E60012, #C4000E);
  color: #fff; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-pay:hover:not(:disabled) {
  background: linear-gradient(135deg, #C4000E, #A0000B);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(230,0,18,0.3);
}
.btn-pay:disabled {
  background: #ccc; color: #999; cursor: not-allowed;
  box-shadow: none; transform: none;
}
.btn-pay .btn-amount {
  font-size: 13px; font-weight: 400; opacity: 0.9;
}

.btn-back {
  width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 12px;
  font-size: 14px; background: #fff; color: #666; cursor: pointer;
  margin-top: 10px; transition: all 0.2s;
}
.btn-back:hover { background: #f5f5f5; }

.demo-badge {
  text-align: center; font-size: 11px; color: #bbb; margin-top: 20px;
}

/* ── Form ── */
.form-section { margin: 20px 0; }
.form-section h3 { font-size: 14px; color: #333; margin-bottom: 16px; }

.form-row { margin-bottom: 16px; position: relative; }
.form-row label {
  display: block; font-size: 13px; color: #555; margin-bottom: 6px;
}
.form-row .required { color: #E60012; }
.form-row .optional { color: #aaa; font-weight:400; }

.form-input {
  width: 100%; padding: 12px 14px; border: 2px solid #e0e0e0;
  border-radius: 10px; font-size: 15px; color: #222;
  outline: none; transition: border-color 0.2s; background: #fafafa;
}
.form-input:focus {
  border-color: #E60012; background: #fff;
  box-shadow: 0 0 0 3px rgba(230,0,18,0.08);
}
.form-input::placeholder { color: #bbb; }

.form-row-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.cvv-help {
  display: inline-block; width: 16px; height: 16px;
  background: #eee; border-radius: 50%;
  text-align: center; line-height: 16px;
  font-size: 10px; cursor: help; color: #888; margin-left: 4px;
}

.card-type-icon {
  position: absolute; right: 14px; top: 36px;
  font-size: 20px; opacity: 0.3;
}

/* ── 字段错误提示 ── */
.field-error {
  font-size: 12px; color: #f5222d; margin-top: 4px; padding-left: 2px;
}

/* ── 发卡行名称 ── */
.card-bank-name {
  font-size: 13px; color: #52c41a; font-weight: 600; margin-top: 6px; padding-left: 2px;
  min-height: 18px;
}
.card-bank-name.error { color: #f5222d; }

/* ── 输入框状态 ── */
.form-input.error {
  border-color: #f5222d; background: #fff2f0;
}
.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(245,34,45,0.08);
}
.form-input.valid {
  border-color: #52c41a; background: #f6ffed;
}

/* ── 摘要条 ── */
.summary-bar {
  background: #fff8f0; padding: 10px 16px; border-radius: 10px;
  font-size: 13px; color: #666; margin-bottom: 20px;
  text-align: center;
}
.summary-bar strong { color: #E60012; }

/* ── 短信验证码 ── */
.sms-section { text-align: center; padding: 24px 0; }
.sms-icon { font-size: 40px; margin-bottom: 12px; }
.sms-label { font-size: 16px; font-weight: 600; color: #222; margin-bottom: 8px; }
.sms-desc { font-size: 13px; color: #666; margin-bottom: 24px; }
.sms-desc strong { color: #222; }

.otp-inputs {
  display: flex; gap: 10px; justify-content: center; margin-bottom: 20px;
}
.otp-box {
  width: 48px; height: 56px; text-align: center; font-size: 22px;
  font-weight: 600; border: 2px solid #e0e0e0; border-radius: 10px;
  outline: none; transition: all 0.2s; background: #fafafa;
}
.otp-box:focus {
  border-color: #E60012; box-shadow: 0 0 0 3px rgba(230,0,18,0.08);
  background: #fff;
}
.otp-box.filled { border-color: #E60012; background: #fff5f5; }

.resend-area {
  font-size: 12px; color: #999; margin-top: 8px;
}

/* ── 验证码验证状态 ── */
.sms-status-area {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; color: #1890ff; font-size: 14px; margin-bottom: 12px;
}
.sms-spinner {
  width: 20px; height: 20px; border: 3px solid #e0e0e0;
  border-top-color: #1890ff; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sms-error-area {
  text-align: center; padding: 10px 16px; margin-bottom: 12px;
  background: #fff2f0; border: 1px solid #ffccc7; border-radius: 10px;
  color: #f5222d; font-size: 14px; font-weight: 600;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.sms-error-area.shake { animation: shake 0.4s ease-in-out; }

/* ── 支付成功 ── */
.success-card { text-align: center; padding: 48px 28px; }
.success-icon { font-size: 56px; margin-bottom: 16px; }
.success-title { font-size: 22px; font-weight: 700; color: #222; margin-bottom: 8px; }
.success-amount { font-size: 32px; font-weight: 700; color: #E60012; margin-bottom: 6px; }
.success-merchant { font-size: 14px; color: #666; margin-bottom: 24px; }
.success-detail {
  font-size: 12px; color: #888; line-height: 2; margin-bottom: 28px;
}
.success-detail span { color: #222; font-weight: 600; }

/* ── 响应式 ── */
@media (max-width: 480px) {
  .cashier-card { padding: 24px 18px; border-radius: 12px; }
  .amount-value { font-size: 32px; }
  .otp-box { width: 42px; height: 48px; font-size: 20px; }
}
