/**
 * 好奇护照封面 + 游乐场起始页外壳
 * 共享：#viewPassportCover 与 #viewIntro.passport-intro-view（白卡、条码区、底栏轨）
 * 封面独占：标题区、徽章、主 CTA
 */
html:has(.passport-cover-view.is-active) {
  height: 100%;
  overflow: hidden;
}

main#main:has(.passport-cover-view.is-active) {
  max-height: 100dvh;
  overflow: hidden;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view).view.is-active.passport-cover-view {
  flex: 1 1 auto;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --pad-x: clamp(0.85rem, 4vw, 1.35rem);
  --pad-y: clamp(0.5rem, 2.2vw, 0.85rem);
  /* 两页白卡统一最小高度：视口高减去外壳上下内边距（与 padding 公式一致） */
  --ppc-page-min-h: calc(
    100dvh - max(0.45rem, env(safe-area-inset-top, 0px)) - max(0.45rem, env(safe-area-inset-bottom, 0px))
  );
  /* 以宽度为主，略参考视口高，避免长屏上徽章过大 */
  --emblem: min(54vw, 10.5rem, min(38dvh, 11rem));
  --ppc-gap-hero-emblem: clamp(0.85rem, 4.2vmin, 1.35rem);
  --ppc-gap-emblem-cta: clamp(1.25rem, 6vmin, 2.15rem);
  --ppc-gap-cta-rails: clamp(1.15rem, 5.5vmin, 2rem);
  width: 100%;
  padding: max(0.45rem, env(safe-area-inset-top, 0)) 0.5rem max(0.45rem, env(safe-area-inset-bottom, 0));
  box-sizing: border-box;
  background: #ececec;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) *,
:is(#viewPassportCover, #viewIntro.passport-intro-view) *::before,
:is(#viewPassportCover, #viewIntro.passport-intro-view) *::after {
  box-sizing: border-box;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .ppc-page {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  width: 100%;
  max-width: min(28rem, 100%, var(--h5-content-max, 26.25rem));
  min-height: var(--ppc-page-min-h);
  margin: 0 auto;
  padding: calc(var(--pad-y) + env(safe-area-inset-top, 0)) calc(var(--pad-x) + env(safe-area-inset-right, 0))
    calc(clamp(0.65rem, 2.6vw, 0.95rem) + env(safe-area-inset-bottom, 0)) calc(var(--pad-x) + env(safe-area-inset-left, 0));
  overflow: hidden;
  box-sizing: border-box;
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: 22px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: clamp(0.2rem, 1.2vmin, 0.35rem);
  flex-shrink: 0;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .barcode-block {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 12rem;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .barcode-bars {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 2px;
  height: 1.75rem;
  margin-bottom: 0.2rem;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .barcode-bars span {
  display: block;
  flex-shrink: 0;
  align-self: stretch;
  background: currentColor;
  border-radius: 0;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .barcode-num {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  line-height: 1.2;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .rail-tl {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.3;
  margin-top: 0.2rem;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .rail-tl .sans-bit {
  font-family: inherit;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .rail-tr {
  flex-shrink: 0;
  text-align: right;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.3;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .rail-tr .rule {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid currentColor;
}

#viewPassportCover .hero-text {
  text-align: center;
  margin-top: clamp(0.28rem, 2vmin, 0.55rem);
  margin-bottom: var(--ppc-gap-hero-emblem);
  flex-shrink: 0;
}

#viewPassportCover .hero-text h1 {
  font-size: clamp(1.55rem, 7vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: clamp(0.22rem, 1.6vmin, 0.32rem);
}

#viewPassportCover .hero-en {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.82;
}

#viewPassportCover .motto {
  margin-top: clamp(0.22rem, 2vw, 0.38rem);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.75rem;
  line-height: 1.45;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

/* 条纹：SVG pattern + SMIL patternTransform，周期 3 用户单位，无 CSS translate 跳帧 */

#viewPassportCover .emblem-wrap {
  position: relative;
  width: var(--emblem);
  height: var(--emblem);
  max-width: 100%;
  margin: 0 auto;
  flex: 0 0 auto;
}

#viewPassportCover .emblem-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--ink);
  pointer-events: none;
  display: block;
}

#viewPassportCover .q-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

#viewPassportCover .q-cover-img {
  display: block;
  width: 56%;
  height: auto;
  max-height: 62%;
  max-width: 100%;
  flex-shrink: 0;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.08));
}

#viewPassportCover .ppc-cta-wrap {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex-shrink: 0;
  margin-top: var(--ppc-gap-emblem-cta);
  z-index: 3;
}

#viewPassportCover .ppc-cta {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  font-size: clamp(0.8rem, 3.4vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  white-space: normal;
  cursor: pointer;
}

#viewPassportCover .ppc-cta:active {
  opacity: 0.92;
  transform: scale(0.99);
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .bottom-rails {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex-shrink: 0;
  margin-top: var(--ppc-gap-cta-rails);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
}

/* 封面：底栏贴白卡底，中间留白随 min-height 均分 */
#viewPassportCover .bottom-rails {
  margin-top: auto;
  padding-top: var(--ppc-gap-cta-rails);
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .rail-bl .pipe {
  opacity: 0.55;
  margin-right: 0.15em;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view) .rail-br {
  text-align: right;
}

@media (min-width: 420px) {
  :is(#viewPassportCover, #viewIntro.passport-intro-view) {
    --pad-x: 1.35rem;
  }
}

/* 矮屏再压一圈，保证主按钮与底栏不重叠 */
@media (max-height: 700px) {
  #viewPassportCover {
    --emblem: min(52vw, min(28dvh, 9.5rem));
    --ppc-gap-hero-emblem: clamp(0.55rem, 3.2vmin, 0.95rem);
    --ppc-gap-emblem-cta: clamp(0.85rem, 4.2vmin, 1.45rem);
    --ppc-gap-cta-rails: clamp(0.72rem, 3.8vmin, 1.2rem);
  }

  #viewPassportCover .hero-text h1 {
    font-size: clamp(1.4rem, 6.5vw, 2rem);
  }

  :is(#viewPassportCover, #viewIntro.passport-intro-view) .bottom-rails {
    font-size: 9px;
  }
}

/* ---------- 起始页：护照白卡内嵌游乐场入口 ---------- */
#viewIntro.passport-intro-view .ppc-intro-toolbar {
  position: relative;
  z-index: 6;
  flex-shrink: 0;
  margin-bottom: 0.12rem;
  pointer-events: auto;
}

#viewIntro.passport-intro-view .ppc-back-passport {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.12em;
  padding: 0.45rem 0.55rem 0.45rem 0;
  margin: 0;
  min-height: 44px;
  min-width: 44px;
  border: none;
  background: transparent;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

#viewIntro.passport-intro-view .ppc-back-passport:active {
  opacity: 0.72;
}

#viewIntro.passport-intro-view .ppc-play-card {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  margin-top: clamp(0.2rem, 1.4vmin, 0.45rem);
  border-radius: clamp(14px, 3.5vw, 18px);
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 95% 70% at 18% 0%, rgba(255, 255, 255, 0.88) 0%, transparent 48%),
    radial-gradient(ellipse 80% 55% at 100% 100%, rgba(226, 232, 240, 0.65) 0%, transparent 42%),
    linear-gradient(165deg, #f8fafc 0%, #eef1f7 38%, #e2e8f0 72%, #d8dee9 100%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(148, 163, 184, 0.18);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#viewIntro.passport-intro-view.trm-root--dark .ppc-play-card {
  background:
    radial-gradient(ellipse 88% 58% at 22% 0%, rgba(140, 152, 168, 0.22) 0%, transparent 46%),
    linear-gradient(165deg, #3d434d 0%, #32373f 40%, #262a32 72%, #1c2026 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:is(#viewPassportCover, #viewIntro.passport-intro-view).trm-root--dark {
  background: #1a1a1f;
  --ink: rgba(244, 244, 245, 0.96);
  --paper: #26262c;
}

:is(#viewPassportCover, #viewIntro.passport-intro-view).trm-root--dark .ppc-page {
  background: var(--paper);
  border-color: color-mix(in srgb, var(--ink) 18%, transparent);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* 深浅模式仅在护照封面切换；与顶栏主题按钮同系 */
#viewPassportCover .ppc-theme-btn {
  position: absolute;
  top: calc(var(--pad-y) + env(safe-area-inset-top, 0px));
  right: calc(var(--pad-x) + env(safe-area-inset-right, 0px));
  z-index: 5;
  border: none;
  background: transparent;
  font-size: clamp(1.05rem, 4.2vw, 1.25rem);
  font-weight: 700;
  line-height: 1;
  color: rgba(10, 10, 10, 0.45);
  cursor: pointer;
  padding: 0.35rem;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#viewPassportCover.trm-root--dark .ppc-theme-btn {
  color: rgba(244, 244, 245, 0.55);
}
