:root {
  --bg: #f8f9fb;
  --card: #ffffff;
  --primary: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #10a37f;
  --accent-dark: #0b7355;
  --accent-blue: #0284c7;
  --accent-blue-dark: #075985;
  --accent-amber: #ea580c;
  --danger: #dc2626;
  --success: #0b8f64;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-xl: 0 60px 120px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 24px 60px rgba(15, 23, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--primary);
  background:
    radial-gradient(circle at 8% 0%, rgba(2, 132, 199, 0.08), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(16, 163, 127, 0.08), transparent 32%),
    var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

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

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

.page {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  padding: 10px 12px 10px 18px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(16, 163, 127, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.15;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
}

.nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
}

.nav a:hover {
  color: var(--accent-dark);
  background: #fff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid rgba(17, 24, 39, 0.05);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 10% 20%, rgba(16, 163, 127, 0.16), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(2, 132, 199, 0.15), transparent 45%),
    var(--card);
  box-shadow: var(--shadow-xl);
}

.hero-copy,
.hero-right {
  min-width: 0;
}

.badge,
.card-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  gap: 6px;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--accent-dark);
  background: rgba(16, 163, 127, 0.1);
  font-size: 14px;
  font-weight: 800;
}

.badge.dark {
  color: #d1fae5;
  background: rgba(16, 163, 127, 0.18);
}

.hero h1 {
  max-width: 720px;
  margin: 22px 0 30px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.12;
  font-weight: 800;
}

.hero-subtitle {
  max-width: 650px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 19px);
}

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

.stat {
  min-width: 0;
}

.stat:first-child {
  grid-column: span 2;
}

.stat strong {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
  color: var(--primary);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.12;
  word-break: keep-all;
}

.stat em {
  color: var(--accent-amber);
  font-size: 14px;
  font-style: normal;
}

.stat > span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.feature-stack {
  display: grid;
  gap: 12px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
  font-weight: 650;
}

.feature-icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: rgba(16, 163, 127, 0.11);
  font-weight: 900;
}

.hero-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  padding: 26px;
  border: 1px solid rgba(2, 132, 199, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.14);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), transparent 38%);
}

.hero-card > * {
  position: relative;
}

.section-title h1,
.section-title h2 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.16;
}

.section-title p {
  margin: 8px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.section-title.centered {
  text-align: center;
}

.product-fieldset {
  min-width: 0;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.product-fieldset legend {
  margin-bottom: 10px;
  color: #374151;
  font-size: 14px;
  font-weight: 800;
}

.product-options {
  display: grid;
  gap: 10px;
}

.product-options .product-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.product-options .product-card:hover {
  transform: translateY(-1px);
  border-color: rgba(2, 132, 199, 0.42);
}

.product-options .product-card:has(input:checked) {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.product-options .product-card.sold-out {
  opacity: 0.58;
  cursor: not-allowed;
}

.product-card input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.product-card strong,
.product-card small {
  display: block;
}

.product-card span {
  min-width: 0;
}

.product-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.product-card b {
  white-space: nowrap;
  color: var(--accent-blue-dark);
  font-size: 15px;
}

form label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: #374151;
  font-size: 14px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--primary);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input,
select {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 14px;
  font-weight: 700;
}

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

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  box-shadow: 0 18px 34px rgba(16, 163, 127, 0.25);
}

.button.primary:hover {
  box-shadow: 0 22px 42px rgba(2, 132, 199, 0.28);
}

.button.secondary {
  color: var(--accent-blue-dark);
  background: #eff6ff;
  border-color: rgba(2, 132, 199, 0.24);
}

.button.quiet {
  color: #374151;
  background: #fff;
  border-color: var(--line);
}

.button.wide {
  width: 100%;
}

.order-form .button,
.compact-form .button {
  margin-top: 22px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.result-panel,
.steps-section,
.workband,
.single-column,
.admin-shell {
  margin-top: 28px;
}

.result-panel,
.lookup-panel,
.faq-panel,
.single-column,
.admin-login,
.delivery-panel {
  padding: clamp(22px, 3vw, 32px);
}

.result-panel {
  background:
    radial-gradient(circle at 0% 0%, rgba(16, 163, 127, 0.1), transparent 35%),
    #fff;
}

.steps-section {
  padding: 34px 0 0;
}

.steps-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.step-card,
.faq-card {
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.05);
}

.step-number {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: var(--accent-dark);
  background: rgba(16, 163, 127, 0.12);
  font-weight: 900;
}

.step-card h3,
.faq-card h3 {
  margin: 14px 0 8px;
  font-size: 18px;
}

.step-card p,
.faq-card p {
  margin: 0;
  color: var(--muted);
}

.faq-panel .faq-grid {
  grid-template-columns: 1fr;
}

.workband {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 22px;
}

.order-meta {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
}

.order-meta div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.order-meta dt {
  color: var(--muted);
}

.order-meta dd {
  margin: 0;
  font-weight: 900;
  word-break: break-all;
}

.token-box,
.lookup-result,
#mockPayResult,
#tokenResult {
  margin-top: 18px;
}

.token-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(2, 132, 199, 0.32);
  border-radius: 16px;
  background: #f8fafc;
}

code {
  overflow-wrap: anywhere;
  color: var(--accent-blue-dark);
  font-family: "Cascadia Code", Consolas, monospace;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #374151;
  background: #edf2f7;
  font-size: 13px;
  font-weight: 900;
}

.status.paid,
.status.delivered {
  color: var(--success);
  background: #dcfce7;
}

.status.pending,
.status.processing,
.status.reserved {
  color: #b45309;
  background: #fef3c7;
}

.status.failed,
.status.cancelled,
.status.expired,
.status.disabled {
  color: var(--danger);
  background: #fee2e2;
}

.status.available {
  color: var(--success);
  background: #dcfce7;
}

.status.sold {
  color: #475569;
  background: #e2e8f0;
}

.lookup-card {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.lookup-card p {
  margin: 0;
}

.pay-action {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.checkout-notice {
  margin-top: 16px;
}

.checkout-state {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(2, 132, 199, 0.22);
  border-radius: 16px;
  background: #f8fafc;
}

.checkout-state strong,
.checkout-state span {
  display: block;
}

.checkout-state span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.checkout-state.success {
  border-color: rgba(11, 143, 100, 0.22);
  background: #f0fdf4;
}

.checkout-state.warning {
  border-color: rgba(180, 83, 9, 0.24);
  background: #fffbeb;
}

.single-column {
  width: min(860px, 100%);
  margin-inline: auto;
}

.admin-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
}

.admin-side {
  position: sticky;
  top: 108px;
  align-self: start;
  min-height: 320px;
  padding: 26px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(circle at 0% 0%, rgba(16, 163, 127, 0.24), transparent 40%),
    linear-gradient(160deg, #111827, #1f2937);
  box-shadow: var(--shadow-card);
}

.admin-side h1 {
  margin: 18px 0 8px;
  font-size: 34px;
  line-height: 1.1;
}

.admin-side p {
  color: #cbd5e1;
}

.admin-side .button {
  margin-top: 20px;
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
}

.admin-main {
  min-width: 0;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 170px auto;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 16px;
}

.table-panel {
  overflow: auto;
}

.mini-table-panel {
  margin-top: 18px;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  font-size: 14px;
}

.mini-table {
  min-width: 620px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #475467;
  background: #f8fafc;
  font-size: 13px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f0fdf4;
}

.delivery-panel {
  margin-top: 18px;
}

.admin-section {
  padding: clamp(20px, 3vw, 28px);
}

.admin-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  margin-top: 18px;
}

.row-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-list-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--primary);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.admin-list-row:hover {
  border-color: rgba(2, 132, 199, 0.36);
  background: #f8fafc;
}

.admin-list-row strong,
.admin-list-row small {
  display: block;
}

.admin-list-row small {
  color: var(--muted);
  font-size: 12px;
}

.admin-list-row b {
  white-space: nowrap;
  color: var(--accent-blue-dark);
}

.stack-form {
  margin-top: 18px;
}

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

.checkbox-label {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  align-self: end;
  margin-top: 16px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 16px;
  border: 1px solid rgba(16, 163, 127, 0.2);
  border-radius: 16px;
  color: var(--accent-dark);
  background: #fff;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    border-radius: 24px;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .hero,
  .workband,
  .admin-shell,
  .admin-management-grid {
    grid-template-columns: 1fr;
  }

  .stats,
  .steps-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .stat:first-child {
    grid-column: auto;
  }

  .admin-side {
    position: static;
  }

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .row-title,
  .admin-list-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .page {
    width: 100%;
    padding: 12px 12px 80px;
  }

  .hero {
    width: 100%;
    padding: 20px 16px;
    border-radius: 24px;
  }

  .hero-card {
    width: calc(100vw - 58px);
    max-width: calc(100vw - 58px);
    padding: 22px 16px;
  }

  .hero-card .section-title,
  .product-fieldset,
  .order-form > label,
  .order-form .button {
    width: 100%;
    max-width: 300px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .product-options .product-card,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .product-options .product-card {
    overflow: hidden;
  }

  .product-card b {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .product-card strong,
  .product-card small {
    overflow-wrap: anywhere;
  }

  input,
  textarea,
  select,
  .button,
  .product-options,
  .product-card {
    max-width: 100%;
    min-width: 0;
  }

  .order-meta div {
    align-items: flex-start;
    flex-direction: column;
  }
}
