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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: #f2f2f2;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background-color: #f2f2f2;
  padding-bottom: 340px;
}

/* ====== 商户卡片 ====== */
.merchant-card {
  background-color: #fff;
  padding: 20px 18px 16px;
}
.payee-label {
  font-size: 13px; color: #999;
  margin-bottom: 8px;
}
.merchant-name {
  font-size: 17px; color: #222;
  font-weight: 600;
  line-height: 1.5;
}

/* ====== 金额输入区域 ====== */
.amount-section {
  background-color: #fff;
  margin-top: 0;
  padding: 0 18px 16px;
}
.amount-input-row {
  display: flex;
  align-items: center;
  min-height: 48px;
}
.currency-yen {
  font-size: 24px; color: #222;
  font-weight: 400;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: flex-end;
  height: 36px;
}
.currency-yen-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  align-self: flex-end;
  filter: contrast(1.5) brightness(0.8);
}
.amount-display {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 36px;
  position: relative;
}
.amount-value {
  font-size: 28px;
  font-weight: 600;
  color: #000000;
  letter-spacing: 0.5px;
  line-height: 1;
}
.amount-cursor {
  display: inline-block;
  width: 2px;
  height: 36px;
  background-color: #1677FF;
  margin-left: 2px;
  animation: blink 1.2s step-end infinite;
}
.amount-cursor.hidden { display: none; }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.amount-placeholder {
  font-size: 24px;
  color: #c8c8c8;
  font-weight: 300;
}
.amount-placeholder.hidden { display: none; }
.add-note-btn {
  border: none; background: none;
  font-size: 12px; color: #1677FF;
  cursor: pointer; padding: 6px 4px;
  flex-shrink: 0;
  white-space: nowrap;
}
.add-note-btn.has-note { color: #7FB8F5; }

/* ====== 支付方式 ====== */
.payment-method-section {
  background-color: #f2f2f2;
  margin-top: 8px;
  padding: 7px 12px;
}
.payment-method-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background-color: #fff;
  border-radius: 8px;
}
.payment-method-option .method-icon {
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 4px;
}
.payment-method-option .method-name {
  font-size: 15px; color: #333;
  font-weight: 400;
  flex: 1;
  text-align: left;
}
.payment-method-option .method-check {
  width: 22px; height: 22px;
  flex-shrink: 0;
}
.alipay-icon-img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
}

/* ====== 数字键盘 ====== */
.keyboard-section {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background-color: #ececec;
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom, 12px);
}
.keyboard-grid {
  display: flex;
}
.keyboard-numbers {
  flex: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background-color: #ececec;
}
.keyboard-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background-color: #ececec;
  margin-left: 3px;
}
.key {
  height: 67px;
  background-color: #FFFFFF;
  border: none;
  border-radius: 2px;
  font-size: 22px; color: #2D2D2D;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background-color 0.08s ease;
  -webkit-user-select: none;
  user-select: none;
}
.key:active {
  background-color: #e8e8e8;
}
.key-delete {
  flex: 2;
  height: auto;
  display: flex; align-items: center; justify-content: center;
}
.key-delete svg {
  width: 20px; height: 20px;
}
.key-zero {
  grid-column: span 2;
}
.confirm-pay-btn {
  flex: 2;
  background-color: #a0c0ef;
  border: none;
  border-radius: 2px;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 4px;
  cursor: pointer;
  transition: background-color 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
  display: flex; align-items: center; justify-content: center;
}
.confirm-pay-btn:active {
  opacity: 0.9;
}
.confirm-pay-btn:not(:disabled) {
  background-color: #1677FF;
}

/* ====== 添加备注弹窗 ====== */
.note-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0);
  z-index: 300; visibility: hidden;
  opacity: 0; transition: all 0.25s ease;
}
.note-modal-overlay.show {
  background: rgba(0,0,0,0.55);
  visibility: visible; opacity: 1;
}
.note-modal-dialog {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 300px; max-width: 88vw;
  background: #fff;
  border-radius: 14px;
  z-index: 301;
  visibility: hidden;
  opacity: 0;
  transition: all 0.25s ease;
  overflow: hidden;
}
.note-modal-dialog.show {
  transform: translate(-50%, -50%) scale(1);
  visibility: visible; opacity: 1;
}
.note-modal-header {
  text-align: center;
  font-size: 16px; font-weight: 600;
  color: #333; padding: 20px 18px 14px;
}
.note-modal-body {
  position: relative;
  padding: 0 18px 10px;
}
.note-modal-input {
  width: 100%;
  height: 40px;
  border: 1px solid #eee; border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px; color: #333;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  line-height: 1.5;
}
.note-modal-input::placeholder { color: #c8c8c8; }
.note-modal-footer {
  display: flex; border-top: 1px solid #f0f0f0;
}
.note-btn {
  flex: 1; border: none; background: none;
  padding: 14px 0; font-size: 15px;
  cursor: pointer;
}
.note-btn-cancel { color: #1677FF; border-right: 1px solid #f0f0f0; }
.note-btn-cancel:active { background: #f0f7ff; }
.note-btn-confirm { color: #1677FF; font-weight: 500; }
.note-btn-confirm:active { background: #f0f7ff; }

/* ====== 支付成功弹窗 ====== */
.success-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
}
.success-modal-overlay.show { display: block; }
.success-modal-dialog {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 300px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px 24px;
  z-index: 1001;
  text-align: center;
  opacity: 0;
  transition: all 0.25s ease;
  display: none;
}
.success-modal-dialog.show {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.success-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
}
.success-icon svg { width: 100%; height: 100%; }
.success-title {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
}
.success-amount {
  font-size: 32px;
  font-weight: 700;
  color: #222;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}
.success-detail {
  background: #f7f7f7;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  text-align: left;
}
.success-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  line-height: 2;
}
.success-detail-label { color: #999; }
.success-detail-value { color: #333; word-break: break-all; text-align: right; max-width: 180px; }
.success-done-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: #1677FF;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}
.success-done-btn:active { background: #0958D9; }

/* ====== 键盘底部服务标识 ====== */
.keyboard-footer {
  text-align: center;
  padding: 8px 0 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #F2F2F2;
}
.footer-brand-img {
  height: 24px;
  object-fit: contain;
  margin-top: 5px;
}
.key-delete .del-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

@media (max-width: 480px) {
  .keyboard-section { max-width: 100%; }
}
