:root {
  --paper: #fffaf4;
  --surface: #ffffff;
  --line: #eadfd4;
  --ink: #2c2621;
  --muted: #82746a;
  --orange: #ff5a2e;
  --orange-deep: #d93e1d;
  --red: #c82d3a;
  --teal: #138a81;
  --blue: #315c9c;
  --shadow: 0 20px 52px rgba(88, 52, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f3eee9;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(19, 138, 129, 0.07) 0 1px, transparent 1px 90px),
    linear-gradient(0deg, rgba(49, 92, 156, 0.05) 0 1px, transparent 1px 90px),
    var(--paper);
}

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

.app-shell {
  min-height: 100vh;
  padding-bottom: 96px;
}

.mobile-topbar {
  height: 88px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 10px 18px 8px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #ece7e2;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.mobile-topbar strong {
  display: block;
  font-size: clamp(16px, 4.2vw, 21px);
  line-height: 1.2;
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-topbar > div {
  min-width: 0;
}

.mobile-topbar span {
  display: block;
  color: #918985;
  text-align: center;
  margin-top: 3px;
  font-size: 13px;
}

.topbar-icon,
.topbar-dots {
  width: 32px;
  height: 32px;
  position: relative;
}

.topbar-icon::before,
.topbar-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 15px;
  width: 24px;
  height: 2px;
  background: #262626;
}

.topbar-icon::before {
  transform: rotate(45deg);
}

.topbar-icon::after {
  transform: rotate(-45deg);
}

.topbar-dots::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 2px;
  width: 5px;
  height: 5px;
  background: #222;
  border-radius: 50%;
  box-shadow: -10px 0 0 #222, -20px 0 0 #222;
}

.page-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(280px, 360px);
  gap: 24px;
  padding: 28px 18px 48px;
}

.checkout-panel {
  min-width: 0;
}

.promo-frame {
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
  box-shadow: var(--shadow);
  max-width: 100%;
  overflow: hidden;
}

.promo-frame img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.form-card {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.field {
  padding: 28px 32px 20px;
  border-bottom: 1px solid #eee6de;
}

.field label {
  display: block;
  color: #6b625b;
  font-size: 20px;
  line-height: 1.35;
  margin-bottom: 14px;
}

.field label span {
  color: var(--red);
  font-weight: 800;
}

.field label em {
  color: var(--red);
  font-style: normal;
  font-weight: 700;
  margin-left: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #e7dfd8;
  border-radius: 0;
  background: #fff;
  color: #2d2924;
  min-height: 58px;
  padding: 0 22px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field textarea {
  min-height: 92px;
  padding: 16px 22px;
  resize: vertical;
  line-height: 1.7;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 90, 46, 0.14);
  background: #fffdf9;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 9px solid #b6ada6;
  transform: translateY(-30%);
  pointer-events: none;
}

select {
  appearance: none;
}

.error {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 14px;
}

.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 22px 32px 6px;
  color: #625951;
  line-height: 1.6;
}

.consent-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--orange);
  flex: 0 0 auto;
}

.consent-error {
  padding: 0 32px;
}

.desktop-pay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: calc(100% - 64px);
  height: 58px;
  margin: 18px 32px 32px;
  border: 0;
  border-radius: 29px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(217, 62, 29, 0.28);
}

.desktop-pay span {
  font-size: 16px;
  opacity: 0.92;
}

.desktop-pay strong {
  font-size: 20px;
}

.desktop-pay:disabled,
.payment-bar button:disabled {
  cursor: wait;
  filter: grayscale(0.25);
  opacity: 0.78;
}

.summary-panel {
  min-width: 0;
}

.summary-sticky {
  position: sticky;
  top: 112px;
  background:
    linear-gradient(140deg, rgba(255, 90, 46, 0.11), transparent 48%),
    linear-gradient(200deg, rgba(19, 138, 129, 0.10), transparent 44%),
    #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px;
}

.summary-eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.summary-sticky h1 {
  margin: 0 0 24px;
  font-size: 28px;
  line-height: 1.2;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #eee4db;
}

.summary-line span {
  color: var(--muted);
}

.summary-line strong {
  color: var(--ink);
}

.summary-note {
  margin-top: 18px;
  border-left: 4px solid var(--blue);
  padding: 12px 0 12px 16px;
  background: rgba(49, 92, 156, 0.07);
}

.summary-note b {
  display: block;
  margin-bottom: 6px;
}

.summary-note p {
  margin: 0;
  color: #625a53;
  line-height: 1.7;
  font-size: 14px;
}

.payment-bar {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 76px;
  padding: 10px max(16px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
  display: none;
  justify-content: center;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid #e6ded6;
  backdrop-filter: blur(14px);
}

.payment-bar div {
  min-width: 0;
  color: var(--red);
  text-align: right;
}

.payment-bar span {
  display: block;
  font-size: 13px;
}

.payment-bar strong {
  display: block;
  font-size: 21px;
}

.payment-bar button {
  width: 174px;
  max-width: 48vw;
  height: 56px;
  border: 0;
  border-radius: 28px;
  background: var(--orange);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(255, 90, 46, 0.28);
}

@media (max-width: 920px) {
  .page-grid {
    display: block;
    width: min(760px, 100%);
    padding: 22px 18px 46px;
  }

  .summary-panel {
    display: none;
  }

  .desktop-pay {
    display: none;
  }

  .payment-bar {
    display: flex;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-bottom: 88px;
  }

  .page-grid {
    padding: 22px 12px 38px;
  }

  .promo-frame {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .form-card {
    margin-top: 20px;
  }

  .field {
    padding: 24px 20px 16px;
  }

  .field label {
    font-size: 18px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 56px;
    padding-inline: 16px;
  }

  .consent-row {
    padding: 18px 20px 4px;
  }

  .consent-error {
    padding-inline: 20px;
  }
}

/* Mobile-first production layout */
html,
body {
  background: #eee9e2;
}

.app-shell {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 88px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(44, 38, 33, 0.05), 0 22px 70px rgba(44, 38, 33, 0.11);
}

.app-shell[data-mode="lookup"] {
  padding-bottom: 0;
}

.mobile-topbar {
  height: 84px;
  padding-inline: 12px;
}

.mobile-topbar strong {
  font-size: 18px;
}

.mobile-topbar span {
  font-size: 12px;
}

.page-grid {
  width: 100%;
  display: block;
  padding: 12px 10px 34px;
}

.checkout-panel {
  width: 100%;
}

.summary-panel,
.desktop-pay {
  display: none;
}

.promo-frame {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.promo-frame img {
  border: 1px solid #f0d1b2;
}

.mode-switch {
  margin: 14px 0 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid #eee0d5;
  background: #fff;
}

.mode-switch button {
  height: 42px;
  border: 0;
  background: transparent;
  color: #7b6d64;
  font-weight: 700;
  cursor: pointer;
}

.mode-switch button.active {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 10px 20px rgba(255, 90, 46, 0.22);
}

.form-card,
.lookup-card {
  margin-top: 0;
  border: 1px solid #eadfd4;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.form-card[hidden],
.lookup-card[hidden] {
  display: none;
}

.field {
  padding: 22px 18px 14px;
}

.field label {
  font-size: 17px;
  margin-bottom: 12px;
}

.field label em {
  display: inline;
  margin-left: 4px;
  font-size: 15px;
}

.field input,
.field select,
.field textarea {
  min-height: 54px;
  padding-inline: 14px;
  font-size: 16px;
}

.field textarea {
  padding: 14px;
}

.consent-row {
  padding: 18px 18px 4px;
  font-size: 14px;
}

.consent-error {
  padding-inline: 18px;
}

.lookup-card {
  padding: 22px 18px 20px;
}

.lookup-head {
  margin-bottom: 18px;
}

.lookup-head span {
  display: block;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.lookup-head h1 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.2;
}

.lookup-form label {
  display: block;
  margin-bottom: 10px;
  color: #6b625b;
  font-size: 16px;
}

.lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
}

.lookup-row input,
.lookup-row button {
  min-height: 52px;
  border: 1px solid #e5d9ce;
}

.lookup-row input {
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  outline: none;
  background: #fff;
}

.lookup-row input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 90, 46, 0.14);
}

.lookup-row button {
  border: 0;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.lookup-row button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.lookup-results {
  margin-top: 12px;
}

.lookup-empty {
  margin: 18px 0 4px;
  padding: 16px;
  background: #f7f3ed;
  color: #776a60;
  line-height: 1.7;
}

.order-item {
  padding: 16px 0;
  border-top: 1px solid #eee4da;
}

.order-item:first-child {
  border-top: 0;
}

.order-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.order-item header span {
  color: var(--teal);
  font-weight: 800;
}

.order-item header strong {
  font-size: 20px;
}

.order-item dl {
  margin: 0;
}

.order-item dl div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
}

.order-item dt,
.order-item dd {
  margin: 0;
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.order-item dt {
  color: #87786d;
}

.order-item dd {
  color: #2f2923;
  font-weight: 700;
}

.payment-bar {
  left: 50%;
  right: auto;
  width: min(430px, 100%);
  display: flex;
  transform: translateX(-50%);
}

.app-shell[data-mode="lookup"] .payment-bar {
  display: none;
}

@media (max-width: 360px) {
  .mobile-topbar strong {
    font-size: 16px;
  }

  .field {
    padding-inline: 14px;
  }

  .payment-bar {
    gap: 10px;
  }

  .payment-bar button {
    width: 150px;
  }
}

/* WeChat opens the page inside its own chrome, so the site itself stays edge-to-edge. */
html,
body {
  background: var(--paper);
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  box-shadow: none;
}

.page-grid {
  padding-top: 10px;
}

.payment-bar {
  left: 0;
  right: 0;
  width: 100%;
  transform: none;
}

@media (min-width: 768px) {
  html,
  body {
    background: #eee9e2;
  }

  .app-shell {
    width: min(430px, 100%);
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(44, 38, 33, 0.05), 0 22px 70px rgba(44, 38, 33, 0.11);
  }

  .payment-bar {
    left: 50%;
    right: auto;
    width: min(430px, 100%);
    transform: translateX(-50%);
  }
}
