:root {
  --nfc-bg: #f5f7fb;
  --nfc-surface: rgba(255, 255, 255, .92);
  --nfc-ink: #0f172a;
  --nfc-muted: #52607a;
  --nfc-border: rgba(15, 23, 42, .09);
  --nfc-btn-bg: #111827;
  --nfc-btn-ink: #ffffff;
  --nfc-accent: #2563eb;
  --nfc-grid: rgba(15, 23, 42, .045);
}

html[data-theme="dark"] {
  --nfc-bg: #0b0f19;
  --nfc-surface: rgba(19, 27, 44, .92);
  --nfc-ink: #f8fafc;
  --nfc-muted: #9aa7bd;
  --nfc-border: rgba(255, 255, 255, .1);
  --nfc-btn-bg: #f8fafc;
  --nfc-btn-ink: #0b0f19;
  --nfc-accent: #60a5fa;
  --nfc-grid: rgba(255, 255, 255, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.nfc-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Inter", "SF Pro Display", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--nfc-ink);
  background-color: var(--nfc-bg);
  background-image:
    linear-gradient(to right, var(--nfc-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--nfc-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-font-smoothing: antialiased;
}

.nfc-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  height: 56px;
  padding: 0 1rem;
  background: var(--nfc-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nfc-border);
}
.nfc-brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  color: var(--nfc-ink);
  font-weight: 700;
}
.nfc-wordmark { font-size: .98rem; letter-spacing: -.01em; }
.nfc-brand-zh {
  padding-left: .45rem;
  border-left: 1px solid var(--nfc-border);
  font-size: .84rem;
  color: var(--nfc-muted);
  font-weight: 600;
}
.nfc-top-actions { display: flex; align-items: center; gap: .5rem; }
.nfc-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--nfc-border);
  background: transparent;
  color: var(--nfc-ink);
  font-size: .95rem;
  cursor: pointer;
}
.nfc-shop-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 .8rem;
  border-radius: 999px;
  border: 1px solid var(--nfc-border);
  color: var(--nfc-ink);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
}

.nfc-main {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nfc-stage {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* Signature Obsidian Digital Pass Card */
.nfc-obsidian-card {
  position: relative;
  aspect-ratio: 85.5 / 54;
  width: 100%;
  border-radius: 20px;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background-color: #090d16;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .075) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .075) 1px, transparent 1px);
  background-size: 26px 26px;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 24px 48px -22px rgba(9, 13, 22, .65);
  color: #f8fafc;
  transition: transform .25s ease;
}

.nfc-card-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 44%, rgba(37, 99, 235, .38) 0%, rgba(250, 204, 21, .11) 34%, rgba(9, 13, 22, 0) 68%);
}
body[data-pass-theme="chuimei"] .nfc-card-glow {
  background: radial-gradient(circle at 50% 44%, rgba(236, 118, 104, .34) 0%, rgba(248, 196, 113, .14) 36%, rgba(9, 13, 22, 0) 68%);
}
body[data-pass-theme="obsidian"] .nfc-card-glow {
  background: radial-gradient(circle at 50% 42%, rgba(99, 102, 241, .32) 0%, rgba(56, 189, 248, .12) 36%, rgba(9, 13, 22, 0) 68%);
}

.nfc-card-top,
.nfc-card-emblem,
.nfc-card-bottom {
  position: relative;
  z-index: 1;
}

.nfc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nfc-chip-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .24rem .62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .1em;
  color: rgba(241, 245, 249, .92);
}
.nfc-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
}
body[data-pass-theme="chuimei"] .nfc-dot {
  background: #f59b8d;
  box-shadow: 0 0 8px #f59b8d;
}
.nfc-wave { color: rgba(226, 232, 240, .72); display: inline-flex; }

.nfc-card-emblem {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nfc-card-emblem svg {
  width: clamp(78px, 24vw, 108px);
  height: clamp(78px, 24vw, 108px);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .5));
}

.nfc-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .6rem;
}
.nfc-card-brand { display: block; font-size: 1.05rem; letter-spacing: .01em; line-height: 1.15; }
.nfc-card-meta { display: block; margin-top: .18rem; font-size: .72rem; color: rgba(203, 213, 225, .78); }
.nfc-tap-pill {
  flex: none;
  padding: .22rem .58rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: .72rem;
  font-weight: 600;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

/* Copy & CTA Card */
.nfc-copy-panel {
  padding: 1.25rem;
  border-radius: 20px;
  background: var(--nfc-surface);
  border: 1px solid var(--nfc-border);
  box-shadow: 0 12px 32px -20px rgba(15, 23, 42, .16);
}
.nfc-preview-note {
  margin: 0 0 .6rem;
  padding: .35rem .65rem;
  border-radius: 10px;
  background: rgba(37, 99, 235, .1);
  color: var(--nfc-accent);
  font-size: .76rem;
  font-weight: 600;
}
.nfc-copy-panel h1 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.3;
  letter-spacing: -.015em;
}
.nfc-subtitle {
  margin: .55rem 0 0;
  font-size: .92rem;
  line-height: 1.65;
  color: var(--nfc-muted);
}
.nfc-cta-row { margin-top: 1.05rem; }
.nfc-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: .65rem 1.25rem;
  border-radius: 999px;
  background: var(--nfc-btn-bg);
  color: var(--nfc-btn-ink);
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, opacity .15s ease;
}
.nfc-primary-btn:hover { opacity: .92; transform: translateY(-1px); }

/* Ecosystem Quick Grid */
.nfc-eco-panel {
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 20px;
  background: var(--nfc-surface);
  border: 1px solid var(--nfc-border);
}
.nfc-eco-heading {
  margin: 0 0 .7rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--nfc-muted);
}
.nfc-eco-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.nfc-eco-card {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .7rem .78rem;
  border-radius: 14px;
  border: 1px solid var(--nfc-border);
  background: var(--nfc-bg);
  text-decoration: none;
  color: var(--nfc-ink);
  transition: border-color .16s ease, transform .16s ease;
}
.nfc-eco-card:hover { border-color: var(--nfc-accent); transform: translateY(-1px); }
.nfc-eco-card strong { font-size: .88rem; }
.nfc-eco-card span { font-size: .74rem; color: var(--nfc-muted); }

/* Instant Redirect Splash */
.nfc-redirect-box {
  padding: 2rem 1.35rem;
  border-radius: 22px;
  background: var(--nfc-surface);
  border: 1px solid var(--nfc-border);
  text-align: center;
}
.nfc-pulse-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d16;
  color: #93c5fd;
  font-weight: 800;
  letter-spacing: .04em;
}
.nfc-redirect-box h1 { margin: 0; font-size: 1.25rem; }
.nfc-redirect-box p { margin: .5rem 0 1.2rem; font-size: .9rem; color: var(--nfc-muted); }

.nfc-footer {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-size: .78rem;
  color: var(--nfc-muted);
}

@media (max-width: 340px) {
  .nfc-obsidian-card { padding: .9rem 1rem; }
  .nfc-eco-grid { grid-template-columns: 1fr; }
}
