:root {
  --bg: #0f0f23;
  --bg-2: #15163a;
  --primary: #7c3aed;
  --primary-soft: #a78bfa;
  --cta: #f43f5e;
  --cta-soft: #fb7185;
  --text: #e2e8f0;
  --muted: #9aa3c4;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(167, 139, 250, 0.25);
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
/* 让 hidden 属性不被其他 display 规则覆盖 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 700px at 80% -10%, #2a1b5e 0%, transparent 55%),
              radial-gradient(900px 600px at 0% 10%, #3b1d4f 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, .btn, .hero-eyebrow, .intro-badge, .countdown {
  font-family: 'Fredoka', 'Nunito', sans-serif;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---- 背景光斑（加漂移动画） ---- */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(72px); opacity: 0.45; }
.orb-1 { width: 360px; height: 360px; background: #7c3aed; top: -80px; right: -60px; animation: orb-drift-1 18s ease-in-out infinite; }
.orb-2 { width: 280px; height: 280px; background: #f43f5e; bottom: 10%; left: -80px; animation: orb-drift-2 22s ease-in-out infinite; }
.orb-3 { width: 220px; height: 220px; background: #22d3ee; top: 40%; right: 10%; opacity: 0.2; animation: orb-drift-3 16s ease-in-out infinite; }
@keyframes orb-drift-1 { 0%,100%{transform:translate(0,0)} 40%{transform:translate(-30px,20px)} 70%{transform:translate(20px,-15px)} }
@keyframes orb-drift-2 { 0%,100%{transform:translate(0,0)} 35%{transform:translate(25px,-20px)} 65%{transform:translate(-15px,30px)} }
@keyframes orb-drift-3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-20px,25px)} }

header, main, footer { position: relative; z-index: 1; }

/* ---- Hero ---- */
.hero { text-align: center; padding: 46px 0 18px; }
.hero-eyebrow {
  letter-spacing: 3px; font-size: 13px; color: var(--primary-soft);
  margin: 0 0 8px; text-transform: uppercase; font-weight: 600;
}
.hero-title {
  font-size: clamp(28px, 7vw, 44px); margin: 0; font-weight: 700;
  background: linear-gradient(92deg, #fff 0%, var(--primary-soft) 45%, var(--cta-soft) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(124, 58, 237, 0.35);
}
.hero-sub { color: var(--muted); margin: 10px 0 0; font-size: 15px; }

.window-banner {
  margin: 26px auto 0; max-width: 500px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(124,58,237,.18) 0%, rgba(244,63,94,.12) 100%);
  border: 1px solid rgba(167,139,250,.4);
  border-radius: var(--radius); padding: 18px 22px;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 12px 36px rgba(124,58,237,.2);
}
.window-state {
  font-size: 13px; font-weight: 700; padding: 4px 14px; border-radius: 999px;
  background: rgba(52, 211, 153, 0.18); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.45);
  letter-spacing: .5px;
}
.window-state.not_started { background: rgba(251,191,36,.18); color: var(--warn); border-color: rgba(251,191,36,.45); }
.window-state.ended       { background: rgba(244,63,94,.18);  color: var(--cta-soft); border-color: rgba(244,63,94,.45); }
.window-range {
  font-size: 13px; color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.05); padding: 3px 12px; border-radius: 6px;
  letter-spacing: .3px;
}
.countdown {
  font-size: 28px; font-weight: 700; letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 20px rgba(167,139,250,.6);
}
.countdown b { color: var(--primary-soft); }

/* ---- 卡片通用 ---- */
.card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 20px; margin: 0;
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
}

/* 所有直接在 intro-screen / result-screen 内的子块统一间距 */
#intro-screen,
#result-screen {
  display: flex; flex-direction: column; gap: 14px;
  padding-top: 14px; padding-bottom: 6px;
}
/* activity-grid 本身是两列，不需要被 flex gap 覆盖 */
#intro-screen > .activity-grid { margin: 0; }
.card-tag {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--primary-soft);
  background: rgba(124, 58, 237, 0.16); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}

/* ---- 公告 ---- */
.announcement-body { font-size: 14px; color: var(--text); word-break: break-word; }
.announcement-body :is(img) { max-width: 100%; height: auto; }
.announcement-body a { color: var(--primary-soft); }

/* ---- 活动概览 ---- */
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; }
.activity-intro {
  margin: 0; padding: 0; overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.activity-intro:hover {
  transform: translateY(-5px);
  border-color: rgba(167,139,250,.55);
  box-shadow: 0 28px 64px rgba(124,58,237,.3);
}

/* 卡片视觉头部 */
.intro-visual {
  position: relative; overflow: hidden;
  height: 128px; display: flex; align-items: center; justify-content: space-around;
  padding: 0 18px;
}
.vis-purple {
  background: linear-gradient(135deg, rgba(124,58,237,.45) 0%, rgba(167,139,250,.12) 100%);
  border-bottom: 1px solid rgba(167,139,250,.2);
}
.vis-rose {
  background: linear-gradient(135deg, rgba(244,63,94,.4) 0%, rgba(251,113,133,.1) 100%);
  border-bottom: 1px solid rgba(244,63,94,.2);
}

/* 礼盒浮动动画 */
.vis-gift { animation: float-gift 3.2s ease-in-out infinite; filter: drop-shadow(0 6px 16px rgba(167,139,250,.5)); }
@keyframes float-gift {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-10px) rotate(2deg); }
}

/* 迷你转盘 */
.mini-wheel-container { position: relative; width: 86px; height: 86px; flex-shrink: 0; }
.mini-wheel {
  width: 86px; height: 86px; border-radius: 50%;
  background: conic-gradient(
    #7c3aed 0% 10%, #f43f5e 10% 20%, #8b5cf6 20% 30%, #fb7185 30% 40%,
    #7c3aed 40% 50%, #f43f5e 50% 60%, #8b5cf6 60% 70%, #fb7185 70% 80%,
    #a855f7 80% 90%, #ec4899 90% 100%
  );
  animation: mini-spin 10s linear infinite;
  border: 3px solid rgba(255,255,255,.35);
  box-shadow: 0 0 22px rgba(244,63,94,.5), 0 0 44px rgba(124,58,237,.25);
}
.mini-wheel-ptr {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 0; height: 0;
  border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 16px solid #fff; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
.mini-wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cta), var(--primary));
  border: 2.5px solid rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka', sans-serif; font-size: 11px; font-weight: 700; color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
}
@keyframes mini-spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

/* 奖励数字 */
.vis-prize { text-align: center; flex-shrink: 0; }
.vis-prize-num {
  font-family: 'Fredoka', sans-serif; font-size: 42px; font-weight: 700; line-height: 1;
  background: linear-gradient(160deg,#fff 0%,var(--primary-soft) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(167,139,250,.5));
}
.vis-prize-rose .vis-prize-num {
  background: linear-gradient(160deg,#fff 0%,var(--cta-soft) 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(244,63,94,.45));
}
.vis-prize-label { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 2px; }
.vis-prize-sub   { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 1px; }

/* 装饰光点 */
.sp {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,.55); animation: sparkle 2.8s ease-in-out infinite;
}
.sp1 { width: 5px;  height: 5px;  top: 22%; left: 12%;  animation-delay: 0s;    animation-duration: 3s; }
.sp2 { width: 4px;  height: 4px;  top: 65%; right: 14%; animation-delay: 1s;    animation-duration: 2.5s; }
.sp3 { width: 6px;  height: 6px;  top: 40%; left: 48%;  animation-delay: 1.8s;  animation-duration: 3.4s; }
@keyframes sparkle {
  0%,100% { opacity: .2; transform: scale(.8); }
  50%      { opacity: .9; transform: scale(1.3); }
}

/* 卡片内容区（加内边距，和视觉头部分开） */
.intro-body { padding: 14px 18px 18px; }

.intro-badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 12px;
  border-radius: 999px; margin-bottom: 8px; color: #fff;
}
.badge-purple { background: linear-gradient(92deg, #7c3aed, #a78bfa); }
.badge-rose   { background: linear-gradient(92deg, #f43f5e, #fb7185); }
.intro-title { margin: 4px 0 6px; font-size: 21px; }
.intro-desc { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.intro-points { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--text); }
.intro-points li { margin: 7px 0; line-height: 1.6; }
.intro-points li b { font-weight: 700; }

/* 公共参与须知卡片 */
.prereq-card { padding: 14px 16px; }
.prereq-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--primary-soft);
  margin-bottom: 10px;
}
.prereq-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 5px 11px;
  border-radius: 999px; line-height: 1;
}
.chip-ok {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.chip-warn {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* 须知卡片—条件行（换行部分） */
.prereq-rows {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 7px;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 10px;
}
.prereq-row {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; color: var(--muted); line-height: 1.65;
}
.prereq-row b { color: #fcd34d; font-weight: 700; }
.prereq-row-icon { flex-shrink: 0; margin-top: 1px; }
.prereq-row-icon.warn { color: #fbbf24; }
.prereq-row-icon.no { color: #f87171; }

/* cond-note 保留给第二屏详情区 */
.cond-note {
  margin: 10px 0 0;
  font-size: 12px; color: var(--muted);
  background: rgba(255,255,255,0.04);
  border-left: 2px solid rgba(167,139,250,.45);
  padding: 6px 10px; border-radius: 0 6px 6px 0; line-height: 1.7;
}

/* ---- 密钥输入 ---- */
.key-box { text-align: left; }
.key-label { display: block; font-weight: 700; margin-bottom: 10px; }
.key-row { display: flex; gap: 10px; }
.key-input {
  flex: 1; min-width: 0; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--card-border); background: rgba(0,0,0,0.25); color: #fff;
  font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.key-input::placeholder { color: #6b7398; }
.key-input:focus { border-color: var(--primary-soft); box-shadow: 0 0 0 3px rgba(124,58,237,.25); }
.hint { min-height: 18px; margin: 10px 0 0; font-size: 13px; color: var(--warn); }

/* ---- 按钮 ---- */
.btn {
  cursor: pointer; border: none; border-radius: 12px; padding: 13px 20px;
  font-size: 15px; font-weight: 600; color: #fff; transition: transform .15s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(92deg, var(--primary), var(--cta));
  box-shadow: 0 10px 26px rgba(124,58,237,.4);
  animation: btn-pulse 2.8s ease-in-out infinite;
}
.btn-primary:hover:not(:disabled) {
  animation: none;
  box-shadow: 0 14px 36px rgba(244,63,94,.55), 0 0 0 3px rgba(244,63,94,.18);
}
.btn-primary:disabled { animation: none; }
@keyframes btn-pulse {
  0%,100% { box-shadow: 0 10px 26px rgba(124,58,237,.4); }
  50%      { box-shadow: 0 12px 38px rgba(244,63,94,.6), 0 0 0 4px rgba(244,63,94,.12); }
}
.btn-ghost { background: rgba(255,255,255,0.07); border: 1px solid var(--card-border); }
.back-btn { padding: 9px 14px; font-size: 14px; align-self: flex-start; }

/* ---- 结果区 ---- */
.key-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; font-size: 14px; }
.key-summary .kv { display: flex; flex-direction: column; }
.key-summary .kv span { color: var(--muted); font-size: 12px; }
.key-summary .kv b { font-weight: 700; word-break: break-all; }

.act-panel { transition: opacity .25s; }
.act-panel.disabled { opacity: .72; }
.panel-head { margin-bottom: 6px; }
.rules { font-size: 14px; color: var(--text); }
.rules ul { margin: 8px 0 0; padding-left: 18px; }
.rules li { margin: 4px 0; }
.status-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-weight: 700; }
.status-line.ok { color: var(--ok); }
.status-line.no { color: var(--cta-soft); }
.panel-action { margin-top: 16px; }
.panel-action .btn { width: 100%; }

/* ---- 大转盘 ---- */
.wheel-wrap {
  position: relative; width: min(320px, 78vw); aspect-ratio: 1; margin: 18px auto 8px;
}
.wheel-wrap canvas {
  width: 100%; height: 100%; display: block; border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(124,58,237,.22), 0 0 50px rgba(244,63,94,.4), 0 0 80px rgba(124,58,237,.2);
  animation: wheel-glow 3s ease-in-out infinite;
}
@keyframes wheel-glow {
  0%,100% { box-shadow: 0 0 0 8px rgba(124,58,237,.22), 0 0 50px rgba(244,63,94,.4), 0 0 80px rgba(124,58,237,.2); }
  50%      { box-shadow: 0 0 0 10px rgba(244,63,94,.28), 0 0 65px rgba(244,63,94,.55), 0 0 100px rgba(124,58,237,.3); }
}
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-top: 26px solid var(--cta); filter: drop-shadow(0 3px 4px rgba(0,0,0,.5));
}
.wheel-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 74px; height: 74px; border-radius: 50%; z-index: 2; cursor: pointer;
  border: 4px solid #fff; background: linear-gradient(135deg, var(--cta), var(--primary));
  color: #fff; font-family: 'Fredoka', sans-serif; font-size: 22px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,.4); transition: transform .15s;
}
.wheel-center:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.05); }
.wheel-center:disabled { opacity: .6; cursor: not-allowed; }

/* ---- 弹窗 ---- */
.modal {
  display: none;
  position: fixed; inset: 0; z-index: 50;
  align-items: center; justify-content: center;
  background: rgba(8, 8, 24, 0.72); backdrop-filter: blur(4px); padding: 20px;
}
.modal.open { display: flex; }
.modal-card { background: linear-gradient(160deg, var(--bg-2), #1c1040); border: 1px solid var(--card-border);
  border-radius: 22px; padding: 28px 24px; text-align: center; max-width: 360px; width: 100%;
  box-shadow: var(--shadow); animation: pop .3s ease; }
.modal-icon { margin: 0 auto 10px; width: 64px; height: 64px; }
.modal-title { margin: 6px 0; font-size: 22px; }
.modal-text { color: var(--muted); margin: 0 0 18px; }
.modal-card .btn { width: 100%; }

/* ---- 历史记录 ---- */
.history-section { padding-bottom: 8px; }
.history-card { padding: 16px 18px; }
.history-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;
}
.history-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--primary-soft);
}
.btn-clear {
  cursor: pointer; background: none; border: 1px solid rgba(244,63,94,.35);
  color: rgba(244,63,94,.75); font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; transition: background .15s, color .15s;
}
.btn-clear:hover { background: rgba(244,63,94,.12); color: var(--cta-soft); }
.history-note { font-size: 11px; color: #6b7398; margin: 0 0 12px; }

.hist-group { margin-bottom: 12px; }
.hist-group:last-child { margin-bottom: 0; }
.hist-key {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--text);
  margin-bottom: 5px; letter-spacing: .3px;
}
.hist-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 6px 0 6px 18px; border-left: 2px solid rgba(167,139,250,.2);
  margin-bottom: 3px; font-size: 12px;
}
.hist-act-tag {
  padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 11px; white-space: nowrap;
}
.tag-purple { background: rgba(124,58,237,.2); color: var(--primary-soft); }
.tag-rose   { background: rgba(244,63,94,.2);  color: var(--cta-soft); }
.hist-reward { color: var(--text); flex: 1; min-width: 0; }
.hist-time   { color: #6b7398; white-space: nowrap; font-size: 11px; }

.site-footer { text-align: center; color: #6b7398; font-size: 12px; padding: 24px 18px 36px; }

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

/* ---- 响应式 ---- */
@media (max-width: 560px) {
  .activity-grid { grid-template-columns: 1fr; }
  .intro-visual { height: 110px; }
  .vis-prize-num { font-size: 34px; }
  .key-row { flex-direction: column; }
  .btn-primary { width: 100%; }
  .key-summary { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
