:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-strong: #171717;
  --text: #171717;
  --muted: #6f6b63;
  --line: #ded8ce;
  --accent: #0d6efd;
  --accent-dark: #0a55c7;
  --accent-soft: #e8f1ff;
  --green: #167a4a;
  --shadow: 0 22px 70px rgba(37, 32, 26, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 28px;
  padding: 18px clamp(20px, 5vw, 64px);
  background: rgba(246, 243, 238, 0.9);
  border-bottom: 1px solid rgba(222, 216, 206, 0.76);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: 92px;
  height: 70px;
  flex: 0 0 92px;
  border-radius: 0;
  object-fit: contain;
}

.brand-text {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-switch {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-self: end;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 4px 6px 4px 10px;
}

.region-switch-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.region-switch-button {
  display: inline-flex;
  min-width: 82px;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
  padding: 0 10px;
}

.region-switch-button:hover {
  background: #f8f8f8;
}

.region-switch-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.region-switch-button[aria-expanded="true"] {
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}

.region-switch-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.region-switch-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 6px;
  z-index: 30;
  display: grid;
  min-width: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(37, 32, 26, 0.18);
  padding: 6px;
}

.region-switch-item {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
  padding: 0 10px;
  text-align: left;
}

.region-switch-item:hover,
.region-switch-item:focus-visible {
  background: var(--accent-soft);
  outline: 0;
}

.region-switch-item.is-selected {
  background: var(--accent);
  color: #fff;
}

.region-switch-check {
  width: 10px;
  height: 6px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(-45deg) translateY(-1px);
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 790px);
  justify-content: center;
  align-items: center;
  padding: 34px 0 36px;
  text-align: center;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-visual {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.hero-visual img {
  display: block;
  width: min(100%, 790px);
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  justify-content: center;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

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

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary,
.button.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.button.full {
  width: 100%;
}

.compact-button {
  min-height: 40px;
  margin-top: 8px;
}

.hero-panel,
.checkout-card,
.qr-card,
.steps-card,
.wechat-panel {
  border: 1px solid rgba(222, 216, 206, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 18px;
}

.card-visual {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 8px;
  padding: 26px;
  background:
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.82), transparent 28%),
    linear-gradient(135deg, #111 0%, #47433c 45%, #c3a66c 100%);
  color: #fff;
}

.card-visual span,
.card-visual small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.card-visual strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.sample-remark {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  border-radius: 8px;
  background: #f7f8fa;
  padding: 16px;
}

.sample-remark span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

code {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.status-strip div {
  display: grid;
  gap: 6px;
  min-height: 104px;
  align-content: center;
  background: rgba(255, 255, 255, 0.86);
  padding: 20px;
}

.status-strip strong {
  font-size: 18px;
}

.status-strip span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.checkout-stepper {
  display: grid;
  gap: 18px;
  padding: 56px 0 28px;
}

.step-indicator {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.step-indicator-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.step-indicator-button span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.step-indicator-button strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-indicator-button.is-active {
  border-color: var(--accent);
  background: #fff;
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.14);
}

.step-indicator-button.is-locked {
  cursor: not-allowed;
  opacity: 0.58;
}

.step-panels {
  position: relative;
  left: 0;
  display: grid;
  grid-template-columns: 100%;
  align-items: start;
  overflow: hidden;
  transition: transform 260ms ease;
  will-change: transform;
}

.step-panels:has([data-step-panel="remark"].is-active) {
  left: 100%;
}

.step-panels:has([data-step-panel="payment"].is-active) {
  left: 200%;
}

.step-panel {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.step-panel:not(.is-active) {
  position: absolute;
  inset: 0;
}

.step-panel[aria-hidden="true"] {
  pointer-events: none;
  visibility: hidden;
}

.step-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.step-controls .button {
  min-width: 132px;
}

.button:disabled,
.button[disabled] {
  cursor: not-allowed;
  opacity: 0.52;
  pointer-events: none;
  transform: none;
}

.checkout-card {
  padding: clamp(22px, 4vw, 34px);
}

.section-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.section-heading > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.section-heading h2 {
  margin-bottom: 6px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.product-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.product-option {
  display: grid;
  cursor: pointer;
}

.product-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-option > span {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.product-option > span {
  min-height: 104px;
}

.product-option input:checked + span {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.16);
}

.product-option:hover > span {
  transform: translateY(-1px);
}

.product-option strong {
  font-size: 17px;
}

.product-option em {
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.product-option small {
  color: var(--muted);
  line-height: 1.5;
}

.product-option .price-breakdown {
  color: #5d6470;
  font-weight: 700;
}

.contact-methods {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
}

.contact-methods legend {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 850;
}

.contact-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.contact-method {
  display: grid;
  cursor: pointer;
}

.contact-method input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.contact-method span {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.contact-method input:checked + span {
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.16);
}

.contact-method input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.field span {
  font-size: 14px;
  font-weight: 850;
}

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

.field input {
  height: 48px;
  padding: 0 14px;
}

.field textarea {
  min-height: 94px;
  resize: vertical;
  padding: 14px;
  line-height: 1.6;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.14);
}

.form-error {
  min-height: 24px;
  margin: 10px 0 16px;
  color: #bd2222;
  font-size: 14px;
  font-weight: 750;
}

.empty-state {
  display: grid;
  min-height: 262px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
}

.empty-state span {
  color: var(--muted);
  line-height: 1.6;
}

.payment-step {
  display: grid;
  gap: 18px;
}

.payment-locked-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.payment-locked-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
}

.payment-locked-state span {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.payment-content {
  display: grid;
  gap: 18px;
}

.result-panel {
  display: grid;
  gap: 18px;
}

.summary-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.summary-list div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  background: #fff;
  padding: 14px;
}

.summary-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.summary-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.copy-status {
  min-height: 22px;
  margin: 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

.payment-section,
.wechat-section,
.notice-section {
  padding: 42px 0;
}

.qr-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.qr-card,
.steps-card {
  padding: 24px;
}

.qr-card img,
.wechat-panel img {
  display: block;
  width: min(100%, 260px);
  height: auto;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-card h3,
.steps-card h3,
.wechat-panel h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.qr-card p,
.steps-card li,
.wechat-panel p,
.notice-grid p {
  color: var(--muted);
  line-height: 1.75;
}

.steps-card ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.wechat-panel {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 24px;
}

.wechat-panel img {
  margin: 0;
}

.notice-section {
  padding-bottom: 72px;
}

.notice-section h2 {
  margin-bottom: 16px;
  font-size: 28px;
}

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

.notice-grid p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px 24px;
  padding: 24px clamp(20px, 5vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.friend-links-section {
  display: grid;
  gap: 12px;
}

.friend-links-title {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
}

.friend-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.friend-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.friend-link-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.back-top {
  color: var(--muted);
}

.friend-link:hover,
.back-top:hover {
  color: var(--text);
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  main {
    width: min(100% - 28px, 640px);
  }

  .hero,
  .qr-layout,
  .wechat-panel,
  .notice-grid {
    grid-template-columns: 1fr;
  }

  .step-indicator {
    grid-template-columns: 1fr;
  }

  .step-controls {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    backdrop-filter: blur(14px);
  }

  .hero {
    min-height: auto;
    padding-top: 46px;
  }

  .status-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .wechat-panel img {
    width: min(100%, 260px);
  }
}

@media (max-width: 520px) {
  .site-header {
    gap: 14px 12px;
    padding: 16px 20px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 72px;
    height: 55px;
    flex-basis: 72px;
  }

  .brand-text {
    font-size: 19px;
  }

  .region-switch-label {
    display: none;
  }

  .region-switch-button,
  .region-switch-menu {
    min-width: 70px;
  }

  .region-switch-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .region-switch-item {
    min-height: 32px;
    font-size: 13px;
  }

  .hero-actions .button,
  .button-row .button {
    width: 100%;
  }

  .step-indicator-button {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 52px;
  }

  .step-indicator-button span {
    width: 34px;
    height: 34px;
  }

  .step-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-controls .button {
    min-width: 0;
    width: 100%;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .summary-list div {
    grid-template-columns: 1fr;
  }

  .contact-method-grid {
    gap: 6px;
  }

  .contact-method span {
    min-height: 40px;
    padding: 0 8px;
    font-size: 13px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
}
