:root {
  --bg: #f3f6ff; --bg2: #e6ecff; --card: #ffffff; --ink: #1f2a44; --sub: #5d6b8a; --line: #dde3f3;
  --pri: #5b6cff; --pri2: #8a5bff; --ok: #22b573; --ok-bg: #e5f8ef; --bad: #ef4b5a; --bad-bg: #fde9eb; --mid: #f5a623; --mid-bg: #fff4e0;
  --gold: #ffb800; --shadow: 0 6px 20px rgba(60, 80, 160, .12); --r: 18px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --fun: "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); background-image: radial-gradient(circle at 10% 0%, #e3e8ff 0, transparent 40%), radial-gradient(circle at 90% 100%, #ffe9f4 0, transparent 40%); min-height: 100vh; font-size: 16px; line-height: 1.6; }
#app { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; min-height: 100vh; }
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:disabled { cursor: default; }
.dim { opacity: .25; }

/* ---------- 通用组件 ---------- */
.btn { padding: 10px 18px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 700; transition: transform .1s, box-shadow .2s; box-shadow: 0 3px 0 var(--line); }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn.primary { background: linear-gradient(135deg, var(--pri), var(--pri2)); color: #fff; border-color: transparent; box-shadow: 0 3px 0 #3c45b8; }
.btn.boss { background: linear-gradient(135deg, #ff6b6b, #c2185b); color: #fff; border-color: transparent; box-shadow: 0 3px 0 #8e1043; }
.btn.boss.locked { background: #c9cfdf; box-shadow: 0 3px 0 #a9b0c2; }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; box-shadow: 0 3px 0 #b02a37; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--sub); }
.btn.big { padding: 14px 30px; font-size: 1.15em; width: 100%; margin-top: 12px; }
.btn.small { padding: 6px 12px; font-size: .9em; }
.btn:disabled { opacity: .5; }
.panel { background: var(--card); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); margin: 14px 0; }
.panel h3 { margin: 0 0 6px; }
.panel p { margin: 6px 0; }
.lbl { display: block; font-weight: 700; color: var(--sub); margin: 12px 0 6px; font-size: .92em; }
.inp { width: 100%; padding: 11px 14px; border-radius: 12px; border: 2px solid var(--line); font: inherit; background: #fafbff; }
.inp:focus { outline: none; border-color: var(--pri); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row .inp { flex: 1; min-width: 160px; }
.tip { color: var(--sub); font-size: .88em; margin: 4px 0 10px; }
.chip { background: #fff7d6; color: #8a6200; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .9em; }
.chipbtn { padding: 7px 14px; border-radius: 999px; border: 2px solid var(--line); background: #fff; margin: 4px 6px 4px 0; font-weight: 600; }
.chipbtn.on { background: var(--c, var(--pri)); border-color: var(--c, var(--pri)); color: #fff; }
.empty { text-align: center; padding: 40px; color: var(--sub); font-size: 1.1em; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 16px; margin: 0 -16px; background: rgba(243, 246, 255, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tb-title { flex: 1; font-weight: 800; font-size: 1.08em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 欢迎 & 首页 ---------- */
.logo { font-family: var(--fun); font-size: 2.6em; font-weight: 900; letter-spacing: 2px; background: linear-gradient(135deg, #5b6cff, #e040fb 60%, #ff8a3d); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.2; }
.logo span { margin-left: 4px; }
.logo.big { font-size: 3.4em; text-align: center; margin-top: 40px; animation: bob 3s ease-in-out infinite; }
.slogan { color: var(--sub); font-weight: 600; letter-spacing: 1px; }
.welcome .slogan { text-align: center; margin-bottom: 10px; }
.welcome .panel { max-width: 520px; margin: 14px auto; }
.av-row { display: flex; gap: 10px; flex-wrap: wrap; }
.av { font-size: 2em; width: 64px; height: 64px; border-radius: 18px; background: #f1f4ff; border: 3px solid transparent; }
.av.on { border-color: var(--pri); background: #e6e9ff; transform: scale(1.06); }
.hero { text-align: center; padding: 26px 0 6px; }
.player { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--r); padding: 14px 18px; box-shadow: var(--shadow); margin: 12px 0; }
.pav { font-size: 2.8em; width: 74px; height: 74px; display: grid; place-items: center; background: linear-gradient(135deg, #e8ebff, #fde8ff); border-radius: 22px; flex-shrink: 0; }
.pinfo { flex: 1; min-width: 0; }
.pname { font-weight: 800; font-size: 1.15em; }
.ptitle { font-size: .72em; background: linear-gradient(135deg, var(--gold), #ff7a00); color: #fff; padding: 2px 9px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.lvline { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--pri); font-size: .9em; }
.lvline small { color: var(--sub); font-weight: 500; }
.xpbar { flex: 1; height: 10px; background: #e9edfa; border-radius: 99px; overflow: hidden; }
.xpbar.wide { margin-top: 8px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #6ee7b7, #3b82f6); border-radius: 99px; transition: width .6s; }
.pstats { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9em; color: var(--sub); margin-top: 4px; font-weight: 600; }
.tile { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s; border: 2px solid transparent; }
.tile:hover { transform: translateY(-3px); border-color: #cfd6ff; }
.tile .ti { font-size: 2em; }
.tile small { color: var(--sub); font-size: .8em; }
.hero-tile { width: 100%; flex-direction: row; justify-content: center; gap: 16px; padding: 20px; background: linear-gradient(135deg, #5b6cff, #a35bff 55%, #ff6ba8); color: #fff; font-size: 1.25em; margin-bottom: 12px; animation: glow 2.5s ease-in-out infinite; }
.hero-tile .ti { font-size: 2.2em; }
.hero-tile span:last-child { display: flex; flex-direction: column; align-items: flex-start; }
.hero-tile small { color: #f0eaff; font-size: .65em; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ---------- 地图 ---------- */
.map { position: relative; }
.isles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 8px 0; }
.isle { position: relative; background: var(--card); border-radius: 24px; padding: 18px 14px; text-align: center; box-shadow: var(--shadow); border: 3px solid transparent; animation: popin .5s both; overflow: hidden; }
.isle::before { content: ""; position: absolute; top: auto; right: -20%; bottom: -50%; left: -20%; height: 70%; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); }
.isle:hover { transform: translateY(-4px) rotate(-.5deg); border-color: var(--c); }
.isle.lit { border-color: var(--gold); box-shadow: 0 0 0 4px #fff3c4, var(--shadow); }
.isle-ico { font-size: 3.2em; animation: bob 3s ease-in-out infinite; position: relative; }
.isle-name { font-family: var(--fun); font-size: 1.4em; font-weight: 900; color: var(--c); position: relative; }
.isle-book { font-size: .85em; color: var(--sub); font-weight: 700; position: relative; }
.isle-intro { font-size: .82em; color: var(--sub); margin: 6px 0; min-height: 2.6em; position: relative; }
.isle-prog { display: flex; justify-content: center; gap: 12px; font-weight: 700; font-size: .9em; position: relative; }
.lit-tag { position: absolute; top: 10px; right: -28px; background: var(--gold); color: #fff; font-size: .75em; font-weight: 800; padding: 2px 30px; transform: rotate(35deg); }

/* ---------- 单元列表 ---------- */
.unit { display: grid; grid-template-columns: 46px 1fr auto; grid-template-areas: "no main boss" "btns btns btns"; gap: 6px 12px; align-items: center; background: var(--card); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); margin: 12px 0; border-left: 6px solid var(--c); animation: popin .4s both; }
.unit.beat { background: linear-gradient(90deg, #fffbe9, #fff); }
.u-no { grid-area: no; width: 42px; height: 42px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 1.2em; }
.u-main { grid-area: main; min-width: 0; }
.u-title { font-weight: 800; font-size: 1.1em; }
.u-sub { color: var(--sub); font-size: .85em; }
.u-stars { color: var(--gold); font-size: 1.1em; letter-spacing: 2px; }
.u-stars small { color: var(--sub); font-size: .7em; letter-spacing: 0; }
.u-boss { grid-area: boss; font-size: 2.2em; animation: bob 2.4s ease-in-out infinite; }
.u-btns { grid-area: btns; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 知识卡 ---------- */
.kcard-wrap { perspective: 1000px; margin-top: 10px; overflow-x: clip; overflow-clip-margin: 12px; } /* 滑入动画不引起手机横向滚动 */
.kcard { background: var(--card); border-radius: 24px; padding: 24px 26px; min-height: 300px; box-shadow: var(--shadow); border-top: 8px solid var(--c); }
.kcard.in-r { animation: inr .35s; } .kcard.in-l { animation: inl .35s; }
.kno { color: var(--sub); font-size: .85em; font-weight: 700; }
.kt { font-size: 1.4em; font-weight: 900; color: var(--c); margin: 6px 0 12px; }
.kc { font-size: 1.07em; line-height: 1.9; }
.kdots { display: flex; justify-content: center; gap: 6px; margin: 14px 0; flex-wrap: wrap; }
.kdots i { width: 9px; height: 9px; border-radius: 50%; background: #cfd6ea; }
.kdots i.on { background: var(--c); width: 22px; border-radius: 9px; }
.knav, .kfoot { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0; }
.kfoot { flex-wrap: wrap; } .kfoot .btn { flex: 1 1 auto; }
/* 背一背 */
.rc-prog { text-align: center; color: var(--sub); font-size: .88em; font-weight: 700; margin-top: 8px; min-height: 1.2em; }
.rc-tag { font-weight: 700; margin-left: 6px; color: var(--c); }
.rc-ask { font-size: 1.02em; line-height: 1.8; color: var(--sub); border: 2px dashed var(--line, #cfd6ea); border-radius: 14px; padding: 14px 16px; }
.rc-hint { margin-top: 12px; line-height: 1.9; color: var(--sub); }
.rc-btns { margin-top: 14px; } .rc-btns .btn { flex: 1 1 0; padding: 10px 6px; white-space: nowrap; }
.rc-sum { font-size: 1.05em; } .rc-stat { margin: 4px 0 8px; font-weight: 600; } .rep-recite .rbar { margin-bottom: 8px; } .rc-list { margin: 4px 0 10px 1.2em; padding: 0; line-height: 1.8; }
.allcards { max-height: 60vh; overflow: auto; text-align: left; }
.allcards p { margin: 2px 0 12px; color: #33405e; }

/* ---------- 运行 HUD ---------- */
.hud { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow); position: sticky; top: 58px; z-index: 15; }
.hearts span { font-size: 1.25em; transition: .3s; display: inline-block; }
.hearts span.lost { filter: grayscale(1); opacity: .3; transform: scale(.8); }
.mode-tag { font-weight: 700; font-size: .9em; color: var(--pri); }
.prog { flex: 1; height: 14px; background: #e9edfa; border-radius: 99px; position: relative; overflow: hidden; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, #6ee7b7, #3b82f6); transition: width .4s; }
.prog span { position: absolute; top: 0; right: 0; bottom: 0; left: 0; text-align: center; font-size: .72em; font-weight: 800; line-height: 14px; color: #34405e; }
.score { font-weight: 900; font-size: 1.2em; color: var(--pri); min-width: 50px; text-align: right; }
.combo { font-weight: 800; font-size: .9em; color: var(--mid); min-width: 0; white-space: nowrap; }
.combo.warm { color: #ff7a00; } .combo.hot { color: #ff2d55; animation: pulse .6s infinite; }
.stage { margin-top: 14px; }
.ch-wrap { animation: popin .35s both; }

/* ---------- 题目卡 ---------- */
.qcard, .game { background: var(--card); border-radius: 22px; padding: 18px 20px 20px; box-shadow: var(--shadow); }
.qhead, .ghead { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.qtag { font-size: .78em; font-weight: 800; padding: 3px 10px; border-radius: 999px; color: #fff; background: var(--pri); }
.qtag.t-m { background: #8a5bff; } .qtag.t-j { background: #00a3c4; } .qtag.t-g { background: #ff8a3d; } .qtag.t-c { background: #6d4c41; }
.qsrc { font-size: .78em; color: var(--sub); }
.qtext { font-size: 1.18em; font-weight: 700; line-height: 1.75; margin-bottom: 14px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opts.judge-row { flex-direction: row; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 16px; border-radius: 14px; background: #f5f7ff; border: 2px solid #e4e9fb; font-size: 1.02em; transition: .15s; width: 100%; }
.opt b { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--pri); border: 2px solid #dfe4fb; font-size: .9em; }
.opt:hover:not(:disabled) { border-color: var(--pri); background: #eef0ff; }
.opt.sel { border-color: var(--pri); background: #e7e9ff; }
.opt.sel b { background: var(--pri); color: #fff; border-color: var(--pri); }
.opt.right { border-color: var(--ok) !important; background: var(--ok-bg) !important; animation: pulse1 .4s; }
.opt.right b { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt.wrong { border-color: var(--bad) !important; background: var(--bad-bg) !important; animation: shake .4s; }
.opt.wrong b { background: var(--bad); color: #fff; border-color: var(--bad); }
.opt.mid { border-color: var(--mid) !important; background: var(--mid-bg) !important; }
.opt.judge { justify-content: center; font-size: 1.25em; font-weight: 800; padding: 18px; }
.submit { margin-top: 14px; width: 100%; }
.explain { display: none; margin-top: 14px; padding: 14px 16px; background: #f8f9ff; border-radius: 14px; border: 2px dashed #d7ddf5; animation: popin .3s; }
.explain.show { display: block; }
.verdict { font-weight: 900; font-size: 1.12em; }
.verdict.ok, .verdict.s2 { color: var(--ok); } .verdict.bad, .verdict.s0 { color: var(--bad); } .verdict.s1 { color: var(--mid); }
.right-ans { font-weight: 700; margin: 4px 0; color: #2c3a5c; }
.exp-text { color: #33405e; margin-top: 4px; }
.next-btn { display: block; margin: 14px 0 0 auto; min-width: 140px; }
.stepno { display: inline-block; font-size: .78em; font-weight: 800; color: #fff; background: #ff8a3d; padding: 1px 9px; border-radius: 99px; margin: 8px 8px 6px 0; }

/* ---------- 分类 ---------- */
.game h3 { margin: 4px 0 10px; font-size: 1.15em; }
.sort-stage { text-align: center; padding: 6px 0 16px; }
.sort-left { font-size: .85em; color: var(--sub); font-weight: 700; }
.sort-card { display: inline-flex; align-items: center; justify-content: center; min-height: 92px; min-width: 260px; max-width: 100%; padding: 16px 24px; margin-top: 8px; border-radius: 18px; background: linear-gradient(135deg, #fff7e6, #ffe9c7); border: 3px solid #ffd28a; font-size: 1.2em; font-weight: 800; box-shadow: 0 6px 0 #f1c27a; }
.sort-card.pop, .sp-card.pop { animation: popin .3s; }
.buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.bucket { padding: 16px 10px; border-radius: 16px; color: #fff; font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); transition: transform .1s; }
.bucket:active { transform: translateY(3px); }
.bucket.b0 { background: #4f7cff; } .bucket.b1 { background: #ff8a3d; } .bucket.b2 { background: #22b573; } .bucket.b3 { background: #b05bff; }
.bcount { background: rgba(255, 255, 255, .3); border-radius: 99px; padding: 0 10px; font-size: .85em; }
.bucket.flash-ok { animation: pulse1 .3s; } .bucket.flash-bad { animation: shake .4s; filter: saturate(.3); }
.bucket.hint { outline: 4px solid var(--gold); outline-offset: 2px; animation: pulse .5s 2; }
.sort-review { margin-top: 8px; font-size: .93em; line-height: 1.8; }

/* ---------- 连线 ---------- */
.mcols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mcol { display: flex; flex-direction: column; gap: 10px; }
.mitem { padding: 12px; border-radius: 14px; background: #f5f7ff; border: 2px solid #e4e9fb; font-weight: 700; min-height: 54px; transition: .15s; }
.mcol.left .mitem { background: #eef4ff; }
.mitem.sel { border-color: var(--pri); background: #dfe3ff; transform: scale(1.03); box-shadow: 0 0 0 4px #e0e4ff; }
.mitem.matched { color: #fff; border-color: transparent; animation: pulse1 .35s; }
.mitem.c0 { background: #4f7cff; } .mitem.c1 { background: #ff8a3d; } .mitem.c2 { background: #22b573; } .mitem.c3 { background: #b05bff; } .mitem.c4 { background: #e94b8a; } .mitem.c5 { background: #00a3c4; }
.mitem.flash-bad { animation: shake .4s; border-color: var(--bad); }
.mitem.nudge { animation: shake .3s; }

/* ---------- 排序 ---------- */
.slots { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: #eef4ff; border: 2px solid #d6e1ff; min-height: 50px; font-weight: 700; cursor: pointer; animation: popin .25s; }
.slot.empty { background: #fafbff; border-style: dashed; cursor: default; animation: none; }
.slot .num { width: 28px; height: 28px; border-radius: 50%; background: var(--pri); color: #fff; display: grid; place-items: center; flex-shrink: 0; font-size: .9em; }
.slot.right { background: var(--ok-bg); border-color: var(--ok); } .slot.right .num { background: var(--ok); }
.slot.wrong { background: var(--bad-bg); border-color: var(--bad); } .slot.wrong .num { background: var(--bad); }
.pool { display: flex; flex-wrap: wrap; gap: 8px; }
.pitem { padding: 10px 14px; border-radius: 14px; background: linear-gradient(135deg, #fff7e6, #ffe9c7); border: 2px solid #ffd28a; font-weight: 700; box-shadow: 0 3px 0 #f1c27a; text-align: left; }

/* ---------- 情境 & 案例 ---------- */
.story { background: linear-gradient(135deg, #f0f7ff, #f9f0ff); border-radius: 16px; padding: 14px 16px; line-height: 1.85; border-left: 5px solid #8a5bff; margin-bottom: 10px; }
.case-story { background: linear-gradient(135deg, #fbf6ef, #f5ece0); border-left-color: #6d4c41; }
.step { margin-top: 12px; }
.step-q { font-weight: 800; font-size: 1.08em; margin-bottom: 10px; }
.scene-end { margin-top: 8px; font-weight: 800; color: var(--gold); font-size: 1.1em; }
.casegame .qcard { box-shadow: none; padding: 6px 0 0; }

/* ---------- 结算 ---------- */
.result { background: var(--card); border-radius: 24px; padding: 26px 22px; box-shadow: var(--shadow); text-align: center; animation: popin .4s; }
.res-title { font-family: var(--fun); font-size: 1.9em; font-weight: 900; }
.res-stars { font-size: 3.2em; letter-spacing: 8px; margin: 6px 0; }
.res-stars span { color: #d8ddea; display: inline-block; }
.res-stars span.on { color: var(--gold); animation: starin .5s both; text-shadow: 0 4px 12px rgba(255, 184, 0, .45); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 16px 0; }
.res-grid div { background: #f5f7ff; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; }
.res-grid b { font-size: 1.6em; color: var(--pri); }
.res-grid b.red { color: #e53935; } .res-grid b.blue { color: #1e88e5; }
.res-grid small { color: var(--sub); }
.res-tip { color: #4a5677; font-weight: 600; }
.res-wrong { text-align: left; background: #fff8f8; border-radius: 14px; padding: 12px 16px; margin: 12px 0; font-size: .93em; }
.res-wrong .wr { margin: 6px 0; }
.res-wrong .ans { color: var(--ok); font-style: normal; font-weight: 800; }
.res-wrong small { color: var(--sub); display: block; padding-left: 12px; }
.res-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }

/* ---------- Boss ---------- */
.arena { display: flex; align-items: center; justify-content: space-around; background: linear-gradient(135deg, #2b2d5c, #5a2a6b); border-radius: 24px; padding: 18px 10px; color: #fff; box-shadow: var(--shadow); }
.fighter { text-align: center; width: 40%; }
.f-ico { font-size: 3.6em; display: inline-block; }
.foe .f-ico { font-size: 4.6em; animation: bob 2s ease-in-out infinite; }
.f-ico.hit { animation: hit .5s !important; }
.f-name { font-weight: 800; margin: 2px 0 6px; }
.hpbar { height: 14px; background: rgba(255, 255, 255, .2); border-radius: 99px; overflow: hidden; }
.hpbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #6ee7b7, #22c55e); transition: width .5s; }
.hpbar i.low { background: linear-gradient(90deg, #ff8a80, #ef4444); }
.hpbar.foe i { background: linear-gradient(90deg, #ff9a3d, #ff3d6e); }
.vs { font-family: var(--fun); font-size: 2em; font-weight: 900; color: var(--gold); animation: pulse 1.2s infinite; }
.bubble { position: relative; background: #fff; border-radius: 16px; padding: 10px 16px; margin: 12px auto 4px; width: fit-content; max-width: 90%; font-weight: 700; box-shadow: var(--shadow); text-align: center; }
.timer { height: 8px; background: #e2e6f3; border-radius: 99px; overflow: hidden; margin: 10px 0; }
.timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #3b82f6, #8a5bff); transition: width .1s linear; }
.timer i.low { background: var(--bad); }
.boss-final { font-size: 5em; animation: hit .8s; }
.big-emoji { font-size: 4em; text-align: center; }

/* ---------- 快问快答 ---------- */
.sp-hud { display: flex; justify-content: space-between; align-items: center; font-weight: 900; }
.sp-time { font-size: 2.4em; color: var(--pri); font-variant-numeric: tabular-nums; }
.sp-score { font-size: 1.8em; color: var(--ok); }
.sp-card { background: var(--card); border-radius: 22px; padding: 30px 24px; min-height: 180px; display: flex; align-items: center; justify-content: center; text-align: center; box-shadow: var(--shadow); margin: 10px 0 16px; }
.sp-card .qtext { margin: 0; font-size: 1.3em; }
.sp-card.flash-ok { box-shadow: 0 0 0 5px var(--ok); }
.sp-btns { display: flex; gap: 14px; }
.sp-btns .opt { font-size: 1.4em; padding: 24px; }
.sp-btns .yes { background: var(--ok-bg); border-color: #a9e8c9; color: #13804f; }
.sp-btns .no { background: var(--bad-bg); border-color: #f6b9c0; color: #b52130; }
.speed .tip { text-align: center; }

/* ---------- PK ---------- */
.pk-board { display: flex; align-items: center; gap: 10px; }
.team { flex: 1; border-radius: 18px; padding: 10px 16px; color: #fff; display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.15em; opacity: .55; transition: .3s; }
.team b { font-size: 1.6em; }
.team.red { background: linear-gradient(135deg, #ff6b6b, #e53935); } .team.blue { background: linear-gradient(135deg, #4fc3f7, #1e88e5); }
.team.active { opacity: 1; transform: scale(1.04); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.pk-round { font-weight: 800; color: var(--sub); white-space: nowrap; font-size: .9em; }
.pk-turn { text-align: center; margin: 12px 0 0; font-weight: 900; font-size: 1.2em; }
.pk-turn .red { color: #e53935; } .pk-turn .blue { color: #1e88e5; }
.bossq { background: #2b2d5c; color: var(--gold); padding: 2px 10px; border-radius: 99px; font-size: .8em; }
.pk-names { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.pk-names span { font-weight: 900; color: var(--sub); }
.pk-names .red { border-color: #ffb3b3; } .pk-names .blue { border-color: #a9d8ff; }

/* ---------- 错题本 / 图鉴 / 徽章 / 商店 ---------- */
.wb-unit { background: var(--card); border-radius: var(--r); padding: 12px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.wb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.wb-item { border-top: 1px solid var(--line); padding: 8px 0; }
.wb-item summary { cursor: pointer; font-weight: 600; }
.wb-item div { margin: 6px 0 0 14px; font-size: .93em; color: #33405e; }
.prog1 { color: var(--ok); font-style: normal; font-size: .8em; }
.cx-tabs { margin: 6px 0 4px; }
.cx-search { display: flex; gap: 8px; margin: 10px 0 6px; } .cx-search .inp { flex: 1; min-width: 0; } .cx-search .btn { flex: none; }
.cx-res .tip { margin: 4px 2px 8px; }
.cx-hit { display: block; width: 100%; text-align: left; background: var(--card); border-radius: var(--r); padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow); border-left: 5px solid var(--c); color: var(--ink); }
.cx-hit small { color: var(--sub); } .cx-hit b { display: block; margin: 3px 0; } .cx-hit p { margin: 0; color: var(--sub); font-size: .9em; line-height: 1.6; }
.cx-res mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
.cx-fills p { margin: 6px 0; line-height: 1.6; } .cx-fills small { color: var(--sub); }
html.dark .cx-res mark { background: #7a5d00; }
.cx-units { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cx-unit { text-align: left; background: var(--card); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); border-top: 5px solid var(--c); position: relative; display: flex; flex-direction: column; }
.cx-unit small { color: var(--sub); }
.cx-cnt { position: absolute; top: 12px; right: 14px; font-weight: 800; color: var(--c); font-size: .9em; }
.cx-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.cx-list span { font-size: .76em; padding: 2px 8px; border-radius: 99px; background: #eef1f8; color: #8a93ad; }
.cx-list span.on { background: color-mix(in srgb, var(--c) 16%, #fff); color: var(--ink); }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { background: var(--card); border-radius: var(--r); padding: 14px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; filter: grayscale(1); opacity: .5; }
.badge.got { filter: none; opacity: 1; border: 2px solid #ffe08a; }
.badge .bi { font-size: 2.6em; }
.badge small { color: var(--sub); font-size: .8em; }
.badge i { font-size: .72em; color: var(--gold); font-style: normal; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.sitem { background: var(--card); border-radius: var(--r); padding: 14px 8px; box-shadow: var(--shadow); border: 3px solid transparent; }
.sitem .sav { font-size: 2.8em; }
.sitem small { font-weight: 700; color: #8a6200; }
.sitem.owned small { color: var(--pri); }
.sitem.using { border-color: var(--ok); } .sitem.using small { color: var(--ok); }
.scope-books { display: flex; flex-wrap: wrap; }
.about p { color: var(--sub); font-size: .92em; }
textarea.inp { margin: 10px 0; resize: vertical; font-family: monospace; font-size: .8em; }

/* ---------- 弹窗 / 提示 / 特效 ---------- */
.modal-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(20, 24, 50, .5); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fadein .2s; }
.modal { background: #fff; border-radius: 22px; padding: 22px; max-width: 560px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: popin .3s; }
.modal-body { text-align: center; font-size: 1.05em; }
.modal-btns { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: #23284a; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: toastin .35s; display: flex; align-items: center; gap: 8px; transition: .4s; }
.toast .ti { font-size: 1.4em; }
.toast.out { opacity: 0; transform: translateY(-10px); }
.floater { position: fixed; z-index: 150; font-weight: 900; font-size: 1.5em; pointer-events: none; transform: translate(-50%, 0); animation: floatup 1.1s forwards; text-shadow: 0 2px 0 #fff, 0 0 8px #fff; }
.floater.good { color: var(--ok); } .floater.bad { color: var(--bad); } .floater.crit { color: #ff2d55; font-size: 2em; }
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 300; pointer-events: none; animation: fall linear forwards; border-radius: 2px; }
.shake { animation: shake .4s; }

@keyframes popin { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes glow { 50% { box-shadow: 0 8px 30px rgba(140, 90, 255, .45); } }
@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes pulse1 { 50% { transform: scale(1.04); } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes hit { 0% { transform: none; filter: none; } 20% { transform: translateX(14px) rotate(8deg) scale(.9); filter: brightness(2) saturate(0); } 50% { transform: translateX(-10px) rotate(-6deg); } 100% { transform: none; } }
@keyframes inr { from { opacity: 0; transform: translateX(60px) rotateY(-12deg); } }
@keyframes inl { from { opacity: 0; transform: translateX(-60px) rotateY(12deg); } }
@keyframes starin { 0% { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3); } 100% { transform: none; } }
@keyframes floatup { to { transform: translate(-50%, -70px); opacity: 0; } }
@keyframes toastin { from { opacity: 0; transform: translateY(-16px); } }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .isles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cx-units { grid-template-columns: 1fr; }
  .logo { font-size: 2.1em; } .logo.big { font-size: 2.7em; }
  .qtext { font-size: 1.06em; }
  .hud { gap: 8px; padding: 7px 12px; } .hearts span { font-size: 1.05em; }
  .f-ico { font-size: 2.6em; } .foe .f-ico { font-size: 3.4em; }
}
@media (max-width: 420px) {
  .isles { grid-template-columns: 1fr; }
  .mcols { gap: 8px; } .mitem { font-size: .88em; padding: 10px 6px; }
  .combo { display: none; }
  .unit { grid-template-columns: 40px 1fr auto; padding: 12px; }
  .u-btns .btn { flex: 1; }
}
@media (min-width: 1200px) { body { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ---------- 第二版新增 ---------- */
.tiles { grid-template-columns: repeat(5, 1fr); }
.bossfight.rage .arena { background: linear-gradient(135deg, #5c1020, #9c1c3a); animation: ragepulse 1.2s ease-in-out infinite; }
.bossfight.rage .foe .f-ico { filter: drop-shadow(0 0 14px #ff3d3d) saturate(1.6); font-size: 5.4em; }
.bossfight.rage .vs { color: #ff5252; }
@keyframes ragepulse { 50% { box-shadow: 0 0 0 6px rgba(255, 61, 61, .35), var(--shadow); } }
.isle-bosses { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; text-align: center; }
.isle-bosses div { background: #f5f7ff; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; }
.isle-bosses span { font-size: 2em; }
.isle-bosses small { color: var(--sub); font-size: .75em; line-height: 1.4; }
.mock-score { margin: 10px 0; }
.mock-score b { font-size: 4em; color: var(--pri); font-family: var(--fun); }
.mock-score span { font-size: 1.2em; color: var(--sub); margin-right: 10px; }
.mock-score i { font-style: normal; font-weight: 900; padding: 4px 14px; border-radius: 99px; color: #fff; vertical-align: super; }
.mock-score .gA { background: var(--ok); } .mock-score .gB { background: #3b82f6; } .mock-score .gC { background: var(--mid); } .mock-score .gD { background: var(--bad); }
.rep-books { text-align: left; margin: 10px 0; }
.rep-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.rep-row:last-child { border-bottom: none; }
.rep-row > span:first-child, .rn { width: 34%; min-width: 110px; font-weight: 600; font-size: .92em; }
.rbar { flex: 1; height: 12px; background: #e9edfa; border-radius: 99px; overflow: hidden; }
.rbar i { display: block; height: 100%; border-radius: 99px; background: var(--pri); transition: width .6s; }
.rbar i.good { background: var(--ok); } .rbar i.mid { background: var(--mid); } .rbar i.bad { background: var(--bad); }
.rep-row b { min-width: 52px; text-align: right; font-size: .9em; }
b.good { color: var(--ok); } b.mid { color: var(--mid); } b.bad, i.bad { color: var(--bad); font-style: normal; } b.none { color: #a0a8bd; font-weight: 500; }
.rs { color: var(--gold); min-width: 70px; font-size: .9em; }
.rep-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
.rep-sum div { display: flex; flex-direction: column; } .rep-sum b { font-size: 1.6em; color: var(--pri); } .rep-sum small { color: var(--sub); }
.rep-book { border-top: 5px solid var(--c); } .rep-book h3 { color: var(--c); }
.weak-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.weak-row .btn { margin-left: 6px; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, 1fr); } .rep-sum { grid-template-columns: repeat(2, 1fr); } .rs { display: none; } }

/* ---------- 第三轮：关键词填空 / 主观题工坊 ---------- */
.tiles { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.qtag.t-f { background: #00897b; } .qtag.t-e { background: #d81b60; }
.fill-s { font-size: 1.12em; line-height: 2.3; background: var(--card); border: 2px dashed var(--line); border-radius: 16px; padding: 14px 16px; margin: 6px 0 14px; }
.blank { display: inline-block; min-width: 4.2em; padding: 0 10px; margin: 0 3px; border-radius: 10px; background: #eef1ff; border-bottom: 3px solid var(--pri); font-weight: 700; color: var(--pri); line-height: 1.8; vertical-align: baseline; }
.blank.empty i { font-style: normal; opacity: .45; font-size: .85em; }
.blank.cur { background: #fff4c2; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 184, 0, .3); animation: pulse1 1.2s infinite; }
.blank.right { background: var(--ok-bg); border-color: var(--ok); color: #138a55; animation: none; box-shadow: none; }
.blank.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); text-decoration: line-through; animation: none; box-shadow: none; }
.blank-in { display: inline-block; max-width: 100%; margin: 0 3px; padding: 0 6px; border: 0; border-bottom: 3px solid var(--pri); border-radius: 10px; background: #eef1ff; color: var(--pri); font: inherit; font-weight: 700; line-height: 1.8; text-align: center; vertical-align: baseline; }
.blank-in:focus { outline: none; background: #fff4c2; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 184, 0, .3); }
.blank-in::placeholder { color: var(--pri); opacity: .4; font-weight: 400; font-size: .85em; }
.blank-in.right { background: var(--ok-bg); border-color: var(--ok); color: #138a55; box-shadow: none; }
.blank-in.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); text-decoration: line-through; box-shadow: none; }
.typed-fix { margin: 6px 0; padding-left: 1.4em; color: var(--bad); }
.fill-mode { margin-top: 10px; } .fill-mode .chipbtn small { display: block; font-weight: 400; opacity: .75; }
.fill-bank { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pitem.used { opacity: .3; }
.sort-review u { text-decoration: none; background: #fff1a8; padding: 0 3px; border-radius: 4px; font-weight: 700; }
.material { border-left-color: #d81b60; }
.mtag { display: inline-block; font-size: .78em; font-weight: 700; color: #fff; background: #d81b60; border-radius: 6px; padding: 0 8px; margin-right: 8px; }
.mtag.q { background: var(--pri); }
.eq { font-weight: 700; margin: 4px 0 8px; line-height: 1.8; }
.echips { display: grid; gap: 8px; margin: 8px 0 12px; }
.echip { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; text-align: left; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); line-height: 1.6; }
.echip .ck { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 6px; border: 2px solid #b8c1dc; }
.echip > span:nth-child(2) { flex: 1; min-width: 0; }
.echip.sel { border-color: var(--pri); background: #eef1ff; }
.echip.sel .ck { background: var(--pri); border-color: var(--pri); box-shadow: inset 0 0 0 3px #fff; }
.echip.right { border-color: var(--ok); background: var(--ok-bg); }
.echip.right .ck { background: var(--ok); border-color: var(--ok); }
.echip.miss { border-color: var(--mid); border-style: dashed; background: var(--mid-bg); }
.echip.wrong { border-color: var(--bad); background: var(--bad-bg); }
.echip.wrong .ck { background: var(--bad); border-color: var(--bad); }
.echip.off { opacity: .55; }
.echip .why { flex-basis: 100%; padding-left: 30px; color: var(--sub); font-size: .88em; }
.echip.wrong .why { color: var(--bad); }
.echip.miss .why { color: #b7770a; font-weight: 700; }
.essay-score { font-family: var(--fun); font-size: 1.4em; text-align: center; }
.essay-score b { font-size: 1.8em; color: #d81b60; }
.model-ans { background: #fffaf0; border: 2px solid #ffe0a3; border-radius: 14px; padding: 12px 14px; margin: 10px 0; line-height: 1.85; }
.model-ans b { display: block; margin-bottom: 4px; }

/* 学习报告 · 交给老师 / 教师汇总 */
.rep-send .row, .teacher .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rep-send .row .inp { flex: 1; min-width: 180px; }
.rep-send textarea.inp, .teacher textarea.inp { width: 100%; box-sizing: border-box; }
.teacher .tip.bad { color: var(--bad); }
.teacher .rs { color: var(--sub); min-width: 96px; }
.t-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.t-table { border-collapse: collapse; width: 100%; font-size: .88em; white-space: nowrap; }
.t-table th, .t-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.t-table th { background: var(--bg2); position: sticky; top: 0; }
.t-table td.good { color: var(--ok); font-weight: 700; } .t-table td.mid { color: var(--mid); font-weight: 700; } .t-table td.bad { color: var(--bad); font-weight: 700; }
.wb-kp { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 6px 10px; border-radius: 10px; background: var(--bg2); font-size: .92em; }
.wb-kp:first-child { margin-top: 4px; }
.wb-kp .btn, .wb-head .btn { white-space: nowrap; flex-shrink: 0; }

/* 组卷打印 */
.pp-book { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.pp-book .pp-b { font-weight: 700; }
.pp-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.pp-cnt { display: flex; align-items: center; gap: 8px; } .pp-cnt span { flex: 1; font-size: .92em; } .pp-cnt .inp { width: 70px; flex: none; }
.paper { background: #fff; color: #000; border-radius: var(--r); box-shadow: var(--shadow); padding: 28px 32px; margin: 14px 0; font-family: "SimSun", "Songti SC", serif; line-height: 1.8; }
.paper h2 { text-align: center; margin: 0 0 4px; font-size: 1.5em; } .pp-meta { text-align: center; color: #555; font-size: .9em; }
.pp-info { text-align: center; margin: 10px 0 16px; letter-spacing: 1px; }
.pp-sec { margin: 18px 0 8px; font-size: 1.05em; }
.pp-q { margin: 8px 0 12px; break-inside: avoid; }
.pp-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; padding-left: 1.6em; }
.pp-lines { height: 5.6em; background: repeating-linear-gradient(transparent 0 1.8em, #bbb 1.8em calc(1.8em + 1px)); margin-top: 4px; }
.pp-lines.tall { height: 11.2em; }
.pp-answers { margin-top: 28px; border-top: 2px dashed #999; padding-top: 16px; }
.pp-k { margin: 6px 0; font-size: .95em; break-inside: avoid; }
@media (max-width: 520px) { .paper { padding: 18px 14px; } .pp-opts { grid-template-columns: 1fr; } }
@media print {
  body { background: #fff !important; }
  .topbar, .no-print, #toasts, .modal-mask { display: none !important; }
  #app { max-width: none; padding: 0; }
  .paper { box-shadow: none; border-radius: 0; padding: 0; margin: 0; font-size: 11pt; }
  .pp-answers { break-before: page; border-top: none; margin-top: 0; }
}
.flag-q { display: block; margin: 10px auto 0; font-size: .82em; color: var(--sub); text-decoration: underline; padding: 4px 8px; }
.flag-q:disabled { text-decoration: none; opacity: .8; cursor: default; }
.flag-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.flag-row > b { min-width: 44px; color: var(--bad); }
.flag-row small { display: block; color: var(--sub); }

/* 自编题库 */
.bank-help { background: var(--bg2); border-radius: 10px; padding: 8px 12px; font-size: .86em; margin: 8px 0; line-height: 1.9; word-break: break-all; }
.bank-edit textarea.inp, .bank-imp textarea.inp { width: 100%; box-sizing: border-box; font-family: inherit; }
.bank-err { color: var(--bad); font-size: .9em; margin-top: 6px; } .ok-line { color: var(--ok); font-weight: 700; }
.bfile { cursor: pointer; }

/* 教师专区 */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.hub-card { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; border: 2px solid transparent; transition: transform .15s, border-color .15s; }
.hub-card:hover { transform: translateY(-2px); border-color: var(--pri); }
.hub-card .ti { font-size: 1.8em; } .hub-card b { font-size: 1.1em; } .hub-card small { color: var(--sub); line-height: 1.6; }

/* 键盘操作时清晰可见的焦点框（鼠标点击不显示） */
button:focus-visible, .btn:focus-visible, .tile:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--pri); outline-offset: 2px; }
.inp:focus-visible { outline: 2px solid var(--pri); outline-offset: 1px; }
/* 实践探究 */
.istep { margin-top: 14px; padding-top: 6px; border-top: 1px dashed var(--line, #ddd); }
.istep:first-child { border-top: 0; margin-top: 6px; }
.istep .qcard { margin-top: 0; }
.next-step { margin: 12px auto 0; display: block; }
.pp-sub { margin-top: 6px; }
/* 组卷打印：打印内容切换、提纲、默写纸 */
.pp-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.pp-m { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 8px 12px; border-radius: 12px; }
.pp-m small { color: var(--sub); font-weight: 400; font-size: .8em; }
.ol-card div { padding-left: 1.4em; }
.paper .blank { display: inline-block; background: none; border: 0; border-bottom: 1px solid #000; border-radius: 0; box-shadow: none; padding: 0; min-width: 0; margin: 0 2px; line-height: 1.3; }
/* 护眼：大字号、休息提醒 */
html.big body { font-size: 18.5px; }
.rest-tip { text-align: center; } .rest-tip .ti { font-size: 3em; line-height: 1.2; } .rest-tip h3 { margin: 4px 0 8px; }
/* 布置作业 */
.hw-card { margin-top: 12px; padding: 12px 14px; border: 2px dashed var(--line); border-radius: 14px; }
.hw-card p { margin: 6px 0; } .hw-in { margin-bottom: 8px; } .hw-ti { margin: 8px 0; }
.hw-prev { padding-left: 1.6em; margin: 6px 0; } .hw-prev li { margin: 3px 0; }
.t-hw h4 { margin: 10px 0 4px; }

/* ---------------- 深色模式（html.dark，由 JS 按设置或系统偏好切换；打印始终为浅色） ---------------- */
html.dark {
  --bg: #12152a; --bg2: #1b1f3a; --card: #1e2340; --ink: #e6e9f5; --sub: #9aa5c4; --line: #343b62;
  --ok-bg: #133a2b; --bad-bg: #3f1d24; --mid-bg: #3b2f14; --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
html.dark body { background-image: radial-gradient(circle at 10% 0%, #1f2550 0, transparent 40%), radial-gradient(circle at 90% 100%, #36203a 0, transparent 40%); }
html.dark .inp { background: #171b33; color: var(--ink); }
html.dark .chip, html.dark .sitem small { background: #3b3214; color: #ffd76a; }
html.dark .sitem small { background: none; }
html.dark .chipbtn { background: var(--card); }
html.dark .chipbtn.on { background: var(--c, var(--pri)); }
html.dark .topbar { background: rgba(18, 21, 42, .85); }
html.dark .tile:hover { border-color: #4a5390; }
html.dark .av { background: #262c50; } html.dark .av.on { background: #303870; }
html.dark .pav { background: linear-gradient(135deg, #2a2f5a, #3a2850); }
html.dark .xpbar, html.dark .prog, html.dark .rbar, html.dark .timer { background: #2a3052; }
html.dark .prog span { color: #cfd5ec; }
html.dark .unit.beat { background: linear-gradient(90deg, #3a3418, var(--card)); }
html.dark .allcards p, html.dark .exp-text, html.dark .wb-item div { color: #c3cae2; }
html.dark .right-ans { color: #dfe4f7; } html.dark .res-tip { color: #aeb8d6; }
html.dark .opt { background: #232946; border-color: #343c66; }
html.dark .opt b { background: #1a1f3a; border-color: #3d4570; }
html.dark .opt:hover:not(:disabled) { background: #2a3160; }
html.dark .opt.sel { background: #2d3470; }
html.dark .opt.sel b { background: var(--pri); }
html.dark .opt.right b { background: var(--ok); } html.dark .opt.wrong b { background: var(--bad); }
html.dark .explain { background: #1a1f3a; border-color: #3a4270; }
html.dark .sort-card, html.dark .pitem { background: linear-gradient(135deg, #3d3017, #4a3615); border-color: #7a5a20; box-shadow: 0 4px 0 #5c4415; color: var(--ink); }
html.dark .mitem:not(.matched) { background: #232946; border-color: #343c66; }
html.dark .mcol.left .mitem:not(.matched) { background: #24304f; }
html.dark .mitem.sel:not(.matched) { background: #2d3470; border-color: var(--pri); }
html.dark .slot { background: #24304f; border-color: #34446e; } html.dark .slot.empty { background: #1a1f3a; }
html.dark .slot.right { background: var(--ok-bg); border-color: var(--ok); } html.dark .slot.wrong { background: var(--bad-bg); border-color: var(--bad); }
html.dark .story { background: linear-gradient(135deg, #1f2a48, #2a2045); }
html.dark .case-story { background: linear-gradient(135deg, #2e271f, #2a2219); }
html.dark .res-grid div, html.dark .isle-bosses div { background: #232946; }
html.dark .res-stars span { color: #3a4166; } html.dark .res-stars span.on { color: var(--gold); }
html.dark .res-wrong { background: #3a1e24; }
html.dark .bubble, html.dark .modal { background: var(--card); }
html.dark .cx-list span { background: #262c48; } html.dark .cx-list span.on { background: color-mix(in srgb, var(--c) 30%, #1e2340); }
html.dark .blank, html.dark .blank-in { background: #262d55; } html.dark .blank-in:focus { background: #4a3f10; } html.dark .blank-in.right { background: var(--ok-bg); color: #6ee7b7; } html.dark .blank-in.wrong { background: var(--bad-bg); } html.dark .blank.cur { background: #4a3f10; } html.dark .blank.right { background: var(--ok-bg); color: #6ee7b7; } html.dark .blank.wrong { background: var(--bad-bg); }
html.dark .sort-review u { background: #5a4c10; }
html.dark .echip.sel { background: #2d3470; }
html.dark .model-ans { background: #2e2716; border-color: #6b5422; }
html.dark .sp-btns .yes { border-color: #2c7a55; color: #6ee7b7; } html.dark .sp-btns .no { border-color: #8a3540; color: #ff9aa5; }
html.dark b.none { color: #6f7896; }
html.dark .paper { box-shadow: none; }
@media print { html.dark { --bg: #fff; --card: #fff; --ink: #000; --sub: #555; --line: #ddd; } }
/* 内容审阅 */
.rv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .rv-head small { color: var(--sub); margin-left: auto; font-size: .78em; }
.rv-body { margin: 8px 0; font-size: .95em; } .rv-body ul, .rv-body ol { margin: 4px 0; padding-left: 1.4em; } .rv-body li { margin: 2px 0; }
.rv-ok { color: var(--ok); } .rv-e { color: var(--sub); margin-top: 4px; } .rv-f { color: var(--sub); }
.rv-item { border-left: 5px solid var(--line); } .rv-item.ok { border-left-color: var(--ok); } .rv-item.bad { border-left-color: var(--bad); }
.rv-item.ok .rv-good { background: var(--ok); color: #fff; } .rv-item.bad .rv-bad { background: var(--bad); color: #fff; }
.rv-only { display: flex; align-items: center; gap: 6px; margin-right: auto; } .rv-sum { margin-top: 6px; color: var(--sub); }
/* 学习日历 */
.pstreak { color: #ff6a00; font-weight: 800; }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 320px; }
.cal-head span { text-align: center; font-size: .75em; color: var(--sub); }
.cal i { display: block; aspect-ratio: 1; min-height: 18px; border-radius: 5px; background: var(--line); }
.cal i.c1, .cal-legend i.c1 { background: #ffd28a; } .cal i.c2, .cal-legend i.c2 { background: #ff9a3d; } .cal i.c3, .cal-legend i.c3 { background: #ff5a1f; }
.cal i.today { outline: 2px solid var(--pri); outline-offset: 1px; }
.cal-legend { display: flex; align-items: center; gap: 4px; font-size: .75em; color: var(--sub); margin-top: 6px; } .cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--line); }
[hidden] { display: none !important; }
.today-tip { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--r); padding: 10px 14px; margin: 0 0 12px; box-shadow: var(--shadow); border-left: 5px solid var(--gold); }
.today-tip .tt-ico { font-size: 1.6em; } .today-tip .tt-txt { flex: 1; min-width: 0; line-height: 1.5; } .today-tip .tt-txt small { display: block; color: var(--sub); font-size: .78em; } .today-tip .btn { flex: none; }
/* 打印错题卷 */
.wp-opt { display: block; margin: 6px 0; cursor: pointer; }
.paper .pp-tag { color: #555; font-size: .9em; }
.pp-cards { margin: 6px 0 14px; padding: 8px 12px; border: 1px dashed #999; border-radius: 8px; break-inside: avoid; }
.pp-cards .ol-card { margin-top: 6px; }
.knav .kread { flex: 0 1 auto; } .kread.on { border-color: var(--pri); color: var(--pri); }
