﻿/* MBTI 反鉴定 —— 复古印刷 / riso 风格
   纸底、墨线、印章红、荧光黄；色板与「沙雕应用」落地页一致。 */

:root {
  --paper: #EFE7D6;
  --card: #FFFDF8;
  --ink: #161616;
  --yellow: #FFD23F;
  --red: #E23B2E;
  --muted: #6B6152;
  --display: "Arial Black", "Arial Narrow", Impact, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(22, 22, 22, .085) 1px, transparent 1.1px);
  background-size: 5px 5px;
  opacity: .55;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 20px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  animation: rise .3s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 通用件 ---------------- */

.btn {
  font-family: inherit;
  border: 2px solid var(--ink);
  cursor: pointer;
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  background: var(--ink);
  color: var(--paper);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .06em;
  box-shadow: 5px 5px 0 var(--red);
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn-primary:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--red); }

.btn-arrow { transition: transform .18s ease; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-plain {
  width: 100%;
  padding: 14px;
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 3px 3px 0 rgba(22, 22, 22, .18);
}

.btn-plain:active { transform: translate(2px, 2px); box-shadow: none; }

.btn-link {
  border: 0;
  background: none;
  padding: 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.btn-ghost {
  padding: 8px 18px;
  background: transparent;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.btn-ghost:active { transform: translate(2px, 2px); box-shadow: none; }

.tag {
  display: inline-block;
  border: 1.5px solid var(--ink);
  background: var(--card);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.4;
}

/* ---------------- 开场 ---------------- */

.screen-cover { gap: 0; }

.cover-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cover-title {
  position: relative;
  margin: 22px 0 0;
  text-align: center;
}

.cover-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .32em;
  text-indent: .34em;
  color: #3B342B;
}

.cover-word {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(56px, 19.5vw, 92px);
  font-weight: 900;
  line-height: .84;
  letter-spacing: -.045em;
  text-shadow: 4px 4px 0 var(--red);
  transform: scaleX(.98);
}

.cover-ribbon {
  display: inline-block;
  margin: 14px 0 0;
  padding: 7px 22px;
  background: var(--red);
  color: #FFF8E7;
  border: 2px solid var(--ink);
  font-family: var(--display);
  font-size: clamp(15px, 4.6vw, 19px);
  font-weight: 900;
  letter-spacing: .16em;
  text-indent: .16em;
  transform: rotate(-2.2deg);
  box-shadow: 3px 3px 0 var(--ink);
}

.cover-sticker {
  position: absolute;
  right: -6px;
  top: -12px;
  width: clamp(66px, 19vw, 88px);
  height: clamp(66px, 19vw, 88px);
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  transform: rotate(10deg);
  box-shadow: 3px 3px 0 var(--ink);
}

.cover-sticker::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(22, 22, 22, .45);
  border-radius: 50%;
}

.cover-lead {
  margin: 26px 0 0;
  font-size: 20px;
  line-height: 1.7;
  text-align: center;
  color: #2A2520;
  text-wrap: balance;
}

.cover-lead b {
  background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 94%, transparent 94%);
  padding: 0 2px;
  font-weight: 800;
}

.cover-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.cover-meta li {
  border: 1.5px solid var(--ink);
  background: var(--card);
  padding: 6px 13px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  color: #3B342B;
}

.cover-axis {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 34px 0 0;
}

.axis-chip {
  position: relative;
  padding: 7px 13px 8px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(22, 22, 22, .2);
  font-family: var(--display);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
  transform: rotate(-2deg);
}

.axis-chip:nth-child(2n) { transform: rotate(2deg); }

.axis-chip i {
  font-style: normal;
  color: #A79A80;
  margin: 0 2px;
}

.axis-chip::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 52%;
  height: 2.5px;
  background: var(--red);
  transform: rotate(-7deg);
}

.cover-axis-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #7A6F5A;
  letter-spacing: .04em;
}

.cover-why {
  max-width: 300px;
  margin: 32px auto 0;
  padding-left: 12px;
  border-left: 3px solid var(--red);
  text-align: left;
}

.why-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--red);
}

.cover-why p {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.75;
  color: #5D5344;
  text-wrap: balance;
}

.cover-actions {
  margin-top: auto;
  padding-top: 28px;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.cover-actions .btn-primary { margin-bottom: 2px; }

.cover-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: #857961;
  letter-spacing: .04em;
}

/* ---------------- 答题 ---------------- */

.screen-quiz { overflow: hidden; }

.quiz-top {
  display: grid;
  gap: 9px;
  padding-top: 4px;
}

.quiz-count {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--display);
}

.quiz-count b {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.quiz-count span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.quiz-bar {
  height: 9px;
  background: rgba(22, 22, 22, .1);
  border: 1.5px solid var(--ink);
  overflow: hidden;
}

.quiz-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width .26s cubic-bezier(.4, 0, .2, 1);
}

/* 题干固定带：牌怎么动，它都不动 */

.prompt-band {
  position: relative;
  z-index: 5;
  margin: 16px 0 10px;
  padding: 22px 18px 18px;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(22, 22, 22, .85);
}

.prompt-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 92px;
  height: 20px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 210, 63, .82);
  border: 1px dashed rgba(22, 22, 22, .3);
}

.prompt {
  margin: 0;
  font-size: clamp(18px, 4.9vw, 21px);
  line-height: 1.5;
  font-weight: 700;
  text-align: center;
  letter-spacing: .01em;
  text-wrap: balance;
}

/* 全宽选项带：一个框，拖到哪个方向才出哪条文本 */

.choice-band {
  position: relative;
  z-index: 6;
  height: 92px;
  display: grid;
  padding: 0;
  background: var(--paper);
}

.band-box {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 12px 14px;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(22, 22, 22, .16);
  transition: background .12s ease, box-shadow .12s ease;
}

.band-box.is-idle {
  justify-content: center;
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}

.band-box.is-on {
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
}

.band-stamp {
  flex: 0 0 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.band-box.is-idle .band-stamp {
  display: none;
}

.band-box.is-on .band-stamp {
  background: var(--red);
  color: #FFF8E7;
}

.band-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink);
}

.band-box.is-idle .band-text {
  font-size: 16px;
  font-weight: 600;
  color: #857961;
}

@keyframes stamp {
  0% { transform: scale(1); }
  45% { transform: scale(.965); }
  100% { transform: scale(1); }
}

/* 转轮 + 牌 */

.quiz-stage {
  flex: 1 1 auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 30px;
  min-height: 0;
  padding: 4px 0 0;
  touch-action: none;
}

.wheel {
  position: relative;
  display: grid;
  place-items: center;
  width: min(290px, calc(100vw - 48px));
  aspect-ratio: 1 / 1;
}

.wheel-ring-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.wheel-ring {
  position: relative;
  width: 84%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1.5px dashed rgba(22, 22, 22, .24);
  will-change: transform;
}

.wheel-ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px dotted rgba(22, 22, 22, .13);
}

/* 四个方向标记点：一个字母，够大够清楚 */

.mark {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(22, 22, 22, .22);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  pointer-events: none;
  transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
}

.mark-n { top: 0; left: 0; right: 0; margin: -21px auto 0; }
.mark-s { bottom: 0; left: 0; right: 0; margin: 0 auto -21px; }
.mark-w { left: 0; top: 50%; margin: -21px 0 0 -21px; }
.mark-e { right: 0; top: 50%; margin: -21px -21px 0 0; }

.mark.is-on {
  background: var(--yellow);
  transform: scale(1.14);
  box-shadow: 3px 3px 0 var(--ink);
}

/* 牌 */

.swipe-card {
  position: relative;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  width: 52%;
  aspect-ratio: 1 / 1;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 5px 6px 0 rgba(22, 22, 22, .22);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transition: background .16s ease, color .16s ease;
}

.swipe-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 253, 248, .32);
  pointer-events: none;
}

.swipe-card.is-on {
  background: var(--yellow);
  color: var(--ink);
}

.swipe-card.is-on::before { border-color: rgba(22, 22, 22, .3); }

.swipe-card.is-dragging { cursor: grabbing; }

.swipe-card.is-flying {
  transition: transform .26s cubic-bezier(.3, 0, .7, 1), opacity .26s ease;
  opacity: 0;
}

.card-seal {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  opacity: .8;
}

.card-word {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
}

.card-sub {
  font-size: 8.5px;
  letter-spacing: .24em;
  text-indent: .24em;
  opacity: .5;
}

/* 卡下手势提示 */

.swipe-hint { transition: opacity .2s ease; }

.swipe-hint.is-off { opacity: 0; }

.sh-gesture {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: sway 2.9s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: translateY(-5px); }
  50% { transform: translateY(5px); }
}

.sh-arrow {
  font-size: 12px;
  color: #857961;
  animation: blink 1.45s steps(2, end) infinite;
}

.sh-arrow.sh-d { animation-delay: .72s; }

@keyframes blink {
  0%, 49% { opacity: .2; }
  50%, 100% { opacity: 1; }
}

.sh-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  background: var(--card);
  font-size: 11.5px;
  font-weight: 700;
  color: #4A4238;
}

.sh-minicard {
  display: inline-block;
  width: 9px;
  height: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 1px;
  background: var(--yellow);
}

/* ---------------- 结果 ---------------- */

.screen-result {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 0;
}

.result-head { position: relative; }

.seal {
  display: inline-block;
  padding: 5px 11px;
  background: var(--red);
  color: #FFF8E7;
  border: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .22em;
  text-indent: .22em;
  transform: rotate(-4deg);
  box-shadow: 2px 2px 0 var(--ink);
}

.result-title {
  margin: 16px 0 6px;
  /* Japanese title is longer; keep it on one line instead of orphaning the last character */
  font-size: clamp(20px, 6.2vw, 26px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.result-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  text-wrap: balance;
}

.grid16 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 16px;
}

.g16 {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-content: center;
  gap: 1px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .01em;
  animation: pop .34s cubic-bezier(.2, 1.3, .4, 1) both;
}

.g16 small {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 8.5px;
  font-weight: 600;
  color: #8B7F6A;
  text-align: center;
  line-height: 1;
}

.g16.is-out {
  background: var(--ink);
  color: var(--paper);
}

.g16.is-out small { color: rgba(255, 253, 248, .5); }

.g16.is-out::after {
  content: "✕";
  position: absolute;
  top: 3px;
  right: 4px;
  color: var(--red);
  font-size: 11px;
  line-height: 1;
}

@keyframes pop {
  from { opacity: 0; transform: scale(.82); }
  to { opacity: 1; transform: none; }
}

.grid16-cap {
  margin: 9px 0 18px;
  font-size: 11px;
  line-height: 1.65;
  color: #857961;
}

.cards { display: grid; gap: 10px; }

.card {
  position: relative;
  padding: 13px 14px 12px 15px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-left: 8px solid var(--red);
  box-shadow: 3px 3px 0 rgba(22, 22, 22, .16);
  animation: rise .34s ease both;
}

.card-top {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.card-code {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1;
}

.card-name { font-size: 12px; color: var(--muted); font-weight: 600; }

.card-unlike {
  margin-left: auto;
  padding: 2px 7px;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-line {
  text-wrap: pretty;
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.68;
  color: #2A2520;
}

.card-punch {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px dashed rgba(22, 22, 22, .22);
  font-size: 12px;
  line-height: 1.65;
  color: #4A4238;
}

/* 彩蛋 */

.egg {
  position: relative;
  margin: 20px 0 4px;
  padding: 18px 16px 16px;
  border: 2px dashed var(--ink);
  background: rgba(255, 210, 63, .32);
  text-align: center;
}

.egg-seal {
  position: absolute;
  right: 12px;
  top: -13px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--red);
  color: #FFF8E7;
  font-size: 15px;
  font-weight: 900;
  transform: rotate(-12deg);
}

.egg-q { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .02em; }

.egg-hint { margin: 5px 0 11px; font-size: 12px; color: #6F6450; }

.egg-open { animation: rise .3s ease both; }

.egg-kicker {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: .26em;
  text-indent: .26em;
  color: #6F6450;
}

.egg-code {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .01em;
  text-shadow: 3px 3px 0 rgba(226, 59, 46, .55);
}

.egg-name { margin: 5px 0 0; font-size: 12.5px; color: #6F6450; font-weight: 600; }

/* 数据抽屉 */

.drawer {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1.5px solid rgba(22, 22, 22, .2);
}

.drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.drawer summary::-webkit-details-marker { display: none; }

.drawer summary::after { content: "＋"; font-size: 14px; }

.drawer[open] summary::after { content: "－"; }

.bars {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.bar-row {
  display: grid;
  grid-template-columns: 78px 1fr 34px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.bar-name { font-weight: 700; letter-spacing: .01em; white-space: nowrap; }

.bar-track {
  position: relative;
  height: 11px;
  background: rgba(22, 22, 22, .08);
  border: 1px solid rgba(22, 22, 22, .45);
}

.bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  background: var(--ink);
}

.bar-row.is-neg .bar-fill { background: var(--red); left: auto; right: 50%; }

.bar-val {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #4A4238;
}

.drawer-note {
  margin: 12px 0 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: #857961;
}

.result-actions {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.result-actions .btn-primary { font-size: 16px; padding: 14px; }

/* ---------------- 结算页广告 ----------------
   纸卡 + 3px 墨线，「广告」标签骑在上边框，样式对齐 dannmaku / city-purity-ads。
   槽高跟着素材走（50 / 100 / 250 都遇到过），不写死一个高度免得裁掉广告；
   没填充就整块不显示（.is-empty），别在页面底部留一个空框。 */

.result-ad {
  position: relative;
  flex-shrink: 0;
  margin: 22px 0 2px;
  padding: 10px;
  background: var(--card);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  border-radius: 3px;
}

.result-ad .ad-label {
  position: absolute;
  top: -12px;
  left: 10px;
  z-index: 1;
  padding: 1px 8px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--muted);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 2px;
}

.result-ad .ad-slot {
  min-height: 50px;
  overflow: visible; /* AdSense 塞进来的 iframe 不能被裁 */
}

/* AdSense 加载后会给 ins 写内联 height:0px / margin-left:-33px / width:390px，
   会把素材裁掉或顶出容器。这里用 !important 压过那些内联样式（它们不带 important）。 */
.result-ad .ad-slot .adsbygoogle {
  display: block;
  width: 100% !important;
  height: auto !important;
  min-height: 50px;
  max-width: 100%;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 auto !important;
}

.result-ad .ad-slot iframe {
  max-width: 100%;
  max-height: none !important;
  position: static !important;
  margin-left: 0 !important;
}

.result-ad.is-empty { display: none !important; }

.result-foot {
  margin: 18px 0 0;
  font-size: 10.5px;
  line-height: 1.85;
  color: #857961;
}

/* 海报预览：和纯度 / 依赖度同一套，先出图，再长按或下载 */

.shotview {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 8, .82);
  padding: 18px;
}

.shotview-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, .4);
  max-width: min(92vw, 420px);
  max-height: 92vh;
  overflow: hidden;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.shotview-cap {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.shotview-img-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}

.shotview-img {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--card);
  -webkit-touch-callout: default;
}

.shotview-wx-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  color: #fff;
  background: rgba(22, 22, 22, .78);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.shotview-tip {
  margin: 10px 4px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
}

.shotview-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.shotview-row .btn-plain {
  width: auto;
  padding: 10px 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translate(-50%, 12px);
  padding: 9px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  font-weight: 700;
  border: 2px solid var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 适配 ---------------- */

@media (min-width: 620px) {
  body { padding: 24px 0; }
  .app {
    min-height: calc(100dvh - 48px);
    border: 2px solid var(--ink);
    box-shadow: 8px 8px 0 rgba(22, 22, 22, .18);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
  }
  .screen-result { overflow-y: auto; }
}

/* 矮屏：封面先收一收，别把按钮顶出首屏 */
@media (max-height: 780px) {
  .cover-title { margin-top: 10px; }
  .cover-lead { margin-top: 16px; font-size: 18px; line-height: 1.65; }
  .cover-meta { margin-top: 12px; }
  .cover-axis { margin-top: 20px; }
  .cover-why { margin-top: 18px; }
  .cover-actions { padding-top: 16px; }
  .cover-note { margin-top: 8px; }
}

/* 更矮的屏：转轮和题干让位 */
@media (max-height: 660px) {
  .prompt-band { margin-top: 10px; padding: 18px 16px 15px; }
  .choice-band { height: 96px; }
  .quiz-stage { gap: 22px; }
  .wheel { width: min(250px, calc(100vw - 48px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
