:root {
  color-scheme: light;
  --page-bg: #0a0710;
  --card-bg: rgba(18, 16, 26, 0.96);
  --panel-bg: rgba(255, 255, 255, 0.06);
  --panel-bg-strong: rgba(255, 255, 255, 0.1);
  --field-bg: rgba(255, 255, 255, 0.96);
  --field-bg-soft: rgba(255, 248, 253, 0.96);
  --field-border: rgba(58, 36, 74, 0.16);
  --field-text: #17111f;
  --field-muted: #756a83;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #ffffff;
  --text-muted: #b9aecb;
  --accent: #ff2aa7;
  --accent-2: #8c3bff;
  --accent-soft: rgba(255, 42, 167, 0.14);
  --warning-bg: rgba(255, 196, 87, 0.13);
  --warning-text: #ffd37a;
  --button-disabled: #d8d9df;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 84, 192, 0.34), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(141, 79, 255, 0.38), transparent 28%),
    linear-gradient(145deg, #050407 0%, #120b1d 48%, #0a0710 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  padding: 24px 16px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.page-shell::before {
  content: "";
  position: fixed;
  inset: 24px auto auto 50%;
  width: min(680px, 86vw);
  height: min(680px, 86vw);
  transform: translateX(-50%) rotate(-8deg);
  border-radius: 34%;
  background: linear-gradient(135deg, rgba(142, 92, 255, 0.38), rgba(255, 83, 191, 0.34));
  filter: blur(2px);
  opacity: 0.8;
  pointer-events: none;
}

.pay-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 28px 20px 20px;
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.brand-logo-full {
  width: 78px;
  height: 78px;
  display: block;
  object-fit: cover;
  border-radius: 22px;
  flex: 0 0 auto;
  box-shadow: 0 14px 32px rgba(255, 42, 167, 0.26);
}

.brand-title {
  font-size: clamp(29px, 6vw, 38px);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
  text-shadow: 0 0 24px rgba(255, 42, 167, 0.28);
}

.brand-subtitle {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}

.field-section + .field-section {
  margin-top: 24px;
}

.section-label {
  display: block;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
}

.text-input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--field-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 42, 167, 0.16);
}

.text-input::placeholder {
  color: rgba(23, 17, 31, 0.42);
}

.field-tip {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.account-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  background: var(--field-bg);
}

.account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(145deg, rgba(255, 42, 167, 0.24), rgba(140, 59, 255, 0.28));
}

.account-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--field-text);
}

.account-id {
  font-size: 13px;
  color: var(--field-muted);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.amount-button {
  min-height: 74px;
  padding: 12px 10px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--field-text);
  text-align: left;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.amount-button.active {
  border-color: var(--accent);
  background: var(--field-bg-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 42, 167, 0.18), 0 12px 28px rgba(255, 42, 167, 0.12);
}

.amount-money {
  font-size: 18px;
  font-weight: 700;
}

.amount-coin {
  margin-top: 6px;
  font-size: 13px;
  color: var(--field-muted);
}

.amount-give {
  margin-top: 6px;
  font-size: 12px;
  color: #ffc657;
}

.custom-amount-card {
  display: block;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--field-text);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-amount-card.active {
  border-color: var(--accent);
  background: var(--field-bg-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 42, 167, 0.18), 0 12px 28px rgba(255, 42, 167, 0.12);
}

.custom-amount-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.custom-amount-title {
  font-size: 15px;
  font-weight: 600;
}

.custom-amount-tag {
  font-size: 12px;
  color: var(--field-muted);
}

.custom-amount-input-wrap {
  height: 54px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 10px;
}

.currency-prefix {
  font-size: 18px;
  font-weight: 700;
  color: var(--field-text);
}

.custom-amount-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--field-text);
  font-size: 18px;
  font-weight: 600;
}

.custom-amount-input::placeholder {
  color: rgba(23, 17, 31, 0.42);
  font-weight: 500;
}

.custom-amount-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--field-muted);
}

.custom-amount-meta.error {
  color: #c34b4b;
}

.method-list {
  display: grid;
  gap: 12px;
}

.method-button {
  width: 100%;
  min-height: 60px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--field-text);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
}

.method-button img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.method-button.active {
  border-color: var(--accent);
  background: var(--field-bg-soft);
}

.notice-box {
  margin-top: 28px;
  padding: 18px 16px;
  border-radius: 12px;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 14px;
  line-height: 1.7;
}

.notice-box:empty {
  display: none;
}

.notice-box p {
  margin: 0;
}

.notice-box p + p {
  margin-top: 10px;
}

.submit-button {
  width: 100%;
  height: 54px;
  margin-top: 24px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff2aa7 0%, #8c3bff 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.submit-button:disabled {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.6);
  cursor: default;
}

.submit-tip,
.status-line {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.status-line.error {
  color: #c34b4b;
}

.status-line.success {
  color: #238152;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 18, 28, 0.48);
}

.modal-card {
  position: relative;
  width: min(100%, 360px);
  border-radius: 16px;
  background: #ffffff;
  padding: 22px 18px 18px;
  box-shadow: 0 24px 48px rgba(18, 24, 40, 0.2);
  border: 1px solid rgba(58, 36, 74, 0.14);
  color: var(--field-text);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 17, 31, 0.08);
  color: var(--field-text);
  font-size: 22px;
  line-height: 1;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.modal-subtitle {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--field-muted);
}

.qr-box {
  width: 220px;
  height: 220px;
  margin: 18px auto 0;
  padding: 10px;
  border: 1px solid rgba(58, 36, 74, 0.14);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-button {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--field-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}

.action-button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #ff2aa7 0%, #8c3bff 100%);
  color: #fff;
}

.order-meta {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--field-muted);
  line-height: 1.7;
  word-break: break-all;
}

@media (max-width: 420px) {
  .page-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pay-card {
    padding-left: 16px;
    padding-right: 16px;
  }

  .amount-grid {
    grid-template-columns: 1fr;
  }

  .account-panel {
    grid-template-columns: 44px 1fr;
  }

  .custom-amount-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
