:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei",
    "Noto Sans CJK SC", system-ui, sans-serif;
  color: #191724;
  background: #f5f9ff;
  line-height: 1.5;
  --canvas: #f5f9ff;
  --surface: #ffffff;
  --ink: #191724;
  --muted: #625d72;
  --brand: #32164f;
  --primary: #502080;
  --primary-hover: #42196d;
  --line: #dfe6f0;
  --focus: #7542a9;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: radial-gradient(ellipse 35rem 29rem at 82% 8%, #edeaf9 0%, transparent 100%), var(--canvas);
  -webkit-text-size-adjust: 100%;
}

.site-header {
  padding-inline: max(1.375rem, env(safe-area-inset-left)) max(1.375rem, env(safe-area-inset-right));
  padding-block-start: env(safe-area-inset-top);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 68rem;
  min-height: 4.5rem;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  border-radius: 0.25rem;
}

.brand-text {
  color: var(--brand);
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 6.625rem;
  height: auto;
}

.language-toggle {
  min-width: 4.55rem;
  min-height: 2.75rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid #ddd9ed;
  border-radius: 999px;
  background: rgb(255 255 255 / 70%);
  color: var(--brand);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.language-toggle:hover {
  background: #fff;
  border-color: #c3b6d7;
}

.claim-layout {
  width: min(100% - 2rem, 30rem);
  margin-inline: auto;
  padding-block: clamp(1rem, 5vw, 3.125rem) max(1rem, env(safe-area-inset-bottom));
}

.claim-panel {
  padding: clamp(1.25rem, 6vw, 2.25rem);
  border: 1px solid #e9edf5;
  border-radius: clamp(1.375rem, 6vw, 2rem);
  background: var(--surface);
  box-shadow: 0 16px 48px rgb(51 37 85 / 6%);
}

.claim-progress {
  display: flex;
  gap: 0.375rem;
  margin-block-end: 1.375rem;
}

.claim-progress span {
  width: 1.75rem;
  height: 0.21875rem;
  border-radius: 999px;
  background: #e6e2f0;
  transition: background-color 180ms ease;
}

.claim-progress[data-step="1"] span:first-child,
.claim-progress[data-step="2"] span:nth-child(2),
.claim-progress[data-step="3"] span:last-child {
  background: var(--primary);
}

.claim-progress[data-step="2"] span:first-child,
.claim-progress[data-step="3"] span:not(:last-child) {
  background: #a587c4;
}

.claim-stage {
  min-width: 0;
  animation: reveal 200ms ease-out;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.entry-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block: -0.125rem 0.625rem;
}

.membership-year {
  margin: 0;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  color: var(--brand);
  background: #f0ebf8;
  font-size: 0.8125rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.entry-emblem {
  display: block;
  width: 3.375rem;
  height: auto;
  padding: 0.5rem;
  border-radius: 1rem;
  background: #f0ebf8;
}

h1 {
  margin: 0;
  font-size: clamp(2.0625rem, 8.85vw, 2.875rem);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.047em;
}

:lang(zh-CN) h1 {
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.stage-heading p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

#entry-stage .stage-heading {
  margin-block-end: 1.5rem;
}

h1[tabindex="-1"]:focus {
  outline: none;
}

.entry-fields {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.375rem;
  min-width: 0;
}

.field label {
  font-size: 0.875rem;
  font-weight: 650;
}

.field input {
  width: 100%;
  min-width: 0;
  min-height: 3.25rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid #8e8da3;
  border-radius: 0.75rem;
  background: #f8faff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.field input::placeholder {
  color: #6e687e;
  opacity: 1;
}

.field input:focus {
  border-color: var(--focus);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px #eee5f8;
}

.field input[aria-invalid="true"] {
  border-color: #b34a68;
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid transparent;
  border-radius: 0.8125rem;
  font: inherit;
  font-weight: 675;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

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

.action.primary:hover:enabled {
  background: var(--primary-hover);
}

.action:disabled {
  cursor: default;
  opacity: 0.74;
}

.action.secondary {
  border-color: #ddd4eb;
  background: #fff;
  color: var(--brand);
}

.action.secondary:hover:enabled {
  border-color: #b9a7ce;
  background: #f7f2fc;
}

#preview-button {
  margin-block-start: 0.25rem;
}

.staging-note,
.noscript-note {
  margin: 0.875rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.review-details {
  margin: 1.5rem 0 0.875rem;
  padding: 0 1rem;
  border-radius: 1rem;
  background: #f5f7fc;
}

.review-details div {
  padding-block: 0.875rem;
}

.review-details div + div {
  border-top: 1px solid var(--line);
}

.review-details dt {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 550;
}

.review-details dd {
  margin: 0.1875rem 0 0;
  color: var(--brand);
  font-size: 1.0625rem;
  font-weight: 680;
  overflow-wrap: anywhere;
}

#review-member-id {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
}

.binding-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin-block-start: 1.375rem;
}

.verification-widget:not(:empty) {
  margin-block-start: 1rem;
}

.staging-sign-in {
  display: inline-block;
  margin-block-start: 0.625rem;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 650;
}

.status {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.625rem;
  background: #fcf0f4;
  color: #7c2140;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

#review-status:not(:empty):not(.working) {
  margin-block-start: 0.875rem;
}

.status:empty,
.status.working {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.spinner {
  width: 0.875rem;
  height: 0.875rem;
  flex: 0 0 auto;
  border: 2px solid rgb(255 255 255 / 45%);
  border-right-color: #fff;
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.success-stage {
  text-align: center;
}

.success-check {
  display: grid;
  width: 3.125rem;
  height: 3.125rem;
  margin: 0.25rem auto 0.875rem;
  place-items: center;
  border-radius: 50%;
  background: #ede7f8;
  color: var(--brand);
}

.success-check::before {
  width: 1.125rem;
  height: 0.625rem;
  margin-block-start: -0.25rem;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(-45deg);
}

.wallet-preview {
  margin: 1.5rem auto 1rem;
  width: min(100%, 22rem);
  overflow: hidden;
  border: 1px solid #d6e5f4;
  border-radius: 0.9375rem;
  background: #e5f1fd;
  color: var(--brand);
  text-align: start;
  box-shadow: 0 8px 20px rgb(46 61 109 / 10%);
}

.pass-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
}

.pass-heading img {
  width: 5.625rem;
  height: auto;
}

.pass-heading span {
  color: #5d4b77;
  font-size: 0.75rem;
  font-weight: 650;
}

.pass-art {
  display: block;
  width: 100%;
  height: auto;
}

.wallet-download {
  display: inline-grid;
  padding: 0.375rem;
  place-items: center;
  border-radius: 0.625rem;
  vertical-align: middle;
}

.wallet-download img {
  display: block;
  width: auto;
  height: 3rem;
}

.device-note {
  margin: 0.625rem auto 0;
  max-width: 26ch;
  color: var(--muted);
  font-size: 0.875rem;
}

.privacy-link {
  display: flex;
  justify-content: center;
  margin-block-start: 0.625rem;
  font-size: 0.8125rem;
}

.privacy-link a {
  display: inline-grid;
  min-height: 2.75rem;
  place-items: center;
  border-radius: 0.25rem;
  color: var(--muted);
  text-underline-offset: 0.2em;
  text-decoration-color: #b1a9be;
}

.privacy-link a:hover {
  color: var(--brand);
}

.privacy-page {
  width: min(100% - 2rem, 44rem);
  margin: clamp(1rem, 5vw, 3rem) auto max(2rem, env(safe-area-inset-bottom));
  padding: clamp(1.25rem, 6vw, 2.5rem);
  border: 1px solid #e9edf5;
  border-radius: 1.5rem;
  background: var(--surface);
}

.privacy-page h1 {
  font-size: clamp(1.875rem, 6vw, 2.625rem);
}

.privacy-page p {
  margin: 0.625rem 0 0;
}

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

.privacy-section {
  margin-block-start: 1.5rem;
}

.privacy-section h2 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--brand);
}

.privacy-page a,
.download-error a {
  color: var(--primary);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.download-error .stage-heading {
  margin-block-end: 1rem;
}

.privacy-page .privacy-return {
  margin-block-start: 1.5rem;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 22rem) {
  .review-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
