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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #ededed;
  color: #191919;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: #ededed;
  position: relative;
  overflow: hidden;
}

.hidden { display: none !important; }

.env-hint {
  background: #fff7e6;
  color: #8a5a00;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 14px;
  border-bottom: 1px solid #ffe0a3;
}

.cashier {
  background: #fff;
  margin: 12px 12px 0;
  border-radius: 12px;
  padding: 30px 22px 26px;
  text-align: center;
}

.pay-logo { display: flex; justify-content: center; margin-bottom: 12px; }
.merchant { font-size: 18px; font-weight: 500; margin: 0 0 4px; }
.sub { font-size: 12px; color: #999; margin: 0 0 30px; }

.amount-block { text-align: left; margin-bottom: 26px; }
.amount-label { font-size: 13px; color: #888; margin-bottom: 8px; }

.amount-line {
  display: flex;
  align-items: baseline;
  min-height: 58px;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 6px;
}

.cny { font-size: 24px; font-weight: 500; margin-right: 8px; }
.amount-text { font-size: 40px; font-weight: 500; line-height: 1.1; letter-spacing: 1px; }

.caret {
  display: inline-block;
  width: 2px;
  height: 38px;
  background: #07c160;
  margin-left: 4px;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.err { min-height: 18px; margin-top: 6px; color: #e64340; font-size: 12px; }

.pay-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: #07c160;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.pay-btn:disabled { background: #d8d8d8; color: #fff; cursor: default; }
.pay-btn:not(:disabled):active { background: #06ad56; }

.keyboard {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #d2d5db;
  padding-top: 1px;
  border-top: 1px solid #c9ccd2;
}

.key {
  height: 54px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
}

.key:active { background: #e5e5e5; }
.key-del svg { display: block; }

.success {
  background: #fff;
  margin: 12px;
  border-radius: 12px;
  padding: 52px 22px 28px;
  text-align: center;
  flex: 1;
}

.success-icon { display: flex; justify-content: center; margin-bottom: 16px; }
.success h2 { font-size: 19px; font-weight: 500; margin: 0 0 10px; }
.success-amount { font-size: 30px; font-weight: 500; margin-bottom: 28px; }

.success-meta { text-align: left; border-top: 1px solid #eee; padding-top: 12px; margin-bottom: 28px; }
.success-meta div { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.success-meta div span:first-child { color: #999; }
.success-meta div span:last-child { color: #333; word-break: break-all; text-align: right; margin-left: 12px; }

.loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: #555;
  z-index: 10;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #d8f3e3;
  border-top-color: #07c160;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
