@font-face{font-family:'RC-Title';src:url(fonts/baloo-800.woff2) format('woff2');font-weight:800;font-display:swap}
@font-face{font-family:'RC';src:url(fonts/qs-400.woff2) format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:'RC';src:url(fonts/qs-500.woff2) format('woff2');font-weight:500;font-display:swap}
@font-face{font-family:'RC';src:url(fonts/qs-600.woff2) format('woff2');font-weight:600;font-display:swap}
@font-face{font-family:'RC';src:url(fonts/qs-700.woff2) format('woff2');font-weight:700;font-display:swap}

:root{
  --ink:#111;
  --blue:#29a9e1;
  --ok:#12a150;
  --bad:#e0342b;
  --gold:#ffd44d;
  --bg:#e8edf4;
  --soft:#f1f6fa;
  --muted:#5b6b7d;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:'RC','Segoe UI',system-ui,-apple-system,sans-serif;
  font-weight:400;
  letter-spacing:.3px;
  -webkit-text-size-adjust:100%;
  -webkit-tap-highlight-color:transparent;
}
button{font-family:inherit}
.screen{display:none}
.screen.on{display:block}
.center{text-align:center}

/* ========== 目录页 ========== */
.wrap{width:min(1000px,100%);margin:0 auto;padding:26px 16px 72px}
.chead{text-align:center;margin:14px 0 26px}
.backlink{
  display:inline-block;font-size:15px;font-weight:600;color:#26384a;text-decoration:none;
  border:1.6px solid var(--ink);background:#fff;border-radius:999px;padding:5px 15px;margin-bottom:16px;
}
.backlink:hover{background:var(--soft)}
.chead h1{
  font-family:'RC-Title';font-weight:800;margin:0;
  font-size:clamp(30px,6vw,52px);line-height:1.02;letter-spacing:-.5px;
}
.chead h1 span{color:var(--blue)}
.chead .sub{margin:10px 0 0;font-size:17px;font-weight:600;color:#26384a}
.chead .tip{margin:6px 0 0;font-size:15px;color:var(--muted)}

.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(232px,1fr));gap:16px}
.st{
  background:#fff;border:1.8px solid var(--ink);border-radius:14px;overflow:hidden;
  cursor:pointer;transition:transform .15s,box-shadow .15s;text-align:left;padding:0;
  display:block;width:100%;
}
.st:hover{transform:translateY(-3px);box-shadow:0 10px 22px rgba(20,35,60,.15)}
.st:active{transform:translateY(-1px)}
.st .strip{display:grid;grid-template-columns:repeat(3,1fr);background:#fff;border-bottom:1.4px solid #dfe5ec}
.st .strip img{width:100%;display:block;aspect-ratio:1/1;object-fit:contain;border-right:1px solid #e7ecf2}
.st .strip img:last-child{border-right:0}
.st .cap{padding:9px 12px;display:flex;align-items:center;gap:9px;font-size:16px;font-weight:600}
.st .cap i{font-style:normal;background:var(--ink);color:#fff;border-radius:7px;font-size:13px;padding:2px 7px;letter-spacing:.5px}
.st .cap em{font-style:normal;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.foot{text-align:center;color:var(--muted);font-size:14px;margin:30px 0 0}

/* ========== 顶部工具条 ========== */
.bar{
  position:sticky;top:0;z-index:20;display:flex;gap:10px;justify-content:center;flex-wrap:wrap;
  padding:10px 12px;background:rgba(232,237,244,.92);backdrop-filter:blur(6px);
  border-bottom:1.4px solid #d3dbe5;
}
.btn{
  font-size:16px;font-weight:600;letter-spacing:.5px;color:var(--ink);
  background:#fff;border:1.8px solid var(--ink);border-radius:999px;
  padding:7px 17px;cursor:pointer;transition:transform .1s,background .12s;
}
.btn:hover{background:var(--soft)}
.btn:active{transform:scale(.96)}
.btn:disabled{opacity:.35;cursor:default}
.btn.primary{background:var(--ink);color:#fff;font-size:19px;padding:13px 38px}
.btn.primary:hover{background:#2b2b2b}
.barTitle{
  display:flex;align-items:center;font-size:16px;font-weight:600;letter-spacing:.5px;
  padding:0 10px;color:#26384a;max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* ========== 练习纸 ========== */
.sheet{
  position:relative;width:min(880px,100%);margin:20px auto 60px;background:#fff;
  padding:48px 46px 36px;border-radius:16px;
  box-shadow:0 12px 34px rgba(20,35,60,.13);
}
.sheet::before{
  content:'';position:absolute;inset:14px;border:1.6px solid var(--ink);
  border-radius:11px;pointer-events:none;
}
.cnr{position:absolute;width:24px;height:24px;pointer-events:none}
.cnr.tl{top:5px;left:5px;border-top:4px solid var(--ink);border-left:4px solid var(--ink);border-top-left-radius:5px}
.cnr.tr{top:5px;right:5px;border-top:4px solid var(--ink);border-right:4px solid var(--ink);border-top-right-radius:5px}
.cnr.bl{bottom:5px;left:5px;border-bottom:4px solid var(--ink);border-left:4px solid var(--ink);border-bottom-left-radius:5px}
.cnr.br{bottom:5px;right:5px;border-bottom:4px solid var(--ink);border-right:4px solid var(--ink);border-bottom-right-radius:5px}
.dot{position:absolute;width:8px;height:8px;border-radius:50%;background:var(--ink);transform:translate(-50%,-50%);pointer-events:none}
.dot.d1{left:22%;top:14px}.dot.d2{left:28%;top:14px}
.dot.d3{left:22%;bottom:14px}.dot.d4{left:28%;bottom:14px}
.dot.d5{right:14px;top:15%}.dot.d6{right:14px;top:20%}
.dot.d7{left:14px;bottom:29%}.dot.d8{left:14px;bottom:35%}

/* Name 行 */
.nrow{display:flex;align-items:baseline;gap:9px;font-size:19px;letter-spacing:.8px;margin:0 0 2px}
.nrow b{font-weight:600}
.nrow input{
  flex:1;min-width:0;max-width:62%;border:0;border-bottom:1.8px solid var(--ink);
  font-family:inherit;font-size:19px;letter-spacing:.6px;padding:1px 8px 3px;background:transparent;outline:none;
}
.htitle{
  font-family:'RC-Title';font-weight:800;margin:4px 0 8px;line-height:1;
  font-size:clamp(28px,5.6vw,50px);letter-spacing:-.6px;
}

/* Directions */
.dl{display:flex;align-items:center;gap:10px;font-size:17px;line-height:1.35}
.dl .tx{flex:1}

/* 播放按钮 */
.spk{
  flex:none;width:32px;height:32px;border:1.8px solid var(--ink);border-radius:50%;
  background:#fff;padding:0;cursor:pointer;display:grid;place-items:center;
  transition:transform .1s,background .12s;
}
.spk svg{width:17px;height:17px;display:block}
.spk .s1{fill:var(--ink)}
.spk .s2{fill:none;stroke:var(--ink);stroke-width:2.1;stroke-linecap:round}
.spk:hover{background:var(--soft)}
.spk:active{transform:scale(.9)}
.spk.playing{background:var(--ink)}
.spk.playing .s1{fill:#fff}
.spk.playing .s2{stroke:#fff}

/* 短文框 */
.textbox{border:1.8px solid var(--ink);border-radius:9px;padding:14px 18px 12px;margin:10px 0 4px}
.sent{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:center;padding:6px 0;border-radius:8px;transition:background .15s}
.sent.on{background:#f2f8fd}
.sent .ctl{display:flex;gap:6px;align-items:center}
.wby{
  font-size:13px;font-weight:600;border:1.6px solid var(--ink);border-radius:999px;
  background:#fff;padding:3px 9px;cursor:pointer;letter-spacing:.5px;
}
.wby:hover{background:var(--soft)}
.wby.on{background:var(--ink);color:#fff}
.sent .body{min-width:0}
.sent .t{font-size:clamp(17px,2.5vw,23px);line-height:1.55;text-align:center}
.wd{cursor:pointer;border-radius:6px;padding:1px 3px;transition:background .12s}
.wd:hover{background:#eef6fc}
.wd.on{background:#ffe9a8}

/* 星星 */
.stars{display:flex;gap:6px;justify-content:center;align-items:center;margin:8px 0 2px}
.star{width:36px;height:36px;flex:none;display:block}
.star .sf{fill:#fff;stroke:var(--ink);stroke-width:2.6;stroke-linejoin:round}
.star .se{fill:var(--ink)}
.star .sm{stroke:var(--ink);stroke-width:2.6;stroke-linecap:round}
.star.rstar{cursor:pointer;transition:transform .12s}
.star.rstar:active{transform:scale(.88)}
.star.on .sf{fill:var(--gold)}
.star.dim{opacity:.3}

/* 题干 */
.qline{display:flex;align-items:center;gap:9px;font-size:17px;line-height:1.35;margin:16px 0 3px}
.qline .qnum{font-weight:600;flex:none}
.qline .tx{flex:1}
.mark{font-size:24px;font-weight:700;flex:none;line-height:1}
.mark.ok{color:var(--ok)}
.mark.bad{color:var(--bad)}

/* 中文（提交前隐藏） */
.zh{display:none}
.sheet.revealed p.zh,.sheet.revealed div.zh{display:block}
.sheet.revealed em.zh,.sheet.revealed span.zh{display:inline}
p.zh{color:var(--muted);font-size:15px;margin:1px 0 6px;line-height:1.5}
.sent .body p.zh{margin:2px 0 0;text-align:center;font-size:15px}
em.zh{font-style:normal;color:var(--muted);font-size:14px}

/* 三格图 */
.cells{display:grid;grid-template-columns:repeat(3,1fr);border:1.8px solid var(--ink);border-radius:8px;overflow:hidden;margin-top:6px}
.seqi{position:relative;border-right:1.8px solid var(--ink);cursor:pointer;background:#fff}
.seqi:last-child{border-right:0}
.seqi img{display:block;width:100%;height:auto;pointer-events:none}
.seqi .ord{
  position:absolute;left:0;top:0;width:20.9%;aspect-ratio:34.4/31.8;
  border:1.8px solid var(--ink);background:#fff;border-radius:0;
  display:grid;place-items:center;font-size:19px;font-weight:700;line-height:1;
}
.seqi .ord.filled{background:#fff}
.seqi:hover .ord{border-color:var(--blue)}
.seqi.ok{outline:3px solid rgba(18,161,80,.55);outline-offset:-3px}
.seqi.bad{outline:3px solid rgba(224,52,43,.55);outline-offset:-3px}
.seqi .fix{
  position:absolute;right:6px;top:6px;background:#fff;border:1.6px solid var(--bad);
  color:var(--bad);font-weight:700;font-size:15px;border-radius:6px;padding:1px 7px;
}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
.seqi.shake{animation:shake .3s}

/* 第一题工具栏 */
.q1tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:10px 0 4px}
.hint{font-size:14px;color:var(--muted);line-height:1.5}
.hint b{color:var(--ink)}

/* 选项 */
.qrow{display:grid;grid-template-columns:1fr 1fr;gap:4px 32px;margin-top:14px}
.opts{display:flex;flex-direction:column;gap:3px;margin-top:2px}
.opt{
  display:flex;align-items:center;gap:9px;font-size:17px;line-height:1.35;
  padding:5px 10px;border-radius:11px;border:1.8px solid transparent;cursor:pointer;
  transition:background .12s,border-color .12s;
}
.opt:hover{background:var(--soft)}
.opt .tx{flex:1;min-width:0}
.opt .mk{font-size:20px;font-weight:700;flex:none;line-height:1}
.opt.sel{border-color:var(--ink);background:#e9f4fb;font-weight:600}
.opt.ok{border-color:var(--ok);background:#e7f7ee}
.opt.ok .mk{color:var(--ok)}
.opt.bad{border-color:var(--bad);background:#fdeceb}
.opt.bad .mk{color:var(--bad)}
.opt.done{cursor:default}
.opt.done:hover{background:inherit}
.opt.sel.done:hover{background:#e9f4fb}
.opt.ok.done:hover{background:#e7f7ee}
.opt.bad.done:hover{background:#fdeceb}

/* 底部按钮 */
.footer{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;margin-top:24px}
.footer.hide{display:none}

/* 结果区 */
.result{display:none;margin-top:20px;border:1.8px solid var(--ink);border-radius:12px;padding:16px 18px;background:#fbfdff}
.result.on{display:block}
.rhead{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.rhead .lbl{font-size:16px;font-weight:600;color:var(--muted)}
#resScore{font-family:'RC-Title';font-weight:800;font-size:34px;line-height:1}
.rhead .stars{margin:0}
.rverdict{font-size:16px;font-weight:600;flex:1;min-width:150px}
.rlist{margin-top:12px;display:flex;flex-direction:column;gap:7px}
.ritem{display:flex;gap:10px;align-items:flex-start;font-size:15px;line-height:1.5;border-top:1px dashed #cfd8e3;padding-top:7px}
.ritem:first-child{border-top:0;padding-top:0}
.ritem .rn{font-weight:700;flex:none;width:64px}
.ritem .rb{flex:1}
.ritem .rb i{font-style:normal;color:var(--muted)}
.ritem .rr{flex:none;font-weight:700;font-size:18px}

@media (max-width:700px){
  .qrow{grid-template-columns:1fr}
  .sheet{padding:34px 20px 26px;margin:14px auto 40px}
  .sheet::before{inset:9px}
  .cnr{width:18px;height:18px}
  .sent{grid-template-columns:auto 1fr;gap:7px}
  .stars .star{width:30px;height:30px}
}
@media (max-width:430px){
  .bar{gap:7px;padding:8px}
  .btn{font-size:15px;padding:6px 13px}
  .sent .t{font-size:16px}
  .wby{display:none}
}
