/* ============================================================
   史册回响 · 羊皮纸海报 × 卡通人物卡
   ============================================================ */
:root {
  --parchment: #f3e6c8;
  --parchment-light: #f9f0dc;
  --parchment-deep: #e6d2a8;
  --parchment-edge: #c9a873;
  --ink: #3b2a1a;
  --ink-soft: #5e4630;
  --ink-muted: #8a6f50;
  --line: rgba(122, 86, 52, 0.28);
  --line-strong: #7a5634;
  --cinnabar: #b8463a;
  --cinnabar-bright: #cf5a4a;
  --blush: #e8a5a0;
  --gold: #c99a4a;
  --sage: #6f8f6a;
  --accent-era: #a8783e;
  --lucky-color: #b8463a;
  --card-color: #b8463a;
  --radius-large: 24px;
  --radius-medium: 16px;
  --shadow-soft: 0 10px 30px rgba(94, 70, 48, 0.16);
  --shadow-card: 0 18px 40px rgba(94, 70, 48, 0.25), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(255, 250, 235, 0.9), transparent 60%),
    radial-gradient(ellipse 60% 60% at 100% 100%, rgba(201, 168, 115, 0.45), transparent 60%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(232, 165, 160, 0.25), transparent 60%),
    var(--parchment);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }

button, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(184, 70, 58, 0.45); outline-offset: 3px; }

/* ============ 背景层 ============ */
.paper-texture {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.32 0 0 0 0 0.18 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.paper-texture::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 160px rgba(140, 100, 55, 0.35);
}
.ambient-canvas { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ============ 按钮 ============ */
.button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 28px; border-radius: 999px; border: 2px solid var(--line-strong);
  font-weight: 800; letter-spacing: 0.08em; cursor: pointer;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s, background 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.button:active { transform: translateY(2px) scale(0.98); }
.button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.button-primary {
  background: linear-gradient(180deg, var(--cinnabar-bright), var(--cinnabar));
  color: #fff6e6;
  box-shadow: 0 5px 0 #7d2c24, 0 12px 24px rgba(184, 70, 58, 0.3);
}
.button-primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 7px 0 #7d2c24, 0 16px 28px rgba(184, 70, 58, 0.35); }
.button-primary:not(:disabled):active { box-shadow: 0 2px 0 #7d2c24; }
.button-ghost { background: rgba(255, 250, 235, 0.75); color: var(--ink-soft); box-shadow: 0 4px 0 rgba(122, 86, 52, 0.35); }
.button-ghost:not(:disabled):hover { background: #fff8e8; transform: translateY(-2px); }
.button-large { min-height: 58px; padding: 0 36px; font-size: 1.08rem; }
.button-small { min-height: 44px; padding: 0 22px; font-size: 0.92rem; }

.icon-button {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line-strong);
  background: rgba(255, 250, 235, 0.8); font-size: 1rem; cursor: pointer; color: var(--ink-muted);
  transition: transform 0.2s var(--ease-bounce), background 0.2s;
}
.icon-button.is-on { background: var(--cinnabar); color: #fff; border-color: #7d2c24; }
.icon-button:hover { transform: rotate(-10deg) scale(1.05); }

/* ============ 访问验证：信封 ============ */
.access-gate {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at center, var(--parchment-light), var(--parchment-deep));
  transition: opacity 1s var(--ease-out);
}
.access-gate.is-opening { opacity: 0; pointer-events: none; }
.access-gate.is-opening .envelope-flap { transform: rotateX(180deg); }
.access-gate.is-opening .gate-card { transform: translateY(-40px) scale(1.04); }
.envelope { position: relative; width: min(420px, 100%); perspective: 900px; }
.envelope-flap {
  position: absolute; left: 6%; right: 6%; top: -38px; height: 76px; z-index: 0;
  background: linear-gradient(180deg, #d9bf8c, #c9a873);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  transform-origin: bottom center; transition: transform 0.8s var(--ease-out);
}
.gate-card {
  position: relative; z-index: 1; padding: 48px 30px 30px; text-align: center;
  background: var(--parchment-light); border: 2px solid var(--line-strong); border-radius: 20px;
  box-shadow: var(--shadow-card), 0 0 0 8px rgba(255, 250, 235, 0.5);
  transition: transform 0.9s var(--ease-out);
}
.gate-card.is-shaking { animation: shake 0.45s; }
.wax-seal {
  position: absolute; left: 50%; top: -34px; transform: translateX(-50%);
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #e0705f, var(--cinnabar) 60%, #7d2c24);
  box-shadow: 0 6px 14px rgba(125, 44, 36, 0.4), inset 0 -4px 8px rgba(0, 0, 0, 0.2);
}
.wax-seal span { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: #fde6d2; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.gate-card h1 { font-family: var(--font-display); font-size: 1.5rem; margin: 10px 0 8px; }
.gate-desc { color: var(--ink-muted); font-size: 0.92rem; line-height: 1.7; }
.gate-form { position: relative; display: grid; gap: 18px; margin-top: 24px; }
.code-slots { display: flex; justify-content: center; gap: 12px; cursor: text; }
.code-slots span {
  width: 56px; height: 64px; border-radius: 14px; border: 2px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.5); display: grid; place-items: center; transition: all 0.25s var(--ease-bounce);
}
.code-slots span.is-filled { border-style: solid; background: #fff8e8; transform: translateY(-4px); }
.code-slots span.is-filled::after { content: "✿"; color: var(--cinnabar); font-size: 1.4rem; animation: popIn 0.3s var(--ease-bounce); }
.gate-input { position: absolute; top: 0; left: 0; width: 100%; height: 64px; opacity: 0; font-size: 16px; }
.gate-error { min-height: 22px; margin-top: 14px; color: var(--cinnabar); font-size: 0.85rem; opacity: 0; transition: opacity 0.2s; }
.gate-error.is-visible { opacity: 1; }

/* ============ 外壳 ============ */
.app-shell { position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.is-locked .app-shell { visibility: hidden; }
.top-bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(243, 230, 200, 0.95), rgba(243, 230, 200, 0));
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; flex-shrink: 0; }
.brand-seal {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; transform: rotate(-6deg);
  background: var(--cinnabar); color: #fff1dc; font-family: var(--font-display); font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 240, 220, 0.5), 0 3px 0 #7d2c24;
}
.brand-text { font-family: var(--font-display); font-weight: 900; letter-spacing: 0.2em; }
.quiz-status { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.top-bar .icon-button { margin-left: auto; flex-shrink: 0; }
.volume-label { font-family: var(--font-display); font-weight: 800; font-size: 0.88rem; color: var(--accent-era); white-space: nowrap; transition: color 0.5s; }
.progress-track { position: relative; flex: 1; height: 10px; background: rgba(255, 250, 235, 0.8); border: 2px solid var(--line-strong); border-radius: 999px; }
.progress-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--accent-era), var(--accent-era) 6px, color-mix(in srgb, var(--accent-era) 75%, white) 6px, color-mix(in srgb, var(--accent-era) 75%, white) 12px); transition: width 0.5s var(--ease-out); }
.progress-quill { position: absolute; top: 50%; left: 0; transform: translate(-50%, -62%) rotate(-20deg); font-size: 1.2rem; transition: left 0.5s var(--ease-out); }
.progress-count { font-size: 0.85rem; font-weight: 700; color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.stage { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) calc(56px + var(--safe-bottom)); }
.screen.is-entering { animation: screenEnter 0.7s var(--ease-out) both; }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.25em; color: var(--cinnabar); margin-bottom: 14px; }
.disclaimer { margin-top: 28px; text-align: center; font-size: 0.78rem; color: var(--ink-muted); }

/* ============ 人物卡组件 ============ */
.figure-card { position: relative; width: 210px; aspect-ratio: 5 / 7.4; perspective: 1000px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.figure-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.7s var(--ease-out); }
.figure-card.is-flipped .figure-card-inner { transform: rotateY(180deg); }
.figure-card-front, .figure-card-back, .figure-card:not(:has(.figure-card-inner)) {
  border-radius: 18px; border: 3px solid var(--line-strong);
  background: linear-gradient(180deg, var(--parchment-light), var(--parchment-deep));
  box-shadow: var(--shadow-card);
}
.figure-card-front, .figure-card-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; overflow: hidden; }
.figure-card:not(:has(.figure-card-inner)) { display: flex; flex-direction: column; overflow: hidden; }
.figure-card-back { transform: rotateY(180deg); align-items: center; justify-content: center; padding: 20px; text-align: center; gap: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--card-color) 18%, var(--parchment-light)), var(--parchment-deep)); }
.figure-card-art {
  position: relative; flex: 1; margin: 10px 10px 0; border-radius: 12px; overflow: hidden; border: 2px solid var(--line);
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.7), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--card-color) 22%, var(--parchment-light)), var(--parchment-deep));
  display: grid; place-items: center;
}
.figure-card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity 0.5s; }
.figure-card-art.has-image img { opacity: 1; }
.figure-card-seal {
  font-family: var(--font-display); font-weight: 900; font-size: 4.2rem; color: color-mix(in srgb, var(--card-color) 70%, var(--ink));
  opacity: 0.55; transition: all 0.3s;
}
.figure-card-art.has-image .figure-card-seal {
  position: absolute; right: 8px; bottom: 8px; font-size: 1rem; width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--cinnabar); color: #fff1dc; border-radius: 6px; opacity: 1; transform: rotate(-6deg);
}
.figure-card-body { padding: 10px 12px 14px; text-align: center; display: flex; flex-direction: column; gap: 3px; align-items: center; }
.figure-card-name { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; }
.figure-card-meta { font-size: 0.72rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.figure-card-badge { margin-top: 4px; padding: 3px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; color: #fff6e6; background: var(--card-color); }
.figure-card-back-seal { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 12px; background: var(--card-color); color: #fff1dc; font-family: var(--font-display); font-weight: 900; font-size: 2rem; transform: rotate(-6deg); box-shadow: inset 0 0 0 3px rgba(255, 240, 220, 0.4); }
.figure-card-quote { font-family: var(--font-display); font-size: 1rem; line-height: 1.7; }
.figure-card-back small { color: var(--ink-muted); font-weight: 700; }
.figure-card.is-small { width: min(240px, 64vw); }

/* ============ 首页 ============ */
.intro-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); align-items: center; min-height: calc(100dvh - 120px); }
.intro-title { font-family: var(--font-display); font-weight: 900; line-height: 1.22; font-size: clamp(2.3rem, 6vw, 4.2rem); }
.intro-title em {
  position: relative; font-style: normal; color: var(--cinnabar); white-space: nowrap;
  background: linear-gradient(transparent 62%, rgba(232, 165, 160, 0.55) 62%);
}
.intro-desc { margin-top: 22px; font-size: clamp(0.95rem, 1.6vw, 1.06rem); line-height: 1.95; color: var(--ink-soft); max-width: 520px; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.intro-stats { display: flex; gap: 14px; margin-top: 36px; }
.intro-stats li { padding: 12px 18px; border: 2px dashed var(--line-strong); border-radius: 16px; background: rgba(255, 250, 235, 0.6); text-align: center; min-width: 88px; }
.intro-stats strong { display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--cinnabar); font-variant-numeric: tabular-nums; }
.intro-stats span { font-size: 0.78rem; color: var(--ink-muted); font-weight: 700; }

.card-fan { position: relative; height: 440px; display: grid; place-items: center; perspective: 1400px; --tilt-x: 0deg; --tilt-y: 0deg; }
.card-fan .fan-card {
  position: absolute; width: 190px;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateX(calc(var(--fan-index) * 58px)) translateY(calc(var(--fan-index) * var(--fan-index) * 6px)) rotate(calc(var(--fan-index) * 9deg));
  transition: transform 0.5s var(--ease-out), z-index 0s;
  z-index: calc(10 - var(--fan-index) * var(--fan-index));
  animation: fanFloat 5s ease-in-out infinite; animation-delay: calc(var(--fan-index) * 0.4s);
}
.card-fan:hover .fan-card { transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateX(calc(var(--fan-index) * 96px)) translateY(calc(var(--fan-index) * var(--fan-index) * 10px)) rotate(calc(var(--fan-index) * 13deg)); }
.card-fan .fan-card:hover { z-index: 20; transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateX(calc(var(--fan-index) * 96px)) translateY(-30px) rotate(calc(var(--fan-index) * 6deg)) scale(1.08); }

.home-section { margin-top: clamp(48px, 8vw, 96px); }
.section-heading { text-align: center; margin-bottom: 28px; }
.section-heading h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.6vw, 2.2rem); }
.section-heading p:not(.eyebrow) { margin-top: 8px; color: var(--ink-muted); }

.fortune-box { display: flex; justify-content: center; align-items: center; gap: clamp(20px, 5vw, 60px); flex-wrap: wrap; }
.fortune-tube {
  position: relative; width: 120px; height: 180px; border: 3px solid var(--line-strong); border-radius: 16px 16px 24px 24px; cursor: pointer;
  background: linear-gradient(90deg, #b5653f, #d48a5c 40%, #b5653f); box-shadow: var(--shadow-card);
  transform-origin: bottom center; -webkit-tap-highlight-color: transparent;
}
.fortune-tube:hover { transform: rotate(-4deg); }
.fortune-tube.is-shaking { animation: tubeShake 0.25s ease-in-out 4; }
.fortune-sticks { position: absolute; top: -48px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.fortune-sticks i { width: 10px; height: 70px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--cinnabar) 0 14px, #e8cf9e 14px); border: 1px solid var(--line-strong); }
.fortune-sticks i:nth-child(odd) { height: 60px; margin-top: 10px; }
.fortune-tube.is-shaking .fortune-sticks i:nth-child(3) { animation: stickPop 1s var(--ease-bounce) forwards; }
.fortune-tube-label { position: absolute; inset: auto 0 22px; font-family: var(--font-display); font-weight: 900; color: #fff1dc; font-size: 1.1rem; }
.fortune-slip {
  width: min(360px, 100%); padding: 26px 24px; text-align: center; border: 2px solid var(--line-strong); border-radius: 18px;
  background: linear-gradient(180deg, #fffaf0, var(--parchment-light)); box-shadow: var(--shadow-soft);
  border-top: 10px solid var(--fortune-color, var(--cinnabar)); transition: transform 0.5s var(--ease-bounce);
}
.fortune-slip.is-revealed { animation: slipIn 0.7s var(--ease-bounce); }
.fortune-level { display: inline-block; padding: 4px 14px; border-radius: 999px; background: var(--fortune-color, var(--cinnabar)); color: #fff6e6; font-weight: 800; font-size: 0.85rem; }
.fortune-name { display: block; margin-top: 12px; font-family: var(--font-display); font-size: 1.25rem; }
.fortune-text { margin-top: 10px; font-family: var(--font-display); color: var(--ink-soft); line-height: 1.7; }
.fortune-tip { margin-top: 12px; font-size: 0.85rem; color: var(--ink-muted); line-height: 1.7; }

.archetype-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 16px; overflow-x: auto; padding: 10px 4px 24px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.archetype-tile { scroll-snap-align: start; height: 230px; padding: 0; border: 0; background: none; perspective: 900px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.archetype-tile-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.6s var(--ease-out); }
.archetype-tile.is-flipped .archetype-tile-inner { transform: rotateY(180deg); }
.archetype-tile-front, .archetype-tile-back {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px;
  border: 2px solid var(--line-strong); border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tile-color) 14%, var(--parchment-light)), var(--parchment-light)); box-shadow: var(--shadow-soft);
}
.archetype-tile:hover .archetype-tile-front { transform: translateY(-4px); }
.archetype-tile-back { transform: rotateY(180deg); background: color-mix(in srgb, var(--tile-color) 22%, var(--parchment-light)); }
.archetype-icon { position: relative; width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; background: var(--tile-color); color: #fff1dc; font-family: var(--font-display); font-size: 1.8rem; font-weight: 900; box-shadow: inset 0 0 0 3px rgba(255, 240, 220, 0.4); overflow: hidden; }
.archetype-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.archetype-tile strong { font-family: var(--font-display); font-size: 1.2rem; }
.archetype-tile small { color: var(--ink-muted); font-weight: 700; }
.archetype-tile em { font-style: normal; font-size: 0.75rem; color: var(--ink-soft); }
.archetype-tile-back p { font-size: 0.85rem; line-height: 1.6; color: var(--ink-soft); }

.duo-card { display: flex; align-items: center; gap: 20px; max-width: 720px; margin: 0 auto; padding: 24px 28px; border: 2px dashed var(--cinnabar); border-radius: 22px; background: rgba(255, 245, 238, 0.7); }
.duo-icon { font-size: 2.6rem; }
.duo-card h2 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 6px; }
.duo-card p { color: var(--ink-soft); line-height: 1.7; }

/* ============ 好友邀请页 ============ */
.screen-invite { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 4vh; gap: 18px; }
.invite-title { font-family: var(--font-display); font-size: clamp(1.6rem, 5vw, 2.4rem); }
.invite-title span { color: var(--cinnabar); }
#inviteCard { --tilt-x: 0deg; --tilt-y: 0deg; transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); transition: transform 0.2s; animation: fanFloat 4s ease-in-out infinite; }
.invite-line { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink-soft); max-width: 420px; line-height: 1.7; }
.invite-actions { display: flex; flex-direction: column; gap: 12px; width: min(420px, 100%); }

/* ============ 人物方向 ============ */
.screen-preference { max-width: 820px; margin: 0 auto; padding-top: 5vh; text-align: center; }
.screen-title { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.4rem); }
.screen-desc { margin-top: 10px; color: var(--ink-muted); }
.preference-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.preference-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 16px 24px; cursor: pointer;
  background: var(--parchment-light); border: 2px solid var(--line-strong); border-radius: 22px; box-shadow: 0 6px 0 rgba(122, 86, 52, 0.3);
  transition: transform 0.25s var(--ease-bounce), box-shadow 0.25s, background 0.25s; -webkit-tap-highlight-color: transparent;
}
.preference-card:hover { transform: translateY(-4px) rotate(-1deg); }
.preference-card.is-selected { background: #fff1ea; border-color: var(--cinnabar); box-shadow: 0 6px 0 #7d2c24; transform: translateY(-4px); }
.preference-card.is-selected::after { content: "✓"; position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--cinnabar); color: #fff; font-weight: 900; animation: popIn 0.35s var(--ease-bounce); }
.preference-glyph { font-size: 2.4rem; }
.preference-card strong { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.preference-card small { display: block; margin-top: 6px; color: var(--ink-muted); font-size: 0.82rem; }
.screen-actions { display: flex; justify-content: center; gap: 14px; margin-top: 34px; }

/* ============ 答题卡 ============ */
.screen-question { padding-top: 1vh; }
.question-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: min(620px, calc(100dvh - 130px));
  background: var(--parchment-light); border: 3px solid var(--line-strong); border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 0 8px rgba(255, 250, 235, 0.45);
}
.question-card.is-turning-in { animation: cardTurnIn 0.6s var(--ease-out) both; }
.question-card.is-turning-out { animation: cardTurnOut 0.32s ease-in both; }
.scene-panel {
  position: relative; display: flex; flex-direction: column; padding: clamp(26px, 4vw, 48px); isolation: isolate;
  border-right: 2px dashed var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent-era) 14%, var(--parchment-light)), var(--parchment-light) 70%);
}
.scene-panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.8s;
  background: linear-gradient(180deg, rgba(249, 240, 220, 0.1) 0%, rgba(249, 240, 220, 0.85) 62%, var(--parchment-light) 100%), var(--scene-image, none) center top / cover no-repeat;
}
.question-card.has-scene-image .scene-panel::before { opacity: 1; }
.question-card.has-scene-image .scene-watermark { display: none; }
.scene-watermark {
  position: absolute; z-index: -1; right: -0.05em; top: 0.05em; pointer-events: none; user-select: none;
  font-family: var(--font-display); font-weight: 900; line-height: 1; font-size: clamp(10rem, 20vw, 15rem);
  color: color-mix(in srgb, var(--accent-era) 14%, transparent); opacity: 0;
}
.scene-watermark.is-visible { animation: watermarkIn 1.2s var(--ease-out) forwards; }
.scene-meta { display: flex; align-items: center; gap: 14px; }
.era-seal { padding: 8px 9px; writing-mode: vertical-rl; font-family: var(--font-display); font-weight: 900; letter-spacing: 0.15em; color: #fff1dc; background: var(--accent-era); border-radius: 8px; transform: rotate(-4deg); box-shadow: inset 0 0 0 2px rgba(255, 240, 220, 0.4), 0 3px 0 rgba(0, 0, 0, 0.15); transition: background 0.5s; }
.scene-meta-text { display: flex; flex-direction: column; gap: 4px; }
.question-number { font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; }
.question-category { display: inline-block; width: fit-content; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; color: var(--accent-era); border: 1.5px solid currentColor; }
.scene-lead { margin-top: auto; padding-top: 34px; font-size: 0.85rem; font-weight: 700; color: var(--ink-muted); letter-spacing: 0.1em; }
.scene-text { margin-top: 10px; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.65; min-height: 3.3em; text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; }
.scene-text.is-typing { cursor: pointer; }
.scene-text.is-typing::after { content: "✎"; margin-left: 6px; color: var(--accent-era); animation: caretBlink 0.8s steps(2) infinite; }
.prompt-text { margin-top: 18px; display: inline-block; padding: 10px 16px; border-radius: 14px; background: #fff; border: 2px solid var(--line-strong); font-size: clamp(1rem, 1.6vw, 1.1rem); font-weight: 800; position: relative; opacity: 0; transform: translateY(8px) scale(0.96); transition: all 0.45s var(--ease-bounce); width: fit-content; }
.prompt-text::before { content: ""; position: absolute; left: 22px; top: -9px; width: 14px; height: 14px; background: #fff; border-left: 2px solid var(--line-strong); border-top: 2px solid var(--line-strong); transform: rotate(45deg); }
.prompt-text.is-visible { opacity: 1; transform: none; }
.keyboard-hint { margin-top: 18px; font-size: 0.75rem; color: var(--ink-muted); }

.answer-panel { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: clamp(22px, 3.5vw, 42px); }
.answer-list { display: grid; gap: 12px; }
.answer-option {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; text-align: left; cursor: pointer;
  background: #fffaf0; border: 2px solid var(--line-strong); border-radius: 18px; box-shadow: 0 4px 0 rgba(122, 86, 52, 0.3);
  opacity: 0; transform: translateY(14px); transition: transform 0.3s var(--ease-bounce), opacity 0.3s, background 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.answer-list.is-revealed .answer-option { opacity: 1; transform: none; transition-delay: calc(var(--stagger-index) * 70ms); }
.answer-list.is-revealed .answer-option:hover { transform: translateY(-3px); background: #fff; transition-delay: 0s; }
.answer-key { flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; color: var(--accent-era); background: color-mix(in srgb, var(--accent-era) 14%, white); border: 2px solid color-mix(in srgb, var(--accent-era) 50%, transparent); transition: all 0.25s var(--ease-bounce); }
.answer-label { flex: 1; font-size: 1rem; line-height: 1.55; font-weight: 600; }
.answer-check { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--cinnabar); color: #fff; font-weight: 900; transform: scale(0); transition: transform 0.35s var(--ease-bounce); }
.answer-option.is-selected { background: #fff1ea; border-color: var(--cinnabar); box-shadow: 0 4px 0 #7d2c24; transform: translateY(-2px); }
.answer-option.is-selected .answer-key { background: var(--cinnabar); color: #fff; border-color: #7d2c24; transform: rotate(-8deg) scale(1.08); }
.answer-option.is-selected .answer-check { transform: scale(1); }
.answer-list.is-revealed .answer-option.is-dimmed { opacity: 0.5; }

.historian-note { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 0.92rem; color: var(--ink-soft); opacity: 0; transform: translateY(6px); transition: opacity 0.4s 0.1s, transform 0.4s 0.1s var(--ease-out); }
.historian-note.is-visible { opacity: 1; transform: none; }
.historian-note.is-static { transition-delay: 0s; }
.note-stamp { flex-shrink: 0; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 900; color: #fff6e6; background: var(--sage); }
.historian-note.is-visible:not(.is-static) .note-stamp { animation: popIn 0.45s var(--ease-bounce); }
.question-actions { display: flex; justify-content: space-between; gap: 12px; }

/* ============ 幕间过场 ============ */
.volume-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; cursor: pointer; background: radial-gradient(ellipse at center, var(--parchment-light), var(--parchment-deep)); animation: fadeIn 0.45s ease both; }
.volume-overlay::before { content: ""; position: absolute; inset: 24px; border: 3px double var(--line-strong); border-radius: 26px; pointer-events: none; }
.volume-overlay.is-leaving { animation: fadeOut 0.5s ease both; }
.volume-inner { text-align: center; padding: 24px; }
.volume-index { display: inline-block; padding: 6px 18px; border-radius: 999px; background: var(--cinnabar); color: #fff1dc; font-family: var(--font-display); font-weight: 900; letter-spacing: 0.25em; animation: popIn 0.6s 0.15s var(--ease-bounce) both; }
.volume-title { margin-top: 20px; font-family: var(--font-display); font-weight: 900; font-size: clamp(3.4rem, 13vw, 6.6rem); letter-spacing: 0.3em; padding-left: 0.3em; animation: inkReveal 1s 0.25s var(--ease-out) both; }
.volume-subtitle { margin-top: 14px; font-family: var(--font-display); font-size: clamp(1rem, 2vw, 1.2rem); color: var(--ink-soft); animation: fadeUp 0.7s 0.6s var(--ease-out) both; }
.volume-skip { display: block; margin-top: 40px; font-size: 0.78rem; color: var(--ink-muted); letter-spacing: 0.25em; animation: fadeIn 0.6s 1.1s both; }

/* ============ 揭晓 ============ */
.screen-reveal { min-height: calc(100dvh - 130px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.reveal-caption { font-family: var(--font-display); font-weight: 700; color: var(--ink-muted); }
.reveal-deck { position: relative; width: 170px; height: 240px; margin: 26px 0 16px; perspective: 1000px; }
.deck-card {
  position: absolute; inset: 0; border-radius: 16px; border: 3px solid var(--line-strong); display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, var(--parchment-deep) 0 10px, var(--parchment-light) 10px 20px); box-shadow: var(--shadow-card);
  transform: translateY(calc(var(--deck-index) * -3px)) rotate(calc((var(--deck-index) - 2) * 3deg));
}
.deck-card b { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 14px; background: var(--cinnabar); color: #fff1dc; font-family: var(--font-display); font-size: 2rem; transform: rotate(-6deg); }
.reveal-deck.is-shuffling .deck-card:nth-child(odd) { animation: shuffleLeft 0.36s ease-in-out infinite alternate; }
.reveal-deck.is-shuffling .deck-card:nth-child(even) { animation: shuffleRight 0.36s ease-in-out infinite alternate; }
.reveal-deck.is-revealed .deck-card:not(:last-child) { opacity: 0; transition: opacity 0.3s; }
.reveal-deck.is-revealed .deck-card:last-child { animation: revealPop 0.8s var(--ease-bounce) both; background: linear-gradient(180deg, #fffaf0, var(--parchment-deep)); }
.reveal-name { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.6rem, 10vw, 4.8rem); color: var(--ink-muted); }
.reveal-name.is-final { color: var(--ink); animation: inkReveal 0.9s var(--ease-out) both; }
.reveal-era { color: var(--cinnabar); font-weight: 800; min-height: 1.5em; }

/* ============ 结果 / 分享页 ============ */
.result-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.result-card-column { position: sticky; top: 72px; display: flex; flex-direction: column; align-items: center; }
.result-eyebrow { text-align: center; }

.flip-card { position: relative; width: 100%; max-width: 400px; aspect-ratio: 5 / 7.6; perspective: 1600px; cursor: pointer; --tilt-x: 0deg; --tilt-y: 0deg; --shine-x: 50%; --shine-y: 30%; -webkit-tap-highlight-color: transparent; outline: none; }
.flip-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); transition: transform 0.75s var(--ease-out); animation: cardDrop 1s var(--ease-bounce) both; }
.flip-card.is-flipped .flip-card-inner { transform: rotateX(var(--tilt-x)) rotateY(calc(180deg + var(--tilt-y))); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 24px; overflow: hidden; }
.flip-back { transform: rotateY(180deg); }
.flip-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--shine-x) var(--shine-y), rgba(255, 255, 255, 0.45), transparent 45%); mix-blend-mode: soft-light; }
.poster-frame {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; padding: 22px 22px 18px; text-align: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 252, 240, 0.95), transparent 70%),
    linear-gradient(180deg, var(--parchment-light), var(--parchment-deep));
  border: 4px solid var(--line-strong); border-radius: 24px;
  box-shadow: inset 0 0 0 6px var(--parchment-light), inset 0 0 0 8px var(--line), inset 0 0 60px rgba(140, 100, 55, 0.3), var(--shadow-card);
}
.poster-corner { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--lucky-color); border: 2px solid var(--line-strong); }
.poster-corner-tl { top: 12px; left: 12px; } .poster-corner-tr { top: 12px; right: 12px; }
.poster-corner-bl { bottom: 12px; left: 12px; } .poster-corner-br { bottom: 12px; right: 12px; }
.poster-frame::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0.2; background: var(--archetype-image, none) center / cover no-repeat; }
.poster-kicker { font-size: 0.72rem; font-weight: 900; letter-spacing: 0.25em; color: var(--ink-muted); }
.portrait-frame {
  position: relative; width: 78%; flex: 1; min-height: 0; margin-top: 12px; border-radius: 16px; overflow: hidden; border: 3px solid var(--line-strong);
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.8), transparent 60%), linear-gradient(180deg, color-mix(in srgb, var(--lucky-color) 25%, var(--parchment-light)), var(--parchment-deep));
  display: grid; place-items: center;
}
.portrait-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; transition: opacity 0.6s; }
.portrait-frame.has-image .portrait-image { opacity: 1; }
.hero-seal { font-family: var(--font-display); font-weight: 900; font-size: clamp(5rem, 14vw, 7.5rem); color: color-mix(in srgb, var(--lucky-color) 70%, var(--ink)); opacity: 0.5; }
.portrait-frame.has-image .hero-seal { position: absolute; right: 8px; bottom: 8px; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.4rem; background: var(--cinnabar); color: #fff1dc; border-radius: 8px; opacity: 1; transform: rotate(-6deg); }
.result-name { margin-top: 12px; font-family: var(--font-display); font-weight: 900; font-size: clamp(2.2rem, 5vw, 2.8rem); line-height: 1.1; }
.result-title { margin-top: 4px; font-size: 0.85rem; color: var(--ink-muted); font-weight: 700; }
.poster-ribbon { position: relative; margin-top: 10px; padding: 6px 24px; background: var(--lucky-color); color: #fff6e6; font-family: var(--font-display); font-weight: 900; font-size: 0.95rem; }
.poster-ribbon::before, .poster-ribbon::after { content: ""; position: absolute; top: 6px; width: 14px; height: 100%; background: color-mix(in srgb, var(--lucky-color) 70%, black); z-index: -1; }
.poster-ribbon::before { left: -10px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.poster-ribbon::after { right: -10px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
.poster-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 12px; }
.poster-stats div { padding: 8px 4px; border: 2px dashed var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.45); }
.poster-stats span { display: block; font-size: 0.7rem; color: var(--ink-muted); font-weight: 700; }
.poster-stats strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.poster-stats div:first-child strong { color: var(--cinnabar); }
.flip-hint { margin-top: 8px; font-size: 0.72rem; color: var(--ink-muted); animation: hintPulse 2s ease-in-out infinite; }
.flip-back .poster-frame { justify-content: center; gap: 16px; padding: 30px 26px; }
.result-quote { margin: 0; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.7; }
.tag-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tag { padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; color: var(--lucky-color); background: color-mix(in srgb, var(--lucky-color) 12%, white); border: 1.5px solid color-mix(in srgb, var(--lucky-color) 45%, transparent); }
.lucky-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.lucky-grid div { position: relative; padding: 12px 8px; border: 2px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.55); }
.lucky-grid span { display: block; font-size: 0.72rem; color: var(--ink-muted); font-weight: 700; }
.lucky-grid strong { font-family: var(--font-display); font-size: 1.05rem; }
.lucky-swatch { position: absolute; top: 8px; right: 8px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.gentle-line { font-family: var(--font-display); font-size: 1rem; color: var(--ink-soft); line-height: 1.7; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--lucky-color) 10%, transparent); }

.share-bar { width: 100%; max-width: 400px; margin-top: 18px; display: grid; gap: 12px; }
.nickname-field { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border: 2px solid var(--line-strong); border-radius: 999px; background: #fffaf0; }
.nickname-field span { font-size: 0.82rem; font-weight: 800; color: var(--ink-muted); white-space: nowrap; }
.nickname-field input { flex: 1; min-width: 0; height: 36px; border: 0; background: transparent; outline: none; font-size: 0.95rem; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-actions .button { padding: 0 12px; font-size: 0.9rem; }

.result-detail-column { display: grid; gap: 18px; min-width: 0; }
.result-section, .compatibility-card {
  padding: clamp(20px, 3vw, 30px); background: rgba(255, 250, 235, 0.85); border: 2px solid var(--line-strong); border-radius: var(--radius-large); box-shadow: 0 6px 0 rgba(122, 86, 52, 0.2);
  opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.result-section.is-inview, .compatibility-card.is-inview { opacity: 1; transform: none; }
.result-section h3 { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 16px; }
.result-section h3 span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--cinnabar); color: #fff1dc; font-size: 0.95rem; transform: rotate(-6deg); }
.result-section > p { line-height: 1.95; color: var(--ink-soft); }

.compatibility-card { background: linear-gradient(160deg, #fff1ea, var(--parchment-light)); border-color: var(--cinnabar); text-align: center; }
.compatibility-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 10px; }
.mini-card { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mini-card-seal { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 12px; background: var(--card-color); color: #fff1dc; font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; transform: rotate(-5deg); }
.mini-card strong { font-family: var(--font-display); }
.mini-card small { font-size: 0.75rem; color: var(--ink-muted); }
.compatibility-heart { position: relative; width: 120px; height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.compatibility-heart::before { content: "♥"; position: absolute; font-size: 120px; line-height: 1; color: rgba(232, 165, 160, 0.55); animation: heartBeat 1.4s ease-in-out infinite; }
.compatibility-heart strong { position: relative; font-family: var(--font-display); font-size: 1.8rem; color: var(--cinnabar); }
.compatibility-heart span { position: relative; font-size: 0.72rem; font-weight: 800; }
.compatibility-description { margin-top: 12px; color: var(--ink-soft); line-height: 1.8; }

.tab-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab-button { padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line-strong); background: #fffaf0; font-weight: 800; font-size: 0.9rem; cursor: pointer; transition: all 0.25s var(--ease-bounce); }
.tab-button:hover { transform: translateY(-2px); }
.tab-button.is-active { background: var(--lucky-color); color: #fff6e6; border-color: color-mix(in srgb, var(--lucky-color) 70%, black); }
.tab-panel { padding: 18px 20px; border-radius: 16px; background: #fff; border: 2px dashed var(--line); }
.tab-panel p { line-height: 1.95; color: var(--ink-soft); }
.tab-panel p.is-switching { animation: fadeUp 0.4s var(--ease-out); }

.radar-wrap { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 18px; align-items: center; }
.radar-chart { width: 100%; overflow: visible; }
.radar-ring { fill: none; stroke: var(--line); }
.radar-axis { stroke: var(--line); }
.radar-label { fill: var(--ink-soft); font-size: 12px; font-weight: 700; }
.radar-area { fill: color-mix(in srgb, var(--lucky-color) 35%, transparent); stroke: var(--lucky-color); stroke-width: 2.5; }
.result-section.is-inview .radar-area { animation: radarGrow 1.1s var(--ease-bounce) both; transform-origin: 160px 160px; }
.radar-dot { fill: var(--lucky-color); }
.dimension-list { display: grid; gap: 9px; }
.dimension-list li { display: grid; grid-template-columns: 4.6em 1fr 2em; align-items: center; gap: 10px; font-size: 0.86rem; font-weight: 700; }
.dimension-name { color: var(--ink-soft); }
.dimension-bar { height: 10px; border-radius: 999px; background: rgba(122, 86, 52, 0.12); overflow: hidden; }
.dimension-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--lucky-color) 60%, white), var(--lucky-color)); transition: width 1.1s var(--ease-out); }
.result-section.is-inview .dimension-bar i { width: var(--score); }
.dimension-list b { text-align: right; color: var(--lucky-color); }

.note-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.note { padding: 16px; border-radius: 16px; background: #fff; border: 2px solid var(--line); }
.note b { display: block; font-family: var(--font-display); margin-bottom: 8px; }
.note p { font-size: 0.9rem; line-height: 1.8; color: var(--ink-soft); }

.soulmate-card { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 18px; background: linear-gradient(120deg, #fff1ea, #fff); border: 2px solid var(--blush); }
.soulmate-seal { flex-shrink: 0; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 14px; background: var(--card-color); color: #fff1dc; font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; transform: rotate(-6deg); }
.soulmate-card small { font-size: 0.78rem; color: var(--ink-muted); font-weight: 700; }
.soulmate-card strong { display: block; font-family: var(--font-display); font-size: 1.3rem; }
.soulmate-card p { margin-top: 4px; font-size: 0.9rem; line-height: 1.7; color: var(--ink-soft); }
.kindred-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.kindred-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 2px solid var(--line); }
.kindred-seal { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--ink-soft); color: #fff1dc; font-family: var(--font-display); font-weight: 900; }
.kindred-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kindred-text strong { font-family: var(--font-display); }
.kindred-text small { font-size: 0.72rem; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kindred-item b { color: var(--cinnabar); }

.line-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.line-item { margin: 0; padding: 20px 16px; border-radius: 16px; font-family: var(--font-display); font-size: 1rem; line-height: 1.75; background: #fff; border: 2px solid var(--line); transform: rotate(-1deg); }
.line-item:nth-child(2) { transform: rotate(1deg); }
.result-actions { display: flex; justify-content: center; }

/* ============ 弹窗 / 提示 / 撒花 ============ */
.save-modal { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; padding: 20px; overflow: auto; background: rgba(59, 42, 26, 0.55); backdrop-filter: blur(4px); }
.save-modal-card { position: relative; width: min(520px, 100%); margin: auto; padding: 24px 20px 20px; background: var(--parchment-light); border: 3px solid var(--line-strong); border-radius: 22px; }
.save-modal-card h2 { font-family: var(--font-display); margin-bottom: 8px; }
.save-modal-card p { font-size: 0.88rem; line-height: 1.7; color: var(--ink-muted); margin-bottom: 14px; padding-right: 36px; }
.save-modal-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; font-size: 1.3rem; cursor: pointer; }
.save-preview { display: block; width: 100%; border-radius: 14px; -webkit-touch-callout: default; user-select: auto; }
.toast { position: fixed; left: 50%; bottom: calc(26px + var(--safe-bottom)); z-index: 70; width: max-content; max-width: min(540px, calc(100% - 32px)); padding: 12px 20px; border-radius: 16px; background: var(--ink); color: #fff4e2; font-size: 0.9rem; line-height: 1.7; text-align: center; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: all 0.3s var(--ease-bounce); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.confetti-layer { position: fixed; inset: 0; z-index: 65; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -30px; animation: confettiFall var(--fall-duration) var(--fall-delay) linear forwards; }
.sparkle { position: fixed; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--gold); animation: sparkleBurst 0.65s var(--ease-out) forwards; }

/* ============ 动画 ============ */
@keyframes screenEnter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes cardTurnIn { from { opacity: 0; transform: perspective(1400px) rotateY(-10deg) translateX(40px) rotate(1deg); } to { opacity: 1; transform: none; } }
@keyframes cardTurnOut { to { opacity: 0; transform: perspective(1400px) rotateY(10deg) translateX(-40px) rotate(-1deg); } }
@keyframes popIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes inkReveal { from { opacity: 0; filter: blur(10px); transform: scale(1.1); } to { opacity: 1; filter: none; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes caretBlink { 50% { opacity: 0; } }
@keyframes watermarkIn { from { opacity: 0; transform: translateY(14px) scale(0.95); } to { opacity: 1; transform: none; } }
@keyframes radarGrow { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px) rotate(-1deg); } 40%, 80% { transform: translateX(8px) rotate(1deg); } }
@keyframes fanFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes tubeShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes stickPop { 0% { transform: translateY(0); } 60% { transform: translateY(-50px); } 100% { transform: translateY(-36px); } }
@keyframes slipIn { from { opacity: 0; transform: translateY(30px) rotate(-4deg) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes shuffleLeft { to { transform: translateX(-60px) rotate(-12deg); } }
@keyframes shuffleRight { to { transform: translateX(60px) rotate(12deg); } }
@keyframes revealPop { 0% { transform: rotateY(180deg) scale(0.8); } 100% { transform: rotateY(0) scale(1.1); } }
@keyframes cardDrop { from { opacity: 0; transform: translateY(-60px) rotate(-8deg) scale(0.9); } to { opacity: 1; } }
@keyframes hintPulse { 50% { opacity: 0.4; } }
@keyframes heartBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
@keyframes confettiFall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--drift), 105vh) rotate(540deg); opacity: 0.7; } }
@keyframes sparkleBurst { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .result-layout { grid-template-columns: minmax(0, 1fr); }
  .result-card-column { position: static; }
  .radar-wrap { grid-template-columns: minmax(0, 1fr); }
  .radar-chart { max-width: 280px; margin: 0 auto; }
}

@media (max-width: 820px) {
  .intro-hero { grid-template-columns: minmax(0, 1fr); min-height: auto; padding-top: 2vh; text-align: center; }
  .intro-desc { margin-left: auto; margin-right: auto; }
  .intro-actions, .intro-stats { justify-content: center; }
  .card-fan { height: 340px; order: -1; }
  .card-fan .fan-card { width: 150px; transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateX(calc(var(--fan-index) * 44px)) translateY(calc(var(--fan-index) * var(--fan-index) * 5px)) rotate(calc(var(--fan-index) * 9deg)); }
  .card-fan:hover .fan-card { transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateX(calc(var(--fan-index) * 62px)) translateY(calc(var(--fan-index) * var(--fan-index) * 8px)) rotate(calc(var(--fan-index) * 12deg)); }
  .card-fan .fan-card:hover { transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateX(calc(var(--fan-index) * 62px)) translateY(-20px) scale(1.06); }
  .question-card { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .scene-panel { border-right: 0; border-bottom: 2px dashed var(--line); min-height: 250px; }
  .keyboard-hint { display: none; }
  .note-grid, .line-list { grid-template-columns: minmax(0, 1fr); }
  .line-item, .line-item:nth-child(2) { transform: none; }
}

@media (max-width: 600px) {
  .brand-text { display: none; }
  .top-bar { gap: 10px; }
  .volume-label { font-size: 0.76rem; }
  .intro-actions .button { flex: 1 1 100%; }
  .intro-stats li { min-width: 0; flex: 1; padding: 10px 6px; }
  .card-fan { height: 290px; }
  .card-fan .fan-card { width: 124px; }
  .figure-card-name { font-size: 1.05rem; }
  .figure-card-meta { font-size: 0.62rem; }
  .fortune-tube { width: 100px; height: 150px; }
  .duo-card { flex-direction: column; text-align: center; padding: 20px; }
  .preference-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 26px; }
  .preference-card { flex-direction: row; text-align: left; padding: 16px 18px; gap: 16px; }
  .screen-actions .button { flex: 1; }
  .question-card { border-radius: 22px; }
  .scene-panel { padding: 22px 18px; min-height: 230px; }
  .answer-panel { padding: 18px 14px 20px; }
  .answer-option { padding: 14px 12px; gap: 10px; }
  .answer-key { width: 32px; height: 32px; }
  .answer-label { font-size: 0.95rem; }
  .question-actions .button { flex: 1; }
  .flip-card { max-width: 340px; }
  .poster-frame { padding: 18px 16px 14px; }
  .share-actions { grid-template-columns: minmax(0, 1fr); }
  .compatibility-row { grid-template-columns: 1fr; }
  .compatibility-heart { margin: 0 auto; }
  .kindred-list { grid-template-columns: minmax(0, 1fr); }
  .volume-overlay::before { inset: 12px; }
}

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