/* ========== 基础重置 ========== */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
/* 整页固定，不产生文档级滚动：只有题卡/解析框内部才允许上下滑动 */
html,body { width:100%; height:100%; background:#0d6b52; font-family:"PingFang SC","Microsoft YaHei","Hiragino Sans GB",sans-serif;
  overflow:hidden; overscroll-behavior:none; }
body { display:flex; justify-content:center; align-items:flex-start; touch-action:pan-y; }
img { display:block; }

/* ========== 舞台：等比缩放容器 ========== */
#stage { position:relative; width:750px; height:1500px; transform-origin:top center; flex:none; }
#stage.landscape { width:750px; height:1333px; }

/* ========== 页面层 ========== */
.page { position:absolute; inset:0; overflow:hidden; display:none; background-color:#0d6b52; }
.page.active { display:block; }
/* 设计稿比例固定 750x1500，长屏多出来的高度用页面底色补齐（不拉伸画面，保证图层对位） */
.page .bg { position:absolute; left:0; top:0; width:100%; height:auto; }
/* 手绘风格背景：底部镜像延伸条，长屏下自然接续，避免出现色块 */
.page .bg-tail { position:absolute; left:0; width:100%; height:auto; }
/* 整张手绘背景：长屏下按高度撑满并左右裁切，避免底部拼接缝 */
.page .bg.cover { height:100%; object-fit:cover; object-position:center top; }
/* 13/14/15 整图页：纵向拉伸铺满舞台，使动态文字与底图 1:1 对齐（cover 会放大底图导致错位） */
.page .bg.fill { height:100%; object-fit:fill; }

/* ========== 文字层（按PSD bbox 半位移） ========== */
.txt { position:absolute; white-space:pre-wrap; word-break:break-word; line-height:1.15;
       font-weight:600; text-align:center; color:#0a6b4e; pointer-events:none; }

/* ========== 通用按钮 ========== */
.hot { position:absolute; cursor:pointer; -webkit-tap-highlight-color:transparent; z-index:5; }
.hot:active { transform:scale(.97); }
.btn-pulse { animation:btnPulse 2.2s ease-in-out infinite; }
@keyframes btnPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.025)} }

/* ========== 交互动画 ========== */
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes fadeInUp { from{opacity:0; transform:translateY(28px)} to{opacity:1; transform:translateY(0)} }
@keyframes zoomIn { from{opacity:0; transform:scale(.82)} to{opacity:1; transform:scale(1)} }
@keyframes popIn { 0%{opacity:0; transform:scale(.5)} 70%{transform:scale(1.06)} 100%{opacity:1; transform:scale(1)} }
@keyframes slideDown { from{opacity:0; transform:translateY(-40px)} to{opacity:1; transform:translateY(0)} }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }
@keyframes floatY { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

.anim-fade { animation:fadeIn .5s ease both; }
.anim-up { animation:fadeInUp .55s cubic-bezier(.2,.8,.3,1) both; }
.anim-zoom { animation:zoomIn .5s cubic-bezier(.2,.8,.3,1) both; }
.anim-pop { animation:popIn .55s cubic-bezier(.2,.9,.3,1.1) both; }
.anim-down { animation:slideDown .5s cubic-bezier(.2,.8,.3,1) both; }
.delay-1 { animation-delay:.12s } .delay-2 { animation-delay:.24s } .delay-3 { animation-delay:.36s }
.delay-4 { animation-delay:.48s } .delay-5 { animation-delay:.6s }

.zoom-group > * { animation:zoomIn .55s cubic-bezier(.2,.8,.3,1) both; }
.zoom-group > *:nth-child(1){animation-delay:.05s}
.zoom-group > *:nth-child(2){animation-delay:.14s}
.zoom-group > *:nth-child(3){animation-delay:.23s}
.zoom-group > *:nth-child(4){animation-delay:.32s}
.zoom-group > *:nth-child(5){animation-delay:.41s}

/* 页面切换 */
.page.enter .bg { animation:fadeIn .35s ease both; }

/* ========== 答题交互 ========== */
.opt { position:absolute; cursor:pointer; transition:transform .18s, filter .18s; }
.opt:hover { filter:brightness(1.04); }
.opt:active { transform:scale(.98); }
.opt.selected .opt-bg { filter:brightness(.94); }
/* 多选对勾：显示在底图已有方形框内 */
.checkmark { position:absolute; width:36px; height:36px; line-height:34px; text-align:center;
    font-size:32px; font-weight:900; color:#0a8f63; opacity:0; transform:scale(.4);
    transition:opacity .18s, transform .18s; pointer-events:none; }
.checkmark.on { opacity:1; transform:scale(1); }
/* 长文本可上下滑动 */
.scroll-box { overflow-y:auto; -webkit-overflow-scrolling:touch; pointer-events:auto; }
.scroll-box::-webkit-scrollbar { width:5px; }
.scroll-box::-webkit-scrollbar-thumb { background:rgba(10,107,78,.3); border-radius:3px; }
.opt.correct .opt-bg { filter:brightness(1.02) saturate(1.15); }
.opt.wrong { animation:shake .45s ease; }
.opt.locked { pointer-events:none; }

/* ========== 表单 ========== */
.field { position:absolute; background:rgba(255,255,255,.55); border-radius:14px; }
.field input { width:100%; height:100%; border:0; outline:0; background:transparent;
    font-size:30px; color:#0a5c42; font-weight:600; padding:0 22px; font-family:inherit; }
.field input::placeholder { color:#7fb39f; }

/* 02 信息登记：透明输入框，叠在设计稿的浅绿输入区上 */
.form-field { position:absolute; border-radius:20px; transition:box-shadow .18s; }
.form-field input { width:100%; height:100%; border:0; outline:0; background:transparent;
    font-size:31px; font-weight:700; color:#0a5c42; padding:0 28px; font-family:inherit;
    letter-spacing:.5px; }
.form-field input::placeholder { color:#8FBFAA; font-weight:600; letter-spacing:0; }
.form-field.on { box-shadow:0 0 0 3px rgba(10,143,99,.22), 0 0 0 9px rgba(10,143,99,.06); }

/* 提交按钮：未填完时压暗 */
.btn-dim { filter:saturate(.55) brightness(1.02) opacity(.85); }
@keyframes shakeX { 0%,100%{transform:translateX(0)} 18%,58%{transform:translateX(-10px)}
                    40%,78%{transform:translateX(10px)} }
.shake-x { animation:shakeX .45s ease; }

/* ========== 排行榜动态文字 ========== */
.rank-row { position:absolute; display:flex; align-items:center; }
.rank-row .nm { font-weight:700; color:#0a5c42; font-size:30px; }
.rank-row .pt { font-weight:800; color:#c8891a; font-size:30px; }

/* ========== 进度填充 ========== */
.progress-fill { transition:width .6s cubic-bezier(.2,.8,.3,1); }

/* ========== 04 判断题 ========== */
.qscroll { position:absolute; overflow:hidden; }
.qscroll.scrollable { overflow-y:auto; -webkit-overflow-scrolling:touch; pointer-events:auto;
    -webkit-mask-image:linear-gradient(180deg,#000 0,#000 calc(100% - 34px),transparent 100%);
    mask-image:linear-gradient(180deg,#000 0,#000 calc(100% - 34px),transparent 100%); }
.qinner { min-height:100%; display:flex; align-items:center; justify-content:center; padding:2px 6px; }
.qtext { width:100%; text-align:center; color:#0E573C; font-weight:800; line-height:1.6;
    letter-spacing:.3px; word-break:break-word; }
.qscroll.scrollable.at-end { -webkit-mask-image:none; mask-image:none; }
.qscroll::-webkit-scrollbar { width:5px; }
.qscroll::-webkit-scrollbar-thumb { background:rgba(10,107,78,.28); border-radius:3px; }

/* 叠加在图层上的可点控件：必须显式放开 pointer-events（.lyr 默认 none，且写在后面会覆盖） */
.lyr.opt-btn { pointer-events:auto; }
.opt-btn { pointer-events:auto; cursor:pointer; transition:transform .14s ease; }
.opt-btn:active { transform:scale(.975); }
.opt-btn.locked { pointer-events:none; }
.opt-btn.picked { animation:pickPop .34s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes pickPop { 0%{transform:scale(1)} 45%{transform:scale(1.035)} 100%{transform:scale(1)} }

/* ========== 06 正确答案行（图层已抹字，题库渲染） ========== */
.ans-row { position:absolute; left:39px; top:603px; width:676px; height:62px;
    display:flex; align-items:center; justify-content:center; white-space:nowrap;
    font-size:48px; font-weight:900; color:#05564F; letter-spacing:1px; pointer-events:none; }
.ans-val { color:#0B8F5E; margin-left:2px; }

/* ========== 弹窗遮罩 ========== */
.overlay { position:absolute; inset:0; background:rgba(0,0,0,.35); display:none; z-index:30; }
.overlay.show { display:block; animation:fadeIn .3s ease both; }

/* ========== 提示Toast ========== */
#toast { position:fixed; left:50%; top:18%; transform:translateX(-50%); z-index:999;
    background:rgba(8,70,52,.92); color:#fff; padding:16px 34px; border-radius:40px;
    font-size:26px; opacity:0; transition:opacity .3s; pointer-events:none; white-space:nowrap; }
#toast.show { opacity:1; }

/* ========== 进入中轻遮罩 ========== */
#busy { position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:1500;
    display:none; align-items:center; gap:16px; padding:22px 40px; border-radius:50px;
    background:rgba(8,70,52,.86); color:#fff; font-size:26px; pointer-events:none; }
#busy.show { display:flex; }
.busy-dot { width:26px; height:26px; border-radius:50%; border:4px solid rgba(255,255,255,.35);
    border-top-color:#fff; animation:busySpin .8s linear infinite; }
@keyframes busySpin { to { transform:rotate(360deg); } }

/* ========== 礼花粒子 ========== */
.confetti { position:absolute; width:11px; height:11px; border-radius:3px; z-index:25; pointer-events:none;
    animation:confettiFall linear forwards; }
@keyframes confettiFall { 0%{opacity:1; transform:translateY(-40px) rotate(0)} 100%{opacity:0; transform:translateY(600px) rotate(720deg)} }

/* ========== 证书盖章 ========== */
.stamp { animation:stampIn .6s cubic-bezier(.2,.9,.3,1.2) .3s both; }
@keyframes stampIn { 0%{opacity:0; transform:scale(2.2) rotate(-20deg)} 100%{opacity:1; transform:scale(1) rotate(-8deg)} }

/* ========== 加载 ========== */
#loading { position:fixed; inset:0; background:#0d6b52; display:flex; align-items:center; justify-content:center;
    z-index:1000; color:#fff; font-size:30px; letter-spacing:2px; transition:opacity .4s; }
#loading.hide { opacity:0; pointer-events:none; }

/* ========== 头像昵称授权底部弹窗 ========== */
.auth-sheet { position:fixed; inset:0; z-index:2000; display:none; }
.auth-sheet.show { display:block; }
.auth-mask { position:absolute; inset:0; background:rgba(0,30,20,.5); animation:fadeIn .25s ease both; }
.auth-panel { position:absolute; left:0; right:0; bottom:0; background:#fff;
    border-radius:36px 36px 0 0; padding:20px 48px calc(36px + env(safe-area-inset-bottom));
    text-align:center; animation:sheetUp .34s cubic-bezier(.2,.8,.3,1) both; }
@keyframes sheetUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.auth-handle { width:72px; height:8px; border-radius:4px; background:#DCEBE4; margin:0 auto 26px; }
.auth-brand { font-size:24px; font-weight:700; color:#8FB8A6; letter-spacing:6px; margin-bottom:10px; }
.auth-title { font-size:44px; font-weight:800; color:#07563D; margin-bottom:16px; letter-spacing:1px; }
.auth-sub { font-size:23px; color:#7BA492; line-height:1.5; margin-bottom:26px; }
.auth-tip { font-size:22px; color:#93B4A5; margin:22px 0 30px; }

.auth-scope-card { background:#F4FAF7; border:2px solid #E2F0E9; border-radius:22px;
    padding:26px 28px; text-align:left; margin-bottom:8px; }
.auth-scope-title { font-size:24px; color:#6F9B88; margin-bottom:14px; }
.auth-scope-item { display:flex; align-items:center; font-size:28px; font-weight:700; color:#134E3A; }
.auth-scope-ico { width:30px; height:30px; border-radius:8px; background:#0A8F63; margin-right:14px;
    position:relative; flex:0 0 auto; }
.auth-scope-ico::after { content:""; position:absolute; left:8px; top:14px; width:13px; height:7px;
    border-left:4px solid #fff; border-bottom:4px solid #fff; transform:rotate(-45deg); }

.auth-btn { display:block; width:100%; height:92px; border:0; border-radius:46px;
    background:linear-gradient(180deg,#12A876,#0A8F63); color:#fff; font-size:33px; font-weight:800;
    font-family:inherit; cursor:pointer; box-shadow:0 8px 20px rgba(10,143,99,.28);
    transition:transform .12s, box-shadow .12s; }
.auth-btn:active { transform:scale(.98); box-shadow:0 4px 12px rgba(10,143,99,.24); }
.auth-btn:disabled { opacity:.7; }
.auth-no { display:block; width:100%; height:72px; border:0; background:transparent;
    color:#9AB5A8; font-size:26px; font-family:inherit; margin-top:6px; cursor:pointer; }

/* 头像选择器（演示模式） */
.av-pick { display:block; width:168px; height:168px; margin:4px auto 30px; position:relative;
    border-radius:50%; cursor:pointer; }
.av-img { width:168px; height:168px; border-radius:50%; object-fit:cover; display:block;
    background:#F0F7F3; box-shadow:0 4px 16px rgba(10,107,78,.12); }
.av-badge { position:absolute; right:-2px; bottom:4px; width:52px; height:52px; border-radius:50%;
    background:#0A8F63; color:#fff; font-size:34px; font-weight:700; line-height:48px; text-align:center;
    border:4px solid #fff; box-shadow:0 2px 8px rgba(10,143,99,.3); }

.auth-input { display:block; width:100%; height:92px; padding:0 30px; margin-bottom:6px;
    border:2px solid #DCEBE4; border-radius:20px; background:#F7FBF9;
    font-size:30px; color:#07563D; font-family:inherit; outline:none; text-align:center;
    transition:border-color .15s, background .15s; }
.auth-input:focus { border-color:#0A8F63; background:#fff; }
.auth-input::placeholder { color:#A9C4B7; }

/* ========== 排行榜用户头像 ========== */
.rank-avatar { position:absolute; border-radius:50%; object-fit:cover;
    border:2px solid #fff; box-shadow:0 1px 5px rgba(0,0,0,.15); z-index:3; }

/* ========== 16 排行榜 ========== */
.rank-top-av { position:absolute; border-radius:50%; object-fit:cover; z-index:2; background:#EAF5EF; }
.rank-mask { position:absolute; left:0; top:0; width:100%; height:auto; z-index:3; pointer-events:none; }
.rank-scroll { position:absolute; left:33px; top:643px; width:685px; height:319px;
    overflow-y:auto; -webkit-overflow-scrolling:touch; pointer-events:auto; z-index:4; }
.rank-scroll::-webkit-scrollbar { width:5px; }
.rank-scroll::-webkit-scrollbar-thumb { background:rgba(7,86,61,.28); border-radius:3px; }
.rank-row { position:relative; height:59px; width:685px; }
.rank-row .r-no { position:absolute; left:83px; top:14px; width:58px; height:32px;
    font-size:26px; font-weight:800; color:#07563D; text-align:center; line-height:32px; }
.rank-row .r-av { position:absolute; left:167px; top:3px; width:52px; height:52px;
    border-radius:50%; object-fit:cover; background:#EAF5EF; box-shadow:0 1px 4px rgba(0,0,0,.12); }
/* 列中心对齐表头：昵称表头中心355、累计积分表头中心598（容器 left=33） */
.rank-row .r-name { position:absolute; left:265px; top:14px; width:185px; height:32px;
    font-size:26px; font-weight:700; color:#07563D; line-height:32px; white-space:nowrap; overflow:hidden; }
.rank-row .r-score { position:absolute; left:503px; top:14px; width:130px; height:32px;
    font-size:26px; font-weight:800; color:#07563D; line-height:32px; text-align:center; }
.rank-row .r-line { position:absolute; left:42px; right:0; bottom:0; height:1px;
    background:rgba(7,86,61,.13); }

/* ================= 分层素材页（新PSD方案） ================= */
.lyr { position:absolute; will-change:transform,opacity; pointer-events:none; }
.lyr img { width:100%; height:100%; display:block; -webkit-user-drag:none; user-select:none; }

/* 按钮：入场放大 + 持续轻微呼吸 */
@keyframes btnBob { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-4px) scale(1.012)} }
.loop-btn { animation:btnBob 2.6s ease-in-out infinite; }

/* 按钮箭头：常驻闪烁引导（透明度 + 左右轻移） */
@keyframes arrowHint {
  0%,100% { opacity:1; transform:translateX(0); }
  35%     { opacity:.28; transform:translateX(7px); }
  60%     { opacity:1; transform:translateX(2px); }
}
.loop-arrow { animation:arrowHint 1.5s ease-in-out infinite; }

/* 礼盒/金币放射线：三条一组交替闪烁 */
@keyframes rayBlink {
  0%,100% { opacity:1;   transform:scale(1); }
  45%     { opacity:.30; transform:scale(.85); }
  70%     { opacity:.92; transform:scale(1.03); }
}
.loop-ray { animation:rayBlink 1.8s ease-in-out infinite; transform-origin:50% 60%; }

/* 麦穗：入场后轻微摇曳 */
@keyframes swayL { 0%,100%{transform:rotate(0deg)} 50%{transform:rotate(-3deg)} }
@keyframes swayR { 0%,100%{transform:rotate(0deg)} 50%{transform:rotate(3deg)} }
.loop-sway-l { animation:swayL 4.2s ease-in-out infinite; transform-origin:90% 90%; }
.loop-sway-r { animation:swayR 4.6s ease-in-out infinite; transform-origin:10% 90%; }

/* 奖励横幅：轻微上下浮动 */
@keyframes bannerFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-3px)} }
.loop-banner { animation:bannerFloat 3.4s ease-in-out infinite; }
.btn-inner { position:absolute; inset:0; }

/* 15 页：合成后的整张海报图 —— 必须允许微信长按保存 */
.poster-img { position:absolute; left:0; top:0; width:750px; height:100%; object-fit:fill;
  z-index:1; -webkit-touch-callout:default; -webkit-user-select:none; }
.share-mask { pointer-events:auto; }

/* ========== 背景音乐按钮：右上角，略下移，播放时旋转，可开关 ========== */
.music-btn { position:absolute; left:636px; top:96px; width:76px; height:76px;
  z-index:200; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.music-disc { position:absolute; inset:0; border-radius:50%;
  background:radial-gradient(circle at 38% 34%, rgba(255,255,255,.95), rgba(255,241,196,.9) 45%, rgba(240,196,90,.92));
  border:2px solid rgba(255,255,255,.85);
  box-shadow:0 3px 10px rgba(0,60,30,.28), inset 0 0 0 4px rgba(9,90,64,.16);
  display:flex; align-items:center; justify-content:center;
  animation:musicSpin 4s linear infinite; animation-play-state:paused; }
.music-note { font-size:40px; font-weight:900; line-height:1; color:#0a6b4e;
  text-shadow:0 1px 1px rgba(255,255,255,.6); transform:translateY(-2px); }
/* 播放态：唱片旋转；关闭态：静止 + 斜杠 */
.music-btn.music-on .music-disc { animation-play-state:running; }
.music-btn:not(.music-on) .music-disc { filter:grayscale(.55) brightness(.92); }
.music-btn::after { content:''; position:absolute; left:50%; top:50%;
  width:100px; height:4px; background:#c8402e; border-radius:3px;
  transform:translate(-50%,-50%) rotate(-45deg) scaleX(0); transform-origin:center;
  box-shadow:0 1px 2px rgba(0,0,0,.25); z-index:2; transition:transform .18s ease; }
.music-btn:not(.music-on)::after { transform:translate(-50%,-50%) rotate(-45deg) scaleX(1); }
@keyframes musicSpin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
