:root {
  --bg: #f5efe4;
  --bg-accent: #e6d8c4;
  --panel: rgba(255, 250, 242, 0.9);
  --panel-strong: #fffaf2;
  --ink: #26170d;
  --muted: #70594d;
  --line: rgba(73, 42, 20, 0.12);
  --brand: #8a4b2c;
  --brand-deep: #4f2d19;
  --green: #2d6c59;
  --shadow: 0 18px 50px rgba(79, 45, 25, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(138, 75, 44, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(45, 108, 89, 0.12), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, #f2eadc 100%);
  min-height: 100vh;
}

body.gated {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 90%);
}

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

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(29, 18, 10, 0.38);
  backdrop-filter: blur(14px);
}

.access-gate.is-hidden {
  display: none;
}

.gate-card {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 249, 240, 0.97);
  border: 1px solid rgba(73, 42, 20, 0.14);
  box-shadow: var(--shadow);
}

.gate-card h2 {
  margin-bottom: 10px;
}

.gate-text {
  margin-bottom: 18px;
  color: var(--muted);
}

.access-form {
  display: grid;
  gap: 14px;
}

.access-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.access-form input,
.access-form button {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font: inherit;
}

.access-form input {
  border: 1px solid rgba(73, 42, 20, 0.14);
  background: rgba(255, 255, 255, 0.86);
}

.access-form button {
  border: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff8f0;
  font-weight: 800;
  cursor: pointer;
}

.turnstile-wrap {
  min-height: 70px;
}

.hero,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  padding: 32px;
}

.hero::after,
.panel::after {
  content: "";
  position: absolute;
  inset: auto -20% -55% auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(138, 75, 44, 0.08), transparent 70%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.section-head h2 {
  margin: 0;
  line-height: 1.15;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  max-width: 10ch;
}

.hero-text,
.section-note,
.stat-label,
.meta-line,
.registration-meta,
.summary-meta {
  color: var(--muted);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(79, 45, 25, 0.08);
  font-size: 0.95rem;
}

.countdown-banner {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(79, 45, 25, 0.92), rgba(138, 75, 44, 0.88));
  color: #fff8f0;
  box-shadow: 0 18px 36px rgba(79, 45, 25, 0.2);
}

.countdown-banner.is-urgent {
  background: linear-gradient(135deg, #8d2d25, #c05334);
}

.countdown-label,
.countdown-meta {
  color: rgba(255, 248, 240, 0.82);
}

.countdown-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.countdown-main {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
}

.countdown-meta {
  font-size: 0.95rem;
}

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

.stat-card,
.summary-card,
.registration-card,
.product-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.stat-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 132px;
}

.stat-card strong {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

#shipping-amount {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.35;
}

.layout,
.board-grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.layout {
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
}

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

.panel {
  padding: 26px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.product-grid,
.summary-list,
.registration-list {
  display: grid;
  gap: 16px;
}

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

.product-card {
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(138, 75, 44, 0.38);
  box-shadow: 0 16px 36px rgba(79, 45, 25, 0.12);
  outline: none;
}

.product-card.is-selected {
  border-color: rgba(45, 108, 89, 0.68);
  box-shadow: 0 0 0 3px rgba(45, 108, 89, 0.14), 0 18px 42px rgba(45, 108, 89, 0.18);
}

.product-card.is-selected .product-body {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(230, 244, 239, 0.92));
}

.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg-accent);
}

.product-body {
  padding: 16px;
}

.product-tags,
.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(138, 75, 44, 0.1);
  color: var(--brand-deep);
  font-size: 0.85rem;
  font-weight: 700;
}

.product-price {
  margin: 14px 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
}

.product-note {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 700;
}

.registration-form {
  display: grid;
  gap: 16px;
}

.registration-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.field-hint {
  margin: -4px 0 2px;
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 700;
}

.registration-form input,
.registration-form select,
.registration-form button {
  width: 100%;
  border: 1px solid rgba(73, 42, 20, 0.14);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font: inherit;
}

.registration-form input,
.registration-form select {
  background: rgba(255, 255, 255, 0.82);
}

.registration-form button {
  border: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff8f0;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}

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

.registration-form button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.deadline-badge {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 210px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(79, 45, 25, 0.08);
}

.deadline-badge.is-urgent {
  background: rgba(138, 75, 44, 0.12);
  border-color: rgba(138, 75, 44, 0.24);
}

.deadline-badge-label,
.deadline-badge-meta {
  color: var(--muted);
}

.deadline-badge-label {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.deadline-badge-main {
  font-size: 1.1rem;
  color: var(--ink);
}

.deadline-badge-meta {
  font-size: 0.85rem;
}

.fee-box {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(45, 108, 89, 0.08);
  border: 1px solid rgba(45, 108, 89, 0.12);
}

.fee-box p {
  margin: 0 0 10px;
  font-weight: 800;
}

.fee-box ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.form-message {
  min-height: 24px;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.confirmation-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(79, 45, 25, 0.06);
  border: 1px solid rgba(79, 45, 25, 0.12);
}

.confirmation-panel.is-hidden {
  display: none;
}

.confirmation-kicker {
  margin: 0;
  color: var(--brand);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confirmation-list {
  display: grid;
  gap: 10px;
}

.confirmation-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(79, 45, 25, 0.16);
}

.confirmation-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.confirmation-row-label {
  color: var(--muted);
}

.confirmation-row-value {
  text-align: right;
}

.confirmation-row-value.is-emphasis {
  color: var(--brand-deep);
  font-size: 1.1rem;
}

.confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.confirmation-actions button {
  width: auto;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.86);
  color: var(--brand-deep);
  border: 1px solid rgba(79, 45, 25, 0.16);
}

.form-message.is-error {
  color: #a52f2f;
}

.form-message.is-success {
  color: var(--green);
}

.summary-card,
.registration-card {
  padding: 16px 18px;
}

.summary-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.summary-card strong {
  font-size: 1.75rem;
}

.registration-card {
  display: grid;
  gap: 6px;
}

.empty-state {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(73, 42, 20, 0.18);
  color: var(--muted);
}

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

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

  .deadline-badge {
    justify-items: start;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 20px;
  }

  .hero,
  .panel {
    padding: 20px;
    border-radius: 24px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .confirmation-row,
  .confirmation-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .confirmation-actions button {
    width: 100%;
  }
}
