:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-elevated: #0d1424;
  --surface: rgba(15, 23, 42, 0.78);
  --surface-strong: rgba(17, 25, 45, 0.92);
  --surface-recessed: rgba(5, 9, 18, 0.88);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --ink: #f8fafc;
  --ink-soft: #cbd5e1;
  --muted: #8b9bb4;
  --crimson: #ef4444;
  --crimson-deep: #dc2626;
  --crimson-glow: rgba(239, 68, 68, 0.34);
  --cobalt: #4285f4;
  --emerald: #34d399;
  --emerald-bg: rgba(16, 185, 129, 0.14);
  --emerald-border: rgba(52, 211, 153, 0.32);
  --amber: #fbbf24;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(251, 191, 36, 0.32);
  --rose: #fb7185;
  --rose-bg: rgba(244, 63, 94, 0.14);
  --rose-border: rgba(251, 113, 133, 0.32);
  --focus: #60a5fa;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "SF Mono", "JetBrains Mono", Consolas, ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
em { font-style: normal; }

/* Ambient background atmosphere */
.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.75;
}

.orb-crimson {
  width: 620px;
  height: 520px;
  top: -160px;
  left: -140px;
  background: radial-gradient(circle, rgba(234, 67, 53, 0.28) 0%, rgba(234, 67, 53, 0) 70%);
}

.orb-cobalt {
  width: 680px;
  height: 580px;
  top: -120px;
  right: -160px;
  background: radial-gradient(circle, rgba(66, 133, 244, 0.28) 0%, rgba(56, 189, 248, 0.08) 42%, transparent 72%);
}

.orb-emerald {
  width: 540px;
  height: 460px;
  bottom: -180px;
  left: 28%;
  background: radial-gradient(circle, rgba(52, 168, 83, 0.16) 0%, rgba(251, 188, 4, 0.06) 45%, transparent 72%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 25%, #000 30%, transparent 100%);
}

/* Main shell */
.page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  min-height: 100vh;
  margin-inline: auto;
  padding: 20px 36px 40px;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(13, 20, 36, 0.68);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

.brand-badge {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mail-icon { display: block; object-fit: contain; }

.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); line-height: 1.25; }
.brand-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--muted); margin-top: 2px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.header-pill .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.header-pill[data-state="ready"] { color: var(--emerald); background: var(--emerald-bg); border-color: var(--emerald-border); }
.header-pill[data-state="ready"] .status-dot { background: var(--emerald); box-shadow: 0 0 10px var(--emerald); animation: pulse 2.2s infinite; }
.header-pill[data-state="empty"] { color: var(--rose); background: var(--rose-bg); border-color: var(--rose-border); }
.header-pill[data-state="empty"] .status-dot { background: var(--rose); }
.header-pill[data-state="paused"], .header-pill[data-state="unknown"] { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-border); }
.header-pill[data-state="paused"] .status-dot, .header-pill[data-state="unknown"] .status-dot { background: var(--amber); }

.lang-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 52px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.lang-toggle:hover,
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.34);
}

.theme-icon { width: 15px; height: 15px; flex: none; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Hero two-column stage */
.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(400px, 0.94fr);
  gap: 52px;
  align-items: start;
  margin-block: 38px 44px;
}

.hero-showcase { min-width: 0; padding-top: 6px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(66, 133, 244, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #93c5fd;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 10px #60a5fa;
}

h1 {
  margin-top: 18px;
  font-size: clamp(36px, 4.4vw, 54px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  background: linear-gradient(120deg, #ffffff 0%, #f1f5f9 55%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin-top: 14px;
  max-width: 520px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.7;
}

/* Sculptural 3D Glass Credential Pass */
.vault-preview {
  position: relative;
  margin: 28px 0 26px;
  max-width: 470px;
  perspective: 1100px;
}

.vault-glow {
  position: absolute;
  inset: -16px -10px;
  border-radius: 28px;
  background: linear-gradient(120deg, rgba(66, 133, 244, 0.28), rgba(234, 67, 53, 0.28), rgba(251, 188, 4, 0.2), rgba(52, 168, 83, 0.24));
  filter: blur(32px);
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.vault-card-back {
  position: absolute;
  inset: 10px -8px -10px 14px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.35));
  border: 1px solid rgba(148, 163, 184, 0.14);
  transform: rotate(2.2deg);
  pointer-events: none;
}

.vault-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  padding: 20px 22px 17px;
  background: linear-gradient(145deg, rgba(22, 33, 58, 0.92) 0%, rgba(11, 17, 31, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: rotate(-1.2deg);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease;
}

.vault-preview:hover .vault-card {
  transform: rotate(0deg) translateY(-4px);
  border-color: rgba(255, 255, 255, 0.26);
}

.vault-preview:hover .vault-glow { opacity: 0.95; }

.vault-card-prism {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #4285f4 0%, #ea4335 34%, #fbbc04 68%, #34a853 100%);
}

.vault-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.vault-chip-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.vault-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  color: var(--emerald);
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
}

.vault-rows {
  display: grid;
  gap: 8px;
}

.vault-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(5, 9, 18, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.11);
}

.vault-row-k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.vault-row-v {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}

.mono { font-family: var(--font-mono); }

.vault-row-totp {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.09), rgba(66, 133, 244, 0.08));
  border-color: rgba(52, 211, 153, 0.24);
}

.totp-demo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.totp-digits {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.12em;
  color: var(--emerald);
}

.totp-chip {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(52, 211, 153, 0.16);
  color: var(--emerald);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.vault-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
  font-size: 11.5px;
  color: var(--muted);
}

.foot-sep { color: rgba(148, 163, 184, 0.35); }

/* Delivery Spec 3-Pillar Cards */
.spec-heading {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.delivery-spec {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.spec-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 13px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.spec-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: rgba(20, 31, 56, 0.78);
}

.spec-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
}

.spec-icon svg { width: 18px; height: 18px; }

.spec-crimson .spec-icon { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.28); }
.spec-cobalt .spec-icon { background: rgba(66, 133, 244, 0.15); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.28); }
.spec-emerald .spec-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.28); }

.spec-copy { min-width: 0; display: flex; flex-direction: column; }
.spec-copy strong { font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.spec-copy span { font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }

/* Right Column: Elevated Frosted-Glass Redemption Card */
.redeem-card {
  position: relative;
  min-width: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(160deg, rgba(17, 25, 45, 0.9) 0%, rgba(10, 15, 28, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.card-prism-strip {
  height: 3.5px;
  background: linear-gradient(90deg, #4285f4 0%, #ea4335 35%, #fbbc04 68%, #34a853 100%);
}

.redeem-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.redeem-heading h2 {
  font-size: 21px;
  font-weight: 760;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.redeem-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.stock-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.stock-pill[data-state="ready"] {
  color: var(--emerald);
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
}

.stock-pill[data-state="ready"]::before {
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 2.2s infinite;
}

.stock-pill[data-state="empty"] {
  color: var(--rose);
  background: var(--rose-bg);
  border-color: var(--rose-border);
}

.stock-pill[data-state="paused"],
.stock-pill[data-state="unknown"] {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.redeem-body { padding: 20px 26px 24px; }

.input-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.input-heading label {
  font-size: 13.5px;
  font-weight: 680;
  color: var(--ink);
}

.code-count {
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.code-count[data-filled="true"] {
  color: #93c5fd;
  background: rgba(66, 133, 244, 0.14);
  border-color: rgba(96, 165, 250, 0.34);
}

.editor-shell {
  position: relative;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(145deg, rgba(148, 163, 184, 0.24), rgba(148, 163, 184, 0.08));
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.editor-shell:focus-within {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.72), rgba(234, 67, 53, 0.65));
  box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.16);
}

textarea {
  display: block;
  width: 100%;
  min-height: 128px;
  padding: 14px 15px;
  border: 0;
  border-radius: 13px;
  background: var(--surface-recessed);
  color: var(--ink);
  resize: vertical;
  font-family: var(--font-mono), "Microsoft YaHei UI", monospace;
  font-size: 13.5px;
  line-height: 1.65;
  outline: none;
}

textarea::placeholder {
  color: #64748b;
  font-family: var(--font-sans);
  font-size: 13.5px;
}

textarea[readonly] { opacity: 0.72; }

.input-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.input-actions { display: flex; align-items: center; gap: 6px; }

.ghost-chip {
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.ghost-chip:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  color: var(--ink);
}

.ghost-chip:disabled { opacity: 0.45; }

.form-message {
  margin-bottom: 14px;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--rose-bg);
  border: 1px solid var(--rose-border);
  color: #fda4af;
  font-size: 13px;
  line-height: 1.5;
}

.cta-stack { display: grid; gap: 10px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.18s ease;
}

.button:active:not(:disabled) { transform: translateY(1px); }

.button.primary {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 52%, #b91c1c 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #f85151 0%, #e02828 52%, #c41c1c 100%);
  box-shadow: 0 14px 32px rgba(239, 68, 68, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transform: translateY(-1px);
}

.button.primary:disabled {
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
  border-color: rgba(148, 163, 184, 0.15);
  box-shadow: none;
}

.button-arrow {
  display: inline-flex;
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.button.primary:hover:not(:disabled) .button-arrow { transform: translateX(3px); }

.button.secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
  color: var(--ink);
}

.button.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.34);
}

.button.secondary:disabled { opacity: 0.45; }

.button.accent-soft {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.36);
  color: #6ee7b7;
}

.button.accent-soft:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(52, 211, 153, 0.52);
}

.button.accent-soft:disabled {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: #64748b;
}

.button.ghost-danger {
  min-height: 40px;
  font-size: 13px;
  background: transparent;
  border-color: rgba(251, 113, 133, 0.3);
  color: #fda4af;
}

.button.ghost-danger:hover:not(:disabled) {
  background: var(--rose-bg);
}

.btn-icon { width: 17px; height: 17px; flex: none; }

.button.compact {
  width: auto;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
}

.trust-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-strip svg { width: 14px; height: 14px; color: #64748b; flex: none; }

/* Results Vault */
.results {
  margin: 0 0 42px;
  scroll-margin-top: 20px;
}

.results-bar {
  padding: 20px 24px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  margin-bottom: 16px;
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.results-heading h2 { font-size: 20px; font-weight: 760; }
.results-heading p { margin-top: 4px; color: var(--ink-soft); font-size: 13.5px; }

.result-tools { display: flex; flex-wrap: wrap; gap: 8px; }

.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

.summary-chip strong { font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.summary-chip[data-tone="delivered"] { background: var(--emerald-bg); border-color: var(--emerald-border); color: var(--emerald); }
.summary-chip[data-tone="delivered"] strong { color: #a7f3d0; }
.summary-chip[data-tone="processing"] { background: rgba(66, 133, 244, 0.14); border-color: rgba(96, 165, 250, 0.34); color: #93c5fd; }
.summary-chip[data-tone="attention"] { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber); }

.items { display: grid; gap: 14px; }

.item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 18px 22px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(17, 26, 46, 0.88), rgba(11, 17, 31, 0.94));
  border: 1px solid var(--border);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2.5px;
  background: var(--border-strong);
}

.item[data-state="DELIVERED"]::before { background: linear-gradient(90deg, #10b981, #34d399, #4285f4); }
.item[data-state="QUEUED"]::before, .item[data-state="PROCESSING"]::before { background: linear-gradient(90deg, #4285f4, #60a5fa); }
.item[data-state="REVIEW"]::before, .item[data-state="RETRYABLE"]::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.item[data-state="INVALID"]::before, .item[data-state="DISABLED"]::before, .item[data-state="EXPIRED"]::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.item-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.item-heading h3 {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.item-state {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 680;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink-soft);
  border: 1px solid var(--border);
}

.item-state[data-state="DELIVERED"] { background: var(--emerald-bg); color: var(--emerald); border-color: var(--emerald-border); }
.item-state[data-state="QUEUED"], .item-state[data-state="PROCESSING"] { background: rgba(66, 133, 244, 0.14); color: #93c5fd; border-color: rgba(96, 165, 250, 0.34); }
.item-state[data-state="REVIEW"], .item-state[data-state="RETRYABLE"] { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.item-state[data-state="INVALID"], .item-state[data-state="DISABLED"], .item-state[data-state="EXPIRED"] { background: var(--rose-bg); color: var(--rose); border-color: var(--rose-border); }

.item-message { margin-top: 10px; color: var(--ink-soft); font-size: 13.5px; }

.fields {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.field {
  display: grid;
  grid-template-columns: minmax(96px, 118px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(5, 9, 18, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.field.field-totp {
  background: linear-gradient(95deg, rgba(16, 185, 129, 0.11), rgba(66, 133, 244, 0.08));
  border-color: rgba(52, 211, 153, 0.28);
}

.field dt {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.field dd { margin: 0; min-width: 0; }

.field code {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.totp-live-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.totp-live-code {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--emerald);
}

.totp-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.14);
  color: #a7f3d0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 650;
}

.totp-timer[data-urgent="true"] {
  background: var(--amber-bg);
  color: var(--amber);
}

.field-actions { display: flex; justify-content: flex-end; gap: 6px; }

.field-btn {
  min-height: 32px;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.field-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-strong);
  color: var(--ink);
}

.field-btn.primary-copy {
  background: rgba(66, 133, 244, 0.16);
  border-color: rgba(96, 165, 250, 0.34);
  color: #93c5fd;
}

.field-btn.primary-copy:hover {
  background: rgba(66, 133, 244, 0.28);
  color: #fff;
}

.field-btn.is-copied {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald);
}

.delivery-date {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
}

/* Toast notice */
.notice {
  position: fixed;
  inset: auto 22px 22px auto;
  z-index: 40;
  max-width: calc(100% - 44px);
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(52, 211, 153, 0.42);
  color: #ecfdf5;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
}

/* Fallback copy dialog */
dialog {
  width: min(480px, calc(100% - 32px));
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 22px;
  background: #0d1424;
  color: var(--ink);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.6);
}

dialog::backdrop { background: rgba(2, 6, 14, 0.72); backdrop-filter: blur(6px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
dialog h2 { font-size: 18px; font-weight: 700; }
dialog label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
dialog textarea { border: 1px solid var(--border); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.88); }
}

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

/* Tablet */
@media (max-width: 1040px) {
  .page { padding: 18px 24px 36px; }
  .hero-stage { grid-template-columns: minmax(0, 1fr) minmax(360px, 0.96fr); gap: 32px; margin-block: 28px 36px; }
  .delivery-spec { grid-template-columns: 1fr; gap: 9px; }
  .spec-card { padding: 11px 13px; }
}

/* Mobile */
@media (max-width: 820px) {
  .page { max-width: 560px; padding: 14px 16px 32px; }
  .site-header { padding: 10px 12px; border-radius: 14px; }
  .brand-badge { width: 34px; height: 34px; border-radius: 10px; }
  .brand-title { font-size: 14px; }
  .brand-sub { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-actions { gap: 6px; flex: none; }
  .theme-toggle, .lang-toggle { height: 32px; padding: 0 9px; min-width: 40px; font-size: 11.5px; border-radius: 8px; }
  .header-pill { display: none; }
  .hero-stage { grid-template-columns: 1fr; gap: 18px; margin-block: 20px 26px; }
  .hero-showcase { padding-top: 0; display: contents; }
  .hero-showcase .eyebrow,
  .hero-showcase h1,
  .hero-showcase .hero-lead { order: 1; }
  .hero-showcase h1 { font-size: 32px; margin-top: 0; }
  .hero-showcase .hero-lead { font-size: 14px; margin-top: -6px; }
  .vault-preview { display: none; }
  .redeem-card { order: 2; }
  .spec-block { order: 3; margin-top: 4px; }
  .delivery-spec { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .spec-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 11px 10px; }
  .spec-copy strong { font-size: 12.5px; }
  .spec-copy span { font-size: 10.5px; }
  .redeem-heading { padding: 18px 18px 14px; }
  .redeem-body { padding: 16px 18px 18px; }
  textarea { min-height: 104px; }
  .trust-strip { font-size: 11px; gap: 6px 10px; }
  .results-bar { padding: 16px; }
  .result-tools { width: 100%; }
  .result-tools .button { flex: 1 1 auto; }
  .item { padding: 15px; }
  .field { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 10px 12px; }
  .field dt { grid-column: 1 / -1; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (max-width: 400px) {
  .delivery-spec { grid-template-columns: 1fr; }
  .spec-card { flex-direction: row; align-items: center; }
}

/* ==========================================================================
   Luminous Porcelain Prism Light Theme (亮白琉璃版)
   ========================================================================== */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fc;
  --bg-elevated: #ffffff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-recessed: #f5f8fe;
  --border: rgba(30, 58, 138, 0.12);
  --border-strong: rgba(30, 58, 138, 0.22);
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --emerald: #059669;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(5, 150, 105, 0.28);
  --amber: #b45309;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(217, 119, 6, 0.3);
  --rose: #dc2626;
  --rose-bg: rgba(239, 68, 68, 0.1);
  --rose-border: rgba(220, 38, 38, 0.28);
  --focus: #2563eb;
}

:root[data-theme="light"] .orb-crimson {
  opacity: 0.72;
  background: radial-gradient(circle, rgba(234, 67, 53, 0.2) 0%, rgba(251, 188, 4, 0.08) 45%, transparent 72%);
}

:root[data-theme="light"] .orb-cobalt {
  opacity: 0.8;
  background: radial-gradient(circle, rgba(66, 133, 244, 0.24) 0%, rgba(56, 189, 248, 0.12) 45%, transparent 72%);
}

:root[data-theme="light"] .orb-emerald {
  opacity: 0.72;
  background: radial-gradient(circle, rgba(52, 168, 83, 0.16) 0%, rgba(251, 188, 4, 0.08) 48%, transparent 72%);
}

:root[data-theme="light"] .ambient-grid {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.055) 1px, transparent 1px);
}

:root[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(30, 58, 138, 0.11);
  box-shadow: 0 10px 28px rgba(30, 58, 138, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .brand-badge {
  background: linear-gradient(145deg, #ffffff, #eef4ff);
  border-color: rgba(37, 99, 235, 0.16);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1), inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .header-pill {
  background: rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .lang-toggle,
:root[data-theme="light"] .theme-toggle {
  background: #ffffff;
  border-color: rgba(30, 58, 138, 0.18);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .lang-toggle:hover,
:root[data-theme="light"] .theme-toggle:hover {
  background: #eef4ff;
  border-color: rgba(37, 99, 235, 0.34);
}

:root[data-theme="light"] .eyebrow {
  background: rgba(37, 99, 235, 0.09);
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
}

:root[data-theme="light"] .eyebrow-dot {
  background: #2563eb;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

:root[data-theme="light"] h1 {
  background: linear-gradient(125deg, #0f172a 0%, #1e293b 50%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:root[data-theme="light"] .vault-glow {
  background: linear-gradient(120deg, rgba(66, 133, 244, 0.26), rgba(234, 67, 53, 0.22), rgba(251, 188, 4, 0.22), rgba(52, 168, 83, 0.22));
  opacity: 0.7;
}

:root[data-theme="light"] .vault-card-back {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(226, 238, 255, 0.65));
  border-color: rgba(37, 99, 235, 0.14);
}

:root[data-theme="light"] .vault-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(244, 248, 255, 0.94) 100%);
  border-color: rgba(37, 99, 235, 0.16);
  box-shadow: 0 22px 48px rgba(30, 58, 138, 0.12), inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .vault-preview:hover .vault-card {
  border-color: rgba(37, 99, 235, 0.3);
}

:root[data-theme="light"] .vault-row {
  background: #f4f7fd;
  border-color: rgba(30, 58, 138, 0.1);
}

:root[data-theme="light"] .vault-row-totp {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.08));
  border-color: rgba(5, 150, 105, 0.26);
}

:root[data-theme="light"] .totp-chip {
  background: rgba(5, 150, 105, 0.12);
}

:root[data-theme="light"] .vault-card-foot {
  border-top-color: rgba(30, 58, 138, 0.14);
}

:root[data-theme="light"] .spec-card {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(30, 58, 138, 0.12);
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.05);
}

:root[data-theme="light"] .spec-card:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 10px 24px rgba(30, 58, 138, 0.09);
}

:root[data-theme="light"] .spec-crimson .spec-icon { background: rgba(239, 68, 68, 0.1); color: #dc2626; border-color: rgba(239, 68, 68, 0.22); }
:root[data-theme="light"] .spec-cobalt .spec-icon { background: rgba(37, 99, 235, 0.1); color: #2563eb; border-color: rgba(37, 99, 235, 0.22); }
:root[data-theme="light"] .spec-emerald .spec-icon { background: rgba(5, 150, 105, 0.1); color: #059669; border-color: rgba(5, 150, 105, 0.22); }

:root[data-theme="light"] .redeem-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 255, 0.94) 100%);
  border-color: rgba(30, 58, 138, 0.15);
  box-shadow: 0 26px 60px rgba(30, 58, 138, 0.11), 0 2px 10px rgba(15, 23, 42, 0.04), inset 0 1px 0 #ffffff;
}

:root[data-theme="light"] .redeem-heading {
  background: rgba(241, 246, 255, 0.55);
}

:root[data-theme="light"] .stock-pill {
  background: rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .code-count {
  background: #eef3fb;
}

:root[data-theme="light"] .code-count[data-filled="true"] {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.11);
  border-color: rgba(37, 99, 235, 0.26);
}

:root[data-theme="light"] .editor-shell {
  background: linear-gradient(145deg, rgba(30, 58, 138, 0.22), rgba(30, 58, 138, 0.12));
}

:root[data-theme="light"] textarea::placeholder { color: #94a3b8; }

:root[data-theme="light"] .ghost-chip {
  background: #ffffff;
  border-color: rgba(30, 58, 138, 0.16);
  color: var(--ink-soft);
}

:root[data-theme="light"] .ghost-chip:hover:not(:disabled) {
  background: #eef4ff;
  border-color: rgba(37, 99, 235, 0.32);
  color: var(--ink);
}

:root[data-theme="light"] .form-message {
  color: #b91c1c;
}

:root[data-theme="light"] .button.primary:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  border-color: #cbd5e1;
}

:root[data-theme="light"] .button.secondary {
  background: #ffffff;
  border-color: rgba(30, 58, 138, 0.18);
  color: var(--ink);
}

:root[data-theme="light"] .button.secondary:hover:not(:disabled) {
  background: #f1f5fd;
  border-color: rgba(37, 99, 235, 0.34);
}

:root[data-theme="light"] .button.accent-soft {
  background: rgba(5, 150, 105, 0.11);
  border-color: rgba(5, 150, 105, 0.3);
  color: #047857;
}

:root[data-theme="light"] .button.accent-soft:hover:not(:disabled) {
  background: rgba(5, 150, 105, 0.18);
}

:root[data-theme="light"] .button.accent-soft:disabled {
  background: #f1f5f9;
  color: #94a3b8;
}

:root[data-theme="light"] .button.ghost-danger {
  color: #be123c;
}

:root[data-theme="light"] .results-bar {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(30, 58, 138, 0.07);
}

:root[data-theme="light"] .summary-chip { background: #f1f5fb; }
:root[data-theme="light"] .summary-chip[data-tone="delivered"] strong { color: #047857; }
:root[data-theme="light"] .summary-chip[data-tone="processing"] { background: rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.25); color: #1d4ed8; }

:root[data-theme="light"] .item {
  background: linear-gradient(160deg, #ffffff, #f8fbff);
  box-shadow: 0 12px 28px rgba(30, 58, 138, 0.08);
}

:root[data-theme="light"] .item-state[data-state="QUEUED"],
:root[data-theme="light"] .item-state[data-state="PROCESSING"] {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.26);
}

:root[data-theme="light"] .field {
  background: #f5f8fe;
  border-color: rgba(30, 58, 138, 0.1);
}

:root[data-theme="light"] .field.field-totp {
  background: linear-gradient(95deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.07));
  border-color: rgba(5, 150, 105, 0.28);
}

:root[data-theme="light"] .totp-timer {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
}

:root[data-theme="light"] .field-btn {
  background: #ffffff;
  border-color: rgba(30, 58, 138, 0.16);
  color: var(--ink-soft);
}

:root[data-theme="light"] .field-btn:hover {
  background: #eef4ff;
  border-color: rgba(37, 99, 235, 0.32);
  color: var(--ink);
}

:root[data-theme="light"] .field-btn.primary-copy {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.26);
  color: #1d4ed8;
}

:root[data-theme="light"] .field-btn.primary-copy:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

:root[data-theme="light"] .notice {
  background: #0f172a;
  color: #f8fafc;
}

:root[data-theme="light"] dialog {
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

:root[data-theme="light"] dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}
