:root{
  --c1:#2b7fff; --c2:#2fae6b; --c3:#f5961d; --c4:#8e5bd6;
  --ink:#1f2430; --sub:#6b7280; --line:#e7ebf2; --bg:#f7f9fc; --card:#ffffff;
  --ok:#2fae6b; --no:#ff4d4f;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent;}
html{ -webkit-text-size-adjust:100%; }
body{
  font-family:"Segoe UI","Microsoft YaHei",system-ui,sans-serif;
  background:var(--bg); color:var(--ink);
  padding-bottom:calc(24px + var(--safe-b));
  overscroll-behavior-y:contain;
}
.wrap{max-width:820px; margin:0 auto; padding:16px 14px 40px;}

/* ===== 顶栏 ===== */
.topbar{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px;}
.brand{display:flex; align-items:center; gap:9px; font-size:19px; font-weight:800; color:#2b3a66;}
.brand .lg{font-size:24px;}
.home-link{
  display:inline-flex; align-items:center; gap:6px; text-decoration:none;
  background:#fff; border:2px solid var(--c1); color:var(--c1);
  font-weight:800; font-size:14px; padding:7px 15px; border-radius:999px;
  box-shadow:0 3px 10px rgba(0,0,0,.05); white-space:nowrap;
}
.home-link img{width:20px; height:20px; border-radius:50%;}

/* ===== 首页 ===== */
.hero{
  text-align:center; padding:20px 14px 22px; border-radius:18px; margin-bottom:16px;
  background:linear-gradient(135deg,#eaf2ff,#f3f0ff);
  box-shadow:0 6px 20px rgba(47,103,255,.10);
}
.hero h1{font-size:24px; font-weight:800; color:#2b3a66; letter-spacing:.5px;}
.hero p{margin-top:7px; color:var(--sub); font-size:14px;}
.hero .pill{
  display:inline-block; margin-top:10px; background:#fff; color:var(--c1);
  font-weight:700; font-size:13px; padding:5px 14px; border-radius:20px;
  box-shadow:0 3px 10px rgba(0,0,0,.05);
}

.sec-title{font-size:15px; font-weight:800; color:#2b3a66; margin:18px 2px 9px; display:flex; align-items:center; gap:7px;}
.chips{display:flex; flex-wrap:wrap; gap:8px;}
.chip{
  border:2px solid #d9e2f0; background:#fff; color:var(--ink);
  font-size:14px; font-weight:700; padding:8px 14px; border-radius:22px;
  cursor:pointer; transition:.12s; font-family:inherit; line-height:1.1;
}
.chip:hover{border-color:var(--c1); color:var(--c1);}
.chip.on{background:var(--c1); border-color:var(--c1); color:#fff;}
.chip .n{opacity:.6; font-weight:600; font-size:12px; margin-left:3px;}

.letters{display:flex; flex-wrap:wrap; gap:6px;}
.lt{
  width:38px; height:38px; border-radius:11px; border:2px solid #d9e2f0; background:#fff;
  font-weight:800; font-size:15px; color:var(--ink); cursor:pointer; font-family:inherit;
}
.lt.on{background:var(--c4); border-color:var(--c4); color:#fff;}

.games{display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; margin-top:6px;}
.gcard{
  background:var(--card); border-radius:18px; padding:18px 14px; text-align:center;
  box-shadow:0 6px 22px rgba(20,30,60,.06); border-top:6px solid var(--gc,var(--c1));
  cursor:pointer; transition:.15s; border-left:0; border-right:0; border-bottom:0;
  font-family:inherit; color:inherit;
}
.gcard:hover{transform:translateY(-3px); box-shadow:0 12px 28px rgba(20,30,60,.12);}
.gcard .ico{font-size:38px; line-height:1;}
.gcard .t{font-size:17px; font-weight:800; color:var(--gc,var(--c1)); margin-top:8px;}
.gcard .d{font-size:12.5px; color:var(--sub); margin-top:6px; line-height:1.5;}
.gcard .cnt{font-size:11.5px; color:#a3adbf; margin-top:6px;}

/* ===== 游戏页 ===== */
.game{display:none;}
.game.show{display:block;}
.gbar{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px;}
.gbar .back{
  border:2px solid var(--line); background:#fff; color:var(--sub); font-weight:800;
  font-size:14px; padding:8px 14px; border-radius:999px; cursor:pointer; font-family:inherit;
}
.gbar .info{display:flex; align-items:center; gap:10px; font-weight:800; font-size:14px; color:var(--sub);}
.gbar .score{color:var(--c1);}
.bar{height:9px; background:#e9eef7; border-radius:99px; overflow:hidden; margin-bottom:16px;}
.bar i{display:block; height:100%; width:0; background:linear-gradient(90deg,var(--c1),var(--c2)); transition:width .3s;}

.stage{
  background:var(--card); border-radius:18px; padding:22px 16px 20px; text-align:center;
  box-shadow:0 6px 22px rgba(20,30,60,.06); border-top:6px solid var(--gc,var(--c1));
}
.qhint{font-size:13px; color:var(--sub); margin-bottom:10px;}
.play-big{
  width:132px; height:132px; border-radius:50%; border:0; cursor:pointer; margin:4px auto 6px;
  background:linear-gradient(135deg,var(--c1),#6aa6ff); color:#fff; font-size:56px;
  box-shadow:0 10px 28px rgba(43,127,255,.32); transition:.15s; display:flex;
  align-items:center; justify-content:center;
}
.play-big:active{transform:scale(.94);}
.play-big.small{width:76px; height:76px; font-size:32px;}
.replay{
  border:2px solid var(--c1); background:#fff; color:var(--c1); font-weight:800; font-size:13.5px;
  padding:7px 16px; border-radius:999px; cursor:pointer; font-family:inherit; margin-top:2px;
}
.picbox{
  width:min(300px,74vw); height:min(300px,74vw); margin:2px auto 6px; border-radius:18px;
  background:#fbfcff; border:1px solid var(--line); display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.picbox img{max-width:100%; max-height:100%; object-fit:contain;}
.picbox .em{font-size:110px; line-height:1;}
.zhbig{font-size:32px; font-weight:800; color:#2b3a66; margin:8px 0 4px;}
.slot{font-size:44px; font-weight:800; letter-spacing:8px; color:#2b3a66; margin:10px 0 4px; font-family:"Courier New",monospace;}
.slot .blank{
  display:inline-block; min-width:34px; border-bottom:4px solid var(--c3);
  color:var(--c3);
}
.subhint{font-size:13px; color:var(--sub); margin-top:6px;}

.opts{display:grid; grid-template-columns:1fr 1fr; gap:11px; margin-top:18px;}
.opt{
  border:2.5px solid #dfe6f2; background:#fff; border-radius:15px; padding:14px 10px;
  font-size:20px; font-weight:800; color:var(--ink); cursor:pointer; font-family:inherit;
  transition:.12s; min-height:62px; display:flex; align-items:center; justify-content:center; gap:6px;
}
.opt:hover{border-color:var(--c1);}
.opt.right{background:#e7f7ec; border-color:var(--ok); color:#1b8a3a;}
.opt.wrong{background:#fff1f0; border-color:var(--no); color:#c4361f; animation:shake .3s;}
.opt.dim{opacity:.45;}
.opt .z{font-size:12.5px; font-weight:600; color:var(--sub);}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.opts.one{grid-template-columns:1fr;}

.fb{margin-top:14px; font-size:15px; font-weight:800; min-height:24px;}
.fb.ok{color:var(--ok);}
.fb.no{color:var(--no);}
.fb .zh{font-size:13.5px; font-weight:600; color:var(--sub); margin-left:6px;}
.streak{font-size:13px; color:var(--c3); font-weight:800; margin-top:4px; min-height:18px;}

/* ===== 结算 ===== */
.result{display:none; text-align:center;}
.result.show{display:block;}
.big-score{font-size:52px; font-weight:800; color:var(--c1); line-height:1.1;}
.medal{font-size:44px;}
.rline{font-size:15px; color:var(--sub); margin-top:6px;}
.wronglist{margin-top:16px; text-align:left;}
.wronglist .wt{font-size:14px; font-weight:800; color:#2b3a66; margin-bottom:8px;}
.wronglist .wi{
  display:flex; align-items:center; gap:10px; background:#fff; border:1px solid var(--line);
  border-radius:12px; padding:9px 12px; margin-bottom:7px;
}
.wronglist .wi .pw{font-weight:800; font-size:15.5px;}
.wronglist .wi .pz{font-size:13px; color:var(--sub); flex:1;}
.wronglist .wi button{
  border:2px solid var(--c1); background:#fff; color:var(--c1); border-radius:10px;
  font-weight:800; font-size:13px; padding:5px 11px; cursor:pointer; font-family:inherit;
}
.btns{display:flex; gap:10px; justify-content:center; margin-top:18px; flex-wrap:wrap;}
.btn{
  border:0; border-radius:999px; padding:13px 26px; font-size:16px; font-weight:800;
  cursor:pointer; font-family:inherit; background:var(--c1); color:#fff;
  box-shadow:0 6px 18px rgba(43,127,255,.25);
}
.btn.ghost{background:#fff; color:var(--c1); border:2px solid var(--c1); box-shadow:none;}

.toast{
  position:fixed; left:50%; bottom:34px; transform:translateX(-50%); background:#1f2430; color:#fff;
  padding:11px 20px; border-radius:12px; font-size:14px; opacity:0; pointer-events:none;
  transition:.3s; z-index:120; max-width:80vw; text-align:center;
}
.toast.show{opacity:1;}
footer{text-align:center; color:#a3adbf; font-size:12px; padding:18px 0 6px;}

@media(max-width:520px){
  .hero h1{font-size:20px;}
  .zhbig{font-size:27px;}
  .slot{font-size:36px; letter-spacing:6px;}
  .opt{font-size:18px;}
  .picbox .em{font-size:88px;}
  .play-big{width:112px; height:112px; font-size:48px;}
}
