:root {
  color: #17211c;
  background: #f4f6f5;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #f4f6f5;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  width: min(1024px, calc(100% - 40px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dfe4e1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #17211c;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #07c160;
  font-size: 15px;
}

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #68736d;
  font-size: 13px;
}

.secure-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #07c160;
  box-shadow: 0 0 0 4px #dff7ea;
}

.checkout {
  width: min(900px, calc(100% - 40px));
  margin: 48px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #dfe4e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(21, 36, 28, 0.08);
}

.summary {
  min-height: 520px;
  padding: 58px 58px 46px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 22px;
  color: #078f49;
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  color: #68736d;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0;
}

.amount {
  min-height: 84px;
  margin: 10px 0 18px;
  color: #101713;
  font-size: 68px;
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.amount span {
  margin-right: 7px;
  font-size: 28px;
  font-weight: 650;
  vertical-align: 20px;
}

.recipient {
  margin: 0;
  color: #7b857f;
  font-size: 14px;
}

.recipient strong {
  margin-left: 8px;
  color: #303b35;
  font-weight: 600;
}

.payment-status {
  min-height: 64px;
  padding-top: 24px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-top: 1px solid #eaeeec;
}

.payment-status > span:last-child {
  display: grid;
  gap: 4px;
}

.payment-status strong {
  font-size: 14px;
  font-weight: 650;
}

.payment-status small {
  color: #8a938e;
  font-size: 12px;
}

.status-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid #cfe9da;
  border-top-color: #07a953;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.payment-status.is-paid .status-spinner {
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: #07a953;
  animation: none;
}

.payment-status.is-paid .status-spinner::after {
  content: "✓";
  font-size: 12px;
  font-weight: 800;
}

.payment-status.is-offline .status-spinner {
  border-color: #e2e5e3;
  border-top-color: #8a938e;
}

.code-area {
  min-height: 520px;
  padding: 48px 30px 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f9fbfa;
  border-left: 1px solid #eaeeec;
}

.qr-frame {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1;
  padding: 13px;
  overflow: hidden;
  border: 1px solid #d8dfdb;
  background: #fff;
}

.qr-crop {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.qr-crop img {
  position: absolute;
  width: 206.3%;
  max-width: none;
  height: auto;
  transform: translate(-25.33%, -23.47%);
  user-select: none;
  -webkit-user-drag: none;
}

.scan-line {
  position: absolute;
  z-index: 1;
  right: 15px;
  left: 15px;
  top: 50%;
  height: 1px;
  opacity: 0.65;
  background: #07c160;
  box-shadow: 0 0 8px rgba(7, 193, 96, 0.5);
  animation: scan 3.2s ease-in-out infinite;
  pointer-events: none;
}

.code-caption {
  margin: 22px 0 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #354139;
  font-size: 14px;
  font-weight: 600;
}

.wechat-mark {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #07c160;
  font-size: 15px;
  font-weight: 800;
}

footer {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #8a938e;
  font-size: 12px;
}

.footer-divider {
  width: 1px;
  height: 12px;
  background: #cfd5d1;
}

.success-dialog {
  width: min(390px, calc(100% - 36px));
  padding: 34px 30px 28px;
  text-align: center;
  border: 0;
  border-radius: 8px;
  color: #17211c;
  background: #fff;
  box-shadow: 0 24px 80px rgba(12, 27, 19, 0.24);
}

.success-dialog::backdrop {
  background: rgba(13, 24, 18, 0.56);
  backdrop-filter: blur(4px);
}

.success-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #07a953;
  font-size: 30px;
  font-weight: 800;
}

.success-dialog h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: 0;
}

.success-dialog p {
  margin: 10px 0 24px;
  color: #737e78;
  font-size: 14px;
  line-height: 1.7;
}

.success-dialog button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #101713;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.success-dialog button:hover {
  background: #26312b;
}

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

@keyframes scan {
  0%, 100% { transform: translateY(-118px); opacity: 0; }
  12%, 88% { opacity: 0.65; }
  50% { transform: translateY(118px); }
}

@media (max-width: 720px) {
  .site-header {
    width: min(100% - 28px, 540px);
    min-height: 62px;
  }

  .checkout {
    width: min(100% - 28px, 540px);
    margin: 24px auto;
    grid-template-columns: 1fr;
  }

  .summary {
    min-height: auto;
    padding: 30px 26px 26px;
  }

  .eyebrow {
    margin-bottom: 15px;
  }

  .amount {
    min-height: 62px;
    margin: 6px 0 13px;
    font-size: 52px;
  }

  .amount span {
    font-size: 23px;
    vertical-align: 15px;
  }

  .payment-status {
    margin-top: 26px;
  }

  .code-area {
    min-height: auto;
    padding: 28px 28px 30px;
    border-top: 1px solid #eaeeec;
    border-left: 0;
  }

  .qr-frame {
    width: min(290px, 100%);
  }
}

@media (max-width: 380px) {
  .site-header,
  .checkout {
    width: calc(100% - 20px);
  }

  .summary {
    padding: 25px 21px 22px;
  }

  .code-area {
    padding: 22px 21px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-spinner,
  .scan-line {
    animation: none;
  }

  .scan-line {
    display: none;
  }
}
