/* 充值码页：购买、付款、交付共用一个主工作区，内容按订单状态逐步出现。 */
body[data-sale-mode="code"] .top-nav a[aria-current="page"] {
  color: #176f62;
  font-weight: 750;
}

body[data-sale-mode="code"] .code-hero {
  grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr);
  grid-template-areas: "intro plan" "form plan";
  gap: 25px 46px;
  align-items: start;
}

body[data-sale-mode="code"] .hero-copy {
  align-self: end;
  max-width: 570px;
}

body[data-sale-mode="code"] .code-buy-card {
  display: block;
  align-self: start;
  padding: 26px 28px 25px;
}

body[data-sale-mode="code"] .code-buy-heading,
body[data-sale-mode="code"] .code-delivery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-sale-mode="code"] .stock-badge {
  padding: 5px 9px;
  border: 1px solid #dce9e4;
  border-radius: 99px;
  background: #f7faf8;
  color: #687d7c;
  font-size: 11px;
  white-space: nowrap;
}

body[data-sale-mode="code"] .stock-badge[data-state="available"] {
  border-color: #c7e6d8;
  background: #eff9f4;
  color: #18735f;
}

body[data-sale-mode="code"] .stock-badge[data-state="unavailable"] {
  border-color: #ecd9c7;
  background: #fbf5ee;
  color: #8b643c;
}

body[data-sale-mode="code"] .code-buy-heading > h2 {
  min-width: 0;
  margin: 0;
  color: #1b343a;
  font-size: 19px;
  font-weight: 740;
  letter-spacing: -.03em;
}

body[data-sale-mode="code"] .code-product-description {
  margin: 0;
  color: #62787b;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

body[data-sale-mode="code"] .code-order-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
  gap: 16px 20px;
  margin: 20px 0 0;
  padding: 17px 0;
  border-top: 1px solid #e2ebe7;
  border-bottom: 1px solid #e2ebe7;
}

body[data-sale-mode="code"] .code-order-summary > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

body[data-sale-mode="code"] .code-order-summary > div > span {
  color: #6c8080;
  font-size: 11px;
}

body[data-sale-mode="code"] .code-order-summary > div > strong {
  overflow-wrap: anywhere;
  color: #20383d;
  font-size: 14px;
  font-weight: 700;
}

body[data-sale-mode="code"] .code-order-summary .code-total {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 13px;
  border-top: 1px solid #edf1ef;
}

body[data-sale-mode="code"] .code-order-summary .code-total > strong {
  color: #137968;
  font-size: 30px;
  font-weight: 760;
  letter-spacing: -.04em;
  line-height: 1.1;
}

body[data-sale-mode="code"] .code-availability-note {
  margin: 12px 0 0;
  color: #8b643c;
  font-size: 12px;
  line-height: 1.5;
}

body[data-sale-mode="code"] .code-redemption-note { margin: 14px 0 0; color: #657a78; font-size: 12px; line-height: 1.55; }

body[data-sale-mode="code"] .code-confirm {
  margin: 15px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

body[data-sale-mode="code"] .code-buy-card .button {
  margin-top: 13px;
  min-height: 52px;
}

body[data-sale-mode="code"] .code-buy-card .button:disabled { opacity: .58; }
body[data-sale-mode="code"] .code-buy-card .form-message:not(:empty) { margin-top: 9px; }
body[data-sale-mode="code"] .code-buy-card .preview-note { margin: 9px 0 0; color: #748581; font-size: 11px; line-height: 1.5; text-align: center; }

/* 有订单后把购买宣传区收起，二维码或订单结果成为唯一主操作区。 */
body[data-sale-mode="code"]:not([data-checkout-stage="purchase"]) .code-hero {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: none;
  gap: 0;
  padding: clamp(22px, 4vw, 42px);
}

body[data-sale-mode="code"]:not([data-checkout-stage="purchase"]) .code-hero > .hero-copy,
body[data-sale-mode="code"]:not([data-checkout-stage="purchase"]) .code-hero > .code-buy-card,
body[data-sale-mode="code"]:not([data-checkout-stage="purchase"]) .code-hero > .benefit-card,
body[data-sale-mode="code"]:not([data-checkout-stage="purchase"]) #process-guide {
  display: none;
}

body[data-sale-mode="code"] .code-post-flow {
  display: grid;
  grid-column: 1 / -1;
  width: min(100%, 920px);
  margin: 0 auto;
  gap: 0;
}

body[data-sale-mode="code"] .code-post-flow .payment-card,
body[data-sale-mode="code"] .code-post-flow .progress-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-sale-mode="code"] .code-post-flow .card-heading {
  gap: 14px;
  align-items: center;
  margin: 0 0 23px;
}

body[data-sale-mode="code"] .code-post-flow .card-heading h2 {
  margin: 0;
  color: #172f36;
  font-size: 27px;
  font-weight: 740;
  letter-spacing: -.035em;
  line-height: 1.25;
}

body[data-sale-mode="code"] .code-post-flow .card-heading p {
  margin: 7px 0 0;
  color: #60757a;
  font-size: 14px;
  line-height: 1.6;
}

body[data-sale-mode="code"] .code-payment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 23px;
  padding: 16px 0;
  border-top: 1px solid #e3ece8;
  border-bottom: 1px solid #e3ece8;
}

body[data-sale-mode="code"] .code-payment-summary > div { display: grid; gap: 5px; }
body[data-sale-mode="code"] .code-payment-summary span { color: #687d7c; font-size: 12px; }
body[data-sale-mode="code"] .code-payment-summary strong { color: #20383d; font-size: 16px; font-weight: 700; }
body[data-sale-mode="code"] .code-payment-summary .code-payment-amount { text-align: right; }
body[data-sale-mode="code"] .code-payment-summary .code-payment-amount strong { color: #137968; font-size: 31px; letter-spacing: -.04em; }

body[data-sale-mode="code"] .code-post-flow .payment-box {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-sale-mode="code"] .code-post-flow .qr-layout {
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 54px);
  align-items: center;
}

body[data-sale-mode="code"] .code-post-flow .qr-frame {
  width: 240px;
  height: 240px;
  padding: 10px;
  border-color: #e2eae6;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(20, 45, 40, .09);
}

body[data-sale-mode="code"] .payment-instructions h3 { margin: 11px 0 0; color: #1b343a; font-size: 21px; font-weight: 730; }
body[data-sale-mode="code"] .payment-instructions > p { margin: 9px 0 0; color: #60757a; font-size: 13px; line-height: 1.65; }
body[data-sale-mode="code"] .payment-instructions .payment-countdown { margin-top: 19px; color: #60757a; font-size: 12px; }
body[data-sale-mode="code"] .payment-instructions .payment-countdown strong { color: #20383d; font-size: 18px; font-variant-numeric: tabular-nums; }
body[data-sale-mode="code"] .payment-instructions .payment-stage-status { margin-top: 17px; color: #176f62; font-size: 13px; font-weight: 680; }

body[data-sale-mode="code"] .code-timeline {
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr) 36px minmax(0, 1fr);
  margin: 28px 0 22px;
}

body[data-sale-mode="code"] .code-timeline .timeline-step { color: #71817f; }
body[data-sale-mode="code"] .code-timeline .timeline-step strong { color: inherit; font-size: 12px; }
body[data-sale-mode="code"] .code-timeline .timeline-step small { font-size: 10px; }
body[data-sale-mode="code"] .code-timeline .timeline-step.active { color: #147968; }

body[data-sale-mode="code"] .status-banner {
  padding: 16px 18px;
  border-color: #dcebe4;
  background: #f5faf7;
  color: #294448;
}

body[data-sale-mode="code"] .status-banner[data-state="success"] { border-color: #cfe7dc; background: #f1faf5; }
body[data-sale-mode="code"] .status-banner[data-state="warning"] { border-color: #edddb9; background: #fffaf0; }
body[data-sale-mode="code"] .status-banner[data-state="error"] { border-color: #f0c9c4; background: #fff6f5; }
body[data-sale-mode="code"] .status-banner[data-state="neutral"] { border-color: #e1e8e5; background: #f7f9f8; }
body[data-sale-mode="code"] .status-banner strong { color: #20383d; font-size: 15px; }
body[data-sale-mode="code"] .status-banner div span { overflow-wrap: anywhere; color: #657a7d; font-size: 12px; line-height: 1.5; }

body[data-sale-mode="code"] .payment-recovery-actions {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 15px;
  padding: 15px 17px;
  border: 1px solid #edddb9;
  border-radius: 12px;
  background: #fffaf0;
}

body[data-sale-mode="code"] .payment-recovery-actions p { margin: 0; color: #755d32; font-size: 12px; line-height: 1.6; }
body[data-sale-mode="code"] .payment-recovery-actions .button { min-height: 42px; margin: 0; }

body[data-sale-mode="code"] .code-delivery {
  margin: 22px 0 10px;
  padding: 21px;
  border: 1px solid #cfe7dc;
  border-radius: 15px;
  background: #f5faf7;
}

body[data-sale-mode="code"] .code-delivery-header h3 { margin: 5px 0 0; color: #19383b; font-size: 20px; font-weight: 740; }
body[data-sale-mode="code"] .delivery-ready { padding: 6px 10px; border: 1px solid #bfe1d1; border-radius: 99px; background: #e7f6ed; color: #18735f; font-size: 11px; font-weight: 720; }
body[data-sale-mode="code"] .code-value-row { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding: 14px; border: 1px solid #d9e7e1; border-radius: 11px; background: #fff; }
body[data-sale-mode="code"] .code-value-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: #183c3b; font-size: 15px; font-weight: 700; letter-spacing: .04em; }
body[data-sale-mode="code"] .code-value-row .copy-button { flex: 0 0 auto; min-height: 38px; padding: 0 12px; font-size: 12px; }
body[data-sale-mode="code"] .code-safety-note,
body[data-sale-mode="code"] .guide-fallback { margin: 9px 0 0; color: #677d7a; font-size: 12px; line-height: 1.6; }
body[data-sale-mode="code"] .order-redemption-guide { gap: 9px; margin: 17px 0 0; padding: 15px 16px; border-color: #dcebe4; background: #fff; }
body[data-sale-mode="code"] .order-redemption-guide > div > span { color: #6a7e7d; font-size: 11px; }
body[data-sale-mode="code"] .order-redemption-guide > div > strong { margin-top: 3px; color: #244348; font-size: 14px; }
body[data-sale-mode="code"] .order-redemption-guide p { color: #536c6d; font-size: 14px; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }
body[data-sale-mode="code"] .code-guide-link { display: inline-flex; width: fit-content; min-height: 43px; margin-top: 14px; padding: 0 16px; text-decoration: none; }

body[data-sale-mode="code"] .query-again { margin-top: 17px; }

body[data-sale-mode="code"] .process-section { margin-top: 46px; }
body[data-sale-mode="code"] .process-section .section-title-row h2,
body[data-sale-mode="code"] .faq-section .section-title-row h2 { font-size: 24px; }
body[data-sale-mode="code"] .code-process-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body[data-sale-mode="code"] .code-process-grid .process-item { min-height: 94px; padding: 19px 21px; }
body[data-sale-mode="code"] .code-process-grid .process-item p { max-width: 230px; }
body[data-sale-mode="code"] .faq-section { margin-top: 45px; }
body[data-sale-mode="code"] .lookup-form { grid-template-columns: minmax(0, 1fr) auto; }
body[data-sale-mode="code"] .lookup-form .button-outline { white-space: nowrap; }
body[data-sale-mode="code"] .lookup-result[data-state] { display: block; }

@media (max-width: 980px) {
  body[data-sale-mode="code"] .code-hero { grid-template-areas: "intro" "form" "plan"; }
}

@media (max-width: 720px) {
  body[data-sale-mode="code"] .top-nav { display: none; }
  body[data-page="user"][data-sale-mode="code"] .header-help { display: inline-flex; align-items: center; margin-left: auto; font-size: 11px; white-space: nowrap; }
  body[data-sale-mode="code"] .code-hero { gap: 17px; padding: 22px 17px; }
  body[data-sale-mode="code"] .code-buy-card { padding: 20px 17px 18px; }
  body[data-sale-mode="code"] .code-buy-heading > h2 { font-size: 17px; }
  body[data-sale-mode="code"] .code-order-summary { gap: 13px 15px; margin-top: 16px; padding: 14px 0; }
  body[data-sale-mode="code"] .code-order-summary .code-total > strong { font-size: 27px; }
  body[data-sale-mode="code"] .code-confirm { font-size: 11px; }
  body[data-sale-mode="code"] .code-post-flow .card-heading { align-items: flex-start; gap: 11px; margin-bottom: 17px; }
  body[data-sale-mode="code"] .code-post-flow .card-heading h2 { font-size: 22px; }
  body[data-sale-mode="code"] .code-post-flow .card-heading p { font-size: 12px; }
  body[data-sale-mode="code"] .code-payment-summary { margin-bottom: 18px; padding: 13px 0; }
  body[data-sale-mode="code"] .code-payment-summary strong { font-size: 14px; }
  body[data-sale-mode="code"] .code-payment-summary .code-payment-amount strong { font-size: 26px; }
  body[data-sale-mode="code"] .code-post-flow .qr-layout { grid-template-columns: 1fr; gap: 19px; }
  body[data-sale-mode="code"] .code-post-flow .qr-frame { width: min(220px, 100%); height: auto; aspect-ratio: 1; margin: 0 auto; }
  body[data-sale-mode="code"] .payment-instructions { text-align: center; }
  body[data-sale-mode="code"] .payment-instructions h3 { margin-top: 9px; font-size: 19px; }
  body[data-sale-mode="code"] .payment-instructions .payment-countdown { max-width: 280px; margin: 16px auto 0; }
  body[data-sale-mode="code"] .payment-instructions .payment-stage-status { justify-content: center; margin-top: 13px; }
  body[data-sale-mode="code"] .code-timeline { grid-template-columns: 1fr; gap: 10px; margin: 22px 0 18px; }
  body[data-sale-mode="code"] .code-timeline .timeline-step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; text-align: left; }
  body[data-sale-mode="code"] .code-timeline .timeline-step > span { margin: 0; }
  body[data-sale-mode="code"] .code-timeline .timeline-step small { margin-top: 2px; }
  body[data-sale-mode="code"] .code-timeline .timeline-rail { width: 1px; height: 8px; margin: -5px 0 -5px 14px; }
  body[data-sale-mode="code"] .code-delivery { padding: 16px 13px; }
  body[data-sale-mode="code"] .code-value-row { flex-wrap: wrap; padding: 11px; }
  body[data-sale-mode="code"] .code-value-row code { flex-basis: 100%; padding-bottom: 4px; font-size: 13px; }
  body[data-sale-mode="code"] .code-value-row .copy-button { flex: 1; }
  body[data-sale-mode="code"] .code-process-grid { grid-template-columns: 1fr; }
  body[data-sale-mode="code"] .code-process-grid .process-item + .process-item { border-left: 0; border-top: 1px solid #e6eeea; }
  body[data-sale-mode="code"] .process-section { margin-top: 34px; }
  body[data-sale-mode="code"] .faq-section { margin-top: 35px; }
}
