* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: #162238;
  font:
    15px/1.6 system-ui,
    -apple-system,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  background: #f5f8fc;
}
a {
  color: #1769ba;
  text-decoration: none;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #79b8ef;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.top {
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - 1160px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #dce5ef;
  background: #fff;
  gap: 20px;
}
.brand {
  font-size: 19px;
  font-weight: 750;
  color: #162238;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand img {
  width: 30px;
  height: 30px;
}
.top nav {
  display: flex;
  gap: 22px;
  white-space: nowrap;
}
.top [aria-current] {
  font-weight: 700;
}
main {
  max-width: 1160px;
  margin: 40px auto;
  padding: 0 24px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.13em;
  color: #65809c;
  margin: 0 0 8px;
}
h1 {
  font-size: 32px;
  line-height: 1.35;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
}
h2 {
  font-size: 19px;
  line-height: 1.4;
  margin: 0;
}
h3 {
  font-size: 18px;
}
.muted,
.hint {
  color: #637790;
}
.muted {
  margin: 0;
}
.hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.7;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr);
  gap: 24px;
  align-items: start;
}
.card {
  background: white;
  border: 1px solid #dce5ef;
  border-radius: 20px;
  padding: 28px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 16px;
}
.section-title:first-child {
  margin-top: 0;
}
.section-title span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  background: #edf5fe;
  color: #1769ba;
}
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.choice {
  position: relative;
  border: 1px solid #dce5ef;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  color: inherit;
}
.choice strong,
.choice small {
  display: block;
}
.choice small {
  color: #637790;
  margin-top: 5px;
}
.choice[aria-pressed="true"] {
  border-color: #2378ca;
  background: #f1f7ff;
  box-shadow: 0 0 0 1px #2378ca;
}
.methods {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.methods .choice {
  flex: 1;
  min-width: 130px;
  padding: 12px 16px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin: 16px 0 8px;
}
input,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #d3deea;
  background: #fbfcfe;
  color: #162238;
  padding: 12px;
  border-radius: 10px;
  min-height: 46px;
}
textarea {
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.label-row a {
  font-size: 12px;
  margin-top: 10px;
}
.captcha-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.captcha-row input {
  min-width: 0;
  flex: 1;
}
.captcha-image {
  padding: 0 !important;
  overflow: hidden;
  width: 140px;
  height: 48px;
  flex-shrink: 0;
}
.captcha-image img {
  max-width: 100%;
  height: 44px;
}
.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 650;
  gap: 8px;
}
.primary {
  color: #fff;
  background: #1371bf;
  border: 1px solid #1371bf;
}
.primary:hover {
  background: #0c5eaa;
}
.secondary {
  background: #fff;
  border: 1px solid #dce5ef;
  color: #25415e;
}
.wide {
  width: 100%;
  margin-top: 22px;
}
.summary {
  position: static;
}
.amount {
  color: #1769ba;
  margin: 24px 0;
}
.amount strong {
  font-size: 42px;
  letter-spacing: -0.04em;
}
.amount span {
  font-size: 20px;
  margin-right: 5px;
}
dl {
  margin: 0;
}
dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f5;
}
dt {
  color: #637790;
  font-size: 13px;
  flex-shrink: 0;
  white-space: nowrap;
}
dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  text-align: right;
  overflow-wrap: anywhere;
}
.total dd {
  font-size: 20px;
  font-weight: 750;
  color: #1769ba;
}
.error {
  background: #fff1f1;
  border: 1px solid #ffcaca;
  color: #a62f3c;
  padding: 12px;
  border-radius: 10px;
  margin-top: 18px;
  font-size: 13px;
}
.history {
  margin-bottom: 24px;
}
.history button {
  margin: 12px 12px 0 0;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}
.status-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2eaf2;
}
.status-icon {
  height: 44px;
  width: 44px;
  border: 4px solid #dceafb;
  border-top-color: #2378ca;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  flex-shrink: 0;
}
.status-icon.done {
  animation: none;
  border-color: #12a779;
  background: #e9faf4;
}
.status-icon.done:after {
  content: "✓";
  display: grid;
  place-items: center;
  color: #129f74;
  font-size: 25px;
  line-height: 35px;
}
.pill {
  margin-left: auto;
  background: #edf5fe;
  border-radius: 99px;
  color: #1769ba;
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.order-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 36px;
  margin-top: 28px;
}
.qr-area {
  text-align: center;
}
.qr-area > img {
  width: 260px;
  max-width: 100%;
  aspect-ratio: 1;
  border: 1px solid #e2eaf2;
  padding: 8px;
  border-radius: 16px;
}
.qr-area a {
  margin-top: 14px;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.order-details h3 {
  margin: 0 0 12px;
}
footer {
  color: #73859a;
  font-size: 12px;
  text-align: center;
  padding: 30px 0 10px;
}
.skeleton {
  height: 88px;
  border-radius: 12px;
  background: linear-gradient(100deg, #edf1f5 25%, #f8fafc 40%, #edf1f5 60%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
.status-head > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.plan-choice {
  display: flex;
  align-items: center;
  gap: 12px;
}
.plan-choice img {
  object-fit: contain;
  flex-shrink: 0;
}
.plan-choice > span {
  min-width: 0;
}
.plan-choice strong {
  overflow-wrap: normal;
  word-break: normal;
}

.error p {
  margin: 0;
}
.error p + p {
  margin-top: 8px;
}
.feedback-reason {
  font-weight: 650;
}
.feedback-hint,
.feedback-payment-note {
  line-height: 1.7;
}
.feedback-reference {
  font-size: 11px;
  overflow-wrap: anywhere;
  color: #8a5260;
}
[aria-invalid="true"] {
  border-color: #ce4754;
}

.status-icon svg {
  display: none;
}
.status-icon.attention {
  animation: none;
  border: 0;
  border-radius: 50%;
  background: #fff7dc;
  color: #b67908;
  padding: 4px;
}
.status-icon.attention svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.payment-scan-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.payment-scan-hint img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 22px;
}

.methods .method-choice {
  display: flex;
  align-items: center;
  gap: 12px;
}
.method-choice .method-logo {
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  object-fit: contain;
}
.method-choice > span {
  min-width: 0;
}

/* Checkout controls share the summary card and the same native form. */
.summary .section-title {
  margin-top: 24px;
}
.summary .methods {
  margin-bottom: 18px;
}
.summary .amount {
  margin: 18px 0;
}

/* Page-top payment announcement remains outside checkout/order view toggles. */
.checkout-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
  padding: 18px 20px;
  border: 1px solid #d3e5f7;
  border-radius: 14px;
  background: #edf5fe;
  color: #426587;
}
.checkout-notice-icon {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #dfeefe;
  color: #1769ba;
}
.checkout-notice h2 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.5;
  color: #1d4e7d;
}
.checkout-notice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}
.checkout-notice > div {
  min-width: 0;
}

/* Compact checkout: keep names readable and controls usable at 320px. */
.card,
.order-details,
.qr-area {
  min-width: 0;
}
.plan-choice img {
  width: 36px;
  height: 36px;
}
.label-row {
  gap: 12px;
  flex-wrap: wrap;
}
.captcha-image {
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .top {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .top nav {
    gap: 18px;
    font-size: 13px;
  }
  .brand {
    font-size: 17px;
  }
  main {
    margin: 24px auto;
    padding: 0 16px;
  }
  h1 {
    font-size: 26px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .card {
    padding: 20px;
    border-radius: 16px;
  }
  .summary {
    grid-row: auto;
  }
  .order-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .qr-area > img {
    width: 240px;
  }
  .choices {
    gap: 10px;
  }
  .choice {
    padding: 12px;
  }
  .captcha-image {
    width: 120px;
  }

  .status-head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }
  .status-head .pill {
    grid-column: 2;
    justify-self: start;
    margin-left: 0;
  }

  .checkout-notice {
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
    margin-bottom: 20px;
  }
  .checkout-notice-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }
}
@media (max-width: 480px) {
  .choices {
    grid-template-columns: minmax(0, 1fr);
  }
  .plan-choice {
    padding: 14px 16px;
  }
  .plan-choice > span {
    flex: 1;
  }
  .methods {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .methods .choice {
    min-width: 0;
    width: 100%;
  }
  .captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
  }
  .captcha-row input {
    padding: 10px;
    font-size: 14px;
  }
  .captcha-image {
    width: 112px;
    height: 48px;
  }
  .captcha-image img {
    width: 110px;
    height: 44px;
    object-fit: contain;
  }
  .actions > * {
    flex: 1 1 100%;
  }
}
.checkout-notice > div {
  flex: 1;
}
.contact-support-button {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 44px;
}
.contact-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #d6e5f5;
  border-radius: 20px;
  background: #fff;
  color: #162238;
  box-shadow: 0 20px 60px #10243b33;
}
.contact-dialog::backdrop {
  background: #10243b66;
}
.contact-panel {
  padding: 24px;
}
.contact-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.contact-dialog-head h2 {
  margin: 0;
  font-size: 22px;
}
.contact-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #edf5fe;
  color: #426587;
  font-size: 26px;
}
.contact-close:hover {
  background: #dfeefe;
}
#contactSupportHelp {
  margin: 6px 0 18px;
}
.contact-rows {
  display: grid;
  gap: 12px;
}
.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #d6e5f5;
  border-radius: 12px;
  background: #f8fbff;
}
.contact-qq-label {
  display: block;
  font-size: 12px;
  color: #6e86a4;
}
.contact-qq-number {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 19px;
  font-weight: 700;
  color: #1769ba;
  user-select: text;
}
.contact-dialog .secondary {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 13px;
}
.contact-feedback {
  min-height: 22px;
  margin: 14px 0 0;
  font-size: 13px;
  color: #1769ba;
}
@media (max-width: 640px) {
  .checkout-notice {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .contact-support-button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .contact-panel {
    padding: 20px;
  }
}

/* Pending-order count remains anchored to its entry, including on mobile. */
#historyToggle {
  position: relative;
}
.history-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #f5f8fc;
  border-radius: 99px;
  background: #d9363e;
  color: #fff;
  font-size: 11px;
  font-weight: 750;
}
.verification-dialog {
  border: 1px solid #dce5ef;
  border-radius: 20px;
  padding: 32px 24px;
  width: min(420px, calc(100vw - 32px));
  color: #162238;
  background: #fff;
  box-shadow: 0 20px 70px #16223833;
}
.verification-dialog::backdrop {
  background: #10213e80;
}
.verification-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}
.verification-panel p {
  font-size: 13px;
  line-height: 1.7;
}
.verification-panel h2:focus {
  outline: none;
}
.verification-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #dceafb;
  border-top-color: #2378ca;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
.order.without-qr .order-body {
  grid-template-columns: minmax(0, 1fr);
}
.order.without-qr .order-details {
  width: min(100%, 680px);
  margin-inline: auto;
}
.order.without-qr .order-details h3 {
  text-align: center;
  margin-bottom: 24px;
}
.order.without-qr .actions {
  justify-content: center;
}

/* Browser history shows plan/time/status rather than merchant order numbers. */
#historyList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.history .history-entry {
  display: grid;
  gap: 12px;
  width: 100%;
  min-height: 90px;
  margin: 0;
  padding: 16px;
  text-align: left;
  color: #1d3552;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  background: #fff;
}
.history-entry-title {
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.history-entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.history-entry-time {
  color: #637790;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.history-entry-state {
  border-radius: 99px;
  padding: 3px 9px;
  color: #1769ba;
  background: #edf5fe;
  font-size: 12px;
  white-space: nowrap;
}
.history .history-entry[data-tone="pending"] {
  border-color: #e8a23b;
  background: #fffbf3;
}
.history-entry[data-tone="pending"] .history-entry-time {
  color: #98620c;
}
.history-entry[data-tone="pending"] .history-entry-state {
  color: #925c08;
  background: #ffedcb;
}
.history .history-entry[data-tone="expired"] {
  border-color: #e1e5ea;
  background: #f4f5f7;
  color: #687687;
}
.history-entry[data-tone="expired"] .history-entry-time {
  color: #737d89;
}
.history-entry[data-tone="expired"] .history-entry-state {
  color: #68717d;
  background: #e7eaee;
}
@media (max-width: 640px) {
  #historyList {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Equal desktop cards follow content height; mobile remains natural-height. */
@media (min-width: 961px) {
  #directForm {
    align-items: stretch;
  }
  #formPanel {
    display: flex;
    flex-direction: column;
  }
  #formPanel > * {
    flex-shrink: 0;
  }
  #formPanel #session {
    flex: 1 0 auto;
    min-height: 196px;
  }
}

/* Compact secondary actions and content-sized browser-order entries. */
#contactSupportOpen,
#historyToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
#contactSupportOpen {
  background: #fff;
  color: #1769ba;
  border: 1px solid #c9def2;
}
#historyToggle {
  background: #eaf2fb;
  color: #245b8d;
  border: 1px solid #dae7f5;
}
#contactSupportOpen:hover,
#historyToggle:hover {
  background: #dfeefa;
  border-color: #a9c9e8;
}
.entry-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
#history {
  padding: 18px;
}
#history > h2 {
  font-size: 16px;
}
#historyList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.history .history-entry {
  flex: 0 1 220px;
  width: 220px;
  max-width: 100%;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
}
.history-entry-title {
  font-size: 13px;
  line-height: 1.5;
}
.history-entry-meta {
  gap: 6px;
}
.history-entry-time,
.history-entry-state {
  font-size: 11px;
}
.history-entry-state {
  padding: 2px 7px;
}
@media (max-width: 640px) {
  #contactSupportOpen {
    grid-column: 2;
    width: auto;
    justify-self: start;
  }
}
@media (max-width: 480px) {
  #history {
    padding: 16px;
  }
  .history .history-entry {
    flex-basis: 100%;
    width: 100%;
  }
}

.order-progress{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;list-style:none;padding:0;margin:20px 0}
.order-progress li{padding:8px 4px;border-top:3px solid #ddd;color:#62686f;font-size:13px;overflow-wrap:anywhere}
.order-progress li[data-done=true]{border-color:#348367;color:#225641}
.order-progress li[aria-current=step]{border-color:#1e6b51;color:#164e3b;font-weight:700;background:#edf6f1}
@media(max-width:640px){.order-progress{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.order-progress li{font-size:12px}}
