/* 活力漫画主题：独立视觉层，沿用原有玩法、角色和演出。 */
:root {
  --ink: #202448;
  --paper: #fffaf0;
  --blue: #2458ee;
  --pink: #ff7657;
  --yellow: #ffdf45;
  --mint: #70e0b1;
  --energy-muted: #626579;
}

body { background: var(--paper); }
body::before, body::after { content: none !important; }
#paper {
  background: radial-gradient(#20244816 1px, transparent 1px) 0 0 / 18px 18px;
}
#app { max-width: 1180px; padding: 0 32px; overflow: visible; }
.brand { font-size: 25px; letter-spacing: -1px; }
.brand small { color: var(--energy-muted); letter-spacing: 1px; }
body[data-screen="home"] .topbar .brand { display: flex; }
body[data-screen="home"] .topbar,
.topbar { padding: 24px 0; min-height: 80px; }
.top-actions { position: static !important; display: flex; flex-direction: row; gap: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: #fff; }
.topbar .settings-btn { position: static; }
.screen:not(#home) { width: 100%; max-width: 680px; margin: 0 auto; }
#home { display: grid; grid-template-columns: 1.05fr 1fr; gap: 38px; align-items: start; padding: 12px 0 36px; }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 32px 26px 24px;
  background: var(--blue);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 32px;
  box-shadow: 8px 8px 0 var(--ink);
  text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(#ffffff20 1.5px, transparent 1.5px) 0 0 / 12px 12px;
  mask-image: linear-gradient(145deg, #000, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; width: 440px; height: 440px; left: -125px; bottom: -260px;
  border: 65px solid #fff2; border-radius: 50%; z-index: -1; pointer-events: none;
}
.hero-ticket {
  display: inline-block; color: var(--ink); background: var(--yellow);
  border: 2px solid var(--ink); padding: 8px 18px; box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-3deg); font: 900 11px/1.2 "Avenir Next", sans-serif; letter-spacing: 2px;
}
.hero .eyebrow { color: #fff; font-size: 12px; letter-spacing: 3px; margin: 25px 0 0; }
.hero .logo { --fs: 65px; margin: 30px 0 15px; }
.hero .logo-top i, .hero .logo-ribbon i, .hero .logo-bits b { animation: none; }
.hero .logo-burst { filter: drop-shadow(0 5px 0 var(--ink)); }
.hero-headline { font-size: clamp(38px, 4.2vw, 54px); line-height: 1.2; letter-spacing: -2px; margin: 25px 0 14px; }
.hero-headline span { color: var(--yellow); }
.hero .intro { color: #fff; font-size: 13px; line-height: 1.8; letter-spacing: .5px; }
.hero .home-stage { height: 144px; margin: 8px -8px 14px; }
.hero .home-stage .slime-party { inset: 20px 0 10px; }
.hero .stage-floor { background: #132c8866; height: 20px; bottom: 0; }
.hero-facts { display: flex; justify-content: center; gap: 0; padding: 17px 0 0; border-top: 1px solid #ffffff4d; }
.hero-facts > span { flex: 1; font-size: 11px; letter-spacing: 1px; color: #fff; }
.hero-facts > span + span { border-left: 1px solid #ffffff4d; }
.hero-facts b { display: block; color: var(--yellow); font: 900 27px/1.25 "Avenir Next", sans-serif; letter-spacing: -1px; margin-bottom: 4px; }
.hero-star { position: absolute; right: 23px; top: 270px; color: var(--yellow); font-size: 45px; transform: rotate(15deg); pointer-events: none; }
.adventure-panel { padding: 12px 0 0; min-width: 0; }
.adventure-heading > span { font: 900 10px/1.5 "Avenir Next", sans-serif; color: var(--blue); letter-spacing: 2px; }
.adventure-heading h2 { font-size: clamp(23px, 2.6vw, 30px); line-height: 1.35; letter-spacing: -1px; margin: 8px 0; }
.adventure-heading h2 span { color: var(--blue); }
.adventure-heading p { color: var(--energy-muted); font-size: 12px; margin-bottom: 22px; }
.big-btn.start-button {
  position: relative; width: 100%; min-height: 86px; padding: 18px 52px 18px 22px;
  background: var(--pink); color: var(--ink); text-shadow: none; text-align: left;
  border: 3px solid var(--ink); border-radius: 19px; box-shadow: 0 6px 0 var(--ink);
  font-size: 22px; line-height: 1.2;
  align-items: flex-start;
}
.start-button::after { content: "↗"; position: absolute; right: 20px; top: 25px; font-size: 28px; }
.big-btn.start-button small { color: var(--ink); text-shadow: none; opacity: .85; font-size: 11px; margin-top: 7px; }
.activity-bar { margin: 22px 0 26px; gap: 9px; }
.activity-pill { background: #fff !important; border-width: 2px; border-radius: 14px; box-shadow: 0 3px 0 var(--ink); min-height: 68px; }
.activity-label { font-size: 11px; }
.section-label { align-items: center; margin: 0 0 16px; gap: 10px; }
.section-label h2 { font-size: 13px; }
.mode-toggle { box-shadow: 0 2px 0 var(--ink); border-width: 2px; }
.mode-pill { padding: 6px 8px; min-height: 36px; font-size: 12px; color: var(--energy-muted); }
.level-list { gap: 13px; }
.level-card {
  grid-template-columns: 40px 1fr auto; gap: 12px;
  padding: 15px 18px 15px 20px; min-height: 84px; overflow: hidden;
  border-width: 2px !important; border-radius: 17px !important; box-shadow: 0 4px 0 var(--ink) !important;
}
.station-number {
  position: absolute; right: 10px; top: -8px;
  font: 900 66px/1 "Avenir Next", sans-serif; color: #2024480b; pointer-events: none;
}
.station-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: #2024480b; }
.station-progress i { display: block; height: 100%; background: var(--blue); }
.level-card:nth-child(1) { background: #ddf8e9; }
.level-card:nth-child(2) { background: #e3edff; }
.level-card:nth-child(3) { background: #fff0c4; }
.level-card strong { font-size: 17px; }
.level-card small { color: #54586b; font-size: 11px; line-height: 1.5; }
.level-icon { width: 40px; }
.level-count { position: relative; font-size: 11px; color: #555a6d; }
.level-count b { font-size: 22px; color: var(--ink); }
.level-card em { background: var(--blue); }
.level-card.recommended { box-shadow: 0 4px 0 var(--ink), 0 0 0 3px var(--yellow) !important; }
.home-actions { margin-top: 22px; gap: 12px; }
.sub-btn { border: 2px solid var(--ink); background: #fff; border-radius: 12px; min-height: 44px; font-weight: 800; }
.footnote { color: var(--energy-muted); line-height: 1.8; font-size: 11px; margin-top: 16px; }
#app > footer { color: var(--energy-muted); line-height: 1.8; }
.primary { background: var(--blue); color: #fff; border-width: 2px; min-height: 56px; }
.secondary { background: #fff; }

/* 题卡和舞台：读题时保持稳定，命中和高连击才强化反馈。 */
.play-top { padding: 8px 0 12px; }
.play-top h1 { font-size: 19px; }
.arcade-hud { background: #fff; border: 2px solid var(--ink); border-radius: 20px; padding: 14px 16px; box-shadow: 0 4px 0 var(--ink); }
.play-stage { margin-top: 12px; height: 125px; }
.question-card { background: #fff; border: 2px solid var(--ink); box-shadow: 5px 6px 0 var(--ink); padding: 20px 22px 14px; }
.target-word { background: #ffed8f; border-radius: 14px; box-shadow: 0 3px 0 var(--ink); text-shadow: none; }
.word-cell.ok { background: #a8f0c7; }
.choices { gap: 12px; }
.choice { background: #fff; box-shadow: 0 4px 0 var(--ink); }
.choice:hover:not(:disabled) { background: #e4edff; }
.choice.picked { background: var(--mint); animation: energy-hit 380ms ease-out; }
.combo-box.hot {
  background: var(--yellow); color: var(--ink); border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink); animation: energy-hit 420ms ease-out;
}
.combo-box.hot b { color: #a53512; }
.combo-box.hot::after { content: "✦"; position: absolute; top: -12px; right: -8px; color: #a53512; font-size: 21px; }
.explanation { background: #e5f9ec; border-color: var(--ink); }

/* 通关奖章和逐项入场；完成分仍沿用原项目的统计语义。 */
.result-screen { padding: 24px 30px; margin-bottom: 30px !important; border: 3px solid var(--ink); border-radius: 28px; background: #fff; box-shadow: 7px 7px 0 var(--ink); }
.finish-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; background: var(--yellow); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-4deg); font: 900 12px/1 "Avenir Next", sans-serif; letter-spacing: 2px; }
.finish-badge span { font-size: 26px; }
.result-screen h1 { font-size: clamp(28px, 5vw, 38px); color: var(--blue); line-height: 1.3; }
.result-score { width: fit-content; min-width: 180px; margin: 16px auto; padding: 8px 24px; border: 2px solid var(--ink); border-radius: 24px; background: #ffed8f; box-shadow: 4px 4px 0 var(--ink); animation: energy-arrive 450ms both; }
.result-score strong { color: var(--ink); font-size: 66px; letter-spacing: -3px; }
.result-score > span { color: #555a6d; }
#result-summary { font-size: 13px; line-height: 1.9; color: #54586b; }
.result-details { gap: 10px; margin: 22px 0; }
.result-detail { flex: 1; border: 2px solid var(--ink); border-radius: 15px; background: #e3edff; padding: 15px 5px; animation: energy-arrive 400ms both; }
.result-detail:nth-child(2) { background: #ddf8e9; animation-delay: 80ms; }
.result-detail:nth-child(3) { background: #ffe4d7; animation-delay: 160ms; }
.result-detail b { color: var(--ink); font-size: 28px; }
.result-detail span { color: #54586b; font-size: 11px; }
.result-screen .primary { justify-content: center; }
.settings-card { border-color: var(--ink); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
.hero :focus-visible { outline-color: var(--yellow); }

@keyframes energy-hit { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.08) rotate(-2deg); } }
@keyframes energy-arrive { from { opacity: 0; transform: translateY(15px) scale(.96); } to { opacity: 1; transform: none; } }

@media (max-width: 960px) and (min-width: 761px) {
  #app { padding: 0 24px; }
  #home { gap: 24px; grid-template-columns: 1fr 1fr; }
  .hero { padding: 28px 18px 22px; }
  .hero .logo { --fs: 58px; }
  .hero .home-stage .softie { width: 65px; }
  .hero .home-stage .softie:nth-child(3) { width: 85px; }
  .section-label { flex-direction: column; align-items: flex-start; }
  .level-card { padding: 12px; gap: 8px; }
}

@media (max-width: 760px) {
  #app { padding: 0 20px; max-width: 560px; }
  body[data-screen="home"] .topbar, .topbar { padding: 16px 0; min-height: 72px; }
  .brand { font-size: 22px; }
  .brand small { font-size: 9px; }
  #home { display: block; padding: 0 0 24px; }
  .hero { padding: 23px 16px 20px; border-radius: 24px; box-shadow: 5px 5px 0 var(--ink); }
  .hero-ticket { font-size: 9px; padding: 6px 12px; }
  .hero .eyebrow { margin: 0; font-size: 10px; }
  .hero .logo { --fs: 44px; margin: 20px 0 8px; }
  .hero-headline { font-size: 32px; margin: 16px 0 8px; }
  .hero .intro { font-size: 11px; margin: 6px 0; }
  .hero .home-stage { height: 85px; margin: 0 -8px 10px; }
  .hero .home-stage .softie { width: 64px; bottom: 0; }
  .hero .home-stage .softie:nth-child(3) { width: 82px; }
  .hero-facts { padding-top: 14px; }
  .hero-facts b { font-size: 23px; }
  .hero-star { right: 18px; top: 180px; font-size: 32px; }
  .adventure-panel { padding-top: 32px; }
  .adventure-heading h2 { font-size: 25px; }
  .activity-bar { gap: 7px; }
  .section-label { margin-bottom: 16px; }
  .result-screen { padding: 23px 16px; }
  .question-card { padding: 16px 14px 12px; }
  .arcade-hud { padding: 12px; }
  .play-stage { height: 95px; }
}

@media (max-width: 380px) {
  #app { padding: 0 14px; }
  .brand small { letter-spacing: 0; }
  .top-actions { gap: 6px; }
  .hero .logo { --fs: 40px; }
  .hero-headline { font-size: 30px; }
  .hero .home-stage .softie { width: 57px; }
  .hero .home-stage .softie:nth-child(3) { width: 72px; }
  .section-label { flex-direction: column; align-items: flex-start; }
  .level-card { padding: 12px; gap: 8px; }
  .level-card small { font-size: 10px; }
  .activity-label { font-size: 10px; }
}

body.reduced .choice.picked, body.reduced .combo-box.hot,
body.reduced .result-score, body.reduced .result-detail, body.reduced .target-word { animation: none; }
body.reduced button, body.reduced .level-card { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .choice.picked, .combo-box.hot, .result-score, .result-detail, .target-word { animation: none; }
  button, .level-card { transition: none; }
}

/* 站内返回入口与来源署名。 */
.academy-game-nav {position:relative;z-index:12;display:flex;justify-content:space-between;gap:16px;max-width:1180px;margin:0 auto;padding:14px 32px 0;font-size:12px;}
.academy-game-nav a {color:var(--ink);text-decoration:none;padding:6px 0;min-height:32px;}
#app > footer a {color:var(--blue);text-underline-offset:3px;}
@media(max-width:760px){.academy-game-nav{max-width:560px;padding:12px 20px 0;}}
