﻿*, *:before, *:after, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: #f3f4f6;
  color: #111827;
  line-height: 1.5;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

html.dpi-scaled,
html.dpi-scaled body {
  width: 100%;
  height: 100%;
}

.checkout-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
}

.checkout-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.checkout-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
}

.header-note {
  font-size: 12px;
  color: #6b7280;
}

.account-strip {
  padding: 12px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0;
}

.strip-item {
  display: inline-block;
  vertical-align: top;
  font-size: 14px;
  box-sizing: border-box;
}

.strip-item.user-item {
  width: 62%;
  padding-right: 16px;
}

.strip-item.room-item {
  width: 38%;
}

.strip-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.input-wrapper {
  position: relative;
}

.strip-input {
  width: 100%;
  height: 34px;
  padding: 4px 28px 4px 8px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  outline: none;
}

.strip-input:focus { border-color: #07c160; }
.strip-input.is-empty { border-color: #ef4444; background: #fef2f2; }

.btn-clear-input {
  position: absolute;
  right: 6px;
  top: 8px;
  width: 18px;
  height: 18px;
  border: none;
  background: #9ca3af;
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
}

.room-val-wrap {
  display: flex;
  align-items: center;
  height: 34px;
}

.strip-val {
  font-size: 14px;
  font-weight: 600;
}

.room-status-dot {
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.checkout-main { padding: 18px 20px 20px; }

.section-group { margin-bottom: 18px; }

.section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#coinRateHint {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
}

.pay-methods { font-size: 0; }

.pay-methods .method-card {
  display: inline-block;
  vertical-align: top;
  width: 48%;
  margin: 0 1%;
  font-size: 14px;
  box-sizing: border-box;
}

.pay-methods.single .method-card { width: 98%; }

.method-card {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}

.method-icon {
  display: inline-block;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  margin-right: 8px;
}
.method-icon svg { width: 22px; height: 22px; display: block; }
.wx-icon { color: #07c160; }
.ali-icon { color: #1677ff; }

.method-name {
  display: inline-block;
  vertical-align: middle;
  font-size: 14px;
  font-weight: 600;
}

.method-card.active[data-pay="wx"] {
  border-color: #07c160;
  background: #f0fdf4;
}
.method-card.active[data-pay="ali"] {
  border-color: #1677ff;
  background: #eff6ff;
}

.amount-grid { font-size: 0; margin: 0 -5px; }

.amount-card {
  display: inline-block;
  vertical-align: top;
  width: 25%;
  padding: 0 5px 10px;
  margin: 0;
  font-size: 14px;
  box-sizing: border-box;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
}

.amount-face {
  display: block;
  position: relative;
  padding: 16px 4px 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.amount-card:hover .amount-face {
  border-color: #cbd5e1;
  background: #fff;
}

.amount-unit {
  display: inline-block;
  vertical-align: baseline;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  margin-right: 1px;
}

.amount-num {
  display: inline-block;
  vertical-align: baseline;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.amount-card .amount-tag {
  position: absolute;
  top: 0;
  right: 0;
  background: #f97316;
  color: #fff;
  font-size: 10px;
  line-height: 1.3;
  padding: 2px 7px;
  border-radius: 0 10px 0 8px;
}

.amount-card.active .amount-face {
  border: 2px solid #07c160;
  background: #ecfdf5;
  padding: 15px 3px 13px;
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

.amount-card.active .amount-unit,
.amount-card.active .amount-num {
  color: #059669;
}

.amount-card.active .amount-face:after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 18px 18px;
  border-color: transparent transparent #07c160 transparent;
}

.amount-card.active .amount-face:before {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 4px;
  z-index: 1;
  width: 5px;
  height: 8px;
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(40deg);
}

.amount-card-custom {
  width: 100%;
  text-align: left;
  cursor: text;
}

.amount-card-custom .amount-face {
  padding: 10px 14px 12px;
  text-align: left;
}

.amount-card-custom.active .amount-face {
  padding: 9px 13px 11px;
}

.custom-amount-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 2px;
}

.custom-amount-row {
  display: block;
  line-height: 1.2;
}

.custom-amount-input {
  display: inline-block;
  vertical-align: baseline;
  width: 140px;
  max-width: 70%;
  height: 28px;
  padding: 0 4px;
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  outline: none;
  font-family: inherit;
}

.amount-card-custom.active .custom-amount-input,
.amount-card-custom.active .custom-amount-label {
  color: #059669;
}

.custom-amount-hint {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #9ca3af;
}

.order-summary-strip {
  padding: 10px 0 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.sum-label {
  font-size: 12px;
  color: #6b7280;
  margin-right: 6px;
}

.sum-value.price strong { font-size: 20px; font-weight: 700; }
.sum-value.coins strong { font-weight: 700; }

.btn-confirm-pay {
  width: 100%;
  height: 44px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-confirm-pay:hover:not(:disabled) { background: #06ad56; }
.btn-confirm-pay:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #9ca3af;
}

.qr-modal {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.qr-modal-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.45);
}

.qr-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.qr-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 10;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 22px;
  line-height: 28px;
  cursor: pointer;
}

.qr-container-card {
  padding: 22px 20px 16px;
  text-align: center;
}

.qr-modal-title {
  font-size: 14px;
  color: #374151;
  margin-bottom: 6px;
}

.modal-price-row {
  font-size: 0;
  margin-bottom: 4px;
}

.currency-symbol,
.amount-number,
.amount-decimal {
  display: inline-block;
  vertical-align: baseline;
  color: #111827;
}

.currency-symbol { font-size: 16px; font-weight: 700; margin-right: 2px; }
.amount-number { font-size: 28px; font-weight: 700; }
.amount-decimal { font-size: 14px; color: #6b7280; }

.modal-coins-badge {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

.qr-viewport {
  min-height: 220px;
  margin: 8px 0 12px;
}

.qr-state { width: 100%; }

.state-idle,
.state-loading {
  color: #6b7280;
  font-size: 13px;
  padding: 40px 0;
}

.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 10px;
  border: 2px solid #e5e7eb;
  border-top-color: #07c160;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.state-qrcode { position: relative; }

.qr-image-box {
  width: 196px;
  height: 196px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  position: relative;
}

.qr-image-box img,
.qr-image-box iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.qr-image-box.is-ali-embed {
  padding: 0;
  overflow: hidden;
}

.qr-image-box.is-ali-embed .qr-center-logo {
  display: none;
}

.qr-center-logo {
  position: absolute;
  left: 50%;
  bottom: 8px;
  margin-left: -36px;
  background: #fff;
  padding: 1px 8px;
  font-size: 10px;
  color: #07c160;
  border: 1px solid #e5e7eb;
}

.scanned-overlay,
.expired-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #fff;
  padding: 24px 12px;
}

.scanned-title,
.expired-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.scanned-desc,
.expired-desc {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

.btn-refresh-primary {
  padding: 6px 14px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.success-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.success-sub {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
}

.receipt-body {
  text-align: left;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  font-size: 13px;
}

.bill-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bill-k { color: #6b7280; }
.bill-v { font-weight: 600; }
.bill-v.order-v { font-size: 11px; }

.order-row { padding-top: 6px; border-top: 1px dashed #e5e7eb; }

.btn-copy-no {
  margin-left: 6px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 1px 6px;
  font-size: 11px;
  cursor: pointer;
}

.qr-footer {
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #6b7280;
}

.countdown-capsule { margin-top: 6px; }
.time-num { font-weight: 700; color: #111827; margin: 0 4px; }

.btn-link-refresh {
  background: transparent;
  border: none;
  color: #07c160;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  margin-left: 6px;
}

.toast-tip {
  position: fixed;
  top: 24px;
  left: 50%;
  margin-left: -80px;
  background: #111827;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  z-index: 9999;
}

html.theme-ali .btn-confirm-pay { background: #1677ff; }
html.theme-ali .btn-confirm-pay:hover:not(:disabled) { background: #1464d9; }
html.theme-ali .btn-confirm-pay:disabled { background: #9ca3af; }
html.theme-ali .strip-input:focus { border-color: #1677ff; }
html.theme-ali .amount-card.active .amount-face {
  border-color: #1677ff;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
html.theme-ali .amount-card.active .amount-unit,
html.theme-ali .amount-card.active .amount-num,
html.theme-ali .amount-card-custom.active .custom-amount-input,
html.theme-ali .amount-card-custom.active .custom-amount-label { color: #1677ff; }
html.theme-ali .amount-card.active .amount-face:after {
  border-color: transparent transparent #1677ff transparent;
}
html.theme-ali .spinner { border-top-color: #1677ff; }
html.theme-ali .qr-center-logo,
html.theme-ali .btn-link-refresh { color: #1677ff; }
html.theme-ali .btn-refresh-primary { background: #1677ff; }

@media (max-width: 640px) {
  .checkout-wrapper { padding: 0; align-items: stretch; }
  .checkout-card { border-radius: 0; min-height: 100vh; border: none; }
  .amount-card { width: 25%; }
}

@media (max-width: 480px) {
  .amount-card { width: 50%; }
  .amount-card-custom { width: 100%; }
  .pay-methods .method-card { width: 98%; }
}
