/* ════════════════════════════════════════════════════════════════════
   亲密人格测试（play-quiz.html）
   所有类名带 pq- 前缀，避免和 styles.css 的 .btn / .container 等互相覆盖。
   ════════════════════════════════════════════════════════════════════ */
.pq-page {
  --pq-bg: #fbf6f1;
  --pq-paper: #ffffff;
  --pq-ink: #2b2326;
  --pq-ink-2: #6b5c62;
  --pq-muted: #a0929a;
  --pq-line: #efe3df;
  --pq-accent: #d9536f;
  --pq-accent-soft: #fbe4ea;
  --p: #f6c38b; /* 当前人格主色，结果页由 JS 设置 */

  background: var(--pq-bg);
  color: var(--pq-ink);
  font-family: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.pq-app { max-width: 480px; margin: 0 auto; padding: 24px 18px 64px; min-height: 70vh; }
.pq-page h1, .pq-page h2, .pq-page h3 {
  font-family: "Noto Serif SC", "Songti SC", serif; line-height: 1.25; text-wrap: balance; margin: 0;
}
.pq-view { display: none; }
.pq-view.on { display: block; }
.pq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 20px; border-radius: 999px; border: 0; background: var(--pq-ink); color: #fff;
  font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, opacity .12s;
}
.pq-btn:hover { color: #fff; text-decoration: none; }
.pq-btn:active { transform: scale(.98); }
.pq-btn.ghost { background: transparent; color: var(--pq-ink); border: 1.5px solid var(--pq-line); }
.pq-btn.ghost:hover { color: var(--pq-ink); }
.pq-btn.accent { background: var(--pq-accent); }
.pq-btn:focus-visible { outline: 3px solid var(--pq-accent-soft); outline-offset: 2px; }
.pq-small { font-size: 13px; color: var(--pq-muted); }

/* ─── 入口 ─── */
.pq-hero { margin: 8px 0 26px; }
.pq-hero .kicker { font-size: 13px; color: var(--pq-accent); font-weight: 500; letter-spacing: .06em; margin-bottom: 10px; }
.pq-hero h1 { font-size: 36px; font-weight: 900; }
.pq-hero p { margin: 14px 0 0; color: var(--pq-ink-2); }
.pq-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0 26px; }
.pq-wall button {
  border: 0; background: var(--pq-paper); border-radius: 16px; padding: 14px 4px 10px; text-align: center;
  cursor: pointer; font: inherit; color: var(--pq-ink); box-shadow: 0 1px 0 var(--pq-line); transition: transform .12s;
}
.pq-wall button:active { transform: scale(.96); }
.pq-wall .ico { width: 44px; height: 44px; border-radius: 14px; margin: 0 auto 8px; display: grid; place-items: center; font-size: 24px; }
.pq-wall .nm { font-size: 12.5px; font-weight: 500; }
/* 人格插画：在各处的图标容器里铺满，稍微放大一点让角色出框 */
.pq-avatar { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.pq-wall .ico { width: 56px; height: 56px; border-radius: 16px; overflow: visible; }
.pq-wall .ico .pq-avatar { transform: scale(1.22) translateY(-4%); }
.pq-meta-row { display: flex; gap: 14px; font-size: 13px; color: var(--pq-muted); justify-content: center; margin: 14px 0 0; }

/* ─── 扫码 / 链接进来的提示、上次结果 ─── */
.pq-invite { margin: 0 0 18px; padding: 12px 14px; border-radius: 14px; background: var(--pq-accent-soft); color: var(--pq-ink); font-size: 14px; line-height: 1.6; border-left: 3px solid var(--pq-accent); }
.pq-link { color: var(--pq-accent); text-decoration: none; border-bottom: 1px dashed var(--pq-accent); }
.pq-link:hover { color: var(--pq-accent); }

/* ─── 你 × TA ─── */
.pq-pair-duo { display: grid; grid-template-columns: 1fr 40px 1fr; align-items: center; gap: 6px; margin-bottom: 12px; }
.pq-pair-duo .who { border-radius: 18px; padding: 14px 8px 10px; text-align: center; }
.pq-pair-duo .who .av { width: 84px; height: 84px; margin: 0 auto 6px; }
.pq-pair-duo .who b { display: block; font-size: 16px; font-weight: 700; }
.pq-pair-duo .who span { font-size: 12px; color: var(--pq-ink-2); }
.pq-pair-duo .x { text-align: center; font-family: "Noto Serif SC", serif; font-size: 26px; font-weight: 900; color: var(--pq-muted); }
.pq-pair-tier { font-size: 13.5px; color: var(--pq-ink-2); margin-bottom: 10px; }
.pq-pair-line { font-family: "Noto Serif SC", serif; font-size: 17px; font-weight: 600; line-height: 1.6; margin: 0 0 16px; }

/* ─── 卡片二维码开关 ─── */
.pq-toggle { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14.5px; font-weight: 500; cursor: pointer; user-select: none; }
.pq-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.pq-toggle .sw { width: 44px; height: 26px; border-radius: 13px; background: var(--pq-line); position: relative; transition: background .2s; flex: 0 0 44px; }
.pq-toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.pq-toggle input:checked + .sw { background: var(--pq-accent); }
.pq-toggle input:checked + .sw::after { transform: translateX(18px); }
.pq-toggle input:focus-visible + .sw { outline: 3px solid var(--pq-accent-soft); }

/* ─── 完成人数 + 分布面板 ─── */
.pq-social { margin: 26px 0 0; text-align: center; }
.pq-social-count { margin: 0; font-size: 13px; color: var(--pq-muted); }
.pq-social-count strong { color: var(--pq-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.pq-stats-toggle {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 4px 2px;
  background: none; border: 0; border-bottom: 1px dashed var(--pq-line); font: inherit; font-size: 13px;
  font-weight: 500; color: var(--pq-ink-2); cursor: pointer;
}
.pq-stats-toggle:hover { color: var(--pq-ink); border-bottom-color: var(--pq-muted); }
.pq-stats-toggle svg { width: 14px; height: 14px; transition: transform .25s ease; }
.pq-stats-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.pq-stats-panel { margin-top: 14px; padding: 16px 18px; border-radius: 18px; background: var(--pq-paper); text-align: left; }
.pq-stats-note { margin: 0 0 10px; font-size: 12px; color: var(--pq-muted); text-align: center; }
.pq-stats-item { display: grid; grid-template-columns: 84px 1fr 44px; align-items: center; gap: 10px; padding: 4px 0; font-size: 13.5px; }
.pq-stats-item .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pq-stats-item .tr { height: 8px; border-radius: 4px; background: var(--pq-bg); overflow: hidden; display: block; }
.pq-stats-item .tr i { display: block; height: 100%; border-radius: 4px; }
.pq-stats-item .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--pq-muted); font-size: 12.5px; }
.pq-stats-empty { margin: 6px 0; font-size: 13px; color: var(--pq-muted); text-align: center; }
.pq-stats-progress { margin: 4px 0 2px; }
.pq-stats-progress .track { height: 10px; border-radius: 5px; background: var(--pq-bg); overflow: hidden; }
.pq-stats-progress .track span { display: block; height: 100%; border-radius: 5px; background: var(--pq-accent); transition: width .6s ease; }
.pq-stats-progress .label { margin: 8px 0 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--pq-accent); font-variant-numeric: tabular-nums; }

/* ─── 答题 ─── */
.pq-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; font-size: 13px; color: var(--pq-muted); }
.pq-topbar button { background: none; border: 0; font: inherit; color: var(--pq-ink-2); cursor: pointer; padding: 6px 0; }
.pq-prog { height: 6px; background: var(--pq-line); border-radius: 3px; overflow: hidden; margin-bottom: 28px; }
.pq-prog i { display: block; height: 100%; width: 0; background: var(--pq-accent); border-radius: 3px; transition: width .3s ease; }
.pq-qnum { font-size: 12px; letter-spacing: .14em; color: var(--pq-accent); margin-bottom: 10px; }
.pq-qtext { font-size: 22px; font-weight: 700; margin-bottom: 24px; font-family: "Noto Serif SC", "Songti SC", serif; line-height: 1.35; }
.pq-opts { display: grid; gap: 12px; }
.pq-opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  background: var(--pq-paper); border: 1.5px solid var(--pq-line); border-radius: 18px; padding: 15px 16px;
  font: inherit; font-size: 15.5px; line-height: 1.55; color: var(--pq-ink); cursor: pointer;
  transition: border-color .12s, transform .12s, background .12s;
}
.pq-opt:hover { border-color: #dcc9cf; }
.pq-opt.picked { border-color: var(--pq-accent); background: var(--pq-accent-soft); }
.pq-opt:active { transform: scale(.985); }
.pq-opt .k { flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--pq-bg); display: grid; place-items: center; font-size: 12px; color: var(--pq-muted); font-weight: 500; margin-top: 2px; }
.pq-opt.picked .k { background: var(--pq-accent); color: #fff; }

/* ─── 结果 ─── */
.pq-rcard { background: var(--pq-paper); border-radius: 26px; overflow: hidden; box-shadow: 0 8px 30px rgba(60, 30, 40, .08); margin-bottom: 18px; }
.pq-rhead { background: var(--p); padding: 30px 24px 26px; position: relative; }
.pq-rhead .lab { font-size: 12px; letter-spacing: .16em; color: rgba(43, 35, 38, .65); margin-bottom: 10px; }
.pq-rhead h2 { font-size: 44px; font-weight: 900; letter-spacing: .02em; }
.pq-rhead .ico { position: absolute; right: 14px; top: 10px; width: 150px; height: 150px; font-size: 52px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .08)); }
.pq-rhead h2, .pq-rhead .tag, .pq-rhead .lab { position: relative; z-index: 1; max-width: calc(100% - 140px); }
.pq-rhead .tag { margin-top: 10px; font-size: 14.5px; color: rgba(43, 35, 38, .8); }
.pq-rbody { padding: 22px 24px 24px; }
.pq-kw { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pq-kw span { font-size: 13px; padding: 4px 12px; border-radius: 999px; background: var(--pq-bg); color: var(--pq-ink-2); }
.pq-quote { font-family: "Noto Serif SC", serif; font-size: 19px; font-weight: 600; line-height: 1.55; margin-bottom: 14px; }
.pq-desc { color: var(--pq-ink-2); font-size: 15px; margin-bottom: 16px; }
.pq-roast { font-size: 14px; color: var(--pq-ink-2); background: var(--pq-bg); border-radius: 14px; padding: 12px 14px; margin-bottom: 6px; }
.pq-roast b { color: var(--pq-ink); font-weight: 500; }
.pq-sec { background: var(--pq-paper); border-radius: 22px; padding: 20px 22px; margin-bottom: 16px; }
.pq-sec h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.pq-rank { display: grid; gap: 10px; }
.pq-rank .row { display: grid; grid-template-columns: 92px 1fr 44px; gap: 10px; align-items: center; font-size: 14px; }
.pq-rank .nm { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pq-rank .mini { width: 24px; height: 24px; flex: 0 0 24px; display: inline-grid; place-items: center; font-size: 16px; }
.pq-rank .bar { height: 8px; border-radius: 4px; background: var(--pq-bg); overflow: hidden; }
.pq-rank .bar i { display: block; height: 100%; border-radius: 4px; }
.pq-rank .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--pq-muted); font-size: 13px; }
.pq-pill { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; color: var(--pq-ink); font-weight: 500; margin-right: 4px; }
.pq-pairs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pq-pair { border-radius: 16px; padding: 12px 8px; text-align: center; font-size: 12.5px; color: var(--pq-ink-2); }
.pq-pair .ico { font-size: 26px; line-height: 1; margin: 0 auto 6px; width: 56px; height: 56px; }
.pq-pair b { display: block; color: var(--pq-ink); font-size: 14px; font-weight: 700; }
.pq-pair .why { font-size: 12px; color: var(--pq-muted); margin-top: 4px; line-height: 1.45; }
/* App 简介卡（整块可点） */
.pq-appcard { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--pq-ink); border: 1.5px solid transparent; transition: border-color .15s, transform .12s; }
.pq-appcard:hover { color: var(--pq-ink); text-decoration: none; border-color: var(--pq-accent); }
.pq-appcard:active { transform: scale(.99); }
.pq-appcard .logo { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 16px; object-fit: cover; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.pq-appcard b { display: block; font-size: 17px; font-weight: 700; font-family: "Noto Serif SC", serif; }
.pq-appcard p { margin: 4px 0 8px; font-size: 14px; color: var(--pq-ink-2); }
.pq-appcard .go { font-size: 14px; font-weight: 600; color: var(--pq-accent); }
.pq-opening { display: flex; gap: 14px; align-items: flex-start; }
.pq-opening .ico { flex: 0 0 48px; height: 48px; border-radius: 14px; background: var(--p); display: grid; place-items: center; font-size: 24px; }
.pq-opening b { display: block; font-size: 15px; }
.pq-opening p { margin: 2px 0 0; font-size: 14px; color: var(--pq-ink-2); }
.pq-actions { display: grid; gap: 10px; margin: 22px 0 10px; }
.pq-axes { display: grid; gap: 10px; }
.pq-axis { font-size: 12.5px; color: var(--pq-muted); }
.pq-axis .lbls { display: flex; justify-content: space-between; margin-bottom: 4px; }
.pq-axis .tr { height: 8px; border-radius: 4px; background: var(--pq-bg); position: relative; }
.pq-axis .tr i { position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--p); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); transform: translateX(-50%); }

/* ─── 弹层 ─── */
/* 居中弹窗。高度用 dvh：手机浏览器的地址栏会让 100vh 比实际可视区高，
   贴底 / 按 vh 算高度的弹层会被推出屏幕，文字看不到。 */
.pq-modal {
  position: fixed; inset: 0; height: 100vh; height: 100dvh;
  background: rgba(30, 20, 25, .55); display: none; align-items: center; justify-content: center;
  padding: 16px; z-index: 50; box-sizing: border-box;
}
.pq-modal.on { display: flex; }
.pq-sheet {
  background: var(--pq-paper); width: 100%; max-width: 440px; border-radius: 24px;
  padding: 18px 18px 22px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  box-shadow: 0 20px 60px rgba(30, 20, 25, .25);
}
.pq-sheet .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pq-sheet .hd h3 { font-size: 17px; }
.pq-sheet .x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--pq-muted); }
.pq-sheet img { width: 100%; border-radius: 14px; display: block; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.pq-sheet .hint { font-size: 13px; color: var(--pq-muted); margin: 12px 0; }
.pq-pdetail .top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.pq-pdetail .top .ico { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font-size: 30px; flex: 0 0 72px; }
.pq-pdetail .top .ico .pq-avatar { transform: scale(1.18); }
.pq-pdetail .top h3 { font-size: 24px; font-weight: 900; }
.pq-pdetail .top .tag { font-size: 13px; color: var(--pq-ink-2); }

@media (prefers-reduced-motion: reduce) { .pq-page * { transition: none !important; } }
