:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --text: #17202a;
  --muted: #607080;
  --line: #dbe3ec;
  --accent: #147a72;
  --accent-strong: #0b5f59;
  --accent-soft: #e3f5f2;
  --danger: #a43830;
  --warning: #fff2dc;
  --shadow: 0 18px 45px rgba(31, 44, 58, 0.11);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(20, 122, 114, 0.08), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  min-height: 46px;
  touch-action: manipulation;
}

.app-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 34px 0 28px;
}

.hero__content h1 {
  margin: 8px 0 12px;
  font-size: clamp(40px, 4vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.order-promo {
  display: grid;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid rgba(20, 122, 114, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 122, 114, 0.1), rgba(255, 242, 220, 0.6)),
    #ffffff;
}

.order-promo > div {
  display: grid;
  gap: 4px;
}

.order-promo span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-promo strong {
  color: var(--text);
  font-size: 19px;
  line-height: 1.18;
}

.order-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.order-link:hover {
  background: var(--accent-strong);
}

.layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.payment-picker,
.payment-card,
.alipay-guide {
  padding: 24px;
}

.payment-picker {
  position: sticky;
  top: 16px;
}

.section-heading p,
.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 6px 0 18px;
  font-size: 22px;
  line-height: 1.25;
}

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

.asset-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 56px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.asset-tab:hover {
  transform: translateY(-1px);
}

.asset-tab[aria-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.asset-tab strong {
  white-space: nowrap;
}

.asset-tab span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-align: right;
}

.network-block,
.amount-tool {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

select,
input {
  height: 52px;
  padding: 0 13px;
}

textarea {
  min-height: 86px;
  resize: vertical;
  padding: 12px 13px;
  line-height: 1.45;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 122, 114, 0.12);
}

.amount-input-row,
.copy-row {
  display: flex;
  gap: 10px;
}

.icon-button {
  width: 46px;
  min-width: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-size: 20px;
}

.refresh-label {
  display: none;
}

.rate-row {
  display: block;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.cny-output {
  display: block;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--accent-strong);
  font-size: 26px;
  font-weight: 850;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.payment-card {
  min-height: 620px;
}

.payment-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.payment-card__top h2 {
  margin: 6px 0 8px;
  font-size: 36px;
  line-height: 1.05;
}

.payment-card__top p:last-child {
  margin: 0;
  color: var(--muted);
}

.payment-card__top #paymentSubtitle {
  max-width: 720px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(164, 56, 48, 0.22);
  border-radius: 8px;
  background: #fff0ed;
  color: var(--danger);
  font-weight: 850;
  line-height: 1.45;
}

.network-badge {
  flex: 0 0 auto;
  max-width: 280px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.qr-area {
  display: grid;
  min-height: 342px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(219, 227, 236, 0.45) 1px, transparent 1px),
    linear-gradient(0deg, rgba(219, 227, 236, 0.45) 1px, transparent 1px),
    #fbfcfe;
  background-size: 24px 24px;
}

.qr-mount,
.alipay-qr {
  display: grid;
  place-items: center;
  width: min(320px, 78vw);
  aspect-ratio: 1;
  border: 10px solid #ffffff;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(22, 31, 42, 0.12);
}

.qr-mount img,
.alipay-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.alipay-fallback {
  display: grid;
  gap: 8px;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 22px;
  border: 2px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.alipay-fallback strong {
  color: var(--text);
  font-size: 18px;
}

.save-qr-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.save-qr-button:hover {
  background: var(--accent-strong);
}

.address-block,
.memo-block {
  margin-top: 20px;
}

.address-field {
  min-width: 0;
  overflow: hidden;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-row button,
#copyAddressButton,
#copyMemoButton {
  min-width: 116px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 850;
}

.warning {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--warning);
  color: #7a4b0d;
  line-height: 1.6;
}

.alipay-guide {
  margin-top: 22px;
}

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

.guide-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.mobile-guide {
  display: none;
}

.guide-grid h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.guide-grid ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.75;
}

.guide-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 750;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #17202a;
  color: #ffffff;
  font-weight: 750;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 901px) {
  .app-shell {
    padding: 18px 0 24px;
  }

  .hero {
    gap: 18px;
    padding: 16px 0 12px;
  }

  .hero__content h1 {
    margin-bottom: 0;
    font-size: clamp(38px, 3.4vw, 58px);
  }

  .order-promo {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    margin-bottom: 18px;
    padding: 14px 16px;
  }

  .order-promo strong {
    font-size: 18px;
  }

  .layout {
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 18px;
  }

  .payment-picker,
  .payment-card,
  .alipay-guide {
    padding: 20px;
  }

  .section-heading h2 {
    margin-bottom: 14px;
    font-size: 20px;
  }

  .asset-tabs {
    gap: 8px;
  }

  .asset-tab {
    min-height: 50px;
    padding: 10px 12px;
  }

  .network-block,
  .amount-tool {
    margin-top: 18px;
    padding-top: 18px;
  }

  .payment-card {
    min-height: 0;
  }

  .payment-card__top {
    margin-bottom: 16px;
  }

  .payment-card__top h2 {
    margin-bottom: 6px;
    font-size: 32px;
  }

  .payment-card__top #paymentSubtitle {
    margin-top: 10px;
    padding: 10px 12px;
    line-height: 1.35;
  }

  .qr-area {
    min-height: 280px;
  }

  .qr-mount,
  .alipay-qr {
    width: min(260px, 32vw);
    border-width: 8px;
  }

  .address-block,
  .memo-block {
    margin-top: 14px;
  }

  .warning {
    margin-top: 14px;
    padding: 12px 14px;
  }

  .alipay-guide {
    margin-top: 18px;
  }
}

@media (max-width: 900px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

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

  .mobile-guide {
    display: block;
  }

  .desktop-guide {
    display: none;
  }

  .hero {
    padding-top: 18px;
  }

  .order-link {
    width: 100%;
  }

  .payment-card {
    min-height: 0;
  }

  .payment-picker {
    position: static;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .payment-picker {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0 30px;
  }

  .payment-picker,
  .payment-card,
  .alipay-guide {
    padding: 16px;
  }

  .asset-tabs,
  .amount-input-row,
  .copy-row {
    grid-template-columns: 1fr;
  }

  .asset-tabs {
    display: grid;
  }

  .copy-row,
  .amount-input-row {
    flex-direction: column;
  }

  .icon-button,
  .copy-row button {
    width: 100%;
    min-width: 0;
    min-height: 52px;
  }

  .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
  }

  .refresh-label {
    display: inline;
  }

  .asset-tab {
    min-height: 60px;
    padding: 13px 14px;
  }

  .payment-card__top {
    display: grid;
  }

  .payment-card__top h2 {
    font-size: 30px;
  }

  .network-badge {
    max-width: 100%;
    width: fit-content;
  }

  .qr-area {
    min-height: 300px;
  }

  .qr-mount,
  .alipay-qr {
    width: min(286px, calc(100vw - 76px));
  }

  .cny-output {
    font-size: 22px;
  }

  .hero__content h1 {
    font-size: 36px;
  }

}
