/* 传播 H5 站点唯一样式文件（PRD §5）。设计 token 用 CSS 变量，主题差异只改变量值 + 首页场景变体。 */

:root {
  --paper: #F6F1E7;
  --ink: #1D1D1B;
  --orange: #FF6A00;
  --green: #CDEB68;
  --html-bg: #D9D4CA;
  --line: 2px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--html-bg); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.app { width: 100%; max-width: 480px; min-height: 100svh; margin: 0 auto; background: var(--paper); position: relative; overflow: hidden; }
.screen { display: none; min-height: 100svh; padding: 24px 22px 32px; position: relative; }
.screen.active { display: block; }

/* ---- 首页 ---- */
.brandline { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.brandline .stamp { border: 1.5px solid var(--ink); padding: 3px 8px; white-space: nowrap; transform: rotate(3deg); background: #FFFDF7; }
.home { padding-top: 30px; }
.home h1 { font-size: clamp(50px, 14vw, 68px); line-height: 1.02; letter-spacing: -4px; margin: 40px 0 18px; font-weight: 950; }
.home h1 span { color: var(--orange); position: relative; display: inline-block; }
.home h1 span:after { content: ""; position: absolute; left: 2px; right: -2px; bottom: -6px; height: 8px; background: var(--green); z-index: -1; transform: rotate(-2deg); }
.subtitle { font-size: 18px; font-weight: 750; line-height: 1.55; margin: 0; max-width: 340px; }
.subtitle b { background: var(--green); padding: 0 4px; border-radius: 3px; }

.scene { height: 275px; margin: 16px -4px 4px; position: relative; }
.board { position: absolute; width: 252px; height: 210px; left: 50%; top: 34px; transform: translateX(-50%) rotate(-5deg); background: #E8B97C; border: var(--line); border-radius: 32px; box-shadow: 8px 8px 0 var(--ink); }
.board:before { content: ""; position: absolute; width: 48px; height: 24px; left: 100px; top: -17px; background: var(--paper); border: var(--line); border-radius: 20px; }
.scene[data-variant="seal"] .board { transform: translateX(-50%) rotate(5deg); background: #FFD2DB; border-radius: 24px; }
.scene[data-variant="seal"] .board:before { left: 96px; background: var(--green); }
.prop { position: absolute; left: 50%; top: 65px; transform: translateX(-50%) rotate(5deg); width: 128px; height: 142px; background: var(--green); border: var(--line); display: flex; align-items: center; justify-content: center; font-size: 66px; font-weight: 950; box-shadow: inset -12px -8px 0 rgba(29, 29, 27, .08); }
.scene[data-variant="onion"] .prop { border-radius: 54% 54% 48% 48%; }
.scene[data-variant="onion"] .prop:before, .scene[data-variant="onion"] .prop:after { content: ""; position: absolute; width: 18px; height: 52px; background: #6D9D45; border: var(--line); top: -39px; border-radius: 100% 0; }
.scene[data-variant="onion"] .prop:before { left: 43px; transform: rotate(-20deg); }
.scene[data-variant="onion"] .prop:after { right: 40px; transform: rotate(24deg) scaleX(-1); }
.scene[data-variant="seal"] .prop { transform: translateX(-50%) rotate(-4deg); border-radius: 28px; }
.tag { position: absolute; background: #FFFDF7; border: var(--line); box-shadow: 3px 3px 0 var(--ink); padding: 5px 13px; border-radius: 99px; font-weight: 900; font-size: 15px; z-index: 2; }
.tag-1 { left: 3px; top: 36px; transform: rotate(-11deg); }
.tag-2 { right: 0; top: 102px; transform: rotate(9deg); background: #FFD7C2; }
.tag-3 { left: 12px; bottom: 18px; transform: rotate(7deg); background: #E4DFFF; }

.home-actions { position: relative; z-index: 3; }
[hidden] { display: none !important; }
.participation { display: inline-flex; align-items: baseline; margin: 0 0 12px; padding: 4px 11px; border: 1.5px solid var(--ink); border-radius: 99px; background: #FFFDF7; font-size: 12px; font-weight: 800; box-shadow: 2px 2px 0 var(--ink); }
.participation strong { margin: 0 3px; color: var(--orange); font-size: 17px; font-weight: 950; font-variant-numeric: tabular-nums; }
.primary { width: 100%; border: var(--line); background: var(--orange); color: #fff; box-shadow: var(--shadow); border-radius: 15px; padding: 16px 18px; font-size: 19px; font-weight: 900; letter-spacing: .5px; transition: transform .12s, box-shadow .12s; }
.primary:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.primary.dark { background: var(--ink); box-shadow: 5px 5px 0 var(--orange); }
.microcopy { text-align: center; font-size: 12px; color: #736D64; margin: 14px 0 0; }

/* ---- 答题 ---- */
.quiz { padding-top: 22px; }
.quiz-top { display: flex; align-items: center; gap: 12px; }
.back { border: var(--line); background: #FFFDF7; width: 38px; height: 38px; border-radius: 50%; font-size: 22px; font-weight: 900; display: grid; place-items: center; padding: 0; }
.progress-track { height: 10px; border: 1.5px solid var(--ink); border-radius: 20px; flex: 1; background: #FFFDF7; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--orange); transition: width .25s; }
.count { font-size: 12px; font-weight: 900; min-width: 38px; text-align: right; }
.scene-label { display: inline-block; margin-top: 44px; padding: 4px 11px; background: var(--green); border: var(--line); font-size: 12px; font-weight: 900; transform: rotate(-2deg); }
.question { font-size: 29px; font-weight: 950; line-height: 1.35; letter-spacing: -.5px; margin: 18px 0 28px; min-height: 80px; }
.answers { display: grid; gap: 13px; }
.answer { width: 100%; text-align: left; background: #FFFDF7; border: var(--line); border-radius: 14px; padding: 16px 15px; display: flex; align-items: flex-start; gap: 12px; box-shadow: 3px 3px 0 var(--ink); font-weight: 700; line-height: 1.5; transition: transform .12s, background .12s; }
.answer:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); background: #FFF0E5; }
.answer.picked { background: var(--green); }
.letter { flex: 0 0 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 950; background: #fff; }
.quiz-note { position: absolute; left: 22px; right: 22px; bottom: max(24px, env(safe-area-inset-bottom)); font-size: 12px; color: #81796F; text-align: center; }

/* ---- 结果 ---- */
.result { padding: 0 0 36px; background: var(--result-bg, #CDEB68); }
.result-topbar { padding: 20px 20px 0; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 900; }
.result-topbar button { border: 1.5px solid var(--ink); background: rgba(255, 255, 255, .55); border-radius: 99px; padding: 5px 11px; font-size: 12px; font-weight: 800; }
.result-card { margin: 18px 14px 0; background: #FFFDF7; border: var(--line); border-radius: 24px; box-shadow: 7px 7px 0 var(--ink); overflow: hidden; }
.result-hero { padding: 27px 23px 23px; border-bottom: var(--line); position: relative; }
.result-kicker { font-size: 13px; font-weight: 900; letter-spacing: 1px; }
.result-level { display: inline-block; margin-top: 15px; padding: 5px 11px; background: var(--ink); color: #fff; border-radius: 6px; font-size: 14px; font-weight: 900; letter-spacing: .5px; transform: rotate(-1deg); }
.result-name { font-size: clamp(54px, 16vw, 74px); font-weight: 950; line-height: 1.08; letter-spacing: -3px; margin: 13px 0 14px; }
.result-tagline { font-size: 20px; font-weight: 850; line-height: 1.5; margin: 0; max-width: 320px; }
.result-percent { display: inline-flex; align-items: center; gap: 8px; margin-top: 15px; padding: 4px 10px; border: 1.5px solid var(--ink); border-radius: 99px; background: var(--result-bg, #CDEB68); font-size: 12px; font-weight: 850; transform: rotate(-1deg); }
.result-percent strong { font-size: 16px; font-weight: 950; }
.result-seal { position: absolute; right: 18px; top: 20px; width: 62px; height: 62px; border: var(--line); background: var(--result-bg, #CDEB68); border-radius: 50%; display: grid; place-items: center; font-size: 31px; font-weight: 950; transform: rotate(9deg); box-shadow: 3px 3px 0 var(--ink); }
.result-body { padding: 20px 22px 22px; }
.block { margin-bottom: 22px; }
.block:last-child { margin-bottom: 0; }
.block-title { font-size: 12px; letter-spacing: 1.2px; font-weight: 950; margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
.block-title:before { content: ""; width: 8px; height: 8px; background: var(--orange); border: 1px solid var(--ink); border-radius: 50%; }
.ingredients { display: flex; flex-wrap: wrap; gap: 7px; }
.ingredient { border: 1.5px solid var(--ink); background: var(--paper); border-radius: 99px; padding: 4px 10px; font-size: 13px; font-weight: 800; }
.evidence { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.evidence li { position: relative; padding-left: 19px; font-size: 15px; font-weight: 650; line-height: 1.55; }
.evidence li:before { content: ""; position: absolute; left: 1px; top: 8px; width: 8px; height: 8px; background: var(--result-bg, #CDEB68); border: 1.5px solid var(--ink); border-radius: 2px; transform: rotate(12deg); }
.plain-copy { font-size: 16px; font-weight: 700; line-height: 1.6; margin: 0; }
.usage { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 12px; padding: 12px 13px; font-size: 15px; font-weight: 750; }
.pair { display: flex; gap: 11px; align-items: center; }
.pair-badge { flex: 0 0 45px; height: 45px; background: var(--ink); color: #fff; display: grid; place-items: center; border-radius: 50%; font-size: 21px; font-weight: 950; }
.pair-text { font-size: 14px; line-height: 1.5; font-weight: 700; }
.pair-text b { font-size: 16px; }
.result-actions { padding: 23px 20px 0; display: grid; gap: 13px; }
.secondary { width: 100%; border: var(--line); background: #FFFDF7; border-radius: 14px; padding: 13px 16px; font-weight: 900; box-shadow: 3px 3px 0 var(--ink); }
.brand-card { margin: 22px 20px 0; padding: 17px; display: grid; grid-template-columns: 1fr 86px; gap: 12px 15px; align-items: center; background: #FFFDF7; border: var(--line); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); }
.brand-card-title { margin: 0 0 5px; font-size: 17px; font-weight: 950; }
.brand-card-copy { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.6; }
.brand-card-search { margin: 8px 0 0; font-size: 16px; font-weight: 950; }
.brand-card-qr { width: 86px; height: 86px; display: block; border: 1px solid var(--ink); }
.brand-card-qr-note { margin: 5px 0 0; text-align: center; font-size: 10px; color: #736D64; }
.brand-card-action { grid-column: 1 / -1; }
.brand-card-tip { grid-column: 1 / -1; margin: -3px 0 0; text-align: center; font-size: 11px; color: #736D64; }
.restart-link { display: block; margin: 18px auto 0; border: 0; background: none; padding: 6px 12px; font-size: 13px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.result-foot { text-align: center; font-size: 11px; color: rgba(29, 29, 27, .68); padding: 12px 24px 0; line-height: 1.6; }

/* ---- 弹框 ---- */
.modal { position: fixed; inset: 0; background: rgba(20, 20, 18, .82); z-index: 30; display: none; align-items: center; justify-content: center; padding: 22px; }
.modal.open { display: flex; }
.modal-panel { background: var(--paper); border: var(--line); border-radius: 20px; width: min(100%, 440px); max-height: 90svh; overflow: auto; padding: 20px; position: relative; box-shadow: 7px 7px 0 var(--orange); }
.modal-close { position: absolute; right: 13px; top: 12px; width: 34px; height: 34px; border: var(--line); border-radius: 50%; background: #FFFDF7; font-size: 19px; font-weight: 900; z-index: 2; }
.modal-title { font-size: 25px; font-weight: 950; margin: 0 40px 15px 0; }
.mystery-lead { font-size: 15px; font-weight: 700; line-height: 1.65; margin: 0 0 17px; color: #5D564E; }
.mystery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 17px; }
.mystery-item { aspect-ratio: 1; border: 1.5px solid var(--ink); border-radius: 13px; background: #FFFDF7; display: grid; place-items: center; position: relative; overflow: hidden; }
.mystery-item:nth-child(odd) { background: #F0EBD9; }
.mystery-seal { position: absolute; font-size: 45px; font-weight: 950; opacity: .12; transform: rotate(-10deg); }
.mystery-question { position: relative; font-size: 29px; font-weight: 950; }
.mystery-note { text-align: center; font-size: 12px; color: #736D64; margin: 0 0 15px; }
.mystery-back { display: block; margin: 14px auto 0; border: 0; background: none; padding: 5px 10px; font-size: 13px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.poster-wrap { width: min(100%, 340px); margin: 0 auto; }
.poster-image { display: block; width: 100%; border: var(--line); border-radius: 10px; background: #fff; -webkit-touch-callout: default; }
/* 微信里点「保存」时描边高亮，把注意力引到「长按存图」 */
.poster-image.hint { outline: 3px solid #D6392B; outline-offset: 3px; animation: poster-hint .9s ease-in-out 2; }
@keyframes poster-hint { 0%, 100% { transform: scale(1); } 50% { transform: scale(.985); } }
.poster-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.poster-actions button { padding: 11px 8px; font-size: 14px; }
.poster-tip { text-align: center; font-size: 12px; color: #6F685F; margin: 10px 0 0; }
.toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; border-radius: 99px; padding: 9px 16px; font-size: 13px; font-weight: 800; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-height: 720px) {
  .home h1 { margin-top: 25px; }
  .scene { height: 235px; }
  .board { transform: translateX(-50%) rotate(-5deg) scale(.86); transform-origin: center top; }
  .scene[data-variant="seal"] .board { transform: translateX(-50%) rotate(5deg) scale(.86); }
  .prop { top: 54px; }
  .tag-3 { bottom: 4px; }
  .question { font-size: 26px; margin-bottom: 20px; }
  .answer { padding: 13px; }
  .scene-label { margin-top: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- 独处鉴定所可选模块：见光指数 / 三选一（仅含 #exposure 或 confess 区块的主题生效） ---- */
.exposure { display: none; margin-top: 15px; padding: 8px 12px; border: 1.5px dashed var(--ink); border-radius: 10px; background: #FFFDF7; font-size: 13px; font-weight: 850; transform: rotate(-1deg); }
.exposure.show { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.exp-dots { letter-spacing: 2px; color: var(--orange); font-size: 15px; }
.exp-note { color: #5D564E; }
.confess { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 14px; padding: 14px; }
.confess-q { margin: 0 0 11px; font-size: 16px; font-weight: 900; }
.confess-options { display: grid; gap: 8px; }
.confess-opt { border: 1.5px solid var(--ink); background: #FFFDF7; border-radius: 99px; padding: 9px 13px; font-size: 14px; font-weight: 800; text-align: left; }
.confess-opt.picked { background: var(--green); }
.confess-reply { display: none; margin: 12px 0 0; font-size: 15px; font-weight: 850; line-height: 1.65; }
.confess-reply.show { display: block; }
.confess-share { display: block; margin-top: 7px; font-size: 13px; font-weight: 800; color: var(--orange); }

/* ---- 大便人格首页场景变体：瓷砖墙 + 一坨本尊，仅 variant="poop" 生效 ---- */
.scene[data-variant="poop"] .board {
  background: #E9F2F5;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 56px, rgba(43, 29, 20, .10) 56px 58px),
    repeating-linear-gradient(90deg, transparent 0 56px, rgba(43, 29, 20, .10) 56px 58px);
  border-radius: 22px;
  transform: translateX(-50%) rotate(-3deg);
}
.scene[data-variant="poop"] .board:before {
  left: 92px;
  width: 64px;
  height: 24px;
  background: #FFD84D;
  border-radius: 22px;
}
.scene[data-variant="poop"] .prop {
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 116px;
  line-height: 1;
  transform: translateX(-50%) rotate(-5deg);
  z-index: 3;
}
.scene[data-variant="poop"] .tag-2 { background: #FFE1A8; }
.scene[data-variant="poop"] .tag-3 { background: #FFF0C9; }

/* 图鉴结果为 9 款时整块切 3 列（3×3），其他数量（8/16）维持 4 列，不影响老主题 */
.mystery-grid[data-count="9"] { grid-template-columns: repeat(3, 1fr); }

@media (max-height: 720px) {
  .scene[data-variant="poop"] .board { transform: translateX(-50%) rotate(-3deg) scale(.86); transform-origin: center top; }
  .scene[data-variant="poop"] .prop { font-size: 96px; }
}


/* ---- 马桶封神榜：结果配图（仅带 #resultArt 容器并给结果配 art 的主题生效） ---- */
.result-art { display: none; width: min(100%, 300px); margin: 14px auto 0; border: var(--line); border-radius: 18px; background: #FFFDF7; box-shadow: 6px 6px 0 var(--ink); overflow: hidden; transform: rotate(-1deg); }
.result-art.show { display: block; }
.result-art img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }

.invite { background: #FFF4E4; border: 1.5px solid var(--ink); border-radius: 12px; padding: 12px 13px; }
.invite-note { margin: 0 0 10px; font-size: 14px; line-height: 1.55; font-weight: 650; opacity: .86; }
.invite-btn {
  display: block; width: 100%; padding: 11px 0;
  border: 0; border-radius: 999px; background: #B9541B; color: #FFF9F0;
  font: inherit; font-size: 15px; font-weight: 800; letter-spacing: .02em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.invite-btn:active { transform: scale(.98); }
.invite-text {
  display: none; margin-top: 10px; padding: 10px 11px;
  background: #fff; border: 1px dashed rgba(31, 26, 22, .38); border-radius: 10px;
  font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  user-select: text; -webkit-user-select: text;
}
.invite-text.show { display: block; }

/* ---- 马桶封神榜首页场景：奶油瓷砖墙 + 一尊金边马桶，仅 variant="throne" 生效 ---- */
.scene[data-variant="throne"] .board {
  background: #F3E7D2;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 56px, rgba(60, 40, 20, .09) 56px 58px),
    repeating-linear-gradient(90deg, transparent 0 56px, rgba(60, 40, 20, .09) 56px 58px);
  border-radius: 22px;
  transform: translateX(-50%) rotate(-3deg);
}
.scene[data-variant="throne"] .board:before { left: 92px; width: 64px; height: 24px; background: #FFD23F; border-radius: 22px; }
.scene[data-variant="throne"] .prop {
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 112px;
  line-height: 1;
  transform: translateX(-50%) rotate(-4deg);
  z-index: 3;
}
.scene[data-variant="throne"] .tag-2 { top: auto; bottom: 86px; right: -2px; background: #FFD9A8; }
.scene[data-variant="throne"] .tag-3 { background: #FFF0C9; }

@media (max-height: 720px) {
  .scene[data-variant="throne"] .board { transform: translateX(-50%) rotate(-3deg) scale(.86); transform-origin: center top; }
  .scene[data-variant="throne"] .prop { font-size: 92px; }
}
