:root {
  --paper: #fff;
  --ink: #151515;
  --muted: rgba(21, 21, 21, .52);
  --line: rgba(21, 21, 21, .13);
  --surface: rgba(21, 21, 21, .045);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Noto Sans SC", sans-serif;
}

:root[data-theme="dark"] {
  --paper: #141414;
  --ink: #ededed;
  --muted: rgba(237, 237, 237, .5);
  --line: rgba(237, 237, 237, .15);
  --surface: rgba(237, 237, 237, .065);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  width: min(100% - 40px, 920px);
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.brand {
  display: block;
  width: 122px;
  height: 32px;
  margin-right: -18px;
}

.logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.logo-on-dark,
:root[data-theme="dark"] .logo-on-light {
  display: none;
}

:root[data-theme="dark"] .logo-on-dark {
  display: block;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .02em;
  white-space: nowrap;
}

main {
  width: min(100% - 40px, 920px);
  margin: 0 auto;
  padding: 82px 0 54px;
}

.intro {
  max-width: 760px;
}

h1 {
  margin: 0;
  font-size: clamp(52px, 8vw, 82px);
  line-height: 1;
  letter-spacing: -.065em;
}

.intro-copy {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.quiz-section {
  margin-top: 78px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head span,
.coming-soon {
  color: var(--muted);
  font-size: 13px;
}

.quiz-card {
  display: block;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .04);
  transition: transform .2s ease, border-color .2s ease;
}

.quiz-card:hover {
  transform: translateY(-3px);
  border-color: var(--muted);
}

.card-meta,
.card-stats,
.card-content,
.card-footer,
.card-tags {
  display: flex;
  align-items: center;
}

.card-meta {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .09em;
}

.card-stats {
  flex: 0 0 auto;
  gap: 14px;
  white-space: nowrap;
}

.card-content {
  justify-content: space-between;
  gap: 24px;
  padding: 52px 0 48px;
}

.card-content h3 {
  margin: 0;
  min-width: 0;
  font-size: clamp(27px, 5.6vw, 58px);
  line-height: 1.02;
  letter-spacing: -.065em;
  white-space: nowrap;
}

.card-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 27px;
}

.card-footer {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.card-tags {
  width: 100%;
  flex-wrap: wrap;
  gap: 7px;
}

.card-tags span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.participant-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.coming-soon {
  margin: 22px 0 0;
  text-align: center;
}

.site-footer {
  width: min(100% - 40px, 920px);
  margin: 0 auto;
  padding: 22px 0 38px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

@media (max-width: 600px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, 920px);
  }

  .site-header {
    height: 68px;
  }

  .brand {
    width: 112px;
    height: 29px;
    margin-right: -17px;
  }

  .product-badge {
    min-height: 16px;
    padding-left: 8px;
    font-size: 12px;
  }

  main {
    padding-top: 58px;
  }

  .quiz-section {
    margin-top: 62px;
  }

  .quiz-card {
    padding: 22px;
    border-radius: 24px;
  }

  .card-content {
    padding: 42px 0 38px;
  }

  .card-arrow {
    width: 48px;
    height: 48px;
  }

  .card-footer {
    padding-top: 18px;
  }

  .card-meta {
    align-items: flex-start;
    gap: 12px;
  }

  .card-stats {
    gap: 8px;
    letter-spacing: .03em;
  }

  .card-tags {
    gap: 6px;
  }

  .card-tags span {
    padding: 6px 9px;
    font-size: 10px;
  }

  .participant-count {
    font-size: 11px;
  }

  .site-footer {
    padding: 20px 0 30px;
    flex-direction: column;
    justify-content: center;
  }

  .site-footer nav {
    gap: 16px;
  }
}

/* ── 在 App 的 WebView 里（?embed=app）──────────────────────────────────────
   App 自己已经有导航栏和返回手势，网页这边再放一遍 logo 页头、"返回全部测试"、
   "去 Popnota 看看" 就是重复入口（而且会把人踢出 App 去开浏览器）。全部收起来，
   只留测试本身。见 popnota-server/src/explore.ts 发的 ?embed=app。 */
:root[data-embed="app"] .site-header,
:root[data-embed="app"] .site-footer,
:root[data-embed="app"] .start-back-btn,
:root[data-embed="app"] .popnota-btn {
  display: none !important;
}
:root[data-embed="app"] .app-shell {
  min-height: 100svh;
  padding-top: calc(28px + env(safe-area-inset-top));
}
