/* polish.css — 大厂级质感打磨层（纯 CSS 新增，不动引擎逻辑）
 * 可整体移除：从 index.html 删掉本文件 <link> 即可一键回滚到原视觉。
 * 主题延续：暖金奢华 / 深夜酒店。
 * 设计原则：渐进增强、尊重 prefers-reduced-motion、仅在可悬停设备启用 hover。
 */

/* ---------- 1. 屏幕切换动效（最大质感提升：原本瞬时切换） ---------- */
.screen.active{animation:screenIn .55s cubic-bezier(.22,1,.36,1) both}
@keyframes screenIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

/* ---------- 2. 入戏页：标题/副题/剧情/按钮 错落入场 ---------- */
#intro .badge{animation:riseIn .6s .1s both}
#intro .title{animation:riseIn .7s .18s both}
#intro .sub{animation:riseIn .7s .28s both}
#intro .deptpick{animation:riseIn .7s .36s both}
#intro .night{animation:riseIn .7s .46s both}
#intro .enter{animation:riseIn .7s .58s both}
@keyframes riseIn{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}

/* 入戏按钮：悬停微亮 + 轻微上浮（仅可悬停设备） */
@media(hover:hover){
  #intro .enter:hover{transform:translateY(-2px);filter:brightness(1.08);box-shadow:0 14px 46px rgba(212,175,55,.75)}
  #intro .enter:active{transform:scale(.96)}
}

/* ---------- 3. 地图页：氛围浮尘粒子（指针穿透，纯装饰） ---------- */
#map .ambient{position:absolute;inset:0;pointer-events:none;z-index:1;overflow:hidden}
#map .ambient i{position:absolute;bottom:-8px;width:4px;height:4px;border-radius:50%;background:radial-gradient(circle,rgba(232,197,71,.9),rgba(232,197,71,0));opacity:0;animation:floatUp linear infinite}
@keyframes floatUp{0%{transform:translateY(0);opacity:0}12%{opacity:.8}100%{transform:translateY(-420px);opacity:0}}
#map .ambient i:nth-child(1){left:12%;animation-duration:11s;animation-delay:0s}
#map .ambient i:nth-child(2){left:26%;animation-duration:14s;animation-delay:2.2s}
#map .ambient i:nth-child(3){left:44%;animation-duration:12s;animation-delay:4s;width:3px;height:3px}
#map .ambient i:nth-child(4){left:61%;animation-duration:15s;animation-delay:1s}
#map .ambient i:nth-child(5){left:78%;animation-duration:13s;animation-delay:3.4s;width:5px;height:5px}
#map .ambient i:nth-child(6){left:90%;animation-duration:16s;animation-delay:5s}

/* ---------- 4. 地图节点：未锁定节点悬停光晕 + 已通关节点微光 ---------- */
@media(hover:hover){
  #mapSvg g[data-act]:hover>circle:first-of-type{stroke:#F7931E;stroke-width:6;filter:drop-shadow(0 0 8px rgba(212,175,55,.8));transition:.2s}
  #mapSvg g[data-act]:hover{transform:translateY(-2px)}
  #mapSvg g[data-act]{transition:transform .2s;cursor:pointer}
}
#mapSvg text{filter:drop-shadow(0 1px 3px rgba(0,0,0,.7))}

/* ---------- 5. 情景页：对话框/选项 入场 + 悬停 ---------- */
#game .dialog .box{animation:riseIn .45s cubic-bezier(.22,1,.36,1) both}
#game .choice-wrap{animation:screenIn .5s cubic-bezier(.22,1,.36,1) both}
@media(hover:hover){
  #game .opt:hover{border-color:var(--gold);background:rgba(212,175,55,.14);box-shadow:0 4px 18px rgba(212,175,55,.18);transform:translateX(4px)}
  #game .opt:hover .k{background:var(--gold);color:#1a1206}
  #game .continue:hover{border-color:var(--gold);background:rgba(212,175,55,.28);box-shadow:0 0 14px rgba(212,175,55,.35)}
  #game .fb .next:hover{transform:translateY(-2px);filter:brightness(1.06)}
  #review .btn:hover{transform:translateY(-2px);filter:brightness(1.06)}
}

/* ---------- 6. 反馈层：内容元素轻微错落入场 ---------- */
#game .fb .emp{animation:riseIn .5s .1s both}
#game .fb .exp{animation:riseIn .5s .18s both}
#game .fb .rem{animation:riseIn .5s .26s both}
#game .fb .next{animation:riseIn .5s .36s both}

/* ---------- 7. 结算页：卡片已由原样式 popIn，补标题错落 ---------- */
#review h2{animation:riseIn .55s .12s both}
#review .sub{animation:riseIn .55s .2s both}
#review .rankline{animation:riseIn .55s .28s both}
#review .statrow:nth-of-type(1){animation:riseIn .55s .36s both}
#review .statrow:nth-of-type(2){animation:riseIn .55s .44s both}
#review .endtext{animation:riseIn .55s .52s both}
#review .btn{animation:riseIn .55s .6s both}

/* ---------- 8. 任务面板 / 登录卡 入场 ---------- */
.qcard{animation:popIn .4s cubic-bezier(.22,1,.36,1) both}
.lg-card{animation:popIn .5s cubic-bezier(.22,1,.36,1) both}

/* ---------- 9. 通用：按钮统一 hover 微亮 ---------- */
@media(hover:hover){
  .questbtn:hover{transform:translateY(-1px);box-shadow:0 0 12px rgba(212,175,55,.35);border-color:var(--gold)}
  .homebtn:hover{transform:translateY(-1px);box-shadow:0 0 12px rgba(212,175,55,.3)}
  .switchacct:hover{color:var(--gold);border-color:var(--gold)}
  .qclose:hover{background:rgba(212,175,55,.3);color:#1a1206}
}

/* ---------- 10. 无障碍：尊重系统减弱动效偏好 ---------- */
@media (prefers-reduced-motion: reduce){
  .screen.active,#intro .badge,#intro .title,#intro .sub,#intro .deptpick,#intro .night,#intro .enter,
  #game .dialog .box,#game .choice-wrap,#game .fb .emp,#game .fb .exp,#game .fb .rem,#game .fb .next,
  #review h2,#review .sub,#review .rankline,#review .statrow:nth-of-type(1),#review .statrow:nth-of-type(2),
  #review .endtext,#review .btn,.qcard,.lg-card,.qpanel,.qmask,.qscroll .qitem{animation:none!important}
  #map .ambient i,#review:after{animation:none!important;opacity:0}
  .ctimer.low .ctimer-bar i{animation:none!important}
}

/* ===== 步骤2：关卡地图升级 ===== */

/* 覆盖原 .mline 的移动虚线动画：改为绘制完成后的静态金线（绘制动画由 map.js 用 stroke-dashoffset 驱动） */
#map .mline{animation:none!important}

/* 地图节点错落入场 */
#map .nodeg{animation:nodeIn .5s cubic-bezier(.22,1,.36,1) both}
@keyframes nodeIn{from{opacity:0;transform:translateY(10px) scale(.86)}to{opacity:1;transform:none}}

/* 锁定段链条：虚线银链，带若隐若现 */
#map .chain{opacity:.85;animation:chainGlow 2.6s ease-in-out infinite}
@keyframes chainGlow{0%,100%{opacity:.45;stroke:#6b5d45}50%{opacity:.95;stroke:#8a7a5c}}

/* ===== 步骤4：晋升横幅（升级全屏） ===== */
#lvlup{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:130;flex-direction:column;background:radial-gradient(circle at 50% 45%,rgba(212,175,55,.28),rgba(8,5,2,.72) 70%);backdrop-filter:blur(2px);animation:lvlupIn .35s}
#lvlup .lvlup-glow{position:absolute;width:340px;height:340px;border-radius:50%;background:radial-gradient(circle,rgba(232,197,71,.9),rgba(212,175,55,.25) 55%,transparent 70%);animation:lvlupGlow 1.6s ease-in-out infinite;pointer-events:none}
@keyframes lvlupGlow{0%,100%{transform:scale(1);opacity:.9}50%{transform:scale(1.25);opacity:1}}
#lvlup .lvlup-card{position:relative;text-align:center;animation:popIn .55s cubic-bezier(.22,1,.36,1) both}
#lvlup .lvlup-badge{font-size:16px;letter-spacing:6px;color:var(--gold2);margin-bottom:6px;text-shadow:0 0 20px rgba(212,175,55,.9)}
#lvlup .lvlup-rank{font-size:52px;font-weight:800;letter-spacing:6px;background:linear-gradient(135deg,#fff,var(--gold2),var(--gold));-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:0 0 40px rgba(212,175,55,.6)}
#lvlup .lvlup-lv{font-size:30px;font-weight:700;color:#fff;margin-top:6px;letter-spacing:3px}
#lvlup .lvlup-sub{font-size:14px;color:#e8dcbd;margin-top:14px;letter-spacing:2px}
@keyframes lvlupIn{from{opacity:0}to{opacity:1}}

/* ===== 步骤5：任务面板动效 + 支线进度条 + 结算页背景光效 ===== */
/* 面板模态入场 */
.qpanel{animation:screenIn .32s both}
.qmask{animation:lvlupIn .32s both}
/* 面板头部金条 */
.qsection h3{display:flex;align-items:center;gap:8px}
.qsection h3:before{content:'';width:4px;height:14px;border-radius:2px;background:linear-gradient(180deg,var(--gold2),var(--gold));box-shadow:0 0 8px rgba(212,175,55,.6)}
/* 条目错落入场 */
.qscroll .qitem{animation:riseIn .45s cubic-bezier(.22,1,.36,1) both}
/* 支线进度条 */
.qbar{height:5px;border-radius:5px;background:rgba(255,255,255,.12);margin-top:8px;overflow:hidden}
.qbar i{display:block;height:100%;border-radius:5px;background:linear-gradient(90deg,var(--amber),var(--gold));box-shadow:0 0 8px rgba(212,175,55,.5);transition:width .8s ease}
.qitem.done .qbar i{background:linear-gradient(90deg,#22c55e,#4ade80);box-shadow:0 0 8px rgba(34,197,94,.5)}
/* 成就状态标签 */
.qstate{display:inline-block;font-size:11px;margin-top:7px;padding:2px 10px;border-radius:20px;border:1px solid rgba(255,255,255,.16);color:#8a7a5c}
.qstate.on{border-color:rgba(34,197,94,.5);color:#86efac;background:rgba(34,197,94,.12)}
/* 已达成条目微光 */
.qitem.done{border-color:rgba(34,197,94,.5);background:rgba(34,197,94,.08);box-shadow:0 0 14px rgba(34,197,94,.12)}
/* 面板滚动条美化 */
.qscroll::-webkit-scrollbar{width:4px}
.qscroll::-webkit-scrollbar-thumb{background:rgba(212,175,55,.4);border-radius:2px}
.qscroll::-webkit-scrollbar-track{background:transparent}
/* 结算页背景动态光效：金色柔光缓慢漂移 */
#review:after{content:'';position:absolute;left:-30%;right:-30%;top:-30%;bottom:-30%;pointer-events:none;z-index:1;background:radial-gradient(circle at 30% 25%,rgba(212,175,55,.16),transparent 60%);animation:lightDrift 8s ease-in-out infinite}
@keyframes lightDrift{0%,100%{transform:translate(-4%,-2%);opacity:.6}50%{transform:translate(4%,3%);opacity:1}}

/* ===== 步骤6：段位进度条（玩家卡下方） ===== */
.rankprog{display:flex;align-items:center;gap:10px;margin:2px 20px 0;flex:none;font-size:11px;color:#b8a57e;letter-spacing:1px;position:relative;z-index:2}
.rankprogbar{flex:1;height:4px;border-radius:4px;background:rgba(255,255,255,.14);overflow:hidden}
.rankprogbar i{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,var(--amber),var(--gold));box-shadow:0 0 8px rgba(212,175,55,.5);transition:width .8s ease}

/* ===== 步骤7：答题计时条（带标签） ===== */
.ctimer{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}
.ctimer-label{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--gold2);letter-spacing:2px;text-align:left;font-weight:600}
.ctimer-label em{font-style:normal;font-size:16px;font-weight:800;color:var(--gold);min-width:24px;text-align:right;font-variant-numeric:tabular-nums}
.ctimer.low .ctimer-label em{color:#f87171}
.ctimer-bar{height:7px;border-radius:6px;background:rgba(255,255,255,.14);overflow:hidden;border:1px solid rgba(212,175,55,.4)}
.ctimer-bar i{display:block;height:100%;border-radius:6px;background:linear-gradient(90deg,var(--amber),var(--gold));box-shadow:0 0 8px rgba(212,175,55,.5);transition:width .12s linear}
.ctimer.low .ctimer-bar i{background:linear-gradient(90deg,#f87171,#ef4444);animation:ctimerBlink .6s ease-in-out infinite}
@keyframes ctimerBlink{0%,100%{opacity:1}50%{opacity:.35}}
