/* R25 新年签/年度回顾 H5 · 13色板 + 5场景 + 揭晓动效 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.35s ease, color 0.35s ease;
  padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
body.showcase-back-active { padding-top: calc(44px + env(safe-area-inset-top, 0)); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; }

body[data-theme='hongjin'] { --primary:#C41E17; --accent:#FFD700; --bg:#1A0A0A; --bg-card:rgba(255,255,255,.08); --text:#FFF8F0; --text-light:rgba(255,248,240,.72); --border:rgba(255,215,0,.25); --hero-grad:linear-gradient(180deg,#1A0A0A,#3D0A0A); }
body[data-theme='jiangzi'] { --primary:#5B2C82; --accent:#E8D5F5; --bg:#0D0D1A; --bg-card:rgba(255,255,255,.07); --text:#F3E8FF; --text-light:rgba(232,213,245,.7); --border:rgba(232,213,245,.2); --hero-grad:linear-gradient(180deg,#0D0D1A,#5B2C82); }
body[data-theme='molv'] { --primary:#1B5E20; --accent:#A5D6A7; --bg:#0A0F0A; --bg-card:rgba(255,255,255,.07); --text:#E8F5E9; --text-light:rgba(165,214,167,.75); --border:rgba(165,214,167,.22); --hero-grad:linear-gradient(180deg,#0A0F0A,#1B5E20); }
body[data-theme='shenlan'] { --primary:#64B5F6; --accent:#0D2137; --bg:#060D14; --bg-card:rgba(255,255,255,.06); --text:#E3F2FD; --text-light:rgba(100,181,246,.75); --border:rgba(100,181,246,.22); --hero-grad:linear-gradient(180deg,#060D14,#0D2137); }
body[data-theme='chengjin'] { --primary:#E65100; --accent:#FFD54F; --bg:#1A0F05; --bg-card:rgba(255,255,255,.08); --text:#FFF8E1; --text-light:rgba(255,213,79,.75); --border:rgba(255,213,79,.25); --hero-grad:linear-gradient(180deg,#1A0F05,#E65100); }
body[data-theme='qianfen'] { --primary:#E91E63; --accent:#F8BBD0; --bg:#FFF0F5; --bg-card:#FFF; --text:#880E4F; --text-light:#AD1457; --border:#F8BBD0; --hero-grad:linear-gradient(180deg,#FFF0F5,#F8BBD0); }
body[data-theme='jijing'] { --primary:#212121; --accent:#F5F5F5; --bg:#FFFFFF; --bg-card:#FAFAFA; --text:#212121; --text-light:#757575; --border:#E0E0E0; --hero-grad:linear-gradient(180deg,#FAFAFA,#E0E0E0); }
body[data-theme='huopo'] { --primary:#7C4DFF; --accent:#00E676; --bg:#FFEB3B; --bg-card:#FFF; --text:#311B92; --text-light:#5E35B1; --border:#CE93D8; --hero-grad:linear-gradient(135deg,#7C4DFF,#00E676); }
body[data-theme='dihai'] { --primary:#42A5F5; --accent:#1A237E; --bg:#0D1130; --bg-card:rgba(255,255,255,.07); --text:#E8EAF6; --text-light:rgba(66,165,245,.8); --border:rgba(66,165,245,.25); --hero-grad:linear-gradient(180deg,#0D1130,#1A237E); }
body[data-theme='chamo'] { --primary:#3E2723; --accent:#BCAAA4; --bg:#EFEBE9; --bg-card:#FFFDF7; --text:#3E2723; --text-light:#795548; --border:#D7CCC8; --hero-grad:linear-gradient(180deg,#EFEBE9,#BCAAA4); }
body[data-theme='lvyi'] { --primary:#2E7D32; --accent:#C8E6C9; --bg:#F1F8E9; --bg-card:#FFF; --text:#1B5E20; --text-light:#388E3C; --border:#C8E6C9; --hero-grad:linear-gradient(180deg,#F1F8E9,#C8E6C9); }
body[data-theme='saibo'] { --primary:#00E5FF; --accent:#FF007F; --bg:#0A0A0A; --bg-card:rgba(255,255,255,.06); --text:#E0FFFF; --text-light:rgba(0,229,255,.75); --border:rgba(0,229,255,.3); --hero-grad:linear-gradient(135deg,#0A0A0A,#FF007F); }
body[data-theme='xingkong'] { --primary:#B39DDB; --accent:#311B92; --bg:#0A0A20; --bg-card:rgba(255,255,255,.07); --text:#EDE7F6; --text-light:rgba(179,157,219,.8); --border:rgba(179,157,219,.25); --hero-grad:linear-gradient(180deg,#0A0A20,#311B92); }

body[data-theme='qianfen'] .hero,
body[data-theme='jijing'] .hero,
body[data-theme='huopo'] .hero,
body[data-theme='chamo'] .hero,
body[data-theme='lvyi'] .hero { color: var(--text); }
body[data-theme='qianfen'] .hero__year,
body[data-theme='jijing'] .hero__year,
body[data-theme='huopo'] .hero__year,
body[data-theme='chamo'] .hero__year,
body[data-theme='lvyi'] .hero__year { text-shadow: 0 2px 24px rgba(0,0,0,.12); }

.particle-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

.section { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 2.5rem 1.25rem; }
.section__title { font-size: 1.35rem; text-align: center; margin-bottom: 1.25rem; color: var(--accent); letter-spacing: 0.08em; }

.hero {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: #fff; overflow: hidden;
}
.hero__grad {
  position: absolute; inset: 0;
  background: var(--hero-grad);
  opacity: 0.85;
}
.hero__content { position: relative; z-index: 2; padding: 2rem 1.5rem; animation: fadeUp .8s ease; }
.hero__year {
  font-size: clamp(3rem, 12vw, 5rem);
  font-weight: 900; letter-spacing: 0.12em;
  text-shadow: 0 0 40px var(--accent), 0 4px 20px rgba(0,0,0,.4);
  margin-bottom: .75rem;
}
.hero__subtitle { font-size: clamp(1rem, 4vw, 1.35rem); opacity: .92; margin-bottom: 2rem; }
.hero__scroll { display: inline-block; margin-top: 1.5rem; font-size: .85rem; opacity: .65; text-decoration: none; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.btn-draw {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 2rem; border-radius: 999px; font-size: 1.05rem; font-weight: 700;
  background: rgba(255,255,255,.12); backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255,255,255,.35); color: #fff;
  box-shadow: 0 0 24px rgba(255,215,0,.35);
  animation: pulseGlow 2s ease-in-out infinite;
  transition: transform .15s ease;
}
.btn-draw:active { transform: scale(0.96); }
@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 20px rgba(255,215,0,.3); }
  50% { box-shadow: 0 0 36px rgba(255,215,0,.55), 0 0 60px rgba(255,215,0,.2); }
}

.draw-section { text-align: center; }
.draw-modes { display: flex; flex-direction: column; gap: 1rem; align-items: center; max-width: 420px; margin: 0 auto; }
.draw-input-wrap { width: 100%; }
.draw-input {
  width: 100%; padding: .75rem 1rem; border-radius: .75rem;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 1rem; margin-bottom: .5rem;
}
.draw-input-hint { font-size: .78rem; color: var(--text-light); margin-bottom: .75rem; }
.shake-hint { font-size: 2.5rem; margin-bottom: .5rem; animation: shakeHint 1.2s ease-in-out infinite; }
@keyframes shakeHint { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.tube {
  width: 120px; height: 180px; margin: 0 auto 1rem;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 8px 8px 40px 40px;
  position: relative; cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.tube:hover { transform: scale(1.03); }
.tube__sticks {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 40px;
  background: repeating-linear-gradient(90deg, #DEB887 0 4px, #D2B48C 4px 8px);
  border-radius: 4px 4px 0 0;
}

.btn { display: inline-flex; align-items: center; justify-content: center; padding: .65rem 1.35rem; border-radius: 999px; font-weight: 600; font-size: .9rem; transition: transform .15s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; border: none; }
.btn-outline { border: 1.5px solid var(--primary); color: var(--primary); background: transparent; }

.result-section { text-align: center; opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .5s; }
.result-section.visible { opacity: 1; transform: translateY(0); }
.result-section.hidden { display: none; }
.result-keyword {
  font-size: clamp(2.5rem, 10vw, 4.5rem); font-weight: 800;
  margin: .5rem 0; line-height: 1.15;
}
.result-emoji { font-size: clamp(3rem, 12vw, 4rem); margin: .25rem 0; }
.result-tagline { font-size: clamp(1rem, 3.5vw, 1.25rem); color: var(--text-light); margin-bottom: 1.25rem; }
.result-card {
  text-align: left; padding: 1.5rem; border-radius: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  backdrop-filter: blur(10px); margin-bottom: 1.25rem;
  line-height: 1.75; font-size: .95rem;
}
.lucky-row { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-bottom: 1.5rem; }
.lucky-badge {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .85rem; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border); font-size: .82rem;
}
.lucky-badge__swatch { width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); }
.result-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

.pool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 640px) { .pool-grid { grid-template-columns: repeat(4, 1fr); } }
.pool-card {
  padding: 1rem .75rem; border-radius: .75rem; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s; cursor: default;
}
.pool-card:hover { transform: scale(1.05); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.pool-card__emoji { font-size: 1.75rem; margin-bottom: .35rem; }
.pool-card__kw { font-size: .9rem; font-weight: 700; }
.pool-cta { text-align: center; margin-top: 1rem; color: var(--text-light); font-size: .88rem; }

.brand-section {
  text-align: center; padding: 2rem 1.25rem;
  background: var(--bg-card); border-top: 1px solid var(--border);
}
.brand-logo { margin: 0 auto 1rem; max-width: 120px; opacity: .9; }
.brand-tagline { font-size: .85rem; color: var(--text-light); margin-bottom: 1rem; }

.site-footer {
  text-align: center; padding: 1.5rem 1rem 2rem;
  font-size: .78rem; color: var(--text-light);
  border-top: 1px solid var(--border);
}

/* 揭晓遮罩 */
.reveal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.75); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.reveal-overlay.active { opacity: 1; pointer-events: auto; }
.reveal-overlay.shake-screen { animation: screenShake .4s ease; }
@keyframes screenShake {
  0%,100% { transform: translate(0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
}
.flash-overlay {
  position: fixed; inset: 0; z-index: 101; background: #fff;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.flash-overlay.flash { opacity: .85; pointer-events: none; }

.suspense-box { text-align: center; color: #fff; }
.suspense-text { font-size: 1.1rem; margin-bottom: .5rem; }
.suspense-dots span { animation: dotBounce 1.2s infinite; display: inline-block; }
.suspense-dots span:nth-child(2) { animation-delay: .2s; }
.suspense-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBounce { 0%,80%,100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-8px); opacity: 1; } }

.reveal-stage { perspective: 1000px; width: min(90vw, 320px); min-height: 200px; display: flex; align-items: center; justify-content: center; }
.reveal-card {
  width: 100%; padding: 2rem 1.5rem; border-radius: 1rem;
  background: linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.25); color: #fff; text-align: center;
  transform-style: preserve-3d; position: relative;
}
.reveal-card.anim-flip { animation: cardFlip 2s ease forwards; }
@keyframes cardFlip {
  0% { transform: rotateY(0); }
  45% { transform: rotateY(90deg); }
  55% { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}
.reveal-card.anim-dissolve { animation: dissolve 2.2s ease forwards; }
@keyframes dissolve {
  0% { filter: blur(12px); opacity: 0; transform: scale(1.1); }
  60% { filter: blur(6px); opacity: .5; }
  100% { filter: blur(0); opacity: 1; transform: scale(1); }
}
.reveal-card.anim-scroll { animation: scrollUnroll 2.5s ease forwards; clip-path: inset(0 100% 0 0); }
@keyframes scrollUnroll { to { clip-path: inset(0 0 0 0); } }
.reveal-card.anim-converge { animation: convergePop .8s cubic-bezier(.34,1.56,.64,1) forwards; opacity: 0; transform: scale(0); }
@keyframes convergePop { to { opacity: 1; transform: scale(1); } }
.reveal-card.anim-slot { overflow: hidden; }
.slot-col { display: inline-block; height: 1.2em; overflow: hidden; vertical-align: bottom; margin: 0 1px; }
.slot-inner { animation: slotRoll 2s ease-out forwards; }
@keyframes slotRoll {
  0% { transform: translateY(0); }
  100% { transform: translateY(var(--slot-end, 0)); }
}

.reveal-kw { font-size: 2rem; font-weight: 800; margin-top: .5rem; }
.reveal-emoji { font-size: 3rem; }

/* 分享弹窗 */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.modal__box {
  position: relative; background: var(--bg); border-radius: 1rem;
  padding: 1.25rem; max-width: 400px; width: 100%; text-align: center;
  border: 1px solid var(--border); max-height: 90vh; overflow-y: auto;
}
.modal__close { position: absolute; top: .75rem; right: .75rem; font-size: 1.25rem; color: var(--text-light); }
.modal__title { font-weight: 700; margin-bottom: .75rem; }
.modal__preview { width: 100%; border-radius: .5rem; margin-bottom: .75rem; box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.modal__hint { font-size: .78rem; color: var(--text-light); }

.scene-panel, .theme-panel { position: fixed; z-index: 50; }
.scene-panel { bottom: calc(5.5rem + env(safe-area-inset-bottom)); left: 1rem; }
.theme-panel { bottom: calc(5.5rem + env(safe-area-inset-bottom)); right: 1rem; }
.scene-panel__toggle, .theme-panel__toggle {
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.15); font-size: 1.25rem;
}
.scene-panel__list, .theme-panel__list {
  position: absolute; bottom: calc(100% + .5rem); left: 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: .75rem;
  padding: .5rem; min-width: 10rem; max-height: 50vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.theme-panel__list { left: auto; right: 0; min-width: 8rem; }
.scene-panel__list button, .theme-panel__list button {
  display: block; width: 100%; text-align: left; padding: .45rem .65rem;
  border-radius: .4rem; font-size: .82rem; color: var(--text);
}
.scene-panel__list button:hover, .theme-panel__list button:hover,
.scene-panel__list button.active, .theme-panel__list button.active {
  background: var(--primary); color: #fff;
}

.back-top {
  position: fixed; bottom: calc(1rem + env(safe-area-inset-bottom)); right: 1rem;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); z-index: 40;
}
.back-top[hidden] { display: none; }

.contact-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom));
  background: rgba(0,0,0,.82); backdrop-filter: blur(8px); color: #fff;
  text-align: center;
}
.contact-footer__btns { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-bottom: .35rem; }
.contact-footer__cta { padding: .45rem 1rem; border-radius: 999px; background: var(--primary, #C41E17); color: #fff; text-decoration: none; font-size: .82rem; font-weight: 600; }
.contact-footer__btn { padding: .45rem .85rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); color: #fff; background: transparent; font-size: .82rem; text-decoration: none; }
.contact-footer__brand { font-size: .68rem; opacity: .65; }
html.has-contact-footer body { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }

@media (min-width: 1024px) {
  .particle-canvas { opacity: 1; }
}
