* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg1: #140b24;
  --bg2: #2a1347;
  --gold: #f6c86b;
  --gold2: #ffe7a8;
  --pink: #ff5c8a;
  --ink: #f6f0fb;
  --muted: #a99bbd;
  --glass: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .1);
  --c: #ff5c8a;
  --ca: #ff5c8a33;
}

html, body {
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(120% 60% at 50% -10%, #4b1f6e 0%, transparent 60%),
    radial-gradient(80% 50% at 100% 100%, #3a1340 0%, transparent 60%),
    var(--bg1);
  background-attachment: fixed;
  min-height: 100vh;
}

.app { max-width: 440px; min-height: 100vh; margin: 0 auto; position: relative; z-index: 1; }

.screen { display: none; padding: 26px 20px 40px; min-height: 100vh; }
.screen.active { display: block; }

/* ---------- 背景漂浮花色 ---------- */
.bg-suits { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.bg-suits span {
  position: absolute; bottom: -40px; color: rgba(255,255,255,.07);
  animation: rise linear infinite;
}
@keyframes rise {
  from { transform: translateY(0) rotate(0); }
  to   { transform: translateY(-115vh) rotate(360deg); }
}
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }

/* ---------- 按钮 ---------- */
.btn {
  position: relative; overflow: hidden;
  display: block; width: 100%;
  border: none; border-radius: 999px;
  padding: 16px 0; font-size: 17px; font-weight: 800; letter-spacing: 1px;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.96); }
.btn span { position: relative; z-index: 1; }
.btn.primary {
  color: #2a1240;
  background: linear-gradient(135deg, var(--gold2), var(--gold) 45%, #ff9a6b);
  box-shadow: 0 10px 30px rgba(246, 200, 107, .35);
}
.btn.primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.7), transparent);
  transform: skewX(-20deg);
  animation: sweep 2.8s ease-in-out infinite;
}
@keyframes sweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(246,200,107,.35), 0 0 0 0 rgba(246,200,107,.5); }
  50%      { box-shadow: 0 10px 30px rgba(246,200,107,.35), 0 0 0 12px rgba(246,200,107,0); }
}
.btn.ghost { color: var(--ink); background: var(--glass); border: 1.5px solid var(--line); }
.btn.small { padding: 12px 0; font-size: 15px; }

/* ---------- 首页 ---------- */
#home { text-align: center; padding-top: 52px; }
.home-badge {
  display: inline-block; font-size: 11px; letter-spacing: 3px; color: var(--gold);
  border: 1px solid rgba(246,200,107,.4); border-radius: 999px; padding: 6px 14px;
  animation: drop .7s cubic-bezier(.2,1.4,.4,1) both;
}
.home-title {
  font-size: 44px; line-height: 1.2; margin-top: 18px; font-weight: 900;
  animation: drop .8s .1s cubic-bezier(.2,1.4,.4,1) both;
}
.gold {
  background: linear-gradient(90deg, var(--gold), #fff3cf, var(--gold), #ff9a6b, var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: goldflow 3s linear infinite;
}
@keyframes goldflow { to { background-position: -200% center; } }
.home-sub { color: var(--muted); margin-top: 12px; font-size: 15px; animation: drop .8s .2s both; }
@keyframes drop { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }

.fan { position: relative; height: 270px; margin: 30px auto 26px; }
.fan-card {
  position: absolute; left: 50%; bottom: 66px;
  width: 104px; height: 148px; margin-left: -52px;
  transform-origin: 50% 210%;
  border-radius: 14px;
  background: linear-gradient(160deg, #3d2363, #1c0e31);
  border: 1.5px solid rgba(255,255,255,.22);
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: fanIn .9s cubic-bezier(.2,1.3,.4,1) both;
}
.fan-card .em { width: 92px; height: 92px; object-fit: contain; animation: bob 2.4s ease-in-out infinite; animation-delay: inherit; }
.fan-card .nm { font-size: 12px; margin-top: 8px; color: var(--ink); font-weight: 700; }
.fan-card::before {
  content: attr(data-suit); position: absolute; top: 6px; left: 9px; font-size: 14px; opacity: .6;
}
@keyframes fanIn { from { transform: rotate(0) translateY(60px); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-7px) scale(1.05); } }

.home-note { color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ---------- 答题页 ---------- */
.quiz-top { display: flex; align-items: center; gap: 12px; }
.back {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--glass); font-size: 26px; line-height: 30px; color: var(--ink); cursor: pointer;
}
.back:disabled { opacity: .25; cursor: default; }
.progress { flex: 1; height: 8px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: visible; position: relative; }
.progress-bar {
  height: 100%; width: 0; border-radius: 99px; position: relative;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  transition: width .45s cubic-bezier(.3,1.3,.5,1);
  box-shadow: 0 0 12px rgba(246,200,107,.6);
}
.progress-bar::after {
  content: ''; position: absolute; right: -9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%; background: var(--gold);
  border: 3px dashed #fff; box-shadow: 0 0 10px rgba(246,200,107,.9);
}
.progress-text { font-size: 13px; color: var(--muted); width: 40px; text-align: right; }

.question-wrap { margin-top: 34px; }
.q-index {
  font-size: 64px; font-weight: 900; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px rgba(246,200,107,.55);
}
.slide .q-index { animation: popIn .5s cubic-bezier(.2,1.5,.4,1) both; }
.slide .q-text { animation: rightIn .45s .05s ease both; }
.slide .q-cards { animation: rightIn .45s ease both; }
.slide .option { animation: rightIn .45s ease both; }
.slide .option:nth-child(1) { animation-delay: .12s; }
.slide .option:nth-child(2) { animation-delay: .19s; }
.slide .option:nth-child(3) { animation-delay: .26s; }
.slide .option:nth-child(4) { animation-delay: .33s; }
@keyframes rightIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

.q-text { font-size: 21px; line-height: 1.55; margin: 12px 0 24px; font-weight: 800; }

.q-cards {
  display: flex; gap: 12px; justify-content: center;
  background: radial-gradient(ellipse at center, #2f9a6c, #17603f);
  border-radius: 18px; padding: 20px 0; margin-top: 14px;
  box-shadow: inset 0 0 0 3px rgba(246,200,107,.35), 0 10px 30px rgba(0,0,0,.3);
}
.q-cards:empty { display: none; }
.q-cards .pcard { animation: flipIn .6s cubic-bezier(.2,1.3,.4,1) both; }
.q-cards .pcard:nth-child(2) { animation-delay: .15s; }
@keyframes flipIn { from { transform: rotateY(90deg) translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  text-align: left; width: 100%;
  padding: 16px 18px; border-radius: 16px;
  background: var(--glass); border: 1.5px solid var(--line);
  font-size: 16px; color: var(--ink); line-height: 1.45;
  cursor: pointer; display: flex; gap: 12px; align-items: center;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .2s;
}
.option:hover { border-color: rgba(246,200,107,.5); }
.option:active { transform: scale(.97); }
.option.picked {
  border-color: var(--gold); background: rgba(246,200,107,.14);
  box-shadow: 0 0 0 4px rgba(246,200,107,.12), 0 0 24px rgba(246,200,107,.25);
  transform: scale(1.02);
}
.option .letter {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--gold); font-weight: 900; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed rgba(246,200,107,.4);
}
.option.picked .letter { background: var(--gold); color: #2a1240; border-color: #fff; animation: chipSpin .5s ease; }
@keyframes chipSpin { from { transform: rotateY(0) scale(1.4); } to { transform: rotateY(360deg) scale(1); } }

/* ---------- 扑克牌 ---------- */
.pcard {
  width: 64px; height: 90px; background: #fffdf8; border-radius: 9px;
  position: relative; box-shadow: 0 6px 14px rgba(0,0,0,.35);
  color: #1d1d1f; font-weight: 800; flex: none;
}
.pcard.red { color: #e0344f; }
.pcard .tl, .pcard .br { position: absolute; font-size: 16px; line-height: 1; text-align: center; }
.pcard .tl { top: 6px; left: 7px; }
.pcard .br { bottom: 6px; right: 7px; transform: rotate(180deg); }
.pcard small { display: block; font-size: 13px; }
.pcard .mid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 36px; }

/* ---------- 加载页 ---------- */
#loading { display: none; flex-direction: column; align-items: center; justify-content: center; }
#loading.active { display: flex; }
.deal { position: relative; width: 200px; height: 170px; }
.cback {
  position: absolute; left: 50%; top: 10px; width: 100px; height: 140px; margin-left: -50px;
  border-radius: 12px; border: 4px solid #fff;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 6px, transparent 6px 12px),
    linear-gradient(135deg, #b23a7a, #5b2a9b);
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.cback::after {
  content: '♠'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: rgba(255,255,255,.55);
}
.cback.d1 { animation: shuffle1 1.1s ease-in-out infinite; }
.cback.d2 { animation: shuffle2 1.1s ease-in-out infinite; }
.cback.d3 { animation: shuffle3 1.1s ease-in-out infinite; }
@keyframes shuffle1 { 0%,100% { transform: rotate(-12deg) translateX(-50px); } 50% { transform: rotate(0) translateX(0) translateY(-20px); z-index: 3; } }
@keyframes shuffle2 { 0%,100% { transform: translateY(-6px); } 50% { transform: rotate(10deg) translateX(50px); } }
@keyframes shuffle3 { 0%,100% { transform: rotate(12deg) translateX(50px); } 50% { transform: rotate(-10deg) translateX(-50px); } }
.loading-text { margin-top: 40px; font-size: 17px; font-weight: 700; color: var(--gold); min-height: 24px; }
.loading-bar { width: 200px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); margin-top: 18px; overflow: hidden; }
.loading-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--gold)); border-radius: 99px; }
#loading.active .loading-bar i { animation: load 2.6s ease-in-out forwards; }
@keyframes load { to { width: 100%; } }

/* ---------- 结果卡片 ---------- */
#result { padding-top: 18px; }
.frame {
  position: relative; border-radius: 26px; padding: 2px; overflow: hidden;
  background: var(--c);
  box-shadow: 0 0 40px var(--ca), 0 20px 50px rgba(0,0,0,.5);
}
.frame::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 200%; height: 200%;
  margin: -100% 0 0 -100%;
  background: conic-gradient(from 0deg, var(--c), var(--gold2), transparent 30%, var(--c) 50%, var(--gold) 70%, transparent 85%, var(--c));
  animation: spin 4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.share-card {
  position: relative; z-index: 1; overflow: hidden;
  border-radius: 24px; padding: 16px 18px 14px; text-align: center;
  background:
    radial-gradient(120% 50% at 50% 0%, var(--ca), transparent 70%),
    linear-gradient(180deg, #24123c, #160b28);
}
.shine {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.16) 45%, rgba(255,255,255,.04) 52%, transparent 60%);
  background-size: 300% 100%;
  animation: shine 4.5s ease-in-out 2.4s infinite;
  background-position: 150% 0;
}
@keyframes shine { 0% { background-position: 150% 0; } 45%, 100% { background-position: -60% 0; } }

.c-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.c-brand { color: var(--muted); letter-spacing: 1px; }
.c-rarity {
  font-weight: 900; font-style: italic; font-size: 13px; letter-spacing: 1px;
  padding: 2px 10px; border-radius: 6px; color: #2a1240;
  background: linear-gradient(135deg, var(--gold2), var(--gold), #ff9a6b);
  box-shadow: 0 0 14px rgba(246,200,107,.6);
}
.c-rarity.R { background: linear-gradient(135deg, #e5ecf6, #9fb3cf); box-shadow: 0 0 10px rgba(159,179,207,.5); }
.c-rarity.SR { background: linear-gradient(135deg, #f5d9ff, #c08bff); box-shadow: 0 0 12px rgba(192,139,255,.6); }

.r-head { font-size: 15px; color: var(--muted); margin-top: 10px; letter-spacing: 2px; }
.r-name {
  font-size: 48px; font-weight: 900; letter-spacing: 4px; line-height: 1.15; margin-top: 4px;
  color: #fff; text-shadow: 0 0 18px var(--c), 0 0 40px var(--ca), 0 3px 0 var(--c);
}
.r-name span { display: inline-block; }
.r-en { font-size: 13px; font-weight: 900; letter-spacing: 6px; color: var(--c); margin-top: 2px; }

.stage {
  position: relative; height: 240px; margin-top: 12px; border-radius: 18px; overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, #ffffff 0%, transparent 55%),
    linear-gradient(165deg, #fdf2f8, #f1e6f7 60%, #e9dcf3);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.6), 0 0 0 1px var(--ca);
}
.rays {
  position: absolute; left: 50%; top: 46%; width: 560px; height: 560px; margin: -280px 0 0 -280px;
  background: repeating-conic-gradient(from 0deg, var(--ca) 0 9deg, transparent 9deg 18deg); opacity: .55;
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 62%);
  mask: radial-gradient(circle, #000 10%, transparent 62%);
  animation: spin 24s linear infinite;
}
.aura {
  position: absolute; left: 50%; top: 44%; width: 150px; height: 150px; margin: -75px 0 0 -75px;
  border-radius: 50%; border: 2px solid var(--c); opacity: 0;
  animation: aura 2.6s ease-out infinite;
}
.aura.a2 { animation-delay: 1.3s; }
@keyframes aura { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.7); opacity: 0; } }

.sparkles i {
  position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 8px 3px var(--c);
  animation: twinkle 2s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1.2); } }

.felt {
  position: absolute; left: -10%; right: -10%; bottom: -70px; height: 120px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 20%, #2f9a6c, #145338);
  box-shadow: inset 0 0 0 4px rgba(246,200,107,.45), 0 -6px 30px rgba(0,0,0,.3);
}

.char-wrap { position: absolute; left: 50%; top: 4px; width: 250px; margin-left: -140px; height: 232px; }
.char {
  position: absolute; left: 0; right: 0; top: 0; text-align: center;
  height: 226px; transform-origin: 50% 90%;
  filter: drop-shadow(0 8px 10px rgba(80,40,90,.25));
}
.char img { display: inline-block; height: 226px; width: auto; max-width: 250px; object-fit: contain; }
.char-shadow {
  position: absolute; left: 50%; bottom: 0; width: 100px; height: 16px; margin-left: -50px;
  border-radius: 50%; background: rgba(60,30,70,.25); filter: blur(4px);
}
.char-fx span {
  position: absolute; font-size: 26px; opacity: 0; color: var(--c); font-weight: 900; font-style: italic;
  text-shadow: 0 2px 0 #fff, 0 0 8px #fff;
  animation: fxUp 2.4s ease-out infinite;
}
@keyframes fxUp {
  0% { opacity: 0; transform: translateY(10px) scale(.5); }
  20% { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-50px) scale(.9) rotate(15deg); }
}

.hand { position: absolute; right: 14px; bottom: 18px; display: flex; z-index: 3; }
.hand .pcard { width: 52px; height: 74px; }
.hand .pcard .mid { font-size: 28px; }
.hand .pcard .tl, .hand .pcard .br { font-size: 13px; }
.hand .pcard small { font-size: 11px; }
.hand .pcard:first-child { transform: rotate(-12deg) translateX(12px); }
.hand .pcard:last-child { transform: rotate(9deg); }

.chips { position: absolute; left: 22px; bottom: 16px; z-index: 3; display: flex; flex-direction: column-reverse; }
.chips i {
  display: block; width: 40px; height: 11px; border-radius: 50%; margin-top: -4px;
  background: #d64545; border: 2px dashed #fff; box-shadow: 0 2px 0 rgba(0,0,0,.3);
}
.chips i:nth-child(2) { background: #2b2b3b; }
.chips i:nth-child(3) { background: #7b3fc4; }
.chips i:nth-child(4) { background: var(--gold); }

.r-slogan {
  font-size: 23px; font-weight: 900; margin: 14px 0 10px; color: var(--gold2);
  text-shadow: 0 0 16px rgba(246,200,107,.45);
}
.r-slogan::before, .r-slogan::after { content: '“'; color: var(--c); margin-right: 4px; }
.r-slogan::after { content: '”'; margin: 0 0 0 4px; }

.r-tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.r-tags span {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px; font-weight: 700;
  color: #fff; background: var(--ca); border: 1px solid var(--c);
}

.r-dims { margin: 16px 2px 2px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.dim { font-size: 12px; }
.dim-labels { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 5px; }
.dim-labels b { color: #fff; }
.dim-track { height: 8px; background: rgba(255,255,255,.08); border-radius: 99px; position: relative; overflow: hidden; }
.dim-fill { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--c), var(--gold)); box-shadow: 0 0 10px var(--c); }
.dim-fill.rtl { background: linear-gradient(270deg, var(--c), var(--gold)); }

.c-foot {
  display: flex; justify-content: space-between; margin-top: 14px; padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,.14); font-size: 12px; color: var(--muted);
}
.c-foot b { color: #fff; }

/* ---------- 揭晓动画（.reveal 时触发） ---------- */
.reveal .frame { animation: cardFlip 1s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes cardFlip {
  0% { transform: perspective(900px) rotateY(180deg) scale(.6); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: perspective(900px) rotateY(0) scale(1); opacity: 1; }
}
.reveal .r-head { animation: fadeUp .5s .6s both; }
.reveal .r-name span { animation: nameDrop .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes nameDrop { from { opacity: 0; transform: translateY(-50px) scale(2) rotate(-10deg); } to { opacity: 1; transform: none; } }
.reveal .r-en { animation: tracking .8s 1.2s ease-out both; }
@keyframes tracking { from { letter-spacing: 20px; opacity: 0; } to { opacity: 1; } }
.reveal .stage { animation: fadeIn .6s .7s both; }
.reveal .char img { animation: charPop .9s 1s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes charPop {
  0% { transform: scale(0) rotate(-180deg); }
  100% { transform: scale(1) rotate(0); }
}
.reveal .hand .pcard { animation: dealIn .6s 1.5s cubic-bezier(.2,1.3,.4,1) both; }
.reveal .hand .pcard:last-child { animation-delay: 1.65s; }
@keyframes dealIn { from { opacity: 0; transform: translate(120px, -80px) rotate(90deg); } }
.reveal .chips i { animation: chipDrop .4s cubic-bezier(.3,1.6,.5,1) both; }
.reveal .chips i:nth-child(1) { animation-delay: 1.4s; }
.reveal .chips i:nth-child(2) { animation-delay: 1.5s; }
.reveal .chips i:nth-child(3) { animation-delay: 1.6s; }
.reveal .chips i:nth-child(4) { animation-delay: 1.7s; }
@keyframes chipDrop { from { opacity: 0; transform: translateY(-120px); } }
.reveal .r-slogan { animation: stamp .5s 1.8s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes stamp { from { opacity: 0; transform: scale(2.2); } to { opacity: 1; transform: none; } }
.reveal .r-tags span { animation: popIn .4s cubic-bezier(.2,1.6,.4,1) both; }
.reveal .r-tags span:nth-child(1) { animation-delay: 2s; }
.reveal .r-tags span:nth-child(2) { animation-delay: 2.1s; }
.reveal .r-tags span:nth-child(3) { animation-delay: 2.2s; }
.reveal .dim-fill { animation: grow 1s 2.2s cubic-bezier(.3,1.2,.5,1) both; }
@keyframes grow { from { width: 0; } }
.reveal .c-foot { animation: fadeUp .5s 2.5s both; }
.reveal .share-hint, .reveal .actions, .reveal .panel { animation: fadeUp .6s 2.6s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- 人格专属动作（揭晓后循环） ---------- */
.char.m-sly     { animation: sly 2.6s 2s ease-in-out infinite; }
.char.m-mad     { animation: mad 2.2s 2s ease-in-out infinite; }
.char.m-swim    { animation: swim 3s 2s ease-in-out infinite; }
.char.m-lock    { animation: lock 2.4s 2s ease-in-out infinite; }
.char.m-still   { animation: still 4s 2s ease-in-out infinite; }
.char.m-slither { animation: slither 2.4s 2s ease-in-out infinite; }
.char.m-tick    { animation: tick 1.6s 2s steps(1) infinite; }
.char.m-ring    { animation: ring 2s 2s ease-in-out infinite; }
@keyframes sly {
  0%, 100% { transform: rotate(0) translateY(0); }
  20% { transform: rotate(-10deg) translateY(-6px); }
  40% { transform: rotate(8deg) translateY(-2px); }
  55% { transform: rotate(8deg) translateY(-2px) scaleX(-1); }
  75% { transform: rotate(-4deg) translateY(-8px) scaleX(-1); }
  90% { transform: rotate(0) scaleX(1); }
}
@keyframes mad {
  0%, 60%, 100% { transform: translate(0) rotate(0) scale(1); }
  64% { transform: translate(-4px, 2px) rotate(-6deg) scale(1.08); }
  68% { transform: translate(4px, -2px) rotate(6deg) scale(1.1); }
  72% { transform: translate(-4px, 0) rotate(-6deg) scale(1.08); }
  76% { transform: translate(3px, 2px) rotate(4deg) scale(1.05); }
  30% { transform: translateY(-10px) scale(1.04); }
}
@keyframes swim {
  0%, 100% { transform: translateX(-16px) rotate(-6deg); }
  50% { transform: translateX(16px) rotate(6deg) translateY(-8px); }
}
@keyframes lock {
  0%, 100% { transform: scale(1); }
  10% { transform: scale(1.15) rotate(-4deg); }
  20% { transform: scale(1) rotate(0); }
  50% { transform: translateX(-10px); }
  70% { transform: translateX(10px); }
}
@keyframes still {
  0%, 80%, 100% { transform: rotate(0); }
  85% { transform: rotate(-3deg); }
  90% { transform: rotate(3deg); }
  95% { transform: rotate(0) translateY(-4px); }
}
@keyframes slither {
  0%, 100% { transform: skewX(0) translateY(0); }
  25% { transform: skewX(12deg) translateX(-8px); }
  50% { transform: skewX(0) translateY(-10px); }
  75% { transform: skewX(-12deg) translateX(8px); }
}
@keyframes tick {
  0% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-8px) rotate(-5deg); }
  50% { transform: translateY(0) rotate(0); }
  75% { transform: translateY(-8px) rotate(5deg); }
}
@keyframes ring {
  0%, 50%, 100% { transform: rotate(0) translateY(0); }
  5%, 15%, 25%, 35% { transform: rotate(-14deg) translateY(-4px); }
  10%, 20%, 30%, 40% { transform: rotate(14deg) translateY(-4px); }
}

/* 截图导出时关掉流光，保证画面干净 */
.exporting .shine, .exporting .aura, .exporting .char-fx, .exporting::before { display: none; }

/* ---------- 结果页其他区域 ---------- */
.share-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 14px; }
.actions { display: flex; gap: 12px; margin-bottom: 18px; }
.actions .btn { flex: 1; }

.panel {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; margin-bottom: 14px;
}
.panel h3 { font-size: 17px; margin-bottom: 10px; color: var(--gold); }
.panel p { font-size: 15px; line-height: 1.8; color: #e3d9ee; }
.kv { display: flex; gap: 10px; margin-top: 12px; font-size: 14px; line-height: 1.6; }
.kv b { flex: none; width: 64px; display: flex; align-items: center; gap: 4px; color: var(--gold2); }
.ic { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
.kv span { color: #d4c8e2; }

.relation { display: flex; gap: 12px; padding: 14px; }
.rel {
  flex: 1; border-radius: 14px; padding: 14px 10px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); transition: transform .15s;
}
.rel:active { transform: scale(.96); }
.rel .lbl { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 4px; }
.rel .em { display: block; width: 76px; height: 76px; object-fit: contain; margin: 4px auto 2px; animation: bob 2.4s ease-in-out infinite; }
.rel .nm { font-weight: 800; font-size: 15px; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.g-item {
  border-radius: 12px; padding: 10px 0 8px; text-align: center; cursor: pointer;
  border: 1.5px solid transparent; transition: transform .15s;
}
.g-item:hover { transform: translateY(-3px); }
.g-item.me { border-color: var(--gold); box-shadow: 0 0 14px rgba(246,200,107,.4); }
.g-item .em { display: block; width: 56px; height: 56px; object-fit: contain; margin: 0 auto; }
.g-item .nm { font-size: 12px; margin-top: 4px; font-weight: 700; }

/* ---------- 弹窗 ---------- */
.modal {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 4, 14, .82); align-items: center; justify-content: center; padding: 20px;
}
.modal.show { display: flex; animation: fadeIn .25s both; }
.modal-box { max-width: 400px; width: 100%; max-height: 92vh; display: flex; flex-direction: column; }
.modal-tip { color: #fff; text-align: center; margin-bottom: 12px; font-size: 15px; }
.modal-box img { width: 100%; border-radius: 18px; object-fit: contain; min-height: 0; flex: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
